blob: 6d5edf641f55bc2347868d1718d32588db43b98d [file] [log] [blame]
Hardik Windlass2013d0c2021-05-20 13:37:25 +00001# Copyright 2021 - present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14# FIXME Can we use the same test against BBSim and Hardware?
15
16*** Settings ***
17Documentation Test various functional end-to-end scenarios for TT workflow
18Suite Setup Setup Suite
19Test Setup Setup
20Test Teardown Teardown
21Suite Teardown Teardown Suite
22Library Collections
23Library String
24Library OperatingSystem
25Library XML
26Library RequestsLibrary
27Library ../../libraries/DependencyLibrary.py
28Resource ../../libraries/onos.robot
29Resource ../../libraries/voltctl.robot
30Resource ../../libraries/voltha.robot
31Resource ../../libraries/utils.robot
32Resource ../../libraries/k8s.robot
33Resource ../../variables/variables.robot
34Resource ../../libraries/power_switch.robot
35
36*** Variables ***
37${POD_NAME} flex-ocp-cord
38${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
39${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs
40#${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
41${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
42${HELM_CHARTS_DIR} ~/helm-charts
43${VOLTHA_POD_NUM} 8
44${NAMESPACE} voltha
Hardik Windlass4288c6a2021-09-28 07:22:06 +000045${INFRA_NAMESPACE} default
Hardik Windlass2013d0c2021-05-20 13:37:25 +000046# For below variable value, using deployment name as using grep for
47# parsing radius pod name, we can also use full radius pod name
48${RESTART_POD_NAME} radius
49${timeout} 60s
50${of_id} 0
51${logical_id} 0
52${has_dataplane} True
53${teardown_device} True
54${scripts} ../../scripts
55
56# Per-test logging on failure is turned off by default; set this variable to enable
57${container_log_dir} ${None}
58
Matteo Scandoloda1c64b2021-07-20 10:14:49 -070059# logging flag to enable Collect Logs, can be passed via the command line too
60# example: -v logging:False
61${logging} True
62
Hardik Windlass2013d0c2021-05-20 13:37:25 +000063# For dataplane bandwidth testing
64${lower_margin_pct} 90 # Allow 10% under the limit
Emrehan UZUNd6f85892021-07-01 13:54:26 +000065${upper_margin_pct} 120 # Allow 20% under the limit
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +000066${pon_max_bw_capacity_xgs}= 9700000 # Mbps, for xgs-pon OLT, when FEC Disabled
Hardik Windlass2013d0c2021-05-20 13:37:25 +000067
68*** Test Cases ***
Girish Gowdracb8482a2021-05-27 09:06:13 -070069Test that the BW is limited to Limiting Bandwidth
Hardik Windlass2013d0c2021-05-20 13:37:25 +000070 [Documentation] Verify support for Tcont type 1.
Girish Gowdracb8482a2021-05-27 09:06:13 -070071 ... Verify that traffic is limited to Limiting Bandwidth (eir+cir+air) configured for the service/onu.
Hardik Windlass2013d0c2021-05-20 13:37:25 +000072 ... Pump 500Mbps in the upstream from RG and verify that the received traffic is only 200Mbps at the BNG.
73 ... Note: Currently, only Flex Pod supports the deployment configuration required to test this scenario.
74 [Tags] functionalTT VOL-4093
75 [Setup] Run Keywords Start Logging TcontType1Onu1
76 ... AND Setup
Hardik Windlass98802ce2021-11-12 14:09:26 +000077 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Girish Gowdraf244d5b2021-09-01 17:16:16 -070078 ... AND Stop Logging TcontType1Onu1
Hardik Windlass2013d0c2021-05-20 13:37:25 +000079 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5083b3a2021-11-11 12:16:22 +000080 Perform Sanity Tests TT
Hardik Windlass2013d0c2021-05-20 13:37:25 +000081 # 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
Hardik Windlass98802ce2021-11-12 14:09:26 +0000115 [Setup] Run Keyword Start Logging TcontType2Type4Onu1
116 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700117 ... AND Stop Logging TcontType2Type4Onu1
Hardik Windlass98802ce2021-11-12 14:09:26 +0000118 Clear All Devices Then Create New Device
Hardik Windlassd388b462021-05-27 05:40:00 +0000119 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000120 Perform Sanity Test TT
Hardik Windlassd388b462021-05-27 05:40:00 +0000121
122 # The test expects the first entry in multi_tcont_tests.tcont2tcont4 input will be for service: vod and tcont: 2
123 # The test expects the second entry in multi_tcont_tests.tcont2tcont4 input will be for service: hsia and tcont: 4
124 ${list_onus_ut}= Create List
125 ${num_multi_tcont_input}= Get Length ${multi_tcont_tests.tcont2tcont4}
126 FOR ${I} IN RANGE 0 ${num_multi_tcont_input}
127 ${onu}= Set Variable ${multi_tcont_tests.tcont2tcont4[${I}]}
128 ${onu_sn}= Set Variable ${onu['onu']}
129 ${service}= Set Variable ${onu['service_type']}
130 ${us_bw}= Set Variable ${onu['us_bw_profile']}
131 ${matched} ${src} ${dst}= Get ONU details with Given Sn and Service ${onu_sn}
132 ... ${service} ${us_bw}
133 Pass Execution If '${matched}' != 'True'
134 ... Skipping test: No ONU found with sn '${onu_sn}', service '${service}' and us_bw '${us_bw}'
135 # Check for iperf3 and jq tools
136 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
137 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
138 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
139 # Get Upstream BW Profile details
140 ${limiting_bw_us}= Get Limiting Bandwidth Details ${us_bw}
141 ${onu_ut} Create Dictionary src ${src} dst ${dst} limiting_bw_us ${limiting_bw_us}
142 Append To List ${list_onus_ut} ${onu_ut}
143 END
144
145 # Case 1: Verify only for HSIA service
146 ${dst}= Set Variable ${list_onus_ut}[1][dst]
147 ${updict}= Run Iperf3 Test Client ${list_onus_ut}[1][src] server=${dst['dp_iface_ip_qinq']}
148 ... args=-t 30 -p 5202
149 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
150 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${list_onus_ut}[1][limiting_bw_us]
151 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
152 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000153 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
154 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Hardik Windlassd388b462021-05-27 05:40:00 +0000155
156 # Case 2: Verify for VOD (with index [0]) and HSIA (with index [1]) service combined
157 ${out_file_0}= Set Variable ${CURDIR}/../../tests/data/out_tcont2
158 ${dst_0}= Set Variable ${list_onus_ut}[0][dst]
159 Run Iperf3 Test Client in Background ${list_onus_ut}[0][src] server=${dst_0['dp_iface_ip_qinq']}
160 ... args=-t 30 -p 5201 out_file=${out_file_0}
161 ${out_file_1}= Set Variable ${CURDIR}/../../tests/data/out_tcont4
162 ${dst_1}= Set Variable ${list_onus_ut}[1][dst]
163 Run Iperf3 Test Client in Background ${list_onus_ut}[1][src] server=${dst_1['dp_iface_ip_qinq']}
164 ... args=-t 30 -p 5202 out_file=${out_file_1}
165 # Wait for the above iperf commands to finish (sleep time depends on -t arg value passed in iperf command)
166 Sleep 35s
167 ${out_0}= Read Output File on System ${out_file_0}
168 ${out_1}= Read Output File on System ${out_file_1}
169 ${actual_upstream_bw_used_0}= Evaluate ${out_0['end']['sum_received']['bits_per_second']}/1000
170 ${pct_limit_up_0}= Evaluate 100*${actual_upstream_bw_used_0}/${list_onus_ut}[0][limiting_bw_us]
171 Should Be True ${pct_limit_up_0} >= ${lower_margin_pct}
172 ... The upstream bandwidth guarantee was not met (${pct_limit_up_0}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000173 Should Be True ${pct_limit_up_0} <= ${upper_margin_pct}
174 ... The upstream bandwidth exceeded the limit (${pct_limit_up_0}% of limit)
Hardik Windlassd388b462021-05-27 05:40:00 +0000175 ${actual_upstream_bw_used_1}= Evaluate ${out_1['end']['sum_received']['bits_per_second']}/1000
176 ${pct_limit_up_1}= Evaluate
177 ... 100*${actual_upstream_bw_used_1}/(${list_onus_ut}[1][limiting_bw_us]-${list_onus_ut}[0][limiting_bw_us])
178 Should Be True ${pct_limit_up_1} >= ${lower_margin_pct}
179 ... The upstream bandwidth guarantee was not met (${pct_limit_up_1}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000180 Should Be True ${pct_limit_up_1} <= ${upper_margin_pct}
181 ... The upstream bandwidth exceeded the limit (${pct_limit_up_1}% of limit)
Hardik Windlassd388b462021-05-27 05:40:00 +0000182
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000183Test that the AIR BW is reserved for a ONU
184 [Documentation] Verify support for Tcont type 1 + type 4 at the same time.
185 ... Verify that 8700Mbps is reserved in the upstream as AIR requirement for the VoIP service.
186 ... Pump 1Gbpbs in the upstream from the RG for HSI service, respectively ONU2, ONU3 and verify that up to 1Gbps
187 ... is received at the BNG.
188 ... Then pump ONU2 and ONU3 HSIA combined. ONUs must be share rest of bw in PON Port. (Expect fixed tcont1)
189 ... Note: Currently, only Flex Pod supports the deployment configuration required to test this scenario.
190 [Tags] functionalTT VOL-4094
Hardik Windlass98802ce2021-11-12 14:09:26 +0000191 [Setup] Run Keyword Start Logging TcontType1Type4Onu1Onu2Onu3
192 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700193 ... AND Stop Logging TcontType1Type4Onu1Onu2Onu3
Hardik Windlass98802ce2021-11-12 14:09:26 +0000194 Clear All Devices Then Create New Device
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000195 # Push multi-tcont sadis to ONOS
196 Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT-multi-tcont.json
197 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000198 Perform Sanity Test TT
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000199
200 # The test expects the first entry in multi_tcont_tests.tcont1tcont4 input will be for service: voip and tcont: 1
201 # The test expects the second entry in multi_tcont_tests.tcont1tcont4 input will be for service: hsia and tcont: 4
202 ${list_onus_ut}= Create List
203 ${num_multi_tcont_input}= Get Length ${multi_tcont_tests.tcont1tcont4}
204 FOR ${I} IN RANGE 0 ${num_multi_tcont_input}
205 ${onu}= Set Variable ${multi_tcont_tests.tcont1tcont4[${I}]}
206 ${onu_sn}= Set Variable ${onu['onu']}
207 ${service}= Set Variable ${onu['service_type']}
208 ${us_bw}= Set Variable ${onu['us_bw_profile']}
209 ${matched} ${src} ${dst}= Get ONU details with Given Sn and Service ${onu_sn}
210 ... ${service} ${us_bw}
211 Pass Execution If '${matched}' != 'True'
212 ... Skipping test: No ONU found with sn '${onu_sn}', service '${service}' and us_bw '${us_bw}'
213 # Check for iperf3 and jq tools
214 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
215 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
216 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
217 # Get Upstream BW Profile details
218 ${limiting_bw_us}= Get Limiting Bandwidth Details ${us_bw}
219 ${onu_ut} Create Dictionary src ${src} dst ${dst} limiting_bw_us ${limiting_bw_us}
220 Append To List ${list_onus_ut} ${onu_ut}
221 END
222
223 # Fill the OLT PON Bandwidth with Fixed Bandwidth Profile ONU
224 ${onu_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("serial")
225 ${olt_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("olt")
226 ${us_bw_profile_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("us_bw_profile")
227 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_fill_pon_bw}
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000228 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000229 ... Get ONU Port in ONOS ${onu_fill_pon_bw} ${of_id}
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000230 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass9e3db232021-10-14 07:10:47 +0000231 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000232 ... volt-add-subscriber-access ${of_id} ${onu_port}
233 Sleep 10s
234 ${limiting_bw_us_fill_pon_bw}= Get Limiting Bandwidth Details ${us_bw_profile_fill_pon_bw}
235
236 # Case 1: Verify both ONUs should be able to get 1Gbps separately when only HSIA service is available
237 ${dst}= Set Variable ${list_onus_ut}[0][dst]
238 ${updict}= Run Iperf3 Test Client ${list_onus_ut}[0][src] server=${dst['dp_iface_ip_qinq']}
239 ... args=-t 30 -p 5202
240 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
241 ${pct_limit_up}= Evaluate
242 ... 100*${actual_upstream_bw_used}/${list_onus_ut}[0][limiting_bw_us]
243 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
244 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
245
246 ${dst}= Set Variable ${list_onus_ut}[1][dst]
247 ${updict}= Run Iperf3 Test Client ${list_onus_ut}[1][src] server=${dst['dp_iface_ip_qinq']}
248 ... args=-t 30 -p 5202
249 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
250 ${pct_limit_up}= Evaluate
251 ... 100*${actual_upstream_bw_used}/${list_onus_ut}[1][limiting_bw_us]
252 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
253 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000254 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
255 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000256
257 # Case 2: Verify ONU1 and ONU2 will share rest of bw in PON Port. (Expect provisioned fixed bw)
258 ${out_file_0}= Set Variable /tmp/out1_tcont4
259 ${dst_0}= Set Variable ${list_onus_ut}[0][dst]
260 Run Iperf3 Test Client in Background ${list_onus_ut}[0][src] server=${dst_0['dp_iface_ip_qinq']}
261 ... args=-t 30 -p 5201 out_file=${out_file_0}
262 ${out_file_1}= Set Variable /tmp/out2_tcont4
263 ${dst_0}= Set Variable ${list_onus_ut}[0][dst]
264 ${dst_1}= Set Variable ${list_onus_ut}[1][dst]
265 Run Iperf3 Test Client in Background ${list_onus_ut}[1][src] server=${dst_1['dp_iface_ip_qinq']}
266 ... args=-t 30 -p 5202 out_file=${out_file_1}
267 # Wait for the above iperf commands to finish (sleep time depends on -t arg value passed in iperf command)
268 Sleep 35s
269 ${out_0}= Read Output File on System ${out_file_0}
270 ${out_1}= Read Output File on Remote System ${list_onus_ut}[1][src] ${out_file_1}
271 # Verify ONU1 and ONU2 tcont4 is share rest of bw.
272 ${actual_upstream_bw_used_0}= Evaluate ${out_0['end']['sum_received']['bits_per_second']}/1000
273 ${pct_limit_up_0}= Evaluate
274 ... 100*${actual_upstream_bw_used_0}/((${pon_max_bw_capacity_xgs}-${limiting_bw_us_fill_pon_bw})/2)
275 Should Be True ${pct_limit_up_0} >= ${lower_margin_pct}
276 ... The upstream bandwidth guarantee was not met (${pct_limit_up_0}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000277 Should Be True ${pct_limit_up_0} <= ${upper_margin_pct}
278 ... The upstream bandwidth exceeded the limit (${pct_limit_up_0}% of limit)
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000279 ${actual_upstream_bw_used_1}= Evaluate ${out_1['end']['sum_received']['bits_per_second']}/1000
280 ${pct_limit_up_1}= Evaluate
281 ... 100*${actual_upstream_bw_used_1}/((${pon_max_bw_capacity_xgs}-${limiting_bw_us_fill_pon_bw})/2)
282 Should Be True ${pct_limit_up_1} >= ${lower_margin_pct}
283 ... The upstream bandwidth guarantee was not met (${pct_limit_up_1}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000284 Should Be True ${pct_limit_up_1} <= ${upper_margin_pct}
285 ... The upstream bandwidth exceeded the limit (${pct_limit_up_1}% of limit)
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000286 # Verify ONU3 (fixed bw) tcont1 air bw is reservered.
287 ${actual_reserved_upstream_bw_for_tcont1}= Evaluate
288 ... ${pon_max_bw_capacity_xgs}-(${actual_upstream_bw_used_0}+${actual_upstream_bw_used_1})
289 ${pct_limit_up_tcont1}= Evaluate 100*${actual_reserved_upstream_bw_for_tcont1}/${limiting_bw_us_fill_pon_bw}
290 Should Be True ${pct_limit_up_tcont1} >= ${lower_margin_pct}
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000291 ... The upstream bandwidth guarantee was not met (${pct_limit_up_tcont1}% of resv)
292 Should Be True ${pct_limit_up_tcont1} <= ${upper_margin_pct}
293 ... The upstream bandwidth exceeded the limit (${pct_limit_up_tcont1}% of limit)
Huseyin Ahmet AYDIN42d3b712021-06-10 14:46:17 +0000294
295 # Sent original sadis file to onos
296 Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT.json
297
Emrehan UZUN683bb962021-06-11 11:59:31 +0000298Verify that non-assured BW is released to assured BW allocation as needed for TT
299 [Documentation] Verify support for Tcont type 2 and 3.
300 ... Pump 1Gbps in the upstream from RG of ONU2 for VoD service and
301 ... then verify that no more than 700Mbps is received at the BNG.
302 ... Firstly, pump 500Mbps from the RG of ONU1 for the VoD service and
303 ... then verify that close to 500Mbps is received at the BNG.
304 ... Also verify that the VoD rate is now truncated to 500Mbps at BNG for ONU2.
305 [Tags] functionalTT VOL-4096
Hardik Windlass98802ce2021-11-12 14:09:26 +0000306 [Setup] Run Keyword Start Logging TcontType2Onu1Type3Onu2
307 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700308 ... AND Stop Logging TcontType2Onu1Type3Onu2
Hardik Windlass98802ce2021-11-12 14:09:26 +0000309 Clear All Devices Then Create New Device
Emrehan UZUN683bb962021-06-11 11:59:31 +0000310 # Push multi-tcont sadis to ONOS
311 Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT-multi-tcont.json
312 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000313 Perform Sanity Test TT
Emrehan UZUN683bb962021-06-11 11:59:31 +0000314
315 # The test expects the first entry in multi_tcont_tests.tcont2tcont3 input will be for service: vod and tcont: 2
316 # The test expects the second entry in multi_tcont_tests.tcont2tcont3 input will be for service: vod and tcont: 3
317 ${list_onus_ut}= Create List
318 ${num_multi_tcont_input}= Get Length ${multi_tcont_tests.tcont2tcont3}
319 ${uni_capacity}= Set Variable 1000000
320 FOR ${I} IN RANGE 0 ${num_multi_tcont_input}
321 ${onu}= Set Variable ${multi_tcont_tests.tcont2tcont3[${I}]}
322 ${onu_sn}= Set Variable ${onu['onu']}
323 ${service}= Set Variable ${onu['service_type']}
324 ${us_bw}= Set Variable ${onu['us_bw_profile']}
325 ${matched} ${src} ${dst}= Get ONU details with Given Sn and Service ${onu_sn}
326 ... ${service} ${us_bw}
327 Pass Execution If '${matched}' != 'True'
328 ... Skipping test: No ONU found with sn '${onu_sn}', service '${service}' and us_bw '${us_bw}'
329 # Check for iperf3 and jq tools
330 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
331 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
332 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
333 # Get Upstream BW Profile details
334 ${limiting_bw_us}= Get Limiting Bandwidth Details ${us_bw}
335 ${onu_ut} Create Dictionary src ${src} dst ${dst} limiting_bw_us ${limiting_bw_us}
336 Append To List ${list_onus_ut} ${onu_ut}
337 END
338
339 # Fill the OLT PON Bandwidth with Fixed Bandwidth Profile ONU
340 ${onu_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("serial")
341 ${olt_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("olt")
342 ${us_bw_profile_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("us_bw_profile")
343 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_fill_pon_bw}
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000344 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
Emrehan UZUN683bb962021-06-11 11:59:31 +0000345 ... Get ONU Port in ONOS ${onu_fill_pon_bw} ${of_id}
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000346 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass9e3db232021-10-14 07:10:47 +0000347 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Emrehan UZUN683bb962021-06-11 11:59:31 +0000348 ... volt-add-subscriber-access ${of_id} ${onu_port}
349 Sleep 10s
350 ${limiting_bw_us_fill_pon_bw}= Get Limiting Bandwidth Details ${us_bw_profile_fill_pon_bw}
351
352 # Case 1: Verify only for VoD service from the RG of ONU2
353 ${dst}= Set Variable ${list_onus_ut}[1][dst]
354 ${updict}= Run Iperf3 Test Client ${list_onus_ut}[1][src] server=${dst['dp_iface_ip_qinq']}
355 ... args=-t 30 -p 5202
356 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
357 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${list_onus_ut}[1][limiting_bw_us]
358 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
359 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000360 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
361 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Emrehan UZUN683bb962021-06-11 11:59:31 +0000362
363 # Case 2: Verify for ONU1 (with index [0]) and ONU2 (with index [1]) devices combined
364 ${out_file_0}= Set Variable /tmp/out_tcont2
365 ${dst_0}= Set Variable ${list_onus_ut}[0][dst]
366 Run Iperf3 Test Client in Background ${list_onus_ut}[0][src] server=${dst_0['dp_iface_ip_qinq']}
367 ... args=-t 30 -p 5201 out_file=${out_file_0}
368 ${out_file_1}= Set Variable /tmp/out_tcont3
369 ${dst_1}= Set Variable ${list_onus_ut}[1][dst]
370 Run Iperf3 Test Client in Background ${list_onus_ut}[1][src] server=${dst_1['dp_iface_ip_qinq']}
371 ... args=-t 30 -p 5202 out_file=${out_file_1}
372 # Wait for the above iperf commands to finish (sleep time depends on -t arg value passed in iperf command)
373 Sleep 35s
374 ${out_0}= Read Output File on System ${out_file_0}
375 ${out_1}= Read Output File on Remote System ${list_onus_ut}[1][src] ${out_file_1}
376 ${actual_upstream_bw_used_0}= Evaluate ${out_0['end']['sum_received']['bits_per_second']}/1000
377 ${pct_limit_up_0}= Evaluate 100*${actual_upstream_bw_used_0}/${list_onus_ut}[0][limiting_bw_us]
378 Should Be True ${pct_limit_up_0} >= ${lower_margin_pct}
379 ... The upstream bandwidth guarantee was not met (${pct_limit_up_0}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000380 Should Be True ${pct_limit_up_0} <= ${upper_margin_pct}
381 ... The upstream bandwidth exceeded the limit (${pct_limit_up_0}% of limit)
Emrehan UZUN683bb962021-06-11 11:59:31 +0000382 ${actual_upstream_bw_used_1}= Evaluate ${out_1['end']['sum_received']['bits_per_second']}/1000
383 ${pct_limit_up_1}= Evaluate
384 ... 100*${actual_upstream_bw_used_1}/(${uni_capacity}-${list_onus_ut}[0][limiting_bw_us])
385 Should Be True ${pct_limit_up_1} >= ${lower_margin_pct}
386 ... The upstream bandwidth guarantee was not met (${pct_limit_up_1}% of resv)
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000387 Should Be True ${pct_limit_up_1} <= ${upper_margin_pct}
388 ... The upstream bandwidth exceeded the limit (${pct_limit_up_1}% of limit)
389
390 # Sent original sadis file to onos
391 Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT.json
392
393Verify that best effort BW is released to assured BW requirement as needed and that fixed BW is reserved always on the PON for TT
394 [Documentation] Verify support for Tcont type 4 and 5.
395 ... Pump 1Gbps upstream from the RG for HSI service of ONU2.
396 ... Verify that no more than 1Gbps is received at the BNG.
397 ... Now pump traffic from the RG's for the HSI service both ONU1 and ONU2 at the same time.
398 ... The BNG should receive at least 700Mbps (500 + 200 Mbps) for ONU2.
399 ... The remaining 300Mbps on the PON should be rationed between the two ONUs.
400 ... Now this is largely scheduler implementation dependent, so this is to be observed on the scheduler in the BAL behaves.
401 ... If it equally distributes the remaining BW,
402 ... ONU1 should get 150Mbps and ONU2 in total should get 850Mbps (500+200+150Mbps).
403 [Tags] functionalTT VOL-4097 non-critical
Hardik Windlass98802ce2021-11-12 14:09:26 +0000404 [Setup] Run Keyword Start Logging TcontType4Onu1Type5Onu2
405 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700406 ... AND Stop Logging TcontType4Onu1Type5Onu2
Hardik Windlass98802ce2021-11-12 14:09:26 +0000407 Clear All Devices Then Create New Device
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000408 Run Keyword If ${has_dataplane} Clean Up Linux
409 Send File To Onos ${CURDIR}/../../tests/data/flex-ocp-cord-sadis-TT-multi-tcont-1.json
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000410 Perform Sanity Test TT
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000411
412 # The test expects the first entry in multi_tcont_tests.tcont4tcont5 input will be for service: hsıa and tcont: 4
413 # The test expects the second entry in multi_tcont_tests.tcont4tcont5 input will be for service: hsıa and tcont: 5
414 ${list_onus_ut}= Create List
415 ${list_onus_ut_air_cir}= Create List
416 ${num_multi_tcont_input}= Get Length ${multi_tcont_tests.tcont4tcont5}
417 FOR ${I} IN RANGE 0 ${num_multi_tcont_input}
418 ${onu}= Set Variable ${multi_tcont_tests.tcont4tcont5[${I}]}
419 ${onu_sn}= Set Variable ${onu['onu']}
420 ${service}= Set Variable ${onu['service_type']}
421 ${us_bw}= Set Variable ${onu['us_bw_profile']}
422 ${matched} ${src} ${dst}= Get ONU details with Given Sn and Service ${onu_sn}
423 ... ${service} ${us_bw}
424 Pass Execution If '${matched}' != 'True'
425 ... Skipping test: No ONU found with sn '${onu_sn}', service '${service}' and us_bw '${us_bw}'
426 # Check for iperf3 and jq tools
427 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
428 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
429 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
430 # Get Upstream BW Profile details
431 ${limiting_bw_us}= Get Limiting Bandwidth Details ${us_bw}
432 ${onu_ut} Create Dictionary src ${src} dst ${dst} limiting_bw_us ${limiting_bw_us}
433 Append To List ${list_onus_ut} ${onu_ut}
434 ${limiting_bw_us_air_cir}= Get Limiting Bandwidth Details for Fixed and Committed ${us_bw}
435 ${onu_ut_air_cir} Create Dictionary src ${src} dst ${dst}
436 ... limiting_bw_us_air_cir ${limiting_bw_us_air_cir}
437 Append To List ${list_onus_ut_air_cir} ${onu_ut_air_cir}
438 END
439
440 # Fill the OLT PON Bandwidth with Fixed Bandwidth Profile ONU
441 ${onu_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("serial")
442 ${olt_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("olt")
443 ${us_bw_profile_fill_pon_bw}= Evaluate ${onus_fill_pon_bw}[0].get("us_bw_profile")
444 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_fill_pon_bw}
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000445 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000446 ... Get ONU Port in ONOS ${onu_fill_pon_bw} ${of_id}
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000447 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass9e3db232021-10-14 07:10:47 +0000448 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Emrehan UZUNd6f85892021-07-01 13:54:26 +0000449 ... 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