blob: 3537b366a411f29ece35f05564626fe1056ec86d [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
Matteo Scandolo142e6272020-04-29 17:36:59 -070089*** Test Cases ***
90
91Create and Enable devices
92 [Documentation] Create and enable the OLTs in VOLTHA
Andrea Campanella70cf0a72020-05-27 10:55:15 +020093 [Tags] non-critical setup
Matteo Scandolo142e6272020-04-29 17:36:59 -070094 ${olt_device_ids}= Create List
95 FOR ${INDEX} IN RANGE 0 ${olt}
Matteo Scandoloeb26a842020-05-08 10:06:24 -070096 ${olt_device_id}= Create Device bbsim${INDEX} 50060 openolt
Matteo Scandolo142e6272020-04-29 17:36:59 -070097 Enable Device ${olt_device_id}
98 Append To List ${olt_device_ids} ${olt_device_id}
99 END
100
101 Set Suite Variable ${olt_device_ids}
102
Matteo Scandolo7d1a80d2021-04-09 14:30:43 -0700103OLTs in ONOS
104 [Documentation] Check that ONOS recognize the correct number of OLTs
105 [Tags] activation plot-onos-olts
106 Wait for Olts in ONOS ${onos_ssh_connection} ${olt}
107
Matteo Scandolo142e6272020-04-29 17:36:59 -0700108Onu Activation in VOLTHA
109 [Documentation] Check that all ONUs reach the ACTIVE/ENABLED state in VOLTHA
110 [Tags] non-critical activation plot-voltha-onus
111 Wait For ONUs In VOLTHA ${total_onus}
112
113Port Discovery in ONOS
114 [Documentation] Check that all the UNI ports show up in ONOS
115 [Tags] non-critical activation plot-onos-ports
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800116 ${onos_devices}= Compute Device IDs
117 FOR ${deviceId} IN @{onos_devices}
118 Wait for Ports in ONOS ${onos_ssh_connection} ${total_onus_per_olt} ${deviceId} BBSM
119 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700120
121Flows validation in VOLTHA before subscriber provisioning
Matteo Scandoloeb26a842020-05-08 10:06:24 -0700122 [Documentation] Check that all the flows has been stored in the logical device
Matteo Scandolo142e6272020-04-29 17:36:59 -0700123 [Tags] non-critical flow-before plot-voltha-flows-before
124 # NOTE fail the test immediately if we're trying to check flows without provisioning them
125 Should Be Equal ${enableFlowProvisioning} true
126 Wait for Logical Devices flows ${workflow} ${total_onus} ${olt} false
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200127 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700128
Matteo Scandolo616daab2020-05-13 11:49:24 -0700129Flows validation in VOLTHA Adapters before subscriber provisioning
130 [Documentation] Check that all flows has been store in devices of type openolt
Matteo Scandolo96dbe432020-05-28 10:51:57 -0700131 [Tags] non-critical flow-before plot-voltha-openolt-flows-before only-me
Matteo Scandolo616daab2020-05-13 11:49:24 -0700132 Should Be Equal ${enableFlowProvisioning} true
133 Wait for OpenOLT Devices flows ${workflow} ${total_onus} ${olt} false
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200134 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo616daab2020-05-13 11:49:24 -0700135
Matteo Scandolo142e6272020-04-29 17:36:59 -0700136Flows validation in ONOS before subscriber provisioning
Matteo Scandoloeb26a842020-05-08 10:06:24 -0700137 [Documentation] Check that all the flows has been acknowledged
Matteo Scandolo142e6272020-04-29 17:36:59 -0700138 [Tags] non-critical flow-before plot-onos-flows-before
139 # NOTE fail the test immediately if we're trying to check flows without provisioning them
140 Should Be Equal ${enableFlowProvisioning} true
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800141
142 ${onos_devices}= Compute Device IDs
143 FOR ${deviceId} IN @{onos_devices}
144 Wait for all flows to in ADDED state ${onos_ssh_connection}
145 ... ${deviceId} ${workflow} ${total_onus_per_olt} 1 false
146 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
147 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700148
149Wait for subscribers to be Authenticated
150 [Documentation] Check that all subscribers have successfully authenticated
151 [Tags] non-critical authentication plot-onos-auth
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800152
153 ${onos_devices}= Compute Device IDs
154 FOR ${deviceId} IN @{onos_devices}
155 Wait for AAA Authentication ${onos_ssh_connection} ${total_onus_per_olt} ${deviceId}
156 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700157
158Provision subscribers
159 [Documentation] Provision data plane flows for all the subscribers
160 [Tags] non-critical provision
161 Should Be Equal ${enableSubscriberProvisioning} true
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800162 ${onos_devices}= Compute Device IDs
163 FOR ${olt} IN @{onos_devices}
Matteo Scandolo37bca8d2020-07-31 11:28:40 -0700164 Provision all subscribers on device ${onos_ssh_connection} ${ONOS_SSH_IP} ${ONOS_REST_PORT} ${olt}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700165 END
166
167Flows validation in VOLTHA after subscriber provisioning
168 [Documentation] Check that all the flows has been stored in the logical device
169 [Tags] non-critical flow-after plot-voltha-flows-after
170 # NOTE fail the test immediately if we're trying to check flows without provisioning them
171 Should Be Equal ${enableFlowProvisioning} true
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800172
Matteo Scandolo142e6272020-04-29 17:36:59 -0700173 Wait for Logical Devices flows ${workflow} ${total_onus} ${olt} true
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200174 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700175
Matteo Scandolo616daab2020-05-13 11:49:24 -0700176Flows validation in VOLTHA Adapters after subscriber provisioning
177 [Documentation] Check that all flows has been store in devices of type openolt
Matteo Scandolo96dbe432020-05-28 10:51:57 -0700178 [Tags] non-critical flow-after plot-voltha-openolt-flows-after only-me
Matteo Scandolo616daab2020-05-13 11:49:24 -0700179 Should Be Equal ${enableFlowProvisioning} true
180 Wait for OpenOLT Devices flows ${workflow} ${total_onus} ${olt} true
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200181 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo616daab2020-05-13 11:49:24 -0700182
Matteo Scandolo142e6272020-04-29 17:36:59 -0700183Flows validation in ONOS after subscriber provisioning
184 [Documentation] Check that all the flows has been acknowledged
185 [Tags] non-critical flow-after plot-onos-flows-after
186 # NOTE fail the test immediately if we're trying to check flows without provisioning them
187 Should Be Equal ${enableFlowProvisioning} true
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800188
189 ${onos_devices}= Compute Device IDs
190 FOR ${deviceId} IN @{onos_devices}
191 Wait for all flows to in ADDED state ${onos_ssh_connection}
192 ... ${deviceId} ${workflow} ${total_onus_per_olt} 1 true
193 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
194 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700195
196Wait for subscribers to have an IP
197 [Documentation] Check that all subscribers have received a DHCP_ACK
198 [Tags] non-critical dhcp plot-onos-dhcp
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800199 ${onos_devices}= Compute Device IDs
200 FOR ${deviceId} IN @{onos_devices}
201 Wait for DHCP Ack ${onos_ssh_connection} ${total_onus_per_olt} ${workflow} ${deviceId}
202 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700203
Hardik Windlass513afd12021-02-03 15:19:46 +0000204Perform Igmp Join
205 [Documentation] Performs Igmp Join for all the ONUs of all the OLTs (based on Rest Endpoint)
206 [Tags] non-critical igmp igmp-join
207 FOR ${INDEX} IN RANGE 0 ${olt}
208 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${INDEX}
209 ${bbsim_rel_local_port}= Evaluate ${BBSIM_REST_PORT}+${INDEX}
210 Create Session ${bbsim_rel} http://${BBSIM_REST_IP}:${bbsim_rel_local_port}
211 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
212 ${onu_list}= Get ONUs List ${NAMESPACE} ${bbsim_pod}
213 Perform Igmp Join or Leave Per OLT ${bbsim_rel} ${onu_list} join
214 List Service ${NAMESPACE} ${bbsim_pod}
215 END
216
217Wait for ONUs Join Igmp Group
218 [Documentation] Checks the ONUs Join the IGMP Group
219 ... Note: Currently, it expects all the ONUs on an OLT joined the same group
220 [Tags] non-critical igmp igmp-join igmp-count-verify igmp-join-count-verify
221 ${onos_devices}= Compute Device IDs
222 FOR ${deviceId} IN @{onos_devices}
223 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
224 ... Verify ONUs in Group Count in ONOS ${onos_ssh_connection} ${total_onus_per_olt} ${deviceId}
225 END
226
Hardik Windlass513afd12021-02-03 15:19:46 +0000227Perform Igmp Leave
228 [Documentation] Performs Igmp Leave for all the ONUs of all the OLTs (based on Rest Endpoint)
229 [Tags] non-critical igmp igmp-leave
230 FOR ${INDEX} IN RANGE 0 ${olt}
231 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${INDEX}
232 ${bbsim_rel_local_port}= Evaluate ${BBSIM_REST_PORT}+${INDEX}
233 Create Session ${bbsim_rel} http://${BBSIM_REST_IP}:${bbsim_rel_local_port}
234 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
235 ${onu_list}= Get ONUs List ${NAMESPACE} ${bbsim_pod}
236 Perform Igmp Join or Leave Per OLT ${bbsim_rel} ${onu_list} leave
237 List Service ${NAMESPACE} ${bbsim_pod}
238 END
239
240Wait for ONUs Leave Igmp Group
241 [Documentation] Checks the ONUs Leave the IGMP Group
242 ... Note: Currently, it expects all the ONUs on an OLT left the same group
243 [Tags] non-critical igmp igmp-leave igmp-count-verify igmp-leave-count-verify
244 ${onos_devices}= Compute Device IDs
245 FOR ${deviceId} IN @{onos_devices}
246 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
247 ... Verify Empty Group in ONOS ${onos_ssh_connection} ${deviceId}
248 END
249
Matteo Scandolo142e6272020-04-29 17:36:59 -0700250Disable and Delete devices
251 [Documentation] Disable and delete the OLTs in VOLTHA
252 [Tags] non-critical teardown
253 FOR ${olt_device_id} IN @{olt_device_ids}
254 Disable Device ${olt_device_id}
255 Delete Device ${olt_device_id}
Matteo Scandolo5899be12020-11-11 15:38:07 -0800256 Remove Values From List ${olt_device_ids} ${olt_device_id}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700257 END
258
259 Set Suite Variable ${olt_device_ids}
260
261*** Keywords ***
262Setup Suite
Matteo Scandolo37bca8d2020-07-31 11:28:40 -0700263 [Documentation] Setup test global variables, open an SSH connection to ONOS and starts a timer
Matteo Scandolo142e6272020-04-29 17:36:59 -0700264 Set Suite Variable ${KUBECTL_CONFIG} export KUBECONFIG=%{KUBECONFIG}
Matteo Scandolo5899be12020-11-11 15:38:07 -0800265 Set Suite Variable ${VOLTCTL_CONFIG} %{VOLTCONFIG}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700266
267 ${total_onus}= Evaluate ${olt} * ${pon} * ${onu}
268 Set Suite Variable ${total_onus}
269
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800270 ${total_onus_per_olt}= Evaluate ${pon} * ${onu}
271 Set Suite Variable ${total_onus_per_olt}
272
Hardik Windlass513afd12021-02-03 15:19:46 +0000273 ${onos_auth}= Create List karaf karaf
274 Create Session ONOS http://${ONOS_REST_IP}:${ONOS_REST_PORT} auth=${ONOS_AUTH}
275 Run Keyword If '${workflow}'=='tt'
276 ... Send File To Onos ${CURDIR}/../../tests/data/onos-igmp.json apps/
277
Matteo Scandolo37bca8d2020-07-31 11:28:40 -0700278 ${onos_ssh_connection} Open ONOS SSH Connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
279 Set Suite Variable ${onos_ssh_connection}
280
281Teardown Suite
282 [Documentation] Close the SSH connection to ONOS
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800283 Close ONOS SSH Connection ${onos_ssh_connection}
284
285Compute device IDs
286 [Documentation] Creates a list of ONOS device ID based on the test configuration
287 # TODO read ${olt} and ${stackid} from parameters
288 ${base}= Set Variable of:00000a0a0a0a0a
289 ${device_ids}= Create List
290 FOR ${olt_id} IN RANGE 0 ${olt}
291 ${decimal_id}= Catenate SEPARATOR= ${stackid} ${olt_id}
292 ${piece}= Convert To Hex ${decimal_id} length=2 lowercase=yes
293 ${id}= Catenate SEPARATOR= ${base} ${piece}
294 Append To List ${device_ids} ${id}
295 END
296
Hardik Windlass513afd12021-02-03 15:19:46 +0000297 [Return] ${device_ids}
298
299Perform Igmp Join or Leave Per OLT
300 [Documentation] Performs Igmp Join for all the ONUs of an OLT (based on Rest Endpoint)
301 [Arguments] ${bbsim_rel_session} ${onu_list} ${task}
302 FOR ${onu} IN @{onu_list}
303 JoinOrLeave Igmp Rest Based ${bbsim_rel_session} ${onu} ${task} 224.0.0.22
304 END
305