blob: 333f4a0384a6476cd549c7a5e3bdd1d26e298cc9 [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
53Resource ../../variables/variables.robot
54
55*** Variables ***
56${ONOS_SSH_IP} 127.0.0.1
57${ONOS_SSH_PORT} 8101
Matteo Scandolo96dbe432020-05-28 10:51:57 -070058${ONOS_REST_PORT} 8181
Matteo Scandolo142e6272020-04-29 17:36:59 -070059
60# Scale pipeline values
Matteo Scandolo50be75c2020-11-12 11:14:12 -080061${stackId} 1
Matteo Scandolo142e6272020-04-29 17:36:59 -070062${olt} 1
63${pon} 1
64${onu} 1
65
Matteo Scandolo142e6272020-04-29 17:36:59 -070066${enableFlowProvisioning} true
67${enableSubscriberProvisioning} true
68
69${workflow} att
Matteo Scandoloeb26a842020-05-08 10:06:24 -070070${withEapol} false
71${withDhcp} false
72${withIgmp} false
Andrea Campanella70cf0a72020-05-27 10:55:15 +020073# as of now the LLDP flow is always installed
74${withLLDP} true
Matteo Scandolo142e6272020-04-29 17:36:59 -070075
76# Per-test logging on failure is turned off by default; set this variable to enable
77${container_log_dir} ${None}
78
79*** Test Cases ***
80
81Create and Enable devices
82 [Documentation] Create and enable the OLTs in VOLTHA
Andrea Campanella70cf0a72020-05-27 10:55:15 +020083 [Tags] non-critical setup
Matteo Scandolo142e6272020-04-29 17:36:59 -070084 ${olt_device_ids}= Create List
85 FOR ${INDEX} IN RANGE 0 ${olt}
Matteo Scandoloeb26a842020-05-08 10:06:24 -070086 ${olt_device_id}= Create Device bbsim${INDEX} 50060 openolt
Matteo Scandolo142e6272020-04-29 17:36:59 -070087 Enable Device ${olt_device_id}
88 Append To List ${olt_device_ids} ${olt_device_id}
89 END
90
91 Set Suite Variable ${olt_device_ids}
92
93Onu Activation in VOLTHA
94 [Documentation] Check that all ONUs reach the ACTIVE/ENABLED state in VOLTHA
95 [Tags] non-critical activation plot-voltha-onus
96 Wait For ONUs In VOLTHA ${total_onus}
97
98Port Discovery in ONOS
99 [Documentation] Check that all the UNI ports show up in ONOS
100 [Tags] non-critical activation plot-onos-ports
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800101 ${onos_devices}= Compute Device IDs
102 FOR ${deviceId} IN @{onos_devices}
103 Wait for Ports in ONOS ${onos_ssh_connection} ${total_onus_per_olt} ${deviceId} BBSM
104 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700105
106Flows validation in VOLTHA before subscriber provisioning
Matteo Scandoloeb26a842020-05-08 10:06:24 -0700107 [Documentation] Check that all the flows has been stored in the logical device
Matteo Scandolo142e6272020-04-29 17:36:59 -0700108 [Tags] non-critical flow-before plot-voltha-flows-before
109 # NOTE fail the test immediately if we're trying to check flows without provisioning them
110 Should Be Equal ${enableFlowProvisioning} true
111 Wait for Logical Devices flows ${workflow} ${total_onus} ${olt} false
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200112 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700113
Matteo Scandolo616daab2020-05-13 11:49:24 -0700114Flows validation in VOLTHA Adapters before subscriber provisioning
115 [Documentation] Check that all flows has been store in devices of type openolt
Matteo Scandolo96dbe432020-05-28 10:51:57 -0700116 [Tags] non-critical flow-before plot-voltha-openolt-flows-before only-me
Matteo Scandolo616daab2020-05-13 11:49:24 -0700117 Should Be Equal ${enableFlowProvisioning} true
118 Wait for OpenOLT Devices flows ${workflow} ${total_onus} ${olt} false
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200119 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo616daab2020-05-13 11:49:24 -0700120
Matteo Scandolo142e6272020-04-29 17:36:59 -0700121Flows validation in ONOS before subscriber provisioning
Matteo Scandoloeb26a842020-05-08 10:06:24 -0700122 [Documentation] Check that all the flows has been acknowledged
Matteo Scandolo142e6272020-04-29 17:36:59 -0700123 [Tags] non-critical flow-before plot-onos-flows-before
124 # NOTE fail the test immediately if we're trying to check flows without provisioning them
125 Should Be Equal ${enableFlowProvisioning} true
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800126
127 ${onos_devices}= Compute Device IDs
128 FOR ${deviceId} IN @{onos_devices}
129 Wait for all flows to in ADDED state ${onos_ssh_connection}
130 ... ${deviceId} ${workflow} ${total_onus_per_olt} 1 false
131 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
132 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700133
134Wait for subscribers to be Authenticated
135 [Documentation] Check that all subscribers have successfully authenticated
136 [Tags] non-critical authentication plot-onos-auth
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800137
138 ${onos_devices}= Compute Device IDs
139 FOR ${deviceId} IN @{onos_devices}
140 Wait for AAA Authentication ${onos_ssh_connection} ${total_onus_per_olt} ${deviceId}
141 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700142
143Provision subscribers
144 [Documentation] Provision data plane flows for all the subscribers
145 [Tags] non-critical provision
146 Should Be Equal ${enableSubscriberProvisioning} true
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800147 ${onos_devices}= Compute Device IDs
148 FOR ${olt} IN @{onos_devices}
Matteo Scandolo37bca8d2020-07-31 11:28:40 -0700149 Provision all subscribers on device ${onos_ssh_connection} ${ONOS_SSH_IP} ${ONOS_REST_PORT} ${olt}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700150 END
151
152Flows validation in VOLTHA after subscriber provisioning
153 [Documentation] Check that all the flows has been stored in the logical device
154 [Tags] non-critical flow-after plot-voltha-flows-after
155 # NOTE fail the test immediately if we're trying to check flows without provisioning them
156 Should Be Equal ${enableFlowProvisioning} true
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800157
Matteo Scandolo142e6272020-04-29 17:36:59 -0700158 Wait for Logical Devices flows ${workflow} ${total_onus} ${olt} true
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200159 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700160
Matteo Scandolo616daab2020-05-13 11:49:24 -0700161Flows validation in VOLTHA Adapters after subscriber provisioning
162 [Documentation] Check that all flows has been store in devices of type openolt
Matteo Scandolo96dbe432020-05-28 10:51:57 -0700163 [Tags] non-critical flow-after plot-voltha-openolt-flows-after only-me
Matteo Scandolo616daab2020-05-13 11:49:24 -0700164 Should Be Equal ${enableFlowProvisioning} true
165 Wait for OpenOLT Devices flows ${workflow} ${total_onus} ${olt} true
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200166 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo616daab2020-05-13 11:49:24 -0700167
Matteo Scandolo142e6272020-04-29 17:36:59 -0700168Flows validation in ONOS after subscriber provisioning
169 [Documentation] Check that all the flows has been acknowledged
170 [Tags] non-critical flow-after plot-onos-flows-after
171 # NOTE fail the test immediately if we're trying to check flows without provisioning them
172 Should Be Equal ${enableFlowProvisioning} true
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800173
174 ${onos_devices}= Compute Device IDs
175 FOR ${deviceId} IN @{onos_devices}
176 Wait for all flows to in ADDED state ${onos_ssh_connection}
177 ... ${deviceId} ${workflow} ${total_onus_per_olt} 1 true
178 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
179 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700180
181Wait for subscribers to have an IP
182 [Documentation] Check that all subscribers have received a DHCP_ACK
183 [Tags] non-critical dhcp plot-onos-dhcp
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800184 ${onos_devices}= Compute Device IDs
185 FOR ${deviceId} IN @{onos_devices}
186 Wait for DHCP Ack ${onos_ssh_connection} ${total_onus_per_olt} ${workflow} ${deviceId}
187 END
Matteo Scandolo142e6272020-04-29 17:36:59 -0700188
189Disable and Delete devices
190 [Documentation] Disable and delete the OLTs in VOLTHA
191 [Tags] non-critical teardown
192 FOR ${olt_device_id} IN @{olt_device_ids}
193 Disable Device ${olt_device_id}
194 Delete Device ${olt_device_id}
Matteo Scandolo5899be12020-11-11 15:38:07 -0800195 Remove Values From List ${olt_device_ids} ${olt_device_id}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700196 END
197
198 Set Suite Variable ${olt_device_ids}
199
200*** Keywords ***
201Setup Suite
Matteo Scandolo37bca8d2020-07-31 11:28:40 -0700202 [Documentation] Setup test global variables, open an SSH connection to ONOS and starts a timer
Matteo Scandolo142e6272020-04-29 17:36:59 -0700203 Set Suite Variable ${KUBECTL_CONFIG} export KUBECONFIG=%{KUBECONFIG}
Matteo Scandolo5899be12020-11-11 15:38:07 -0800204 Set Suite Variable ${VOLTCTL_CONFIG} %{VOLTCONFIG}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700205
206 ${total_onus}= Evaluate ${olt} * ${pon} * ${onu}
207 Set Suite Variable ${total_onus}
208
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800209 ${total_onus_per_olt}= Evaluate ${pon} * ${onu}
210 Set Suite Variable ${total_onus_per_olt}
211
Matteo Scandolo37bca8d2020-07-31 11:28:40 -0700212 ${onos_ssh_connection} Open ONOS SSH Connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
213 Set Suite Variable ${onos_ssh_connection}
214
215Teardown Suite
216 [Documentation] Close the SSH connection to ONOS
Matteo Scandolo50be75c2020-11-12 11:14:12 -0800217 Close ONOS SSH Connection ${onos_ssh_connection}
218
219Compute device IDs
220 [Documentation] Creates a list of ONOS device ID based on the test configuration
221 # TODO read ${olt} and ${stackid} from parameters
222 ${base}= Set Variable of:00000a0a0a0a0a
223 ${device_ids}= Create List
224 FOR ${olt_id} IN RANGE 0 ${olt}
225 ${decimal_id}= Catenate SEPARATOR= ${stackid} ${olt_id}
226 ${piece}= Convert To Hex ${decimal_id} length=2 lowercase=yes
227 ${id}= Catenate SEPARATOR= ${base} ${piece}
228 Append To List ${device_ids} ${id}
229 END
230
231 [Return] ${device_ids}