Joey Armstrong | 9fadcbe | 2024-01-17 19:00:37 -0500 | [diff] [blame] | 1 | # Copyright 2021-2024 Open Networking Foundation (ONF) and the ONF Contributors |
Hardik Windlass | 2013d0c | 2021-05-20 13:37:25 +0000 | [diff] [blame] | 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | # FIXME Can we use the same test against BBSim and Hardware? |
| 15 | |
| 16 | *** Settings *** |
| 17 | Documentation Test various functional end-to-end scenarios for TT workflow |
| 18 | Suite Setup Setup Suite |
| 19 | Test Setup Setup |
| 20 | Test Teardown Teardown |
| 21 | Suite Teardown Teardown Suite |
| 22 | Library Collections |
| 23 | Library String |
| 24 | Library OperatingSystem |
| 25 | Library XML |
| 26 | Library RequestsLibrary |
| 27 | Library ../../libraries/DependencyLibrary.py |
| 28 | Resource ../../libraries/onos.robot |
| 29 | Resource ../../libraries/voltctl.robot |
| 30 | Resource ../../libraries/voltha.robot |
| 31 | Resource ../../libraries/utils.robot |
| 32 | Resource ../../libraries/k8s.robot |
| 33 | Resource ../../variables/variables.robot |
| 34 | Resource ../../libraries/power_switch.robot |
| 35 | |
| 36 | *** Variables *** |
| 37 | ${POD_NAME} flex-ocp-cord |
| 38 | ${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 39 | ${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs |
| 40 | #${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 41 | ${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml |
| 42 | ${HELM_CHARTS_DIR} ~/helm-charts |
| 43 | ${VOLTHA_POD_NUM} 8 |
| 44 | ${NAMESPACE} voltha |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 45 | ${INFRA_NAMESPACE} default |
Hardik Windlass | 2013d0c | 2021-05-20 13:37:25 +0000 | [diff] [blame] | 46 | # For below variable value, using deployment name as using grep for |
| 47 | # parsing radius pod name, we can also use full radius pod name |
| 48 | ${RESTART_POD_NAME} radius |
| 49 | ${timeout} 60s |
| 50 | ${of_id} 0 |
| 51 | ${logical_id} 0 |
| 52 | ${has_dataplane} True |
| 53 | ${teardown_device} True |
| 54 | ${scripts} ../../scripts |
| 55 | |
| 56 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 57 | ${container_log_dir} ${None} |
| 58 | |
Matteo Scandolo | da1c64b | 2021-07-20 10:14:49 -0700 | [diff] [blame] | 59 | # logging flag to enable Collect Logs, can be passed via the command line too |
| 60 | # example: -v logging:False |
| 61 | ${logging} True |
| 62 | |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 63 | # flag to choose the subscriber provisioning command type in ONOS |
| 64 | # TT often provision a single services for a subscriber (eg: hsia, voip, ...) one after the other. |
| 65 | # if set to True, command used is "volt-add-subscriber-unitag" |
| 66 | # if set to False, comand used is "volt-add-subscriber-access" |
| 67 | ${unitag_sub} False |
| 68 | |
Hardik Windlass | 2013d0c | 2021-05-20 13:37:25 +0000 | [diff] [blame] | 69 | # For dataplane bandwidth testing |
| 70 | ${lower_margin_pct} 90 # Allow 10% under the limit |
Emrehan UZUN | d6f8589 | 2021-07-01 13:54:26 +0000 | [diff] [blame] | 71 | ${upper_margin_pct} 120 # Allow 20% under the limit |
Huseyin Ahmet AYDIN | 42d3b71 | 2021-06-10 14:46:17 +0000 | [diff] [blame] | 72 | ${pon_max_bw_capacity_xgs}= 9700000 # Mbps, for xgs-pon OLT, when FEC Disabled |
Hardik Windlass | 2013d0c | 2021-05-20 13:37:25 +0000 | [diff] [blame] | 73 | |
| 74 | *** Test Cases *** |
Girish Gowdra | cb8482a | 2021-05-27 09:06:13 -0700 | [diff] [blame] | 75 | Test that the BW is limited to Limiting Bandwidth |
Hardik Windlass | 2013d0c | 2021-05-20 13:37:25 +0000 | [diff] [blame] | 76 | [Documentation] Verify support for Tcont type 1. |
Girish Gowdra | cb8482a | 2021-05-27 09:06:13 -0700 | [diff] [blame] | 77 | ... Verify that traffic is limited to Limiting Bandwidth (eir+cir+air) configured for the service/onu. |
Hardik Windlass | 2013d0c | 2021-05-20 13:37:25 +0000 | [diff] [blame] | 78 | ... Pump 500Mbps in the upstream from RG and verify that the received traffic is only 200Mbps at the BNG. |
| 79 | ... Note: Currently, only Flex Pod supports the deployment configuration required to test this scenario. |
| 80 | [Tags] functionalTT VOL-4093 |
| 81 | [Setup] Run Keywords Start Logging TcontType1Onu1 |
| 82 | ... AND Setup |
Hardik Windlass | 98802ce | 2021-11-12 14:09:26 +0000 | [diff] [blame] | 83 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
Girish Gowdra | f244d5b | 2021-09-01 17:16:16 -0700 | [diff] [blame] | 84 | ... AND Stop Logging TcontType1Onu1 |
Hardik Windlass | 2013d0c | 2021-05-20 13:37:25 +0000 | [diff] [blame] | 85 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 86 | Perform Sanity Tests TT |
Hardik Windlass | 2013d0c | 2021-05-20 13:37:25 +0000 | [diff] [blame] | 87 | # Find the ONU as required for this test |
| 88 | ${test_onu}= Set Variable ${multi_tcont_tests.tcont1[0]} |
| 89 | ${test_onu_sn}= Set Variable ${test_onu['onu']} |
| 90 | ${test_service_type}= Set Variable ${test_onu['service_type']} |
| 91 | ${test_us_bw_profile}= Set Variable ${test_onu['us_bw_profile']} |
| 92 | ${matched} ${src} ${dst}= Get ONU details with Given Sn and Service ${test_onu_sn} ${test_service_type} |
| 93 | ... ${test_us_bw_profile} |
| 94 | Pass Execution If '${matched}' != 'True' |
| 95 | ... Skipping test: No ONU found with sn '${test_onu_sn}', service '${test_service_type}' and us_bw '${test_us_bw_profile}' |
| 96 | # Check for iperf3 and jq tools |
| 97 | ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq |
| 98 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 99 | Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG |
Girish Gowdra | cb8482a | 2021-05-27 09:06:13 -0700 | [diff] [blame] | 100 | ${limiting_bw_value_upstream}= Get Limiting Bandwidth Details ${test_us_bw_profile} |
Hardik Windlass | 2013d0c | 2021-05-20 13:37:25 +0000 | [diff] [blame] | 101 | # Stream UDP packets from RG to server |
| 102 | ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']} |
| 103 | ... args=-u -b 500M -t 30 -p 5201 |
| 104 | # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput. |
| 105 | ${actual_upstream_bw_used}= Evaluate |
| 106 | ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000 |
Girish Gowdra | cb8482a | 2021-05-27 09:06:13 -0700 | [diff] [blame] | 107 | ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream} |
Hardik Windlass | 2013d0c | 2021-05-20 13:37:25 +0000 | [diff] [blame] | 108 | Should Be True ${pct_limit_up} >= ${lower_margin_pct} |
| 109 | ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv) |
Emrehan UZUN | d6f8589 | 2021-07-01 13:54:26 +0000 | [diff] [blame] | 110 | Should Be True ${pct_limit_up} <= ${upper_margin_pct} |
| 111 | ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit) |
Hardik Windlass | 2013d0c | 2021-05-20 13:37:25 +0000 | [diff] [blame] | 112 | |
Hardik Windlass | d388b46 | 2021-05-27 05:40:00 +0000 | [diff] [blame] | 113 | Test that assured BW is allocated as needed on the PON |
| 114 | [Documentation] Verify support for Tcont type 2 and 4. |
| 115 | ... Verify that the BW from tcont type 4 is bequeathed to type2 as needed. |
| 116 | ... 1) Pump 1Gbps in the upstream from the RG for HSIA service and verify that no more than 1Gbps is received at the BNG. |
| 117 | ... 2) Pump 500Mbps from the RG for the VoD service and verify that close to 500Mbps is received at the BNG. |
| 118 | ... Also, verify that the HSI rate is now truncated to 500Mbps at BNG. |
| 119 | ... Note: Currently, only Flex Pod supports the deployment configuration required to test this scenario. |
| 120 | [Tags] functionalTT VOL-4095 |
Hardik Windlass | 98802ce | 2021-11-12 14:09:26 +0000 | [diff] [blame] | 121 | [Setup] Run Keyword Start Logging TcontType2Type4Onu1 |
| 122 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
Girish Gowdra | f244d5b | 2021-09-01 17:16:16 -0700 | [diff] [blame] | 123 | ... AND Stop Logging TcontType2Type4Onu1 |
Hardik Windlass | 98802ce | 2021-11-12 14:09:26 +0000 | [diff] [blame] | 124 | Clear All Devices Then Create New Device |
Hardik Windlass | d388b46 | 2021-05-27 05:40:00 +0000 | [diff] [blame] | 125 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 126 | Perform Sanity Test TT |
Hardik Windlass | d388b46 | 2021-05-27 05:40:00 +0000 | [diff] [blame] | 127 | |
| 128 | # The test expects the first entry in multi_tcont_tests.tcont2tcont4 input will be for service: vod and tcont: 2 |
| 129 | # The test expects the second entry in multi_tcont_tests.tcont2tcont4 input will be for service: hsia and tcont: 4 |
| 130 | ${list_onus_ut}= Create List |
| 131 | ${num_multi_tcont_input}= Get Length ${multi_tcont_tests.tcont2tcont4} |
| 132 | FOR ${I} IN RANGE 0 ${num_multi_tcont_input} |
| 133 | ${onu}= Set Variable ${multi_tcont_tests.tcont2tcont4[${I}]} |
| 134 | ${onu_sn}= Set Variable ${onu['onu']} |
| 135 | ${service}= Set Variable ${onu['service_type']} |
| 136 | ${us_bw}= Set Variable ${onu['us_bw_profile']} |
| 137 | ${matched} ${src} ${dst}= Get ONU details with Given Sn and Service ${onu_sn} |
| 138 | ... ${service} ${us_bw} |
| 139 | Pass Execution If '${matched}' != 'True' |
| 140 | ... Skipping test: No ONU found with sn '${onu_sn}', service '${service}' and us_bw '${us_bw}' |
| 141 | # Check for iperf3 and jq tools |
| 142 | ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq |
| 143 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 144 | Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG |
| 145 | # Get Upstream BW Profile details |
| 146 | ${limiting_bw_us}= Get Limiting Bandwidth Details ${us_bw} |
| 147 | ${onu_ut} Create Dictionary src ${src} dst ${dst} limiting_bw_us ${limiting_bw_us} |
| 148 | Append To List ${list_onus_ut} ${onu_ut} |
| 149 | END |
| 150 | |
| 151 | # Case 1: Verify only for HSIA service |
| 152 | ${dst}= Set Variable ${list_onus_ut}[1][dst] |
| 153 | ${updict}= Run Iperf3 Test Client ${list_onus_ut}[1][src] server=${dst['dp_iface_ip_qinq']} |
| 154 | ... args=-t 30 -p 5202 |
| 155 | ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000 |
| 156 | ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${list_onus_ut}[1][limiting_bw_us] |
| 157 | Should Be True ${pct_limit_up} >= ${lower_margin_pct} |
| 158 | ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv) |
Emrehan UZUN | d6f8589 | 2021-07-01 13:54:26 +0000 | [diff] [blame] | 159 | Should Be True ${pct_limit_up} <= ${upper_margin_pct} |
| 160 | ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit) |
Hardik Windlass | d388b46 | 2021-05-27 05:40:00 +0000 | [diff] [blame] | 161 | |
| 162 | # Case 2: Verify for VOD (with index [0]) and HSIA (with index [1]) service combined |
| 163 | ${out_file_0}= Set Variable ${CURDIR}/../../tests/data/out_tcont2 |
| 164 | ${dst_0}= Set Variable ${list_onus_ut}[0][dst] |
| 165 | Run Iperf3 Test Client in Background ${list_onus_ut}[0][src] server=${dst_0['dp_iface_ip_qinq']} |
| 166 | ... args=-t 30 -p 5201 out_file=${out_file_0} |
| 167 | ${out_file_1}= Set Variable ${CURDIR}/../../tests/data/out_tcont4 |
| 168 | ${dst_1}= Set Variable ${list_onus_ut}[1][dst] |
| 169 | Run Iperf3 Test Client in Background ${list_onus_ut}[1][src] server=${dst_1['dp_iface_ip_qinq']} |
| 170 | ... args=-t 30 -p 5202 out_file=${out_file_1} |
| 171 | # Wait for the above iperf commands to finish (sleep time depends on -t arg value passed in iperf command) |
| 172 | Sleep 35s |
| 173 | ${out_0}= Read Output File on System ${out_file_0} |
| 174 | ${out_1}= Read Output File on System ${out_file_1} |
| 175 | ${actual_upstream_bw_used_0}= Evaluate ${out_0['end']['sum_received']['bits_per_second']}/1000 |
| 176 | ${pct_limit_up_0}= Evaluate 100*${actual_upstream_bw_used_0}/${list_onus_ut}[0][limiting_bw_us] |
| 177 | Should Be True ${pct_limit_up_0} >= ${lower_margin_pct} |
| 178 | ... The upstream bandwidth guarantee was not met (${pct_limit_up_0}% of resv) |
Emrehan UZUN | d6f8589 | 2021-07-01 13:54:26 +0000 | [diff] [blame] | 179 | Should Be True ${pct_limit_up_0} <= ${upper_margin_pct} |
| 180 | ... The upstream bandwidth exceeded the limit (${pct_limit_up_0}% of limit) |
Hardik Windlass | d388b46 | 2021-05-27 05:40:00 +0000 | [diff] [blame] | 181 | ${actual_upstream_bw_used_1}= Evaluate ${out_1['end']['sum_received']['bits_per_second']}/1000 |
| 182 | ${pct_limit_up_1}= Evaluate |
| 183 | ... 100*${actual_upstream_bw_used_1}/(${list_onus_ut}[1][limiting_bw_us]-${list_onus_ut}[0][limiting_bw_us]) |
| 184 | Should Be True ${pct_limit_up_1} >= ${lower_margin_pct} |
| 185 | ... The upstream bandwidth guarantee was not met (${pct_limit_up_1}% of resv) |
Emrehan UZUN | d6f8589 | 2021-07-01 13:54:26 +0000 | [diff] [blame] | 186 | Should Be True ${pct_limit_up_1} <= ${upper_margin_pct} |
| 187 | ... The upstream bandwidth exceeded the limit (${pct_limit_up_1}% of limit) |
Hardik Windlass | d388b46 | 2021-05-27 05:40:00 +0000 | [diff] [blame] | 188 | |
Huseyin Ahmet AYDIN | 42d3b71 | 2021-06-10 14:46:17 +0000 | [diff] [blame] | 189 | Test that the AIR BW is reserved for a ONU |
| 190 | [Documentation] Verify support for Tcont type 1 + type 4 at the same time. |
| 191 | ... Verify that 8700Mbps is reserved in the upstream as AIR requirement for the VoIP service. |
| 192 | ... Pump 1Gbpbs in the upstream from the RG for HSI service, respectively ONU2, ONU3 and verify that up to 1Gbps |
| 193 | ... is received at the BNG. |
| 194 | ... Then pump ONU2 and ONU3 HSIA combined. ONUs must be share rest of bw in PON Port. (Expect fixed tcont1) |
| 195 | ... Note: Currently, only Flex Pod supports the deployment configuration required to test this scenario. |
Girish Gowdra | 8fd9696 | 2021-12-14 16:20:04 +0530 | [diff] [blame] | 196 | [Tags] functionalTT VOL-4094 non-critical |
Hardik Windlass | 98802ce | 2021-11-12 14:09:26 +0000 | [diff] [blame] | 197 | [Setup] Run Keyword Start Logging TcontType1Type4Onu1Onu2Onu3 |
| 198 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
Girish Gowdra | f244d5b | 2021-09-01 17:16:16 -0700 | [diff] [blame] | 199 | ... AND Stop Logging TcontType1Type4Onu1Onu2Onu3 |
Hardik Windlass | 98802ce | 2021-11-12 14:09:26 +0000 | [diff] [blame] | 200 | Clear All Devices Then Create New Device |
Huseyin Ahmet AYDIN | 42d3b71 | 2021-06-10 14:46:17 +0000 | [diff] [blame] | 201 | # Push multi-tcont sadis to ONOS |
| 202 | Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT-multi-tcont.json |
| 203 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 204 | Perform Sanity Test TT |
Huseyin Ahmet AYDIN | 42d3b71 | 2021-06-10 14:46:17 +0000 | [diff] [blame] | 205 | |
| 206 | # The test expects the first entry in multi_tcont_tests.tcont1tcont4 input will be for service: voip and tcont: 1 |
| 207 | # The test expects the second entry in multi_tcont_tests.tcont1tcont4 input will be for service: hsia and tcont: 4 |
| 208 | ${list_onus_ut}= Create List |
| 209 | ${num_multi_tcont_input}= Get Length ${multi_tcont_tests.tcont1tcont4} |
| 210 | FOR ${I} IN RANGE 0 ${num_multi_tcont_input} |
| 211 | ${onu}= Set Variable ${multi_tcont_tests.tcont1tcont4[${I}]} |
| 212 | ${onu_sn}= Set Variable ${onu['onu']} |
| 213 | ${service}= Set Variable ${onu['service_type']} |
| 214 | ${us_bw}= Set Variable ${onu['us_bw_profile']} |
| 215 | ${matched} ${src} ${dst}= Get ONU details with Given Sn and Service ${onu_sn} |
| 216 | ... ${service} ${us_bw} |
| 217 | Pass Execution If '${matched}' != 'True' |
| 218 | ... Skipping test: No ONU found with sn '${onu_sn}', service '${service}' and us_bw '${us_bw}' |
| 219 | # Check for iperf3 and jq tools |
| 220 | ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq |
| 221 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 222 | Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG |
| 223 | # Get Upstream BW Profile details |
| 224 | ${limiting_bw_us}= Get Limiting Bandwidth Details ${us_bw} |
| 225 | ${onu_ut} Create Dictionary src ${src} dst ${dst} limiting_bw_us ${limiting_bw_us} |
| 226 | Append To List ${list_onus_ut} ${onu_ut} |
| 227 | END |
| 228 | |
| 229 | # Fill the OLT PON Bandwidth with Fixed Bandwidth Profile ONU |
| 230 | ${onu_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("serial") |
| 231 | ${olt_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("olt") |
| 232 | ${us_bw_profile_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("us_bw_profile") |
| 233 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_fill_pon_bw} |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 234 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s |
Huseyin Ahmet AYDIN | 42d3b71 | 2021-06-10 14:46:17 +0000 | [diff] [blame] | 235 | ... Get ONU Port in ONOS ${onu_fill_pon_bw} ${of_id} |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 236 | Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | 9e3db23 | 2021-10-14 07:10:47 +0000 | [diff] [blame] | 237 | ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Huseyin Ahmet AYDIN | 42d3b71 | 2021-06-10 14:46:17 +0000 | [diff] [blame] | 238 | ... volt-add-subscriber-access ${of_id} ${onu_port} |
| 239 | Sleep 10s |
| 240 | ${limiting_bw_us_fill_pon_bw}= Get Limiting Bandwidth Details ${us_bw_profile_fill_pon_bw} |
| 241 | |
| 242 | # Case 1: Verify both ONUs should be able to get 1Gbps separately when only HSIA service is available |
| 243 | ${dst}= Set Variable ${list_onus_ut}[0][dst] |
| 244 | ${updict}= Run Iperf3 Test Client ${list_onus_ut}[0][src] server=${dst['dp_iface_ip_qinq']} |
| 245 | ... args=-t 30 -p 5202 |
| 246 | ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000 |
| 247 | ${pct_limit_up}= Evaluate |
| 248 | ... 100*${actual_upstream_bw_used}/${list_onus_ut}[0][limiting_bw_us] |
| 249 | Should Be True ${pct_limit_up} >= ${lower_margin_pct} |
| 250 | ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv) |
| 251 | |
| 252 | ${dst}= Set Variable ${list_onus_ut}[1][dst] |
| 253 | ${updict}= Run Iperf3 Test Client ${list_onus_ut}[1][src] server=${dst['dp_iface_ip_qinq']} |
| 254 | ... args=-t 30 -p 5202 |
| 255 | ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000 |
| 256 | ${pct_limit_up}= Evaluate |
| 257 | ... 100*${actual_upstream_bw_used}/${list_onus_ut}[1][limiting_bw_us] |
| 258 | Should Be True ${pct_limit_up} >= ${lower_margin_pct} |
| 259 | ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv) |
Emrehan UZUN | d6f8589 | 2021-07-01 13:54:26 +0000 | [diff] [blame] | 260 | Should Be True ${pct_limit_up} <= ${upper_margin_pct} |
| 261 | ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit) |
Huseyin Ahmet AYDIN | 42d3b71 | 2021-06-10 14:46:17 +0000 | [diff] [blame] | 262 | |
| 263 | # Case 2: Verify ONU1 and ONU2 will share rest of bw in PON Port. (Expect provisioned fixed bw) |
| 264 | ${out_file_0}= Set Variable /tmp/out1_tcont4 |
| 265 | ${dst_0}= Set Variable ${list_onus_ut}[0][dst] |
| 266 | Run Iperf3 Test Client in Background ${list_onus_ut}[0][src] server=${dst_0['dp_iface_ip_qinq']} |
| 267 | ... args=-t 30 -p 5201 out_file=${out_file_0} |
| 268 | ${out_file_1}= Set Variable /tmp/out2_tcont4 |
| 269 | ${dst_0}= Set Variable ${list_onus_ut}[0][dst] |
| 270 | ${dst_1}= Set Variable ${list_onus_ut}[1][dst] |
| 271 | Run Iperf3 Test Client in Background ${list_onus_ut}[1][src] server=${dst_1['dp_iface_ip_qinq']} |
| 272 | ... args=-t 30 -p 5202 out_file=${out_file_1} |
| 273 | # Wait for the above iperf commands to finish (sleep time depends on -t arg value passed in iperf command) |
| 274 | Sleep 35s |
| 275 | ${out_0}= Read Output File on System ${out_file_0} |
| 276 | ${out_1}= Read Output File on Remote System ${list_onus_ut}[1][src] ${out_file_1} |
| 277 | # Verify ONU1 and ONU2 tcont4 is share rest of bw. |
| 278 | ${actual_upstream_bw_used_0}= Evaluate ${out_0['end']['sum_received']['bits_per_second']}/1000 |
| 279 | ${pct_limit_up_0}= Evaluate |
| 280 | ... 100*${actual_upstream_bw_used_0}/((${pon_max_bw_capacity_xgs}-${limiting_bw_us_fill_pon_bw})/2) |
| 281 | Should Be True ${pct_limit_up_0} >= ${lower_margin_pct} |
| 282 | ... The upstream bandwidth guarantee was not met (${pct_limit_up_0}% of resv) |
Emrehan UZUN | d6f8589 | 2021-07-01 13:54:26 +0000 | [diff] [blame] | 283 | Should Be True ${pct_limit_up_0} <= ${upper_margin_pct} |
| 284 | ... The upstream bandwidth exceeded the limit (${pct_limit_up_0}% of limit) |
Huseyin Ahmet AYDIN | 42d3b71 | 2021-06-10 14:46:17 +0000 | [diff] [blame] | 285 | ${actual_upstream_bw_used_1}= Evaluate ${out_1['end']['sum_received']['bits_per_second']}/1000 |
| 286 | ${pct_limit_up_1}= Evaluate |
| 287 | ... 100*${actual_upstream_bw_used_1}/((${pon_max_bw_capacity_xgs}-${limiting_bw_us_fill_pon_bw})/2) |
| 288 | Should Be True ${pct_limit_up_1} >= ${lower_margin_pct} |
| 289 | ... The upstream bandwidth guarantee was not met (${pct_limit_up_1}% of resv) |
Emrehan UZUN | d6f8589 | 2021-07-01 13:54:26 +0000 | [diff] [blame] | 290 | Should Be True ${pct_limit_up_1} <= ${upper_margin_pct} |
| 291 | ... The upstream bandwidth exceeded the limit (${pct_limit_up_1}% of limit) |
Huseyin Ahmet AYDIN | 42d3b71 | 2021-06-10 14:46:17 +0000 | [diff] [blame] | 292 | # Verify ONU3 (fixed bw) tcont1 air bw is reservered. |
| 293 | ${actual_reserved_upstream_bw_for_tcont1}= Evaluate |
| 294 | ... ${pon_max_bw_capacity_xgs}-(${actual_upstream_bw_used_0}+${actual_upstream_bw_used_1}) |
| 295 | ${pct_limit_up_tcont1}= Evaluate 100*${actual_reserved_upstream_bw_for_tcont1}/${limiting_bw_us_fill_pon_bw} |
| 296 | Should Be True ${pct_limit_up_tcont1} >= ${lower_margin_pct} |
Emrehan UZUN | d6f8589 | 2021-07-01 13:54:26 +0000 | [diff] [blame] | 297 | ... The upstream bandwidth guarantee was not met (${pct_limit_up_tcont1}% of resv) |
| 298 | Should Be True ${pct_limit_up_tcont1} <= ${upper_margin_pct} |
| 299 | ... The upstream bandwidth exceeded the limit (${pct_limit_up_tcont1}% of limit) |
Huseyin Ahmet AYDIN | 42d3b71 | 2021-06-10 14:46:17 +0000 | [diff] [blame] | 300 | |
| 301 | # Sent original sadis file to onos |
| 302 | Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT.json |
| 303 | |
Emrehan UZUN | 683bb96 | 2021-06-11 11:59:31 +0000 | [diff] [blame] | 304 | Verify that non-assured BW is released to assured BW allocation as needed for TT |
| 305 | [Documentation] Verify support for Tcont type 2 and 3. |
| 306 | ... Pump 1Gbps in the upstream from RG of ONU2 for VoD service and |
| 307 | ... then verify that no more than 700Mbps is received at the BNG. |
| 308 | ... Firstly, pump 500Mbps from the RG of ONU1 for the VoD service and |
| 309 | ... then verify that close to 500Mbps is received at the BNG. |
| 310 | ... Also verify that the VoD rate is now truncated to 500Mbps at BNG for ONU2. |
Girish Gowdra | 8fd9696 | 2021-12-14 16:20:04 +0530 | [diff] [blame] | 311 | [Tags] functionalTT VOL-4096 non-critical |
Hardik Windlass | 98802ce | 2021-11-12 14:09:26 +0000 | [diff] [blame] | 312 | [Setup] Run Keyword Start Logging TcontType2Onu1Type3Onu2 |
| 313 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
Girish Gowdra | f244d5b | 2021-09-01 17:16:16 -0700 | [diff] [blame] | 314 | ... AND Stop Logging TcontType2Onu1Type3Onu2 |
Hardik Windlass | 98802ce | 2021-11-12 14:09:26 +0000 | [diff] [blame] | 315 | Clear All Devices Then Create New Device |
Emrehan UZUN | 683bb96 | 2021-06-11 11:59:31 +0000 | [diff] [blame] | 316 | # Push multi-tcont sadis to ONOS |
| 317 | Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT-multi-tcont.json |
| 318 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 319 | Perform Sanity Test TT |
Emrehan UZUN | 683bb96 | 2021-06-11 11:59:31 +0000 | [diff] [blame] | 320 | |
| 321 | # The test expects the first entry in multi_tcont_tests.tcont2tcont3 input will be for service: vod and tcont: 2 |
| 322 | # The test expects the second entry in multi_tcont_tests.tcont2tcont3 input will be for service: vod and tcont: 3 |
| 323 | ${list_onus_ut}= Create List |
| 324 | ${num_multi_tcont_input}= Get Length ${multi_tcont_tests.tcont2tcont3} |
| 325 | ${uni_capacity}= Set Variable 1000000 |
| 326 | FOR ${I} IN RANGE 0 ${num_multi_tcont_input} |
| 327 | ${onu}= Set Variable ${multi_tcont_tests.tcont2tcont3[${I}]} |
| 328 | ${onu_sn}= Set Variable ${onu['onu']} |
| 329 | ${service}= Set Variable ${onu['service_type']} |
| 330 | ${us_bw}= Set Variable ${onu['us_bw_profile']} |
| 331 | ${matched} ${src} ${dst}= Get ONU details with Given Sn and Service ${onu_sn} |
| 332 | ... ${service} ${us_bw} |
| 333 | Pass Execution If '${matched}' != 'True' |
| 334 | ... Skipping test: No ONU found with sn '${onu_sn}', service '${service}' and us_bw '${us_bw}' |
| 335 | # Check for iperf3 and jq tools |
| 336 | ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq |
| 337 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 338 | Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG |
| 339 | # Get Upstream BW Profile details |
| 340 | ${limiting_bw_us}= Get Limiting Bandwidth Details ${us_bw} |
| 341 | ${onu_ut} Create Dictionary src ${src} dst ${dst} limiting_bw_us ${limiting_bw_us} |
| 342 | Append To List ${list_onus_ut} ${onu_ut} |
| 343 | END |
| 344 | |
| 345 | # Fill the OLT PON Bandwidth with Fixed Bandwidth Profile ONU |
| 346 | ${onu_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("serial") |
| 347 | ${olt_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("olt") |
| 348 | ${us_bw_profile_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("us_bw_profile") |
| 349 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_fill_pon_bw} |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 350 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s |
Emrehan UZUN | 683bb96 | 2021-06-11 11:59:31 +0000 | [diff] [blame] | 351 | ... Get ONU Port in ONOS ${onu_fill_pon_bw} ${of_id} |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 352 | Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | 9e3db23 | 2021-10-14 07:10:47 +0000 | [diff] [blame] | 353 | ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Emrehan UZUN | 683bb96 | 2021-06-11 11:59:31 +0000 | [diff] [blame] | 354 | ... volt-add-subscriber-access ${of_id} ${onu_port} |
| 355 | Sleep 10s |
| 356 | ${limiting_bw_us_fill_pon_bw}= Get Limiting Bandwidth Details ${us_bw_profile_fill_pon_bw} |
| 357 | |
| 358 | # Case 1: Verify only for VoD service from the RG of ONU2 |
| 359 | ${dst}= Set Variable ${list_onus_ut}[1][dst] |
| 360 | ${updict}= Run Iperf3 Test Client ${list_onus_ut}[1][src] server=${dst['dp_iface_ip_qinq']} |
| 361 | ... args=-t 30 -p 5202 |
| 362 | ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000 |
| 363 | ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${list_onus_ut}[1][limiting_bw_us] |
| 364 | Should Be True ${pct_limit_up} >= ${lower_margin_pct} |
| 365 | ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv) |
Emrehan UZUN | d6f8589 | 2021-07-01 13:54:26 +0000 | [diff] [blame] | 366 | Should Be True ${pct_limit_up} <= ${upper_margin_pct} |
| 367 | ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit) |
Emrehan UZUN | 683bb96 | 2021-06-11 11:59:31 +0000 | [diff] [blame] | 368 | |
| 369 | # Case 2: Verify for ONU1 (with index [0]) and ONU2 (with index [1]) devices combined |
| 370 | ${out_file_0}= Set Variable /tmp/out_tcont2 |
| 371 | ${dst_0}= Set Variable ${list_onus_ut}[0][dst] |
| 372 | Run Iperf3 Test Client in Background ${list_onus_ut}[0][src] server=${dst_0['dp_iface_ip_qinq']} |
| 373 | ... args=-t 30 -p 5201 out_file=${out_file_0} |
| 374 | ${out_file_1}= Set Variable /tmp/out_tcont3 |
| 375 | ${dst_1}= Set Variable ${list_onus_ut}[1][dst] |
| 376 | Run Iperf3 Test Client in Background ${list_onus_ut}[1][src] server=${dst_1['dp_iface_ip_qinq']} |
| 377 | ... args=-t 30 -p 5202 out_file=${out_file_1} |
| 378 | # Wait for the above iperf commands to finish (sleep time depends on -t arg value passed in iperf command) |
| 379 | Sleep 35s |
| 380 | ${out_0}= Read Output File on System ${out_file_0} |
| 381 | ${out_1}= Read Output File on Remote System ${list_onus_ut}[1][src] ${out_file_1} |
| 382 | ${actual_upstream_bw_used_0}= Evaluate ${out_0['end']['sum_received']['bits_per_second']}/1000 |
| 383 | ${pct_limit_up_0}= Evaluate 100*${actual_upstream_bw_used_0}/${list_onus_ut}[0][limiting_bw_us] |
| 384 | Should Be True ${pct_limit_up_0} >= ${lower_margin_pct} |
| 385 | ... The upstream bandwidth guarantee was not met (${pct_limit_up_0}% of resv) |
Emrehan UZUN | d6f8589 | 2021-07-01 13:54:26 +0000 | [diff] [blame] | 386 | Should Be True ${pct_limit_up_0} <= ${upper_margin_pct} |
| 387 | ... The upstream bandwidth exceeded the limit (${pct_limit_up_0}% of limit) |
Emrehan UZUN | 683bb96 | 2021-06-11 11:59:31 +0000 | [diff] [blame] | 388 | ${actual_upstream_bw_used_1}= Evaluate ${out_1['end']['sum_received']['bits_per_second']}/1000 |
| 389 | ${pct_limit_up_1}= Evaluate |
| 390 | ... 100*${actual_upstream_bw_used_1}/(${uni_capacity}-${list_onus_ut}[0][limiting_bw_us]) |
| 391 | Should Be True ${pct_limit_up_1} >= ${lower_margin_pct} |
| 392 | ... The upstream bandwidth guarantee was not met (${pct_limit_up_1}% of resv) |
Emrehan UZUN | d6f8589 | 2021-07-01 13:54:26 +0000 | [diff] [blame] | 393 | Should Be True ${pct_limit_up_1} <= ${upper_margin_pct} |
| 394 | ... The upstream bandwidth exceeded the limit (${pct_limit_up_1}% of limit) |
| 395 | |
| 396 | # Sent original sadis file to onos |
| 397 | Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT.json |
| 398 | |
| 399 | Verify that best effort BW is released to assured BW requirement as needed and that fixed BW is reserved always on the PON for TT |
| 400 | [Documentation] Verify support for Tcont type 4 and 5. |
| 401 | ... Pump 1Gbps upstream from the RG for HSI service of ONU2. |
| 402 | ... Verify that no more than 1Gbps is received at the BNG. |
| 403 | ... Now pump traffic from the RG's for the HSI service both ONU1 and ONU2 at the same time. |
| 404 | ... The BNG should receive at least 700Mbps (500 + 200 Mbps) for ONU2. |
| 405 | ... The remaining 300Mbps on the PON should be rationed between the two ONUs. |
| 406 | ... Now this is largely scheduler implementation dependent, so this is to be observed on the scheduler in the BAL behaves. |
| 407 | ... If it equally distributes the remaining BW, |
| 408 | ... ONU1 should get 150Mbps and ONU2 in total should get 850Mbps (500+200+150Mbps). |
| 409 | [Tags] functionalTT VOL-4097 non-critical |
Hardik Windlass | 98802ce | 2021-11-12 14:09:26 +0000 | [diff] [blame] | 410 | [Setup] Run Keyword Start Logging TcontType4Onu1Type5Onu2 |
| 411 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
Girish Gowdra | f244d5b | 2021-09-01 17:16:16 -0700 | [diff] [blame] | 412 | ... AND Stop Logging TcontType4Onu1Type5Onu2 |
Hardik Windlass | 98802ce | 2021-11-12 14:09:26 +0000 | [diff] [blame] | 413 | Clear All Devices Then Create New Device |
Emrehan UZUN | d6f8589 | 2021-07-01 13:54:26 +0000 | [diff] [blame] | 414 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 415 | Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT-multi-tcont-1.json |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 416 | Perform Sanity Test TT |
Emrehan UZUN | d6f8589 | 2021-07-01 13:54:26 +0000 | [diff] [blame] | 417 | |
| 418 | # The test expects the first entry in multi_tcont_tests.tcont4tcont5 input will be for service: hsıa and tcont: 4 |
| 419 | # The test expects the second entry in multi_tcont_tests.tcont4tcont5 input will be for service: hsıa and tcont: 5 |
| 420 | ${list_onus_ut}= Create List |
| 421 | ${list_onus_ut_air_cir}= Create List |
| 422 | ${num_multi_tcont_input}= Get Length ${multi_tcont_tests.tcont4tcont5} |
| 423 | FOR ${I} IN RANGE 0 ${num_multi_tcont_input} |
| 424 | ${onu}= Set Variable ${multi_tcont_tests.tcont4tcont5[${I}]} |
| 425 | ${onu_sn}= Set Variable ${onu['onu']} |
| 426 | ${service}= Set Variable ${onu['service_type']} |
| 427 | ${us_bw}= Set Variable ${onu['us_bw_profile']} |
| 428 | ${matched} ${src} ${dst}= Get ONU details with Given Sn and Service ${onu_sn} |
| 429 | ... ${service} ${us_bw} |
| 430 | Pass Execution If '${matched}' != 'True' |
| 431 | ... Skipping test: No ONU found with sn '${onu_sn}', service '${service}' and us_bw '${us_bw}' |
| 432 | # Check for iperf3 and jq tools |
| 433 | ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq |
| 434 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 435 | Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG |
| 436 | # Get Upstream BW Profile details |
| 437 | ${limiting_bw_us}= Get Limiting Bandwidth Details ${us_bw} |
| 438 | ${onu_ut} Create Dictionary src ${src} dst ${dst} limiting_bw_us ${limiting_bw_us} |
| 439 | Append To List ${list_onus_ut} ${onu_ut} |
| 440 | ${limiting_bw_us_air_cir}= Get Limiting Bandwidth Details for Fixed and Committed ${us_bw} |
| 441 | ${onu_ut_air_cir} Create Dictionary src ${src} dst ${dst} |
| 442 | ... limiting_bw_us_air_cir ${limiting_bw_us_air_cir} |
| 443 | Append To List ${list_onus_ut_air_cir} ${onu_ut_air_cir} |
| 444 | END |
| 445 | |
| 446 | # Fill the OLT PON Bandwidth with Fixed Bandwidth Profile ONU |
| 447 | ${onu_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("serial") |
| 448 | ${olt_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("olt") |
| 449 | ${us_bw_profile_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("us_bw_profile") |
| 450 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_fill_pon_bw} |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 451 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s |
Emrehan UZUN | d6f8589 | 2021-07-01 13:54:26 +0000 | [diff] [blame] | 452 | ... Get ONU Port in ONOS ${onu_fill_pon_bw} ${of_id} |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 453 | Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | 9e3db23 | 2021-10-14 07:10:47 +0000 | [diff] [blame] | 454 | ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Emrehan UZUN | d6f8589 | 2021-07-01 13:54:26 +0000 | [diff] [blame] | 455 | ... volt-add-subscriber-access ${of_id} ${onu_port} |
| 456 | Sleep 10s |
| 457 | ${limiting_bw_us_fill_pon_bw}= Get Limiting Bandwidth Details ${us_bw_profile_fill_pon_bw} |
| 458 | |
| 459 | # Case 1: Verify only for HSIA service from the RG of ONU2 |
| 460 | ${dst}= Set Variable ${list_onus_ut}[1][dst] |
| 461 | ${updict}= Run Iperf3 Test Client ${list_onus_ut}[1][src] server=${dst['dp_iface_ip_qinq']} |
| 462 | ... args=-t 30 -p 5202 |
| 463 | ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000 |
| 464 | ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${list_onus_ut}[1][limiting_bw_us] |
| 465 | Should Be True ${pct_limit_up} >= ${lower_margin_pct} |
| 466 | ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv) |
| 467 | Should Be True ${pct_limit_up} <= ${upper_margin_pct} |
| 468 | ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit) |
| 469 | |
| 470 | # Case 2: Verify for ONU1 (with index [0]) and ONU2 (with index [1]) devices combined |
| 471 | ${out_file_0}= Set Variable /tmp/out_tcont4 |
| 472 | ${dst_0}= Set Variable ${list_onus_ut}[0][dst] |
| 473 | Run Iperf3 Test Client in Background ${list_onus_ut}[0][src] server=${dst_0['dp_iface_ip_qinq']} |
| 474 | ... args=-t 30 -p 5201 out_file=${out_file_0} |
| 475 | ${out_file_1}= Set Variable /tmp/out_tcont5 |
| 476 | ${dst_1}= Set Variable ${list_onus_ut}[1][dst] |
| 477 | Run Iperf3 Test Client in Background ${list_onus_ut}[1][src] server=${dst_1['dp_iface_ip_qinq']} |
| 478 | ... args=-t 30 -p 5202 out_file=${out_file_1} |
| 479 | # Wait for the above iperf commands to finish (sleep time depends on -t arg value passed in iperf command) |
| 480 | Sleep 35s |
| 481 | ${out_0}= Read Output File on System ${out_file_0} |
| 482 | ${out_1}= Read Output File on Remote System ${list_onus_ut}[1][src] ${out_file_1} |
| 483 | ${actual_upstream_bw_used_0}= Evaluate ${out_0['end']['sum_received']['bits_per_second']}/1000 |
| 484 | ${limit_up_0_denominator}= Evaluate |
| 485 | ... ((${pon_max_bw_capacity_xgs}-${limiting_bw_us_fill_pon_bw}-${list_onus_ut_air_cir}[1][limiting_bw_us_air_cir])/2) |
| 486 | ${pct_limit_up_0}= Evaluate |
| 487 | ... 100*${actual_upstream_bw_used_0}/${limit_up_0_denominator} |
| 488 | Should Be True ${pct_limit_up_0} >= ${lower_margin_pct} |
| 489 | ... The upstream bandwidth guarantee was not met (${pct_limit_up_0}% of resv) |
| 490 | Should Be True ${pct_limit_up_0} <= ${upper_margin_pct} |
| 491 | ... The upstream bandwidth exceeded the limit (${pct_limit_up_0}% of limit) |
| 492 | ${actual_upstream_bw_used_1}= Evaluate ${out_1['end']['sum_received']['bits_per_second']}/1000 |
| 493 | ${limit_up_1_numerator}= Evaluate |
| 494 | ... (${actual_upstream_bw_used_1}-${list_onus_ut_air_cir}[1][limiting_bw_us_air_cir]) |
| 495 | ${limit_up_1_denominator}= Evaluate |
| 496 | ... ((${pon_max_bw_capacity_xgs}-${limiting_bw_us_fill_pon_bw}-${list_onus_ut_air_cir}[1][limiting_bw_us_air_cir])/2) |
| 497 | ${pct_limit_up_1}= Evaluate |
| 498 | ... 100*${limit_up_1_numerator}/${limit_up_1_denominator} |
| 499 | Should Be True ${pct_limit_up_1} >= ${lower_margin_pct} |
| 500 | ... The upstream bandwidth guarantee was not met (${pct_limit_up_1}% of resv) |
| 501 | Should Be True ${pct_limit_up_1} <= ${upper_margin_pct} |
| 502 | ... The upstream bandwidth exceeded the limit (${pct_limit_up_1}% of limit) |
Emrehan UZUN | 683bb96 | 2021-06-11 11:59:31 +0000 | [diff] [blame] | 503 | |
| 504 | # Sent original sadis file to onos |
| 505 | Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT.json |
| 506 | |
Hardik Windlass | 2013d0c | 2021-05-20 13:37:25 +0000 | [diff] [blame] | 507 | *** Keywords *** |
Huseyin Ahmet AYDIN | 42d3b71 | 2021-06-10 14:46:17 +0000 | [diff] [blame] | 508 | Read Output File on Remote System |
| 509 | [Arguments] ${src} ${file} |
| 510 | [Documentation] Login to ${src} and reads the content of ${file}. |
| 511 | Get File from Remote System ${file} ${src['ip']} ${src['user']} ${src['pass']} |
| 512 | ${output}= OperatingSystem.Get File ${file} |
| 513 | Log ${output} |
| 514 | ${object}= Evaluate json.loads(r'''${output}''') json |
| 515 | [Return] ${object} |
| 516 | |
| 517 | Get File from Remote System |
| 518 | [Arguments] ${file} ${ip} ${user} ${pass}=${None} |
| 519 | [Documentation] Gets file from the remote system and stores it in /tmp folder on local |
| 520 | ${conn_id}= SSHLibrary.Open Connection ${ip} |
| 521 | Run Keyword If '${pass}' != '${None}' |
| 522 | ... SSHLibrary.Login ${user} ${pass} |
| 523 | ... ELSE |
| 524 | ... SSHLibrary.Login With Public Key ${user} %{HOME}/.ssh/id_rsa |
| 525 | SSHLibrary.Get File ${file} /tmp/ |
| 526 | SSHLibrary.Close Connection |
| 527 | |
Hardik Windlass | d388b46 | 2021-05-27 05:40:00 +0000 | [diff] [blame] | 528 | Read Output File on System |
| 529 | [Arguments] ${file} |
| 530 | [Documentation] Reads the content of ${file}. |
| 531 | ${output}= OperatingSystem.Get File ${file} |
| 532 | Log ${output} |
| 533 | ${object}= Evaluate json.loads(r'''${output}''') json |
| 534 | [Return] ${object} |
| 535 | |
| 536 | Run Iperf3 Test Client in Background |
| 537 | [Arguments] ${src} ${server} ${args} ${out_file} |
| 538 | [Documentation] Login to ${src} and run the iperf3 client against ${server} using ${args} in background. |
| 539 | ... Stores the results of the test in ${out_file}. |
| 540 | ${output} ${stderr} ${rc}= Execute Remote Command iperf3 -J -c ${server} ${args} > ${out_file} & |
| 541 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 542 | Should Be Equal As Integers ${rc} 0 |
| 543 | |
Hardik Windlass | 2013d0c | 2021-05-20 13:37:25 +0000 | [diff] [blame] | 544 | Get ONU details with Given Sn and Service |
| 545 | [Documentation] This keyword finds the ONU details (as required for multi-tcont test) |
| 546 | ... with given serial number and service type |
| 547 | ... The keyword, additionally, also verifies the associated upstream bandwidth profile |
| 548 | [Arguments] ${onu_sn} ${service_type} ${us_bw_profile} |
| 549 | ${matched}= Set Variable False |
| 550 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 551 | ${src}= Set Variable ${hosts.src[${I}]} |
| 552 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 553 | ${service}= Get Variable Value ${src['service_type']} "null" |
| 554 | ${onu}= Get Variable Value ${src['onu']} "null" |
| 555 | Continue For Loop If '${onu}' != '${onu_sn}' or '${service}' != '${service_type}' |
| 556 | # Additional verification to check upstream bandwidth profile |
| 557 | ${of_id}= Get ofID From OLT List ${src['olt']} |
| 558 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 559 | ${subscriber_id}= Set Variable ${of_id}/${onu_port} |
| 560 | ${us_bw} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile |
Hardik Windlass | 35db2aa | 2021-06-03 12:41:26 +0000 | [diff] [blame] | 561 | ... ${service_type} |
Hardik Windlass | 2013d0c | 2021-05-20 13:37:25 +0000 | [diff] [blame] | 562 | ${matched}= Set Variable If |
| 563 | ... '${onu}' == '${onu_sn}' and '${service}' == '${service_type}' and ${us_bw} == '${us_bw_profile}' |
| 564 | ... True False |
| 565 | Exit For Loop If ${matched} |
| 566 | END |
| 567 | [Return] ${matched} ${src} ${dst} |
| 568 | |
| 569 | Setup Suite |
| 570 | [Documentation] Set up the test suite |
| 571 | Common Test Suite Setup |
| 572 | ${switch_type}= Get Variable Value ${web_power_switch.type} |
| 573 | Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type} |
| 574 | |
| 575 | |
| 576 | Clear All Devices Then Create New Device |
| 577 | [Documentation] Remove any devices from VOLTHA and ONOS |
| 578 | # Remove all devices from voltha and nos |
| 579 | Delete All Devices and Verify |
| 580 | # Execute normal test Setup Keyword |
| 581 | Setup |