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