blob: e2ef26ed1199c00aad8c44858cb5759c8184dfe6 [file] [log] [blame]
Matteo Scandolo142e6272020-04-29 17:36:59 -07001# Copyright 2017 - 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
15# Tests can be enabled by passing the following tags:
16# - [setup] Creates and enable the OLT devices
17# - [activation] Checks that ONUs are active in VOLTHA and ports discevered in ONOS
18# - [flow-before] Checks that flows are pushed (before subscriber provisioning)
19# - [authentication] Checks that subscribers are correctly authenticated
20# - [provision] Provision the data-plane flows for all the subscribers
21# - [flow-after] Checks that flows are pushed (after subscriber provisioning)
22# - [dhcp] Checks that subscribers have received an IP
23#
24# To run the full test:
25# robot Voltha_Scale_Tests.robot
26#
27# To run only ceratain tests:
28# robot -i activation -i flow-before Voltha_Scale_Tests.robot
29#
30# To exclude only ceratain tests:
31# robot -e -i flow-before Voltha_Scale_Tests.robot
32#
33# Once te test complete you can extrapolate the results by using
34# python extract-times.py
35
36*** Settings ***
37Documentation Collect measurements on VOLTHA performances
38Suite Setup Setup Suite
39#Test Setup Setup
40#Test Teardown Teardown
Matteo Scandolo37bca8d2020-07-31 11:28:40 -070041Suite Teardown Teardown Suite
Matteo Scandolo142e6272020-04-29 17:36:59 -070042Library Collections
43Library String
44Library OperatingSystem
45Library XML
Matteo Scandolo142e6272020-04-29 17:36:59 -070046Library RequestsLibrary
47Library ../../libraries/DependencyLibrary.py
48Resource ../../libraries/onos.robot
49Resource ../../libraries/voltctl.robot
50Resource ../../libraries/voltha.robot
Matteo Scandoloeb26a842020-05-08 10:06:24 -070051Resource ../../libraries/flows.robot
Matteo Scandolo142e6272020-04-29 17:36:59 -070052Resource ../../libraries/k8s.robot
Hardik Windlass513afd12021-02-03 15:19:46 +000053Resource ../../libraries/utils.robot
54Resource ../../libraries/bbsim.robot
Matteo Scandolo142e6272020-04-29 17:36:59 -070055Resource ../../variables/variables.robot
56
57*** Variables ***
58${ONOS_SSH_IP} 127.0.0.1
Matteo Scandoloec73e702021-04-09 11:09:38 -070059${ONOS_SSH_PORT} 30115
Hardik Windlass513afd12021-02-03 15:19:46 +000060${ONOS_REST_IP} 127.0.0.1
Matteo Scandoloec73e702021-04-09 11:09:38 -070061${ONOS_REST_PORT} 30120
Matteo Scandolo142e6272020-04-29 17:36:59 -070062
Hardik Windlass513afd12021-02-03 15:19:46 +000063${BBSIM_REST_IP} 127.0.0.1
64${BBSIM_REST_PORT} 50071
65
66${NAMESPACE} default
67
Matteo Scandolo142e6272020-04-29 17:36:59 -070068# Scale pipeline values
Matteo Scandolo50be75c2020-11-12 11:14:12 -080069${stackId} 1
Matteo Scandolo142e6272020-04-29 17:36:59 -070070${olt} 1
71${pon} 1
72${onu} 1
73
Matteo Scandolo142e6272020-04-29 17:36:59 -070074${enableFlowProvisioning} true
75${enableSubscriberProvisioning} true
76
77${workflow} att
Matteo Scandoloeb26a842020-05-08 10:06:24 -070078${withEapol} false
79${withDhcp} false
80${withIgmp} false
Andrea Campanella70cf0a72020-05-27 10:55:15 +020081# as of now the LLDP flow is always installed
82${withLLDP} true
Matteo Scandolo142e6272020-04-29 17:36:59 -070083
84# Per-test logging on failure is turned off by default; set this variable to enable
85${container_log_dir} ${None}
86
Hardik Windlass513afd12021-02-03 15:19:46 +000087${timeout} 10m
88
Hardik Windlassf8b3ee62022-01-24 16:36:32 +000089# ONU Image to test for Upgrade needs to be passed in the following format:
90${image_version} BBSM_IMG_00002
91${image_url} http://bbsim0:50074/images/software-image.img
92${image_vendor} BBSM
93${image_activate_on_success} false
94${image_commit_on_success} false
95${image_crc} 0
96
Matteo Scandolo142e6272020-04-29 17:36:59 -070097*** Test Cases ***
98
99Create and Enable devices
100 [Documentation] Create and enable the OLTs in VOLTHA
Matteo Scandolo830071d2021-07-01 15:17:27 +0200101 [Tags] setup
Matteo Scandolo142e6272020-04-29 17:36:59 -0700102 ${olt_device_ids}= Create List
103 FOR ${INDEX} IN RANGE 0 ${olt}
Matteo Scandoloeb26a842020-05-08 10:06:24 -0700104 ${olt_device_id}= Create Device bbsim${INDEX} 50060 openolt
Matteo Scandolo142e6272020-04-29 17:36:59 -0700105 Enable Device ${olt_device_id}
106 Append To List ${olt_device_ids} ${olt_device_id}
107 END
108
109 Set Suite Variable ${olt_device_ids}
110
Matteo Scandolo7d1a80d2021-04-09 14:30:43 -0700111OLTs in ONOS
112 [Documentation] Check that ONOS recognize the correct number of OLTs
113 [Tags] activation plot-onos-olts
Matteo Scandolo520f77e2021-06-01 16:14:47 -0700114 ${onos_devices}= Compute Device IDs
115 FOR ${deviceId} IN @{onos_devices}
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200116 Wait for Olt in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${deviceId}
Matteo Scandolo520f77e2021-06-01 16:14:47 -0700117 END
Matteo Scandolo7d1a80d2021-04-09 14:30:43 -0700118
Matteo Scandolo142e6272020-04-29 17:36:59 -0700119Onu Activation in VOLTHA
120 [Documentation] Check that all ONUs reach the ACTIVE/ENABLED state in VOLTHA
Matteo Scandolo830071d2021-07-01 15:17:27 +0200121 [Tags] activation plot-voltha-onus
Andrea Campanella4ec9b832022-02-09 13:21:54 +0100122 Wait For ONUs In VOLTHA ${total_onus} ${timeout}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700123
124Port Discovery in ONOS
125 [Documentation] Check that all the UNI ports show up in ONOS
Matteo Scandolo830071d2021-07-01 15:17:27 +0200126 [Tags] activation plot-onos-ports
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800127 ${onos_devices}= Compute Device IDs
128 FOR ${deviceId} IN @{onos_devices}
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200129 Wait for Ports in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus_per_olt} ${deviceId} BBSM
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800130 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700131
132Flows validation in VOLTHA before subscriber provisioning
Matteo Scandoloeb26a842020-05-08 10:06:24 -0700133 [Documentation] Check that all the flows has been stored in the logical device
Matteo Scandolo830071d2021-07-01 15:17:27 +0200134 [Tags] flow-before plot-voltha-flows-before
Matteo Scandolo142e6272020-04-29 17:36:59 -0700135 # NOTE fail the test immediately if we're trying to check flows without provisioning them
136 Should Be Equal ${enableFlowProvisioning} true
137 Wait for Logical Devices flows ${workflow} ${total_onus} ${olt} false
Andrea Campanella4ec9b832022-02-09 13:21:54 +0100138 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP} ${timeout}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700139
Matteo Scandolo616daab2020-05-13 11:49:24 -0700140Flows validation in VOLTHA Adapters before subscriber provisioning
141 [Documentation] Check that all flows has been store in devices of type openolt
Matteo Scandolo830071d2021-07-01 15:17:27 +0200142 [Tags] flow-before plot-voltha-openolt-flows-before only-me
Matteo Scandolo616daab2020-05-13 11:49:24 -0700143 Should Be Equal ${enableFlowProvisioning} true
144 Wait for OpenOLT Devices flows ${workflow} ${total_onus} ${olt} false
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200145 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo616daab2020-05-13 11:49:24 -0700146
Matteo Scandolo142e6272020-04-29 17:36:59 -0700147Flows validation in ONOS before subscriber provisioning
Matteo Scandoloeb26a842020-05-08 10:06:24 -0700148 [Documentation] Check that all the flows has been acknowledged
Matteo Scandolo830071d2021-07-01 15:17:27 +0200149 [Tags] flow-before plot-onos-flows-before
Matteo Scandolo142e6272020-04-29 17:36:59 -0700150 # NOTE fail the test immediately if we're trying to check flows without provisioning them
151 Should Be Equal ${enableFlowProvisioning} true
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800152
153 ${onos_devices}= Compute Device IDs
154 FOR ${deviceId} IN @{onos_devices}
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200155 Wait for all flows to in ADDED state ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800156 ... ${deviceId} ${workflow} ${total_onus_per_olt} 1 false
157 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
158 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700159
160Wait for subscribers to be Authenticated
161 [Documentation] Check that all subscribers have successfully authenticated
Matteo Scandolo830071d2021-07-01 15:17:27 +0200162 [Tags] authentication plot-onos-auth
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800163
164 ${onos_devices}= Compute Device IDs
165 FOR ${deviceId} IN @{onos_devices}
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200166 Wait for AAA Authentication ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus_per_olt} ${deviceId}
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800167 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700168
Hardik Windlassf8b3ee62022-01-24 16:36:32 +0000169Image Download and Validation during ONUs Software Upgrade
170 [Documentation] Validates the Download Image step in ONU Upgrade process
171 ... Requirement: Pass image details in following parameters in the robot command
172 ... onu_image_name, onu_image_url, onu_image_version, onu_image_crc, onu_image_local_dir
173 ... Note: Expects the image url and other parameters to be common for all ONUs on all BBSim
174 [Tags] onu-upgrade onu-upgrade-image-download
Hardik Windlassca8ce7c2022-02-01 09:01:23 +0000175 @{list_onu_device_id}= Create List
176 ${list_onu_device_id}= Get ONUs Device IDs from Voltha
177 ${onu_device_id_str}= Catenate @{list_onu_device_id}
178 Download ONU Device Image ${image_version} ${image_url} ${image_vendor}
179 ... ${image_activate_on_success} ${image_commit_on_success}
180 ... ${image_crc} ${onu_device_id_str}
Hardik Windlassf8b3ee62022-01-24 16:36:32 +0000181 ${imageState}= Run Keyword If '${image_activate_on_success}'=='true' and '${image_commit_on_success}'=='false'
182 ... Set Variable IMAGE_ACTIVE
183 ... ELSE IF '${image_activate_on_success}'=='true' and '${image_commit_on_success}'=='true'
184 ... Set Variable IMAGE_COMMITTED
185 ... ELSE Set Variable IMAGE_INACTIVE
186 ${activated}= Set Variable If '${image_activate_on_success}'=='true' True False
187 ${committed}= Set Variable If '${image_activate_on_success}'=='true' and '${image_commit_on_success}'=='true'
188 ... True False
Hardik Windlass6fd3cae2022-03-03 08:35:33 +0000189 Wait for ONUs Image Status in VOLTHA ${total_onus} ${image_version} DOWNLOAD_SUCCEEDED NO_ERROR ${imageState}
190 ... ${timeout}
Hardik Windlassca8ce7c2022-02-01 09:01:23 +0000191 FOR ${onu_device_id} IN @{list_onu_device_id}
192 Wait Until Keyword Succeeds ${timeout} 10s Verify ONU Device Image List ${onu_device_id}
Hardik Windlassf8b3ee62022-01-24 16:36:32 +0000193 ... ${image_version} ${committed} ${activated} True
194 END
195
196Image Activation and Validation during ONUs Software Upgrade
197 [Documentation] Validates the Activate Image step in ONU Upgrade process
198 ... Requirement: Pass image details in following parameters in the robot command
199 ... onu_image_name, onu_image_url, onu_image_version, onu_image_crc, onu_image_local_dir
200 ... Note: Expects the image url and other parameters to be common for all ONUs on all BBSim
201 [Tags] onu-upgrade onu-upgrade-image-activate
202 Pass Execution If '${image_activate_on_success}'=='true' Skipping test: Image activated in download stage
Hardik Windlassca8ce7c2022-02-01 09:01:23 +0000203 @{list_onu_device_id}= Create List
204 ${list_onu_device_id}= Get ONUs Device IDs from Voltha
205 ${onu_device_id_str}= Catenate @{list_onu_device_id}
206 Activate ONU Device Image ${image_version} ${image_commit_on_success} ${onu_device_id_str}
Hardik Windlassf8b3ee62022-01-24 16:36:32 +0000207 ${imageState}= Set Variable If '${image_commit_on_success}'=='true' IMAGE_COMMITTED IMAGE_ACTIVE
208 ${committed}= Set Variable If '${image_commit_on_success}'=='true' True False
Hardik Windlass6fd3cae2022-03-03 08:35:33 +0000209 Wait for ONUs Image Status in VOLTHA ${total_onus} ${image_version} DOWNLOAD_SUCCEEDED NO_ERROR ${imageState}
210 ... ${timeout}
Hardik Windlassca8ce7c2022-02-01 09:01:23 +0000211 FOR ${onu_device_id} IN @{list_onu_device_id}
212 Wait Until Keyword Succeeds ${timeout} 10s Verify ONU Device Image List ${onu_device_id}
Hardik Windlassf8b3ee62022-01-24 16:36:32 +0000213 ... ${image_version} ${committed} True True
214 END
215
216Image Commit and Validation during ONUs Software Upgrade
217 [Documentation] Validates the Commit Image step in ONU Upgrade process
218 ... Requirement: Pass image details in following parameters in the robot command
219 ... onu_image_name, onu_image_url, onu_image_version, onu_image_crc, onu_image_local_dir
220 ... Note: Expects the image url and other parameters to be common for all ONUs on all BBSim
221 [Tags] onu-upgrade onu-upgrade-image-commit
222 Pass Execution If '${image_commit_on_success}'=='true' Skipping test: Image committed in download or activate stage
Hardik Windlassca8ce7c2022-02-01 09:01:23 +0000223 @{list_onu_device_id}= Create List
224 ${list_onu_device_id}= Get ONUs Device IDs from Voltha
225 ${onu_device_id_str}= Catenate @{list_onu_device_id}
226 Commit ONU Device Image ${image_version} ${onu_device_id_str}
Hardik Windlass6fd3cae2022-03-03 08:35:33 +0000227 Wait for ONUs Image Status in VOLTHA ${total_onus} ${image_version} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED
228 ... ${timeout}
Hardik Windlassca8ce7c2022-02-01 09:01:23 +0000229 FOR ${onu_device_id} IN @{list_onu_device_id}
230 Wait Until Keyword Succeeds ${timeout} 10s Verify ONU Device Image List ${onu_device_id}
Hardik Windlassf8b3ee62022-01-24 16:36:32 +0000231 ... ${image_version} True True True
232 END
233
Matteo Scandolo142e6272020-04-29 17:36:59 -0700234Provision subscribers
235 [Documentation] Provision data plane flows for all the subscribers
Matteo Scandolo830071d2021-07-01 15:17:27 +0200236 [Tags] provision
Matteo Scandolo142e6272020-04-29 17:36:59 -0700237 Should Be Equal ${enableSubscriberProvisioning} true
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800238 ${onos_devices}= Compute Device IDs
239 FOR ${olt} IN @{onos_devices}
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200240 Provision all subscribers on device ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${ONOS_SSH_IP} ${ONOS_REST_PORT} ${olt}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700241 END
242
243Flows validation in VOLTHA after subscriber provisioning
244 [Documentation] Check that all the flows has been stored in the logical device
Matteo Scandolo830071d2021-07-01 15:17:27 +0200245 [Tags] flow-after plot-voltha-flows-after
Matteo Scandolo142e6272020-04-29 17:36:59 -0700246 # NOTE fail the test immediately if we're trying to check flows without provisioning them
247 Should Be Equal ${enableFlowProvisioning} true
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800248
Matteo Scandolo142e6272020-04-29 17:36:59 -0700249 Wait for Logical Devices flows ${workflow} ${total_onus} ${olt} true
Andrea Campanella4ec9b832022-02-09 13:21:54 +0100250 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP} ${timeout}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700251
Matteo Scandolo616daab2020-05-13 11:49:24 -0700252Flows validation in VOLTHA Adapters after subscriber provisioning
253 [Documentation] Check that all flows has been store in devices of type openolt
Matteo Scandolo830071d2021-07-01 15:17:27 +0200254 [Tags] flow-after plot-voltha-openolt-flows-after only-me
Matteo Scandolo616daab2020-05-13 11:49:24 -0700255 Should Be Equal ${enableFlowProvisioning} true
256 Wait for OpenOLT Devices flows ${workflow} ${total_onus} ${olt} true
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200257 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo616daab2020-05-13 11:49:24 -0700258
Matteo Scandolo142e6272020-04-29 17:36:59 -0700259Flows validation in ONOS after subscriber provisioning
260 [Documentation] Check that all the flows has been acknowledged
Matteo Scandolo830071d2021-07-01 15:17:27 +0200261 [Tags] flow-after plot-onos-flows-after
Matteo Scandolo142e6272020-04-29 17:36:59 -0700262 # NOTE fail the test immediately if we're trying to check flows without provisioning them
263 Should Be Equal ${enableFlowProvisioning} true
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800264
265 ${onos_devices}= Compute Device IDs
266 FOR ${deviceId} IN @{onos_devices}
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200267 Wait for all flows to in ADDED state ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800268 ... ${deviceId} ${workflow} ${total_onus_per_olt} 1 true
269 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
270 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700271
272Wait for subscribers to have an IP
273 [Documentation] Check that all subscribers have received a DHCP_ACK
Matteo Scandolo830071d2021-07-01 15:17:27 +0200274 [Tags] dhcp plot-onos-dhcp
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800275 ${onos_devices}= Compute Device IDs
276 FOR ${deviceId} IN @{onos_devices}
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200277 Wait for DHCP Ack ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus_per_olt} ${workflow} ${deviceId}
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800278 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700279
Hardik Windlass513afd12021-02-03 15:19:46 +0000280Perform Igmp Join
281 [Documentation] Performs Igmp Join for all the ONUs of all the OLTs (based on Rest Endpoint)
282 [Tags] non-critical igmp igmp-join
283 FOR ${INDEX} IN RANGE 0 ${olt}
284 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${INDEX}
285 ${bbsim_rel_local_port}= Evaluate ${BBSIM_REST_PORT}+${INDEX}
286 Create Session ${bbsim_rel} http://${BBSIM_REST_IP}:${bbsim_rel_local_port}
287 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
288 ${onu_list}= Get ONUs List ${NAMESPACE} ${bbsim_pod}
289 Perform Igmp Join or Leave Per OLT ${bbsim_rel} ${onu_list} join
290 List Service ${NAMESPACE} ${bbsim_pod}
291 END
292
293Wait for ONUs Join Igmp Group
294 [Documentation] Checks the ONUs Join the IGMP Group
295 ... Note: Currently, it expects all the ONUs on an OLT joined the same group
296 [Tags] non-critical igmp igmp-join igmp-count-verify igmp-join-count-verify
297 ${onos_devices}= Compute Device IDs
298 FOR ${deviceId} IN @{onos_devices}
299 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200300 ... Verify ONUs in Group Count in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus_per_olt} ${deviceId}
Hardik Windlass513afd12021-02-03 15:19:46 +0000301 END
302
Hardik Windlass513afd12021-02-03 15:19:46 +0000303Perform Igmp Leave
304 [Documentation] Performs Igmp Leave for all the ONUs of all the OLTs (based on Rest Endpoint)
305 [Tags] non-critical igmp igmp-leave
306 FOR ${INDEX} IN RANGE 0 ${olt}
307 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${INDEX}
308 ${bbsim_rel_local_port}= Evaluate ${BBSIM_REST_PORT}+${INDEX}
309 Create Session ${bbsim_rel} http://${BBSIM_REST_IP}:${bbsim_rel_local_port}
310 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
311 ${onu_list}= Get ONUs List ${NAMESPACE} ${bbsim_pod}
312 Perform Igmp Join or Leave Per OLT ${bbsim_rel} ${onu_list} leave
313 List Service ${NAMESPACE} ${bbsim_pod}
314 END
315
316Wait for ONUs Leave Igmp Group
317 [Documentation] Checks the ONUs Leave the IGMP Group
318 ... Note: Currently, it expects all the ONUs on an OLT left the same group
319 [Tags] non-critical igmp igmp-leave igmp-count-verify igmp-leave-count-verify
320 ${onos_devices}= Compute Device IDs
321 FOR ${deviceId} IN @{onos_devices}
322 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200323 ... Verify Empty Group in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${deviceId}
Hardik Windlass513afd12021-02-03 15:19:46 +0000324 END
325
Matteo Scandolo142e6272020-04-29 17:36:59 -0700326Disable and Delete devices
327 [Documentation] Disable and delete the OLTs in VOLTHA
328 [Tags] non-critical teardown
Matteo Scandolof078ba72021-12-15 15:31:47 -0800329
Andrea Campanella029b3832022-01-11 13:43:30 +0100330 ${rc} ${output}= Run And Return Rc And Output voltctl -c ${VOLTCTL_CONFIG} device list -m 32MB -f Type=openolt -q
Matteo Scandolof078ba72021-12-15 15:31:47 -0800331 Should Be Equal As Integers ${rc} 0 Failed to get device list from voltctl: ${output}
332 Log ${output}
333 ${devices}= Split To Lines ${output}
334 Log ${devices}
335
336 FOR ${id} IN @{devices}
337 Disable Device ${id}
338 Delete Device ${id}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700339 END
340
Matteo Scandolo75911092021-11-16 17:05:36 -0800341 ${onos_devices}= Compute Device IDs
342 FOR ${deviceId} IN @{onos_devices}
343 Wait for all flows to be removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${deviceId}
344 END
345
Matteo Scandolo142e6272020-04-29 17:36:59 -0700346*** Keywords ***
347Setup Suite
Matteo Scandolo37bca8d2020-07-31 11:28:40 -0700348 [Documentation] Setup test global variables, open an SSH connection to ONOS and starts a timer
Matteo Scandolo142e6272020-04-29 17:36:59 -0700349 Set Suite Variable ${KUBECTL_CONFIG} export KUBECONFIG=%{KUBECONFIG}
Matteo Scandolo5899be12020-11-11 15:38:07 -0800350 Set Suite Variable ${VOLTCTL_CONFIG} %{VOLTCONFIG}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700351
352 ${total_onus}= Evaluate ${olt} * ${pon} * ${onu}
353 Set Suite Variable ${total_onus}
354
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800355 ${total_onus_per_olt}= Evaluate ${pon} * ${onu}
356 Set Suite Variable ${total_onus_per_olt}
357
Hardik Windlass513afd12021-02-03 15:19:46 +0000358 ${onos_auth}= Create List karaf karaf
359 Create Session ONOS http://${ONOS_REST_IP}:${ONOS_REST_PORT} auth=${ONOS_AUTH}
360 Run Keyword If '${workflow}'=='tt'
361 ... Send File To Onos ${CURDIR}/../../tests/data/onos-igmp.json apps/
362
Matteo Scandolo37bca8d2020-07-31 11:28:40 -0700363Teardown Suite
364 [Documentation] Close the SSH connection to ONOS
TorstenThieme4e2168e2021-06-22 14:01:47 +0000365 Close All ONOS SSH Connections
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800366
367Compute device IDs
368 [Documentation] Creates a list of ONOS device ID based on the test configuration
369 # TODO read ${olt} and ${stackid} from parameters
370 ${base}= Set Variable of:00000a0a0a0a0a
371 ${device_ids}= Create List
372 FOR ${olt_id} IN RANGE 0 ${olt}
373 ${decimal_id}= Catenate SEPARATOR= ${stackid} ${olt_id}
374 ${piece}= Convert To Hex ${decimal_id} length=2 lowercase=yes
375 ${id}= Catenate SEPARATOR= ${base} ${piece}
376 Append To List ${device_ids} ${id}
377 END
378
Hardik Windlass513afd12021-02-03 15:19:46 +0000379 [Return] ${device_ids}
380
381Perform Igmp Join or Leave Per OLT
382 [Documentation] Performs Igmp Join for all the ONUs of an OLT (based on Rest Endpoint)
383 [Arguments] ${bbsim_rel_session} ${onu_list} ${task}
384 FOR ${onu} IN @{onu_list}
385 JoinOrLeave Igmp Rest Based ${bbsim_rel_session} ${onu} ${task} 224.0.0.22
386 END