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