blob: 0bcd2638bf8b8f1e89c6ab476c9659d9668c2fbf [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
45# For below variable value, using deployment name as using grep for
46# parsing radius pod name, we can also use full radius pod name
47${RESTART_POD_NAME} radius
48${timeout} 60s
49${of_id} 0
50${logical_id} 0
51${has_dataplane} True
52${teardown_device} True
53${scripts} ../../scripts
54
55# Per-test logging on failure is turned off by default; set this variable to enable
56${container_log_dir} ${None}
57
Matteo Scandoloda1c64b2021-07-20 10:14:49 -070058# logging flag to enable Collect Logs, can be passed via the command line too
59# example: -v logging:False
60${logging} True
61
Hardik Windlass2013d0c2021-05-20 13:37:25 +000062# For dataplane bandwidth testing
63${lower_margin_pct} 90 # Allow 10% under the limit
Emrehan UZUNd6f85892021-07-01 13:54:26 +000064${upper_margin_pct} 120 # Allow 20% under the limit
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +000065${pon_max_bw_capacity_xgs}= 9700000 # Mbps, for xgs-pon OLT, when FEC Disabled
Hardik Windlass2013d0c2021-05-20 13:37:25 +000066
67*** Test Cases ***
Girish Gowdracb8482a2021-05-27 09:06:13 -070068Test that the BW is limited to Limiting Bandwidth
Hardik Windlass2013d0c2021-05-20 13:37:25 +000069 [Documentation] Verify support for Tcont type 1.
Girish Gowdracb8482a2021-05-27 09:06:13 -070070 ... Verify that traffic is limited to Limiting Bandwidth (eir+cir+air) configured for the service/onu.
Hardik Windlass2013d0c2021-05-20 13:37:25 +000071 ... Pump 500Mbps in the upstream from RG and verify that the received traffic is only 200Mbps at the BNG.
72 ... Note: Currently, only Flex Pod supports the deployment configuration required to test this scenario.
73 [Tags] functionalTT VOL-4093
74 [Setup] Run Keywords Start Logging TcontType1Onu1
75 ... AND Setup
76 [Teardown] Run Keywords Collect Logs
77 ... AND Stop Logging TcontType1Onu1
Hardik Windlass35db2aa2021-06-03 12:41:26 +000078 ... AND Delete All Devices and Verify
Hardik Windlass2013d0c2021-05-20 13:37:25 +000079 Run Keyword If ${has_dataplane} Clean Up Linux
80 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
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 Gowdracb8482a2021-05-27 09:06:13 -070094 ${limiting_bw_value_upstream}= Get Limiting Bandwidth Details ${test_us_bw_profile}
Hardik Windlass2013d0c2021-05-20 13:37:25 +000095 # 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 Gowdracb8482a2021-05-27 09:06:13 -0700101 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
Hardik Windlass2013d0c2021-05-20 13:37:25 +0000102 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
103 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000104 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
105 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Hardik Windlass2013d0c2021-05-20 13:37:25 +0000106
Hardik Windlassd388b462021-05-27 05:40:00 +0000107Test 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
115 [Setup] Run Keywords Start Logging TcontType2Type4Onu1
116 ... AND Setup
117 [Teardown] Run Keywords Collect Logs
118 ... AND Stop Logging TcontType2Type4Onu1
119 ... AND Delete All Devices and Verify
120 Run Keyword If ${has_dataplane} Clean Up Linux
121 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test TT
122
123 # The test expects the first entry in multi_tcont_tests.tcont2tcont4 input will be for service: vod and tcont: 2
124 # The test expects the second entry in multi_tcont_tests.tcont2tcont4 input will be for service: hsia and tcont: 4
125 ${list_onus_ut}= Create List
126 ${num_multi_tcont_input}= Get Length ${multi_tcont_tests.tcont2tcont4}
127 FOR ${I} IN RANGE 0 ${num_multi_tcont_input}
128 ${onu}= Set Variable ${multi_tcont_tests.tcont2tcont4[${I}]}
129 ${onu_sn}= Set Variable ${onu['onu']}
130 ${service}= Set Variable ${onu['service_type']}
131 ${us_bw}= Set Variable ${onu['us_bw_profile']}
132 ${matched} ${src} ${dst}= Get ONU details with Given Sn and Service ${onu_sn}
133 ... ${service} ${us_bw}
134 Pass Execution If '${matched}' != 'True'
135 ... Skipping test: No ONU found with sn '${onu_sn}', service '${service}' and us_bw '${us_bw}'
136 # Check for iperf3 and jq tools
137 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
138 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
139 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
140 # Get Upstream BW Profile details
141 ${limiting_bw_us}= Get Limiting Bandwidth Details ${us_bw}
142 ${onu_ut} Create Dictionary src ${src} dst ${dst} limiting_bw_us ${limiting_bw_us}
143 Append To List ${list_onus_ut} ${onu_ut}
144 END
145
146 # Case 1: Verify only for HSIA service
147 ${dst}= Set Variable ${list_onus_ut}[1][dst]
148 ${updict}= Run Iperf3 Test Client ${list_onus_ut}[1][src] server=${dst['dp_iface_ip_qinq']}
149 ... args=-t 30 -p 5202
150 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
151 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${list_onus_ut}[1][limiting_bw_us]
152 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
153 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000154 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
155 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Hardik Windlassd388b462021-05-27 05:40:00 +0000156
157 # Case 2: Verify for VOD (with index [0]) and HSIA (with index [1]) service combined
158 ${out_file_0}= Set Variable ${CURDIR}/../../tests/data/out_tcont2
159 ${dst_0}= Set Variable ${list_onus_ut}[0][dst]
160 Run Iperf3 Test Client in Background ${list_onus_ut}[0][src] server=${dst_0['dp_iface_ip_qinq']}
161 ... args=-t 30 -p 5201 out_file=${out_file_0}
162 ${out_file_1}= Set Variable ${CURDIR}/../../tests/data/out_tcont4
163 ${dst_1}= Set Variable ${list_onus_ut}[1][dst]
164 Run Iperf3 Test Client in Background ${list_onus_ut}[1][src] server=${dst_1['dp_iface_ip_qinq']}
165 ... args=-t 30 -p 5202 out_file=${out_file_1}
166 # Wait for the above iperf commands to finish (sleep time depends on -t arg value passed in iperf command)
167 Sleep 35s
168 ${out_0}= Read Output File on System ${out_file_0}
169 ${out_1}= Read Output File on System ${out_file_1}
170 ${actual_upstream_bw_used_0}= Evaluate ${out_0['end']['sum_received']['bits_per_second']}/1000
171 ${pct_limit_up_0}= Evaluate 100*${actual_upstream_bw_used_0}/${list_onus_ut}[0][limiting_bw_us]
172 Should Be True ${pct_limit_up_0} >= ${lower_margin_pct}
173 ... The upstream bandwidth guarantee was not met (${pct_limit_up_0}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000174 Should Be True ${pct_limit_up_0} <= ${upper_margin_pct}
175 ... The upstream bandwidth exceeded the limit (${pct_limit_up_0}% of limit)
Hardik Windlassd388b462021-05-27 05:40:00 +0000176 ${actual_upstream_bw_used_1}= Evaluate ${out_1['end']['sum_received']['bits_per_second']}/1000
177 ${pct_limit_up_1}= Evaluate
178 ... 100*${actual_upstream_bw_used_1}/(${list_onus_ut}[1][limiting_bw_us]-${list_onus_ut}[0][limiting_bw_us])
179 Should Be True ${pct_limit_up_1} >= ${lower_margin_pct}
180 ... The upstream bandwidth guarantee was not met (${pct_limit_up_1}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000181 Should Be True ${pct_limit_up_1} <= ${upper_margin_pct}
182 ... The upstream bandwidth exceeded the limit (${pct_limit_up_1}% of limit)
Hardik Windlassd388b462021-05-27 05:40:00 +0000183
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000184Test that the AIR BW is reserved for a ONU
185 [Documentation] Verify support for Tcont type 1 + type 4 at the same time.
186 ... Verify that 8700Mbps is reserved in the upstream as AIR requirement for the VoIP service.
187 ... Pump 1Gbpbs in the upstream from the RG for HSI service, respectively ONU2, ONU3 and verify that up to 1Gbps
188 ... is received at the BNG.
189 ... Then pump ONU2 and ONU3 HSIA combined. ONUs must be share rest of bw in PON Port. (Expect fixed tcont1)
190 ... Note: Currently, only Flex Pod supports the deployment configuration required to test this scenario.
191 [Tags] functionalTT VOL-4094
192 [Setup] Run Keywords Start Logging TcontType1Type4Onu1Onu2Onu3
193 ... AND Setup
194 [Teardown] Run Keywords Collect Logs
195 ... AND Stop Logging TcontType1Type4Onu1Onu2Onu3
196 ... AND Delete All Devices and Verify
197 # Push multi-tcont sadis to ONOS
198 Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT-multi-tcont.json
199 Run Keyword If ${has_dataplane} Clean Up Linux
200 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test TT
201
202 # The test expects the first entry in multi_tcont_tests.tcont1tcont4 input will be for service: voip and tcont: 1
203 # The test expects the second entry in multi_tcont_tests.tcont1tcont4 input will be for service: hsia and tcont: 4
204 ${list_onus_ut}= Create List
205 ${num_multi_tcont_input}= Get Length ${multi_tcont_tests.tcont1tcont4}
206 FOR ${I} IN RANGE 0 ${num_multi_tcont_input}
207 ${onu}= Set Variable ${multi_tcont_tests.tcont1tcont4[${I}]}
208 ${onu_sn}= Set Variable ${onu['onu']}
209 ${service}= Set Variable ${onu['service_type']}
210 ${us_bw}= Set Variable ${onu['us_bw_profile']}
211 ${matched} ${src} ${dst}= Get ONU details with Given Sn and Service ${onu_sn}
212 ... ${service} ${us_bw}
213 Pass Execution If '${matched}' != 'True'
214 ... Skipping test: No ONU found with sn '${onu_sn}', service '${service}' and us_bw '${us_bw}'
215 # Check for iperf3 and jq tools
216 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
217 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
218 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
219 # Get Upstream BW Profile details
220 ${limiting_bw_us}= Get Limiting Bandwidth Details ${us_bw}
221 ${onu_ut} Create Dictionary src ${src} dst ${dst} limiting_bw_us ${limiting_bw_us}
222 Append To List ${list_onus_ut} ${onu_ut}
223 END
224
225 # Fill the OLT PON Bandwidth with Fixed Bandwidth Profile ONU
226 ${onu_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("serial")
227 ${olt_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("olt")
228 ${us_bw_profile_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("us_bw_profile")
229 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_fill_pon_bw}
230 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
231 ... Get ONU Port in ONOS ${onu_fill_pon_bw} ${of_id}
232 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
233 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
234 ... volt-add-subscriber-access ${of_id} ${onu_port}
235 Sleep 10s
236 ${limiting_bw_us_fill_pon_bw}= Get Limiting Bandwidth Details ${us_bw_profile_fill_pon_bw}
237
238 # Case 1: Verify both ONUs should be able to get 1Gbps separately when only HSIA service is available
239 ${dst}= Set Variable ${list_onus_ut}[0][dst]
240 ${updict}= Run Iperf3 Test Client ${list_onus_ut}[0][src] server=${dst['dp_iface_ip_qinq']}
241 ... args=-t 30 -p 5202
242 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
243 ${pct_limit_up}= Evaluate
244 ... 100*${actual_upstream_bw_used}/${list_onus_ut}[0][limiting_bw_us]
245 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
246 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
247
248 ${dst}= Set Variable ${list_onus_ut}[1][dst]
249 ${updict}= Run Iperf3 Test Client ${list_onus_ut}[1][src] server=${dst['dp_iface_ip_qinq']}
250 ... args=-t 30 -p 5202
251 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
252 ${pct_limit_up}= Evaluate
253 ... 100*${actual_upstream_bw_used}/${list_onus_ut}[1][limiting_bw_us]
254 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
255 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000256 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
257 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000258
259 # Case 2: Verify ONU1 and ONU2 will share rest of bw in PON Port. (Expect provisioned fixed bw)
260 ${out_file_0}= Set Variable /tmp/out1_tcont4
261 ${dst_0}= Set Variable ${list_onus_ut}[0][dst]
262 Run Iperf3 Test Client in Background ${list_onus_ut}[0][src] server=${dst_0['dp_iface_ip_qinq']}
263 ... args=-t 30 -p 5201 out_file=${out_file_0}
264 ${out_file_1}= Set Variable /tmp/out2_tcont4
265 ${dst_0}= Set Variable ${list_onus_ut}[0][dst]
266 ${dst_1}= Set Variable ${list_onus_ut}[1][dst]
267 Run Iperf3 Test Client in Background ${list_onus_ut}[1][src] server=${dst_1['dp_iface_ip_qinq']}
268 ... args=-t 30 -p 5202 out_file=${out_file_1}
269 # Wait for the above iperf commands to finish (sleep time depends on -t arg value passed in iperf command)
270 Sleep 35s
271 ${out_0}= Read Output File on System ${out_file_0}
272 ${out_1}= Read Output File on Remote System ${list_onus_ut}[1][src] ${out_file_1}
273 # Verify ONU1 and ONU2 tcont4 is share rest of bw.
274 ${actual_upstream_bw_used_0}= Evaluate ${out_0['end']['sum_received']['bits_per_second']}/1000
275 ${pct_limit_up_0}= Evaluate
276 ... 100*${actual_upstream_bw_used_0}/((${pon_max_bw_capacity_xgs}-${limiting_bw_us_fill_pon_bw})/2)
277 Should Be True ${pct_limit_up_0} >= ${lower_margin_pct}
278 ... The upstream bandwidth guarantee was not met (${pct_limit_up_0}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000279 Should Be True ${pct_limit_up_0} <= ${upper_margin_pct}
280 ... The upstream bandwidth exceeded the limit (${pct_limit_up_0}% of limit)
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000281 ${actual_upstream_bw_used_1}= Evaluate ${out_1['end']['sum_received']['bits_per_second']}/1000
282 ${pct_limit_up_1}= Evaluate
283 ... 100*${actual_upstream_bw_used_1}/((${pon_max_bw_capacity_xgs}-${limiting_bw_us_fill_pon_bw})/2)
284 Should Be True ${pct_limit_up_1} >= ${lower_margin_pct}
285 ... The upstream bandwidth guarantee was not met (${pct_limit_up_1}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000286 Should Be True ${pct_limit_up_1} <= ${upper_margin_pct}
287 ... The upstream bandwidth exceeded the limit (${pct_limit_up_1}% of limit)
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000288 # Verify ONU3 (fixed bw) tcont1 air bw is reservered.
289 ${actual_reserved_upstream_bw_for_tcont1}= Evaluate
290 ... ${pon_max_bw_capacity_xgs}-(${actual_upstream_bw_used_0}+${actual_upstream_bw_used_1})
291 ${pct_limit_up_tcont1}= Evaluate 100*${actual_reserved_upstream_bw_for_tcont1}/${limiting_bw_us_fill_pon_bw}
292 Should Be True ${pct_limit_up_tcont1} >= ${lower_margin_pct}
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000293 ... The upstream bandwidth guarantee was not met (${pct_limit_up_tcont1}% of resv)
294 Should Be True ${pct_limit_up_tcont1} <= ${upper_margin_pct}
295 ... The upstream bandwidth exceeded the limit (${pct_limit_up_tcont1}% of limit)
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000296
297 # Sent original sadis file to onos
298 Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT.json
299
Emrehan UZUN683bb962021-06-11 11:59:31 +0000300Verify that non-assured BW is released to assured BW allocation as needed for TT
301 [Documentation] Verify support for Tcont type 2 and 3.
302 ... Pump 1Gbps in the upstream from RG of ONU2 for VoD service and
303 ... then verify that no more than 700Mbps is received at the BNG.
304 ... Firstly, pump 500Mbps from the RG of ONU1 for the VoD service and
305 ... then verify that close to 500Mbps is received at the BNG.
306 ... Also verify that the VoD rate is now truncated to 500Mbps at BNG for ONU2.
307 [Tags] functionalTT VOL-4096
308 [Setup] Run Keywords Start Logging TcontType2Onu1Type3Onu2
309 ... AND Setup
310 [Teardown] Run Keywords Collect Logs
311 ... AND Stop Logging TcontType2Onu1Type3Onu2
Hardik Windlass7a62cf72021-07-07 04:35:01 +0000312 ... AND Delete All Devices and Verify
Emrehan UZUN683bb962021-06-11 11:59:31 +0000313 # Push multi-tcont sadis to ONOS
314 Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT-multi-tcont.json
315 Run Keyword If ${has_dataplane} Clean Up Linux
316 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test TT
317
318 # The test expects the first entry in multi_tcont_tests.tcont2tcont3 input will be for service: vod and tcont: 2
319 # The test expects the second entry in multi_tcont_tests.tcont2tcont3 input will be for service: vod and tcont: 3
320 ${list_onus_ut}= Create List
321 ${num_multi_tcont_input}= Get Length ${multi_tcont_tests.tcont2tcont3}
322 ${uni_capacity}= Set Variable 1000000
323 FOR ${I} IN RANGE 0 ${num_multi_tcont_input}
324 ${onu}= Set Variable ${multi_tcont_tests.tcont2tcont3[${I}]}
325 ${onu_sn}= Set Variable ${onu['onu']}
326 ${service}= Set Variable ${onu['service_type']}
327 ${us_bw}= Set Variable ${onu['us_bw_profile']}
328 ${matched} ${src} ${dst}= Get ONU details with Given Sn and Service ${onu_sn}
329 ... ${service} ${us_bw}
330 Pass Execution If '${matched}' != 'True'
331 ... Skipping test: No ONU found with sn '${onu_sn}', service '${service}' and us_bw '${us_bw}'
332 # Check for iperf3 and jq tools
333 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
334 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
335 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
336 # Get Upstream BW Profile details
337 ${limiting_bw_us}= Get Limiting Bandwidth Details ${us_bw}
338 ${onu_ut} Create Dictionary src ${src} dst ${dst} limiting_bw_us ${limiting_bw_us}
339 Append To List ${list_onus_ut} ${onu_ut}
340 END
341
342 # Fill the OLT PON Bandwidth with Fixed Bandwidth Profile ONU
343 ${onu_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("serial")
344 ${olt_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("olt")
345 ${us_bw_profile_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("us_bw_profile")
346 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_fill_pon_bw}
347 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
348 ... Get ONU Port in ONOS ${onu_fill_pon_bw} ${of_id}
349 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
350 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
351 ... volt-add-subscriber-access ${of_id} ${onu_port}
352 Sleep 10s
353 ${limiting_bw_us_fill_pon_bw}= Get Limiting Bandwidth Details ${us_bw_profile_fill_pon_bw}
354
355 # Case 1: Verify only for VoD service from the RG of ONU2
356 ${dst}= Set Variable ${list_onus_ut}[1][dst]
357 ${updict}= Run Iperf3 Test Client ${list_onus_ut}[1][src] server=${dst['dp_iface_ip_qinq']}
358 ... args=-t 30 -p 5202
359 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
360 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${list_onus_ut}[1][limiting_bw_us]
361 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
362 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000363 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
364 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Emrehan UZUN683bb962021-06-11 11:59:31 +0000365
366 # Case 2: Verify for ONU1 (with index [0]) and ONU2 (with index [1]) devices combined
367 ${out_file_0}= Set Variable /tmp/out_tcont2
368 ${dst_0}= Set Variable ${list_onus_ut}[0][dst]
369 Run Iperf3 Test Client in Background ${list_onus_ut}[0][src] server=${dst_0['dp_iface_ip_qinq']}
370 ... args=-t 30 -p 5201 out_file=${out_file_0}
371 ${out_file_1}= Set Variable /tmp/out_tcont3
372 ${dst_1}= Set Variable ${list_onus_ut}[1][dst]
373 Run Iperf3 Test Client in Background ${list_onus_ut}[1][src] server=${dst_1['dp_iface_ip_qinq']}
374 ... args=-t 30 -p 5202 out_file=${out_file_1}
375 # Wait for the above iperf commands to finish (sleep time depends on -t arg value passed in iperf command)
376 Sleep 35s
377 ${out_0}= Read Output File on System ${out_file_0}
378 ${out_1}= Read Output File on Remote System ${list_onus_ut}[1][src] ${out_file_1}
379 ${actual_upstream_bw_used_0}= Evaluate ${out_0['end']['sum_received']['bits_per_second']}/1000
380 ${pct_limit_up_0}= Evaluate 100*${actual_upstream_bw_used_0}/${list_onus_ut}[0][limiting_bw_us]
381 Should Be True ${pct_limit_up_0} >= ${lower_margin_pct}
382 ... The upstream bandwidth guarantee was not met (${pct_limit_up_0}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000383 Should Be True ${pct_limit_up_0} <= ${upper_margin_pct}
384 ... The upstream bandwidth exceeded the limit (${pct_limit_up_0}% of limit)
Emrehan UZUN683bb962021-06-11 11:59:31 +0000385 ${actual_upstream_bw_used_1}= Evaluate ${out_1['end']['sum_received']['bits_per_second']}/1000
386 ${pct_limit_up_1}= Evaluate
387 ... 100*${actual_upstream_bw_used_1}/(${uni_capacity}-${list_onus_ut}[0][limiting_bw_us])
388 Should Be True ${pct_limit_up_1} >= ${lower_margin_pct}
389 ... The upstream bandwidth guarantee was not met (${pct_limit_up_1}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000390 Should Be True ${pct_limit_up_1} <= ${upper_margin_pct}
391 ... The upstream bandwidth exceeded the limit (${pct_limit_up_1}% of limit)
392
393 # Sent original sadis file to onos
394 Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT.json
395
396Verify that best effort BW is released to assured BW requirement as needed and that fixed BW is reserved always on the PON for TT
397 [Documentation] Verify support for Tcont type 4 and 5.
398 ... Pump 1Gbps upstream from the RG for HSI service of ONU2.
399 ... Verify that no more than 1Gbps is received at the BNG.
400 ... Now pump traffic from the RG's for the HSI service both ONU1 and ONU2 at the same time.
401 ... The BNG should receive at least 700Mbps (500 + 200 Mbps) for ONU2.
402 ... The remaining 300Mbps on the PON should be rationed between the two ONUs.
403 ... Now this is largely scheduler implementation dependent, so this is to be observed on the scheduler in the BAL behaves.
404 ... If it equally distributes the remaining BW,
405 ... ONU1 should get 150Mbps and ONU2 in total should get 850Mbps (500+200+150Mbps).
406 [Tags] functionalTT VOL-4097 non-critical
407 [Setup] Run Keywords Start Logging TcontType4Onu1Type5Onu2
408 ... AND Setup
409 [Teardown] Run Keywords Collect Logs
410 ... AND Stop Logging TcontType4Onu1Type5Onu2
411 ... AND Delete All Devices and Verify
412 Run Keyword If ${has_dataplane} Clean Up Linux
413 Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT-multi-tcont-1.json
414 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test TT
415
416 # The test expects the first entry in multi_tcont_tests.tcont4tcont5 input will be for service: hsıa and tcont: 4
417 # The test expects the second entry in multi_tcont_tests.tcont4tcont5 input will be for service: hsıa and tcont: 5
418 ${list_onus_ut}= Create List
419 ${list_onus_ut_air_cir}= Create List
420 ${num_multi_tcont_input}= Get Length ${multi_tcont_tests.tcont4tcont5}
421 FOR ${I} IN RANGE 0 ${num_multi_tcont_input}
422 ${onu}= Set Variable ${multi_tcont_tests.tcont4tcont5[${I}]}
423 ${onu_sn}= Set Variable ${onu['onu']}
424 ${service}= Set Variable ${onu['service_type']}
425 ${us_bw}= Set Variable ${onu['us_bw_profile']}
426 ${matched} ${src} ${dst}= Get ONU details with Given Sn and Service ${onu_sn}
427 ... ${service} ${us_bw}
428 Pass Execution If '${matched}' != 'True'
429 ... Skipping test: No ONU found with sn '${onu_sn}', service '${service}' and us_bw '${us_bw}'
430 # Check for iperf3 and jq tools
431 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
432 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
433 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
434 # Get Upstream BW Profile details
435 ${limiting_bw_us}= Get Limiting Bandwidth Details ${us_bw}
436 ${onu_ut} Create Dictionary src ${src} dst ${dst} limiting_bw_us ${limiting_bw_us}
437 Append To List ${list_onus_ut} ${onu_ut}
438 ${limiting_bw_us_air_cir}= Get Limiting Bandwidth Details for Fixed and Committed ${us_bw}
439 ${onu_ut_air_cir} Create Dictionary src ${src} dst ${dst}
440 ... limiting_bw_us_air_cir ${limiting_bw_us_air_cir}
441 Append To List ${list_onus_ut_air_cir} ${onu_ut_air_cir}
442 END
443
444 # Fill the OLT PON Bandwidth with Fixed Bandwidth Profile ONU
445 ${onu_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("serial")
446 ${olt_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("olt")
447 ${us_bw_profile_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("us_bw_profile")
448 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_fill_pon_bw}
449 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
450 ... Get ONU Port in ONOS ${onu_fill_pon_bw} ${of_id}
451 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
452 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
453 ... volt-add-subscriber-access ${of_id} ${onu_port}
454 Sleep 10s
455 ${limiting_bw_us_fill_pon_bw}= Get Limiting Bandwidth Details ${us_bw_profile_fill_pon_bw}
456
457 # Case 1: Verify only for HSIA service from the RG of ONU2
458 ${dst}= Set Variable ${list_onus_ut}[1][dst]
459 ${updict}= Run Iperf3 Test Client ${list_onus_ut}[1][src] server=${dst['dp_iface_ip_qinq']}
460 ... args=-t 30 -p 5202
461 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
462 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${list_onus_ut}[1][limiting_bw_us]
463 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
464 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
465 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
466 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
467
468 # Case 2: Verify for ONU1 (with index [0]) and ONU2 (with index [1]) devices combined
469 ${out_file_0}= Set Variable /tmp/out_tcont4
470 ${dst_0}= Set Variable ${list_onus_ut}[0][dst]
471 Run Iperf3 Test Client in Background ${list_onus_ut}[0][src] server=${dst_0['dp_iface_ip_qinq']}
472 ... args=-t 30 -p 5201 out_file=${out_file_0}
473 ${out_file_1}= Set Variable /tmp/out_tcont5
474 ${dst_1}= Set Variable ${list_onus_ut}[1][dst]
475 Run Iperf3 Test Client in Background ${list_onus_ut}[1][src] server=${dst_1['dp_iface_ip_qinq']}
476 ... args=-t 30 -p 5202 out_file=${out_file_1}
477 # Wait for the above iperf commands to finish (sleep time depends on -t arg value passed in iperf command)
478 Sleep 35s
479 ${out_0}= Read Output File on System ${out_file_0}
480 ${out_1}= Read Output File on Remote System ${list_onus_ut}[1][src] ${out_file_1}
481 ${actual_upstream_bw_used_0}= Evaluate ${out_0['end']['sum_received']['bits_per_second']}/1000
482 ${limit_up_0_denominator}= Evaluate
483 ... ((${pon_max_bw_capacity_xgs}-${limiting_bw_us_fill_pon_bw}-${list_onus_ut_air_cir}[1][limiting_bw_us_air_cir])/2)
484 ${pct_limit_up_0}= Evaluate
485 ... 100*${actual_upstream_bw_used_0}/${limit_up_0_denominator}
486 Should Be True ${pct_limit_up_0} >= ${lower_margin_pct}
487 ... The upstream bandwidth guarantee was not met (${pct_limit_up_0}% of resv)
488 Should Be True ${pct_limit_up_0} <= ${upper_margin_pct}
489 ... The upstream bandwidth exceeded the limit (${pct_limit_up_0}% of limit)
490 ${actual_upstream_bw_used_1}= Evaluate ${out_1['end']['sum_received']['bits_per_second']}/1000
491 ${limit_up_1_numerator}= Evaluate
492 ... (${actual_upstream_bw_used_1}-${list_onus_ut_air_cir}[1][limiting_bw_us_air_cir])
493 ${limit_up_1_denominator}= Evaluate
494 ... ((${pon_max_bw_capacity_xgs}-${limiting_bw_us_fill_pon_bw}-${list_onus_ut_air_cir}[1][limiting_bw_us_air_cir])/2)
495 ${pct_limit_up_1}= Evaluate
496 ... 100*${limit_up_1_numerator}/${limit_up_1_denominator}
497 Should Be True ${pct_limit_up_1} >= ${lower_margin_pct}
498 ... The upstream bandwidth guarantee was not met (${pct_limit_up_1}% of resv)
499 Should Be True ${pct_limit_up_1} <= ${upper_margin_pct}
500 ... The upstream bandwidth exceeded the limit (${pct_limit_up_1}% of limit)
Emrehan UZUN683bb962021-06-11 11:59:31 +0000501
502 # Sent original sadis file to onos
503 Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT.json
504
Hardik Windlass2013d0c2021-05-20 13:37:25 +0000505*** Keywords ***
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000506Read Output File on Remote System
507 [Arguments] ${src} ${file}
508 [Documentation] Login to ${src} and reads the content of ${file}.
509 Get File from Remote System ${file} ${src['ip']} ${src['user']} ${src['pass']}
510 ${output}= OperatingSystem.Get File ${file}
511 Log ${output}
512 ${object}= Evaluate json.loads(r'''${output}''') json
513 [Return] ${object}
514
515Get File from Remote System
516 [Arguments] ${file} ${ip} ${user} ${pass}=${None}
517 [Documentation] Gets file from the remote system and stores it in /tmp folder on local
518 ${conn_id}= SSHLibrary.Open Connection ${ip}
519 Run Keyword If '${pass}' != '${None}'
520 ... SSHLibrary.Login ${user} ${pass}
521 ... ELSE
522 ... SSHLibrary.Login With Public Key ${user} %{HOME}/.ssh/id_rsa
523 SSHLibrary.Get File ${file} /tmp/
524 SSHLibrary.Close Connection
525
Hardik Windlassd388b462021-05-27 05:40:00 +0000526Read Output File on System
527 [Arguments] ${file}
528 [Documentation] Reads the content of ${file}.
529 ${output}= OperatingSystem.Get File ${file}
530 Log ${output}
531 ${object}= Evaluate json.loads(r'''${output}''') json
532 [Return] ${object}
533
534Run Iperf3 Test Client in Background
535 [Arguments] ${src} ${server} ${args} ${out_file}
536 [Documentation] Login to ${src} and run the iperf3 client against ${server} using ${args} in background.
537 ... Stores the results of the test in ${out_file}.
538 ${output} ${stderr} ${rc}= Execute Remote Command iperf3 -J -c ${server} ${args} > ${out_file} &
539 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
540 Should Be Equal As Integers ${rc} 0
541
Hardik Windlass2013d0c2021-05-20 13:37:25 +0000542Get ONU details with Given Sn and Service
543 [Documentation] This keyword finds the ONU details (as required for multi-tcont test)
544 ... with given serial number and service type
545 ... The keyword, additionally, also verifies the associated upstream bandwidth profile
546 [Arguments] ${onu_sn} ${service_type} ${us_bw_profile}
547 ${matched}= Set Variable False
548 FOR ${I} IN RANGE 0 ${num_all_onus}
549 ${src}= Set Variable ${hosts.src[${I}]}
550 ${dst}= Set Variable ${hosts.dst[${I}]}
551 ${service}= Get Variable Value ${src['service_type']} "null"
552 ${onu}= Get Variable Value ${src['onu']} "null"
553 Continue For Loop If '${onu}' != '${onu_sn}' or '${service}' != '${service_type}'
554 # Additional verification to check upstream bandwidth profile
555 ${of_id}= Get ofID From OLT List ${src['olt']}
556 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} ${of_id}
557 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
558 ${us_bw} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
Hardik Windlass35db2aa2021-06-03 12:41:26 +0000559 ... ${service_type}
Hardik Windlass2013d0c2021-05-20 13:37:25 +0000560 ${matched}= Set Variable If
561 ... '${onu}' == '${onu_sn}' and '${service}' == '${service_type}' and ${us_bw} == '${us_bw_profile}'
562 ... True False
563 Exit For Loop If ${matched}
564 END
565 [Return] ${matched} ${src} ${dst}
566
567Setup Suite
568 [Documentation] Set up the test suite
569 Common Test Suite Setup
570 ${switch_type}= Get Variable Value ${web_power_switch.type}
571 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
572
573
574Clear All Devices Then Create New Device
575 [Documentation] Remove any devices from VOLTHA and ONOS
576 # Remove all devices from voltha and nos
577 Delete All Devices and Verify
578 # Execute normal test Setup Keyword
579 Setup
580
581
582Teardown Suite
583 [Documentation] Tear down steps for the suite
584 Run Keyword If ${has_dataplane} Clean Up Linux
585 Run Keyword If ${teardown_device} Delete All Devices And Verify
TorstenThieme4e2168e2021-06-22 14:01:47 +0000586 Close All ONOS SSH Connections