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