blob: f39cbbcca9cca36b356ac775308a48c06b3fdf22 [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 Scandolo3553ca22020-06-05 08:54:13 -070041#Suite 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
61${olt} 1
62${pon} 1
63${onu} 1
64
Matteo Scandolo142e6272020-04-29 17:36:59 -070065${enableFlowProvisioning} true
66${enableSubscriberProvisioning} true
67
68${workflow} att
Matteo Scandoloeb26a842020-05-08 10:06:24 -070069${withEapol} false
70${withDhcp} false
71${withIgmp} false
Andrea Campanella70cf0a72020-05-27 10:55:15 +020072# as of now the LLDP flow is always installed
73${withLLDP} true
Matteo Scandolo142e6272020-04-29 17:36:59 -070074
75# Per-test logging on failure is turned off by default; set this variable to enable
76${container_log_dir} ${None}
77
78*** Test Cases ***
79
80Create and Enable devices
81 [Documentation] Create and enable the OLTs in VOLTHA
Andrea Campanella70cf0a72020-05-27 10:55:15 +020082 [Tags] non-critical setup
Matteo Scandolo142e6272020-04-29 17:36:59 -070083 ${olt_device_ids}= Create List
84 FOR ${INDEX} IN RANGE 0 ${olt}
Matteo Scandoloeb26a842020-05-08 10:06:24 -070085 ${olt_device_id}= Create Device bbsim${INDEX} 50060 openolt
Matteo Scandolo142e6272020-04-29 17:36:59 -070086 Enable Device ${olt_device_id}
87 Append To List ${olt_device_ids} ${olt_device_id}
88 END
89
90 Set Suite Variable ${olt_device_ids}
91
92Onu Activation in VOLTHA
93 [Documentation] Check that all ONUs reach the ACTIVE/ENABLED state in VOLTHA
94 [Tags] non-critical activation plot-voltha-onus
95 Wait For ONUs In VOLTHA ${total_onus}
96
97Port Discovery in ONOS
98 [Documentation] Check that all the UNI ports show up in ONOS
99 [Tags] non-critical activation plot-onos-ports
100 Wait for Ports in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus} BBSM
101
102Flows validation in VOLTHA before subscriber provisioning
Matteo Scandoloeb26a842020-05-08 10:06:24 -0700103 [Documentation] Check that all the flows has been stored in the logical device
Matteo Scandolo142e6272020-04-29 17:36:59 -0700104 [Tags] non-critical flow-before plot-voltha-flows-before
105 # NOTE fail the test immediately if we're trying to check flows without provisioning them
106 Should Be Equal ${enableFlowProvisioning} true
107 Wait for Logical Devices flows ${workflow} ${total_onus} ${olt} false
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200108 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700109
Matteo Scandolo616daab2020-05-13 11:49:24 -0700110Flows validation in VOLTHA Adapters before subscriber provisioning
111 [Documentation] Check that all flows has been store in devices of type openolt
Matteo Scandolo96dbe432020-05-28 10:51:57 -0700112 [Tags] non-critical flow-before plot-voltha-openolt-flows-before only-me
Matteo Scandolo616daab2020-05-13 11:49:24 -0700113 Should Be Equal ${enableFlowProvisioning} true
114 Wait for OpenOLT Devices flows ${workflow} ${total_onus} ${olt} false
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200115 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo616daab2020-05-13 11:49:24 -0700116
Matteo Scandolo142e6272020-04-29 17:36:59 -0700117Flows validation in ONOS before subscriber provisioning
Matteo Scandoloeb26a842020-05-08 10:06:24 -0700118 [Documentation] Check that all the flows has been acknowledged
Matteo Scandolo142e6272020-04-29 17:36:59 -0700119 [Tags] non-critical flow-before plot-onos-flows-before
120 # NOTE fail the test immediately if we're trying to check flows without provisioning them
121 Should Be Equal ${enableFlowProvisioning} true
122 Wait for all flows to in ADDED state ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200123 ... ${workflow} ${total_onus} ${olt} false ${withEapol} ${withDhcp}
124 ... ${withIgmp} ${withLLDP}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700125
126Wait for subscribers to be Authenticated
127 [Documentation] Check that all subscribers have successfully authenticated
128 [Tags] non-critical authentication plot-onos-auth
129 Wait for AAA Authentication ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus}
130
131Provision subscribers
132 [Documentation] Provision data plane flows for all the subscribers
133 [Tags] non-critical provision
134 Should Be Equal ${enableSubscriberProvisioning} true
135 ${olts}= List OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
136 FOR ${olt} IN @{olts}
Matteo Scandolo96dbe432020-05-28 10:51:57 -0700137 Provision all subscribers on device ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${ONOS_REST_PORT} ${olt}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700138 END
139
140Flows validation in VOLTHA after subscriber provisioning
141 [Documentation] Check that all the flows has been stored in the logical device
142 [Tags] non-critical flow-after plot-voltha-flows-after
143 # NOTE fail the test immediately if we're trying to check flows without provisioning them
144 Should Be Equal ${enableFlowProvisioning} true
145 Wait for Logical Devices flows ${workflow} ${total_onus} ${olt} true
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200146 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700147
Matteo Scandolo616daab2020-05-13 11:49:24 -0700148Flows validation in VOLTHA Adapters after subscriber provisioning
149 [Documentation] Check that all flows has been store in devices of type openolt
Matteo Scandolo96dbe432020-05-28 10:51:57 -0700150 [Tags] non-critical flow-after plot-voltha-openolt-flows-after only-me
Matteo Scandolo616daab2020-05-13 11:49:24 -0700151 Should Be Equal ${enableFlowProvisioning} true
152 Wait for OpenOLT Devices flows ${workflow} ${total_onus} ${olt} true
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200153 ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP}
Matteo Scandolo616daab2020-05-13 11:49:24 -0700154
Matteo Scandolo142e6272020-04-29 17:36:59 -0700155Flows validation in ONOS after subscriber provisioning
156 [Documentation] Check that all the flows has been acknowledged
157 [Tags] non-critical flow-after plot-onos-flows-after
158 # NOTE fail the test immediately if we're trying to check flows without provisioning them
159 Should Be Equal ${enableFlowProvisioning} true
160 Wait for all flows to in ADDED state ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Andrea Campanella70cf0a72020-05-27 10:55:15 +0200161 ... ${workflow} ${total_onus} ${olt} true ${withEapol} ${withDhcp}
162 ... ${withIgmp} ${withLLDP}
Matteo Scandolo142e6272020-04-29 17:36:59 -0700163
164Wait for subscribers to have an IP
165 [Documentation] Check that all subscribers have received a DHCP_ACK
166 [Tags] non-critical dhcp plot-onos-dhcp
167 Wait for DHCP Ack ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus}
168
169Disable and Delete devices
170 [Documentation] Disable and delete the OLTs in VOLTHA
171 [Tags] non-critical teardown
172 FOR ${olt_device_id} IN @{olt_device_ids}
173 Disable Device ${olt_device_id}
174 Delete Device ${olt_device_id}
175 END
176
177 Set Suite Variable ${olt_device_ids}
178
179*** Keywords ***
180Setup Suite
181 [Documentation] Setup test global variables and starts a timer
182 Set Suite Variable ${KUBECTL_CONFIG} export KUBECONFIG=%{KUBECONFIG}
183 Set Suite Variable ${VOLTCTL_CONFIG} export VOLTCONFIG=%{VOLTCONFIG}
184
185 ${total_onus}= Evaluate ${olt} * ${pon} * ${onu}
186 Set Suite Variable ${total_onus}
187