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