blob: 8f6e667dd90a553b694a3eacae074ce671472c7a [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
Hardik Windlassa9b38262021-10-27 08:14:22 +000067${INFRA_NAMESPACE} default
Hardik Windlass513afd12021-02-03 15:19:46 +000068
Matteo Scandolo142e6272020-04-29 17:36:59 -070069# Scale pipeline values
Matteo Scandolo50be75c2020-11-12 11:14:12 -080070${stackId} 1
Matteo Scandolo142e6272020-04-29 17:36:59 -070071${olt} 1
72${pon} 1
73${onu} 1
74
Matteo Scandolo142e6272020-04-29 17:36:59 -070075${enableFlowProvisioning} true
76${enableSubscriberProvisioning} true
77
78${workflow} att
Matteo Scandoloeb26a842020-05-08 10:06:24 -070079${withEapol} false
80${withDhcp} false
81${withIgmp} false
Andrea Campanella70cf0a72020-05-27 10:55:15 +020082# as of now the LLDP flow is always installed
83${withLLDP} true
Matteo Scandolo142e6272020-04-29 17:36:59 -070084
85# Per-test logging on failure is turned off by default; set this variable to enable
86${container_log_dir} ${None}
87
Hardik Windlass513afd12021-02-03 15:19:46 +000088${timeout} 10m
89
Matteo Scandolo142e6272020-04-29 17:36:59 -070090*** Test Cases ***
91
92Create and Enable devices
93 [Documentation] Create and enable the OLTs in VOLTHA
Matteo Scandolo830071d2021-07-01 15:17:27 +020094 [Tags] setup
Matteo Scandolo142e6272020-04-29 17:36:59 -070095 ${olt_device_ids}= Create List
96 FOR ${INDEX} IN RANGE 0 ${olt}
Matteo Scandoloeb26a842020-05-08 10:06:24 -070097 ${olt_device_id}= Create Device bbsim${INDEX} 50060 openolt
Matteo Scandolo142e6272020-04-29 17:36:59 -070098 Enable Device ${olt_device_id}
99 Append To List ${olt_device_ids} ${olt_device_id}
100 END
101
102 Set Suite Variable ${olt_device_ids}
103
Matteo Scandolo7d1a80d2021-04-09 14:30:43 -0700104OLTs in ONOS
105 [Documentation] Check that ONOS recognize the correct number of OLTs
106 [Tags] activation plot-onos-olts
Matteo Scandolo520f77e2021-06-01 16:14:47 -0700107 ${onos_devices}= Compute Device IDs
108 FOR ${deviceId} IN @{onos_devices}
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200109 Wait for Olt in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${deviceId}
Matteo Scandolo520f77e2021-06-01 16:14:47 -0700110 END
Matteo Scandolo7d1a80d2021-04-09 14:30:43 -0700111
Matteo Scandolo142e6272020-04-29 17:36:59 -0700112Onu Activation in VOLTHA
113 [Documentation] Check that all ONUs reach the ACTIVE/ENABLED state in VOLTHA
Matteo Scandolo830071d2021-07-01 15:17:27 +0200114 [Tags] activation plot-voltha-onus
Matteo Scandolo142e6272020-04-29 17:36:59 -0700115 Wait For ONUs In VOLTHA ${total_onus}
116
117Port Discovery in ONOS
118 [Documentation] Check that all the UNI ports show up in ONOS
Matteo Scandolo830071d2021-07-01 15:17:27 +0200119 [Tags] activation plot-onos-ports
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800120 ${onos_devices}= Compute Device IDs
121 FOR ${deviceId} IN @{onos_devices}
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200122 Wait for Ports in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus_per_olt} ${deviceId} BBSM
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800123 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700124
125Flows validation in VOLTHA before subscriber provisioning
Matteo Scandoloeb26a842020-05-08 10:06:24 -0700126 [Documentation] Check that all the flows has been stored in the logical device
Matteo Scandolo830071d2021-07-01 15:17:27 +0200127 [Tags] flow-before plot-voltha-flows-before
Matteo Scandolo142e6272020-04-29 17:36:59 -0700128 # NOTE fail the test immediately if we're trying to check flows without provisioning them
129 Should Be Equal ${enableFlowProvisioning} true
130 Wait for Logical Devices flows ${workflow} ${total_onus} ${olt} false
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200131 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700132
Matteo Scandolo616daab2020-05-13 11:49:24 -0700133Flows validation in VOLTHA Adapters before subscriber provisioning
134 [Documentation] Check that all flows has been store in devices of type openolt
Matteo Scandolo830071d2021-07-01 15:17:27 +0200135 [Tags] flow-before plot-voltha-openolt-flows-before only-me
Matteo Scandolo616daab2020-05-13 11:49:24 -0700136 Should Be Equal ${enableFlowProvisioning} true
137 Wait for OpenOLT Devices flows ${workflow} ${total_onus} ${olt} false
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200138 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo616daab2020-05-13 11:49:24 -0700139
Matteo Scandolo142e6272020-04-29 17:36:59 -0700140Flows validation in ONOS before subscriber provisioning
Matteo Scandoloeb26a842020-05-08 10:06:24 -0700141 [Documentation] Check that all the flows has been acknowledged
Matteo Scandolo830071d2021-07-01 15:17:27 +0200142 [Tags] flow-before plot-onos-flows-before
Matteo Scandolo142e6272020-04-29 17:36:59 -0700143 # NOTE fail the test immediately if we're trying to check flows without provisioning them
144 Should Be Equal ${enableFlowProvisioning} true
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800145
146 ${onos_devices}= Compute Device IDs
147 FOR ${deviceId} IN @{onos_devices}
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200148 Wait for all flows to in ADDED state ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800149 ... ${deviceId} ${workflow} ${total_onus_per_olt} 1 false
150 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
151 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700152
153Wait for subscribers to be Authenticated
154 [Documentation] Check that all subscribers have successfully authenticated
Matteo Scandolo830071d2021-07-01 15:17:27 +0200155 [Tags] authentication plot-onos-auth
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800156
157 ${onos_devices}= Compute Device IDs
158 FOR ${deviceId} IN @{onos_devices}
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200159 Wait for AAA Authentication ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus_per_olt} ${deviceId}
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800160 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700161
162Provision subscribers
163 [Documentation] Provision data plane flows for all the subscribers
Matteo Scandolo830071d2021-07-01 15:17:27 +0200164 [Tags] provision
Matteo Scandolo142e6272020-04-29 17:36:59 -0700165 Should Be Equal ${enableSubscriberProvisioning} true
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800166 ${onos_devices}= Compute Device IDs
167 FOR ${olt} IN @{onos_devices}
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200168 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 -0700169 END
170
171Flows validation in VOLTHA after subscriber provisioning
172 [Documentation] Check that all the flows has been stored in the logical device
Matteo Scandolo830071d2021-07-01 15:17:27 +0200173 [Tags] flow-after plot-voltha-flows-after
Matteo Scandolo142e6272020-04-29 17:36:59 -0700174 # NOTE fail the test immediately if we're trying to check flows without provisioning them
175 Should Be Equal ${enableFlowProvisioning} true
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800176
Matteo Scandolo142e6272020-04-29 17:36:59 -0700177 Wait for Logical Devices flows ${workflow} ${total_onus} ${olt} true
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200178 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700179
Matteo Scandolo616daab2020-05-13 11:49:24 -0700180Flows validation in VOLTHA Adapters after subscriber provisioning
181 [Documentation] Check that all flows has been store in devices of type openolt
Matteo Scandolo830071d2021-07-01 15:17:27 +0200182 [Tags] flow-after plot-voltha-openolt-flows-after only-me
Matteo Scandolo616daab2020-05-13 11:49:24 -0700183 Should Be Equal ${enableFlowProvisioning} true
184 Wait for OpenOLT Devices flows ${workflow} ${total_onus} ${olt} true
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200185 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo616daab2020-05-13 11:49:24 -0700186
Matteo Scandolo142e6272020-04-29 17:36:59 -0700187Flows validation in ONOS after subscriber provisioning
188 [Documentation] Check that all the flows has been acknowledged
Matteo Scandolo830071d2021-07-01 15:17:27 +0200189 [Tags] flow-after plot-onos-flows-after
Matteo Scandolo142e6272020-04-29 17:36:59 -0700190 # NOTE fail the test immediately if we're trying to check flows without provisioning them
191 Should Be Equal ${enableFlowProvisioning} true
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800192
193 ${onos_devices}= Compute Device IDs
194 FOR ${deviceId} IN @{onos_devices}
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200195 Wait for all flows to in ADDED state ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800196 ... ${deviceId} ${workflow} ${total_onus_per_olt} 1 true
197 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
198 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700199
200Wait for subscribers to have an IP
201 [Documentation] Check that all subscribers have received a DHCP_ACK
Matteo Scandolo830071d2021-07-01 15:17:27 +0200202 [Tags] dhcp plot-onos-dhcp
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800203 ${onos_devices}= Compute Device IDs
204 FOR ${deviceId} IN @{onos_devices}
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200205 Wait for DHCP Ack ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus_per_olt} ${workflow} ${deviceId}
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800206 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700207
Hardik Windlass513afd12021-02-03 15:19:46 +0000208Perform Igmp Join
209 [Documentation] Performs Igmp Join for all the ONUs of all the OLTs (based on Rest Endpoint)
210 [Tags] non-critical igmp igmp-join
211 FOR ${INDEX} IN RANGE 0 ${olt}
212 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${INDEX}
213 ${bbsim_rel_local_port}= Evaluate ${BBSIM_REST_PORT}+${INDEX}
214 Create Session ${bbsim_rel} http://${BBSIM_REST_IP}:${bbsim_rel_local_port}
215 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
216 ${onu_list}= Get ONUs List ${NAMESPACE} ${bbsim_pod}
217 Perform Igmp Join or Leave Per OLT ${bbsim_rel} ${onu_list} join
218 List Service ${NAMESPACE} ${bbsim_pod}
219 END
220
221Wait for ONUs Join Igmp Group
222 [Documentation] Checks the ONUs Join the IGMP Group
223 ... Note: Currently, it expects all the ONUs on an OLT joined the same group
224 [Tags] non-critical igmp igmp-join igmp-count-verify igmp-join-count-verify
225 ${onos_devices}= Compute Device IDs
226 FOR ${deviceId} IN @{onos_devices}
227 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200228 ... 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 +0000229 END
230
Hardik Windlass513afd12021-02-03 15:19:46 +0000231Perform Igmp Leave
232 [Documentation] Performs Igmp Leave for all the ONUs of all the OLTs (based on Rest Endpoint)
233 [Tags] non-critical igmp igmp-leave
234 FOR ${INDEX} IN RANGE 0 ${olt}
235 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${INDEX}
236 ${bbsim_rel_local_port}= Evaluate ${BBSIM_REST_PORT}+${INDEX}
237 Create Session ${bbsim_rel} http://${BBSIM_REST_IP}:${bbsim_rel_local_port}
238 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
239 ${onu_list}= Get ONUs List ${NAMESPACE} ${bbsim_pod}
240 Perform Igmp Join or Leave Per OLT ${bbsim_rel} ${onu_list} leave
241 List Service ${NAMESPACE} ${bbsim_pod}
242 END
243
244Wait for ONUs Leave Igmp Group
245 [Documentation] Checks the ONUs Leave the IGMP Group
246 ... Note: Currently, it expects all the ONUs on an OLT left the same group
247 [Tags] non-critical igmp igmp-leave igmp-count-verify igmp-leave-count-verify
248 ${onos_devices}= Compute Device IDs
249 FOR ${deviceId} IN @{onos_devices}
250 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Andrea Campanellabbfe55f2021-07-02 10:46:01 +0200251 ... Verify Empty Group in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${deviceId}
Hardik Windlass513afd12021-02-03 15:19:46 +0000252 END
253
Matteo Scandolo142e6272020-04-29 17:36:59 -0700254Disable and Delete devices
255 [Documentation] Disable and delete the OLTs in VOLTHA
256 [Tags] non-critical teardown
257 FOR ${olt_device_id} IN @{olt_device_ids}
258 Disable Device ${olt_device_id}
259 Delete Device ${olt_device_id}
Matteo Scandolo5899be12020-11-11 15:38:07 -0800260 Remove Values From List ${olt_device_ids} ${olt_device_id}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700261 END
262
263 Set Suite Variable ${olt_device_ids}
264
265*** Keywords ***
266Setup Suite
Matteo Scandolo37bca8d2020-07-31 11:28:40 -0700267 [Documentation] Setup test global variables, open an SSH connection to ONOS and starts a timer
Matteo Scandolo142e6272020-04-29 17:36:59 -0700268 Set Suite Variable ${KUBECTL_CONFIG} export KUBECONFIG=%{KUBECONFIG}
Matteo Scandolo5899be12020-11-11 15:38:07 -0800269 Set Suite Variable ${VOLTCTL_CONFIG} %{VOLTCONFIG}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700270
271 ${total_onus}= Evaluate ${olt} * ${pon} * ${onu}
272 Set Suite Variable ${total_onus}
273
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800274 ${total_onus_per_olt}= Evaluate ${pon} * ${onu}
275 Set Suite Variable ${total_onus_per_olt}
276
Hardik Windlass513afd12021-02-03 15:19:46 +0000277 ${onos_auth}= Create List karaf karaf
278 Create Session ONOS http://${ONOS_REST_IP}:${ONOS_REST_PORT} auth=${ONOS_AUTH}
279 Run Keyword If '${workflow}'=='tt'
280 ... Send File To Onos ${CURDIR}/../../tests/data/onos-igmp.json apps/
281
Matteo Scandolo37bca8d2020-07-31 11:28:40 -0700282Teardown Suite
283 [Documentation] Close the SSH connection to ONOS
TorstenThieme4e2168e2021-06-22 14:01:47 +0000284 Close All ONOS SSH Connections
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800285
286Compute device IDs
287 [Documentation] Creates a list of ONOS device ID based on the test configuration
288 # TODO read ${olt} and ${stackid} from parameters
289 ${base}= Set Variable of:00000a0a0a0a0a
290 ${device_ids}= Create List
291 FOR ${olt_id} IN RANGE 0 ${olt}
292 ${decimal_id}= Catenate SEPARATOR= ${stackid} ${olt_id}
293 ${piece}= Convert To Hex ${decimal_id} length=2 lowercase=yes
294 ${id}= Catenate SEPARATOR= ${base} ${piece}
295 Append To List ${device_ids} ${id}
296 END
297
Hardik Windlass513afd12021-02-03 15:19:46 +0000298 [Return] ${device_ids}
299
300Perform Igmp Join or Leave Per OLT
301 [Documentation] Performs Igmp Join for all the ONUs of an OLT (based on Rest Endpoint)
302 [Arguments] ${bbsim_rel_session} ${onu_list} ${task}
303 FOR ${onu} IN @{onu_list}
304 JoinOrLeave Igmp Rest Based ${bbsim_rel_session} ${onu} ${task} 224.0.0.22
305 END
306