blob: 7097d13822c6cb95c29b8e5b6007ad3b58adf50f [file] [log] [blame]
Hardik Windlass2013d0c2021-05-20 13:37:25 +00001# 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 ***
17Documentation Test various functional end-to-end scenarios for TT workflow
18Suite Setup Setup Suite
19Test Setup Setup
20Test Teardown Teardown
21Suite Teardown Teardown Suite
22Library Collections
23Library String
24Library OperatingSystem
25Library XML
26Library RequestsLibrary
27Library ../../libraries/DependencyLibrary.py
28Resource ../../libraries/onos.robot
29Resource ../../libraries/voltctl.robot
30Resource ../../libraries/voltha.robot
31Resource ../../libraries/utils.robot
32Resource ../../libraries/k8s.robot
33Resource ../../variables/variables.robot
34Resource ../../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 Windlass4288c6a2021-09-28 07:22:06 +000045${INFRA_NAMESPACE} default
Hardik Windlass2013d0c2021-05-20 13:37:25 +000046# 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 Scandoloda1c64b2021-07-20 10:14:49 -070059# logging flag to enable Collect Logs, can be passed via the command line too
60# example: -v logging:False
61${logging} True
62
Hardik Windlass2013d0c2021-05-20 13:37:25 +000063# For dataplane bandwidth testing
64${lower_margin_pct} 90 # Allow 10% under the limit
Emrehan UZUNd6f85892021-07-01 13:54:26 +000065${upper_margin_pct} 120 # Allow 20% under the limit
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +000066${pon_max_bw_capacity_xgs}= 9700000 # Mbps, for xgs-pon OLT, when FEC Disabled
Hardik Windlass2013d0c2021-05-20 13:37:25 +000067
68*** Test Cases ***
Girish Gowdracb8482a2021-05-27 09:06:13 -070069Test that the BW is limited to Limiting Bandwidth
Hardik Windlass2013d0c2021-05-20 13:37:25 +000070 [Documentation] Verify support for Tcont type 1.
Girish Gowdracb8482a2021-05-27 09:06:13 -070071 ... Verify that traffic is limited to Limiting Bandwidth (eir+cir+air) configured for the service/onu.
Hardik Windlass2013d0c2021-05-20 13:37:25 +000072 ... 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
77 [Teardown] Run Keywords Collect Logs
Hardik Windlass35db2aa2021-06-03 12:41:26 +000078 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -070079 ... AND Run Keyword If ${logging} Collect Logs
80 ... AND Stop Logging TcontType1Onu1
Hardik Windlass2013d0c2021-05-20 13:37:25 +000081 Run Keyword If ${has_dataplane} Clean Up Linux
82 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
83 # Find the ONU as required for this test
84 ${test_onu}= Set Variable ${multi_tcont_tests.tcont1[0]}
85 ${test_onu_sn}= Set Variable ${test_onu['onu']}
86 ${test_service_type}= Set Variable ${test_onu['service_type']}
87 ${test_us_bw_profile}= Set Variable ${test_onu['us_bw_profile']}
88 ${matched} ${src} ${dst}= Get ONU details with Given Sn and Service ${test_onu_sn} ${test_service_type}
89 ... ${test_us_bw_profile}
90 Pass Execution If '${matched}' != 'True'
91 ... Skipping test: No ONU found with sn '${test_onu_sn}', service '${test_service_type}' and us_bw '${test_us_bw_profile}'
92 # Check for iperf3 and jq tools
93 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
94 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
95 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
Girish Gowdracb8482a2021-05-27 09:06:13 -070096 ${limiting_bw_value_upstream}= Get Limiting Bandwidth Details ${test_us_bw_profile}
Hardik Windlass2013d0c2021-05-20 13:37:25 +000097 # Stream UDP packets from RG to server
98 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
99 ... args=-u -b 500M -t 30 -p 5201
100 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
101 ${actual_upstream_bw_used}= Evaluate
102 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
Girish Gowdracb8482a2021-05-27 09:06:13 -0700103 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
Hardik Windlass2013d0c2021-05-20 13:37:25 +0000104 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
105 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000106 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
107 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Hardik Windlass2013d0c2021-05-20 13:37:25 +0000108
Hardik Windlassd388b462021-05-27 05:40:00 +0000109Test that assured BW is allocated as needed on the PON
110 [Documentation] Verify support for Tcont type 2 and 4.
111 ... Verify that the BW from tcont type 4 is bequeathed to type2 as needed.
112 ... 1) Pump 1Gbps in the upstream from the RG for HSIA service and verify that no more than 1Gbps is received at the BNG.
113 ... 2) Pump 500Mbps from the RG for the VoD service and verify that close to 500Mbps is received at the BNG.
114 ... Also, verify that the HSI rate is now truncated to 500Mbps at BNG.
115 ... Note: Currently, only Flex Pod supports the deployment configuration required to test this scenario.
116 [Tags] functionalTT VOL-4095
117 [Setup] Run Keywords Start Logging TcontType2Type4Onu1
118 ... AND Setup
119 [Teardown] Run Keywords Collect Logs
Hardik Windlassd388b462021-05-27 05:40:00 +0000120 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700121 ... AND Run Keyword If ${logging} Collect Logs
122 ... AND Stop Logging TcontType2Type4Onu1
Hardik Windlassd388b462021-05-27 05:40:00 +0000123 Run Keyword If ${has_dataplane} Clean Up Linux
124 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test TT
125
126 # The test expects the first entry in multi_tcont_tests.tcont2tcont4 input will be for service: vod and tcont: 2
127 # The test expects the second entry in multi_tcont_tests.tcont2tcont4 input will be for service: hsia and tcont: 4
128 ${list_onus_ut}= Create List
129 ${num_multi_tcont_input}= Get Length ${multi_tcont_tests.tcont2tcont4}
130 FOR ${I} IN RANGE 0 ${num_multi_tcont_input}
131 ${onu}= Set Variable ${multi_tcont_tests.tcont2tcont4[${I}]}
132 ${onu_sn}= Set Variable ${onu['onu']}
133 ${service}= Set Variable ${onu['service_type']}
134 ${us_bw}= Set Variable ${onu['us_bw_profile']}
135 ${matched} ${src} ${dst}= Get ONU details with Given Sn and Service ${onu_sn}
136 ... ${service} ${us_bw}
137 Pass Execution If '${matched}' != 'True'
138 ... Skipping test: No ONU found with sn '${onu_sn}', service '${service}' and us_bw '${us_bw}'
139 # Check for iperf3 and jq tools
140 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
141 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
142 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
143 # Get Upstream BW Profile details
144 ${limiting_bw_us}= Get Limiting Bandwidth Details ${us_bw}
145 ${onu_ut} Create Dictionary src ${src} dst ${dst} limiting_bw_us ${limiting_bw_us}
146 Append To List ${list_onus_ut} ${onu_ut}
147 END
148
149 # Case 1: Verify only for HSIA service
150 ${dst}= Set Variable ${list_onus_ut}[1][dst]
151 ${updict}= Run Iperf3 Test Client ${list_onus_ut}[1][src] server=${dst['dp_iface_ip_qinq']}
152 ... args=-t 30 -p 5202
153 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
154 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${list_onus_ut}[1][limiting_bw_us]
155 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
156 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000157 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
158 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Hardik Windlassd388b462021-05-27 05:40:00 +0000159
160 # Case 2: Verify for VOD (with index [0]) and HSIA (with index [1]) service combined
161 ${out_file_0}= Set Variable ${CURDIR}/../../tests/data/out_tcont2
162 ${dst_0}= Set Variable ${list_onus_ut}[0][dst]
163 Run Iperf3 Test Client in Background ${list_onus_ut}[0][src] server=${dst_0['dp_iface_ip_qinq']}
164 ... args=-t 30 -p 5201 out_file=${out_file_0}
165 ${out_file_1}= Set Variable ${CURDIR}/../../tests/data/out_tcont4
166 ${dst_1}= Set Variable ${list_onus_ut}[1][dst]
167 Run Iperf3 Test Client in Background ${list_onus_ut}[1][src] server=${dst_1['dp_iface_ip_qinq']}
168 ... args=-t 30 -p 5202 out_file=${out_file_1}
169 # Wait for the above iperf commands to finish (sleep time depends on -t arg value passed in iperf command)
170 Sleep 35s
171 ${out_0}= Read Output File on System ${out_file_0}
172 ${out_1}= Read Output File on System ${out_file_1}
173 ${actual_upstream_bw_used_0}= Evaluate ${out_0['end']['sum_received']['bits_per_second']}/1000
174 ${pct_limit_up_0}= Evaluate 100*${actual_upstream_bw_used_0}/${list_onus_ut}[0][limiting_bw_us]
175 Should Be True ${pct_limit_up_0} >= ${lower_margin_pct}
176 ... The upstream bandwidth guarantee was not met (${pct_limit_up_0}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000177 Should Be True ${pct_limit_up_0} <= ${upper_margin_pct}
178 ... The upstream bandwidth exceeded the limit (${pct_limit_up_0}% of limit)
Hardik Windlassd388b462021-05-27 05:40:00 +0000179 ${actual_upstream_bw_used_1}= Evaluate ${out_1['end']['sum_received']['bits_per_second']}/1000
180 ${pct_limit_up_1}= Evaluate
181 ... 100*${actual_upstream_bw_used_1}/(${list_onus_ut}[1][limiting_bw_us]-${list_onus_ut}[0][limiting_bw_us])
182 Should Be True ${pct_limit_up_1} >= ${lower_margin_pct}
183 ... The upstream bandwidth guarantee was not met (${pct_limit_up_1}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000184 Should Be True ${pct_limit_up_1} <= ${upper_margin_pct}
185 ... The upstream bandwidth exceeded the limit (${pct_limit_up_1}% of limit)
Hardik Windlassd388b462021-05-27 05:40:00 +0000186
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000187Test that the AIR BW is reserved for a ONU
188 [Documentation] Verify support for Tcont type 1 + type 4 at the same time.
189 ... Verify that 8700Mbps is reserved in the upstream as AIR requirement for the VoIP service.
190 ... Pump 1Gbpbs in the upstream from the RG for HSI service, respectively ONU2, ONU3 and verify that up to 1Gbps
191 ... is received at the BNG.
192 ... Then pump ONU2 and ONU3 HSIA combined. ONUs must be share rest of bw in PON Port. (Expect fixed tcont1)
193 ... Note: Currently, only Flex Pod supports the deployment configuration required to test this scenario.
194 [Tags] functionalTT VOL-4094
195 [Setup] Run Keywords Start Logging TcontType1Type4Onu1Onu2Onu3
196 ... AND Setup
197 [Teardown] Run Keywords Collect Logs
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000198 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700199 ... AND Run Keyword If ${logging} Collect Logs
200 ... AND Stop Logging TcontType1Type4Onu1Onu2Onu3
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000201 # 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
204 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test TT
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}
234 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
235 ... Get ONU Port in ONOS ${onu_fill_pon_bw} ${of_id}
236 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
237 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
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 UZUNd6f85892021-07-01 13:54:26 +0000260 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
261 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000262
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 UZUNd6f85892021-07-01 13:54:26 +0000283 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 AYDIN42d3b712021-06-10 14:46:17 +0000285 ${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 UZUNd6f85892021-07-01 13:54:26 +0000290 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 AYDIN42d3b712021-06-10 14:46:17 +0000292 # 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 UZUNd6f85892021-07-01 13:54:26 +0000297 ... 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 AYDIN42d3b712021-06-10 14:46:17 +0000300
301 # Sent original sadis file to onos
302 Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT.json
303
Emrehan UZUN683bb962021-06-11 11:59:31 +0000304Verify 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.
311 [Tags] functionalTT VOL-4096
312 [Setup] Run Keywords Start Logging TcontType2Onu1Type3Onu2
313 ... AND Setup
314 [Teardown] Run Keywords Collect Logs
Hardik Windlass7a62cf72021-07-07 04:35:01 +0000315 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700316 ... AND Run Keyword If ${logging} Collect Logs
317 ... AND Stop Logging TcontType2Onu1Type3Onu2
Emrehan UZUN683bb962021-06-11 11:59:31 +0000318 # Push multi-tcont sadis to ONOS
319 Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT-multi-tcont.json
320 Run Keyword If ${has_dataplane} Clean Up Linux
321 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test TT
322
323 # The test expects the first entry in multi_tcont_tests.tcont2tcont3 input will be for service: vod and tcont: 2
324 # The test expects the second entry in multi_tcont_tests.tcont2tcont3 input will be for service: vod and tcont: 3
325 ${list_onus_ut}= Create List
326 ${num_multi_tcont_input}= Get Length ${multi_tcont_tests.tcont2tcont3}
327 ${uni_capacity}= Set Variable 1000000
328 FOR ${I} IN RANGE 0 ${num_multi_tcont_input}
329 ${onu}= Set Variable ${multi_tcont_tests.tcont2tcont3[${I}]}
330 ${onu_sn}= Set Variable ${onu['onu']}
331 ${service}= Set Variable ${onu['service_type']}
332 ${us_bw}= Set Variable ${onu['us_bw_profile']}
333 ${matched} ${src} ${dst}= Get ONU details with Given Sn and Service ${onu_sn}
334 ... ${service} ${us_bw}
335 Pass Execution If '${matched}' != 'True'
336 ... Skipping test: No ONU found with sn '${onu_sn}', service '${service}' and us_bw '${us_bw}'
337 # Check for iperf3 and jq tools
338 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
339 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
340 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
341 # Get Upstream BW Profile details
342 ${limiting_bw_us}= Get Limiting Bandwidth Details ${us_bw}
343 ${onu_ut} Create Dictionary src ${src} dst ${dst} limiting_bw_us ${limiting_bw_us}
344 Append To List ${list_onus_ut} ${onu_ut}
345 END
346
347 # Fill the OLT PON Bandwidth with Fixed Bandwidth Profile ONU
348 ${onu_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("serial")
349 ${olt_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("olt")
350 ${us_bw_profile_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("us_bw_profile")
351 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_fill_pon_bw}
352 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
353 ... Get ONU Port in ONOS ${onu_fill_pon_bw} ${of_id}
354 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
355 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
356 ... volt-add-subscriber-access ${of_id} ${onu_port}
357 Sleep 10s
358 ${limiting_bw_us_fill_pon_bw}= Get Limiting Bandwidth Details ${us_bw_profile_fill_pon_bw}
359
360 # Case 1: Verify only for VoD service from the RG of ONU2
361 ${dst}= Set Variable ${list_onus_ut}[1][dst]
362 ${updict}= Run Iperf3 Test Client ${list_onus_ut}[1][src] server=${dst['dp_iface_ip_qinq']}
363 ... args=-t 30 -p 5202
364 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
365 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${list_onus_ut}[1][limiting_bw_us]
366 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
367 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000368 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
369 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Emrehan UZUN683bb962021-06-11 11:59:31 +0000370
371 # Case 2: Verify for ONU1 (with index [0]) and ONU2 (with index [1]) devices combined
372 ${out_file_0}= Set Variable /tmp/out_tcont2
373 ${dst_0}= Set Variable ${list_onus_ut}[0][dst]
374 Run Iperf3 Test Client in Background ${list_onus_ut}[0][src] server=${dst_0['dp_iface_ip_qinq']}
375 ... args=-t 30 -p 5201 out_file=${out_file_0}
376 ${out_file_1}= Set Variable /tmp/out_tcont3
377 ${dst_1}= Set Variable ${list_onus_ut}[1][dst]
378 Run Iperf3 Test Client in Background ${list_onus_ut}[1][src] server=${dst_1['dp_iface_ip_qinq']}
379 ... args=-t 30 -p 5202 out_file=${out_file_1}
380 # Wait for the above iperf commands to finish (sleep time depends on -t arg value passed in iperf command)
381 Sleep 35s
382 ${out_0}= Read Output File on System ${out_file_0}
383 ${out_1}= Read Output File on Remote System ${list_onus_ut}[1][src] ${out_file_1}
384 ${actual_upstream_bw_used_0}= Evaluate ${out_0['end']['sum_received']['bits_per_second']}/1000
385 ${pct_limit_up_0}= Evaluate 100*${actual_upstream_bw_used_0}/${list_onus_ut}[0][limiting_bw_us]
386 Should Be True ${pct_limit_up_0} >= ${lower_margin_pct}
387 ... The upstream bandwidth guarantee was not met (${pct_limit_up_0}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000388 Should Be True ${pct_limit_up_0} <= ${upper_margin_pct}
389 ... The upstream bandwidth exceeded the limit (${pct_limit_up_0}% of limit)
Emrehan UZUN683bb962021-06-11 11:59:31 +0000390 ${actual_upstream_bw_used_1}= Evaluate ${out_1['end']['sum_received']['bits_per_second']}/1000
391 ${pct_limit_up_1}= Evaluate
392 ... 100*${actual_upstream_bw_used_1}/(${uni_capacity}-${list_onus_ut}[0][limiting_bw_us])
393 Should Be True ${pct_limit_up_1} >= ${lower_margin_pct}
394 ... The upstream bandwidth guarantee was not met (${pct_limit_up_1}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000395 Should Be True ${pct_limit_up_1} <= ${upper_margin_pct}
396 ... The upstream bandwidth exceeded the limit (${pct_limit_up_1}% of limit)
397
398 # Sent original sadis file to onos
399 Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT.json
400
401Verify that best effort BW is released to assured BW requirement as needed and that fixed BW is reserved always on the PON for TT
402 [Documentation] Verify support for Tcont type 4 and 5.
403 ... Pump 1Gbps upstream from the RG for HSI service of ONU2.
404 ... Verify that no more than 1Gbps is received at the BNG.
405 ... Now pump traffic from the RG's for the HSI service both ONU1 and ONU2 at the same time.
406 ... The BNG should receive at least 700Mbps (500 + 200 Mbps) for ONU2.
407 ... The remaining 300Mbps on the PON should be rationed between the two ONUs.
408 ... Now this is largely scheduler implementation dependent, so this is to be observed on the scheduler in the BAL behaves.
409 ... If it equally distributes the remaining BW,
410 ... ONU1 should get 150Mbps and ONU2 in total should get 850Mbps (500+200+150Mbps).
411 [Tags] functionalTT VOL-4097 non-critical
412 [Setup] Run Keywords Start Logging TcontType4Onu1Type5Onu2
413 ... AND Setup
414 [Teardown] Run Keywords Collect Logs
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000415 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700416 ... AND Run Keyword If ${logging} Collect Logs
417 ... AND Stop Logging TcontType4Onu1Type5Onu2
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000418 Run Keyword If ${has_dataplane} Clean Up Linux
419 Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT-multi-tcont-1.json
420 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test TT
421
422 # The test expects the first entry in multi_tcont_tests.tcont4tcont5 input will be for service: hsıa and tcont: 4
423 # The test expects the second entry in multi_tcont_tests.tcont4tcont5 input will be for service: hsıa and tcont: 5
424 ${list_onus_ut}= Create List
425 ${list_onus_ut_air_cir}= Create List
426 ${num_multi_tcont_input}= Get Length ${multi_tcont_tests.tcont4tcont5}
427 FOR ${I} IN RANGE 0 ${num_multi_tcont_input}
428 ${onu}= Set Variable ${multi_tcont_tests.tcont4tcont5[${I}]}
429 ${onu_sn}= Set Variable ${onu['onu']}
430 ${service}= Set Variable ${onu['service_type']}
431 ${us_bw}= Set Variable ${onu['us_bw_profile']}
432 ${matched} ${src} ${dst}= Get ONU details with Given Sn and Service ${onu_sn}
433 ... ${service} ${us_bw}
434 Pass Execution If '${matched}' != 'True'
435 ... Skipping test: No ONU found with sn '${onu_sn}', service '${service}' and us_bw '${us_bw}'
436 # Check for iperf3 and jq tools
437 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
438 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
439 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
440 # Get Upstream BW Profile details
441 ${limiting_bw_us}= Get Limiting Bandwidth Details ${us_bw}
442 ${onu_ut} Create Dictionary src ${src} dst ${dst} limiting_bw_us ${limiting_bw_us}
443 Append To List ${list_onus_ut} ${onu_ut}
444 ${limiting_bw_us_air_cir}= Get Limiting Bandwidth Details for Fixed and Committed ${us_bw}
445 ${onu_ut_air_cir} Create Dictionary src ${src} dst ${dst}
446 ... limiting_bw_us_air_cir ${limiting_bw_us_air_cir}
447 Append To List ${list_onus_ut_air_cir} ${onu_ut_air_cir}
448 END
449
450 # Fill the OLT PON Bandwidth with Fixed Bandwidth Profile ONU
451 ${onu_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("serial")
452 ${olt_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("olt")
453 ${us_bw_profile_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("us_bw_profile")
454 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_fill_pon_bw}
455 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
456 ... Get ONU Port in ONOS ${onu_fill_pon_bw} ${of_id}
457 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
458 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
459 ... volt-add-subscriber-access ${of_id} ${onu_port}
460 Sleep 10s
461 ${limiting_bw_us_fill_pon_bw}= Get Limiting Bandwidth Details ${us_bw_profile_fill_pon_bw}
462
463 # Case 1: Verify only for HSIA service from the RG of ONU2
464 ${dst}= Set Variable ${list_onus_ut}[1][dst]
465 ${updict}= Run Iperf3 Test Client ${list_onus_ut}[1][src] server=${dst['dp_iface_ip_qinq']}
466 ... args=-t 30 -p 5202
467 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
468 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${list_onus_ut}[1][limiting_bw_us]
469 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
470 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
471 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
472 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
473
474 # Case 2: Verify for ONU1 (with index [0]) and ONU2 (with index [1]) devices combined
475 ${out_file_0}= Set Variable /tmp/out_tcont4
476 ${dst_0}= Set Variable ${list_onus_ut}[0][dst]
477 Run Iperf3 Test Client in Background ${list_onus_ut}[0][src] server=${dst_0['dp_iface_ip_qinq']}
478 ... args=-t 30 -p 5201 out_file=${out_file_0}
479 ${out_file_1}= Set Variable /tmp/out_tcont5
480 ${dst_1}= Set Variable ${list_onus_ut}[1][dst]
481 Run Iperf3 Test Client in Background ${list_onus_ut}[1][src] server=${dst_1['dp_iface_ip_qinq']}
482 ... args=-t 30 -p 5202 out_file=${out_file_1}
483 # Wait for the above iperf commands to finish (sleep time depends on -t arg value passed in iperf command)
484 Sleep 35s
485 ${out_0}= Read Output File on System ${out_file_0}
486 ${out_1}= Read Output File on Remote System ${list_onus_ut}[1][src] ${out_file_1}
487 ${actual_upstream_bw_used_0}= Evaluate ${out_0['end']['sum_received']['bits_per_second']}/1000
488 ${limit_up_0_denominator}= Evaluate
489 ... ((${pon_max_bw_capacity_xgs}-${limiting_bw_us_fill_pon_bw}-${list_onus_ut_air_cir}[1][limiting_bw_us_air_cir])/2)
490 ${pct_limit_up_0}= Evaluate
491 ... 100*${actual_upstream_bw_used_0}/${limit_up_0_denominator}
492 Should Be True ${pct_limit_up_0} >= ${lower_margin_pct}
493 ... The upstream bandwidth guarantee was not met (${pct_limit_up_0}% of resv)
494 Should Be True ${pct_limit_up_0} <= ${upper_margin_pct}
495 ... The upstream bandwidth exceeded the limit (${pct_limit_up_0}% of limit)
496 ${actual_upstream_bw_used_1}= Evaluate ${out_1['end']['sum_received']['bits_per_second']}/1000
497 ${limit_up_1_numerator}= Evaluate
498 ... (${actual_upstream_bw_used_1}-${list_onus_ut_air_cir}[1][limiting_bw_us_air_cir])
499 ${limit_up_1_denominator}= Evaluate
500 ... ((${pon_max_bw_capacity_xgs}-${limiting_bw_us_fill_pon_bw}-${list_onus_ut_air_cir}[1][limiting_bw_us_air_cir])/2)
501 ${pct_limit_up_1}= Evaluate
502 ... 100*${limit_up_1_numerator}/${limit_up_1_denominator}
503 Should Be True ${pct_limit_up_1} >= ${lower_margin_pct}
504 ... The upstream bandwidth guarantee was not met (${pct_limit_up_1}% of resv)
505 Should Be True ${pct_limit_up_1} <= ${upper_margin_pct}
506 ... The upstream bandwidth exceeded the limit (${pct_limit_up_1}% of limit)
Emrehan UZUN683bb962021-06-11 11:59:31 +0000507
508 # Sent original sadis file to onos
509 Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT.json
510
Hardik Windlass2013d0c2021-05-20 13:37:25 +0000511*** Keywords ***
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000512Read Output File on Remote System
513 [Arguments] ${src} ${file}
514 [Documentation] Login to ${src} and reads the content of ${file}.
515 Get File from Remote System ${file} ${src['ip']} ${src['user']} ${src['pass']}
516 ${output}= OperatingSystem.Get File ${file}
517 Log ${output}
518 ${object}= Evaluate json.loads(r'''${output}''') json
519 [Return] ${object}
520
521Get File from Remote System
522 [Arguments] ${file} ${ip} ${user} ${pass}=${None}
523 [Documentation] Gets file from the remote system and stores it in /tmp folder on local
524 ${conn_id}= SSHLibrary.Open Connection ${ip}
525 Run Keyword If '${pass}' != '${None}'
526 ... SSHLibrary.Login ${user} ${pass}
527 ... ELSE
528 ... SSHLibrary.Login With Public Key ${user} %{HOME}/.ssh/id_rsa
529 SSHLibrary.Get File ${file} /tmp/
530 SSHLibrary.Close Connection
531
Hardik Windlassd388b462021-05-27 05:40:00 +0000532Read Output File on System
533 [Arguments] ${file}
534 [Documentation] Reads the content of ${file}.
535 ${output}= OperatingSystem.Get File ${file}
536 Log ${output}
537 ${object}= Evaluate json.loads(r'''${output}''') json
538 [Return] ${object}
539
540Run Iperf3 Test Client in Background
541 [Arguments] ${src} ${server} ${args} ${out_file}
542 [Documentation] Login to ${src} and run the iperf3 client against ${server} using ${args} in background.
543 ... Stores the results of the test in ${out_file}.
544 ${output} ${stderr} ${rc}= Execute Remote Command iperf3 -J -c ${server} ${args} > ${out_file} &
545 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
546 Should Be Equal As Integers ${rc} 0
547
Hardik Windlass2013d0c2021-05-20 13:37:25 +0000548Get ONU details with Given Sn and Service
549 [Documentation] This keyword finds the ONU details (as required for multi-tcont test)
550 ... with given serial number and service type
551 ... The keyword, additionally, also verifies the associated upstream bandwidth profile
552 [Arguments] ${onu_sn} ${service_type} ${us_bw_profile}
553 ${matched}= Set Variable False
554 FOR ${I} IN RANGE 0 ${num_all_onus}
555 ${src}= Set Variable ${hosts.src[${I}]}
556 ${dst}= Set Variable ${hosts.dst[${I}]}
557 ${service}= Get Variable Value ${src['service_type']} "null"
558 ${onu}= Get Variable Value ${src['onu']} "null"
559 Continue For Loop If '${onu}' != '${onu_sn}' or '${service}' != '${service_type}'
560 # Additional verification to check upstream bandwidth profile
561 ${of_id}= Get ofID From OLT List ${src['olt']}
562 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} ${of_id}
563 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
564 ${us_bw} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
Hardik Windlass35db2aa2021-06-03 12:41:26 +0000565 ... ${service_type}
Hardik Windlass2013d0c2021-05-20 13:37:25 +0000566 ${matched}= Set Variable If
567 ... '${onu}' == '${onu_sn}' and '${service}' == '${service_type}' and ${us_bw} == '${us_bw_profile}'
568 ... True False
569 Exit For Loop If ${matched}
570 END
571 [Return] ${matched} ${src} ${dst}
572
573Setup Suite
574 [Documentation] Set up the test suite
575 Common Test Suite Setup
576 ${switch_type}= Get Variable Value ${web_power_switch.type}
577 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
578
579
580Clear All Devices Then Create New Device
581 [Documentation] Remove any devices from VOLTHA and ONOS
582 # Remove all devices from voltha and nos
583 Delete All Devices and Verify
584 # Execute normal test Setup Keyword
585 Setup
586
587
588Teardown Suite
589 [Documentation] Tear down steps for the suite
590 Run Keyword If ${has_dataplane} Clean Up Linux
591 Run Keyword If ${teardown_device} Delete All Devices And Verify
TorstenThieme4e2168e2021-06-22 14:01:47 +0000592 Close All ONOS SSH Connections