blob: c2c1527c1d5bf74fd2af50d077e09dee15f5908d [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
41Suite Teardown Teardown Suite
42Library Collections
43Library String
44Library OperatingSystem
45Library XML
46Library Timer
47Library RequestsLibrary
48Library ../../libraries/DependencyLibrary.py
49Resource ../../libraries/onos.robot
50Resource ../../libraries/voltctl.robot
51Resource ../../libraries/voltha.robot
52Resource ../../libraries/utils.robot
53Resource ../../libraries/k8s.robot
54Resource ../../variables/variables.robot
55
56*** Variables ***
57${ONOS_SSH_IP} 127.0.0.1
58${ONOS_SSH_PORT} 8101
59
60# Scale pipeline values
61${olt} 1
62${pon} 1
63${onu} 1
64
65${enableLLDP} false
66${enableFlowProvisioning} true
67${enableSubscriberProvisioning} true
68
69${workflow} att
70#${flowsBeforeProvisioning} 1
71#${flowsAfterProvisioning} 1
72
73# Per-test logging on failure is turned off by default; set this variable to enable
74${container_log_dir} ${None}
75
76*** Test Cases ***
77
78Create and Enable devices
79 [Documentation] Create and enable the OLTs in VOLTHA
80 [Tags] setup
81 ${olt_device_ids}= Create List
82 FOR ${INDEX} IN RANGE 0 ${olt}
83 ${olt_device_id}= Create Device bbsim${INDEX} 50060 openolt 0f:f1:ce:c${INDEX}:ff:ee
84 Enable Device ${olt_device_id}
85 Append To List ${olt_device_ids} ${olt_device_id}
86 END
87
88 Set Suite Variable ${olt_device_ids}
89
90Onu Activation in VOLTHA
91 [Documentation] Check that all ONUs reach the ACTIVE/ENABLED state in VOLTHA
92 [Tags] non-critical activation plot-voltha-onus
93 Wait For ONUs In VOLTHA ${total_onus}
94
95Port Discovery in ONOS
96 [Documentation] Check that all the UNI ports show up in ONOS
97 [Tags] non-critical activation plot-onos-ports
98 Wait for Ports in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus} BBSM
99
100Flows validation in VOLTHA before subscriber provisioning
101 [Documentation] Check that all the flows has been acknowledged
102 [Tags] non-critical flow-before plot-voltha-flows-before
103 # NOTE fail the test immediately if we're trying to check flows without provisioning them
104 Should Be Equal ${enableFlowProvisioning} true
105 Wait for Logical Devices flows ${workflow} ${total_onus} ${olt} false
106
107Flows validation in ONOS before subscriber provisioning
108 [Documentation] Check that all the flows has been stored in the logical device
109 [Tags] non-critical flow-before plot-onos-flows-before
110 # NOTE fail the test immediately if we're trying to check flows without provisioning them
111 Should Be Equal ${enableFlowProvisioning} true
112 Wait for all flows to in ADDED state ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
113 ... ${workflow} ${total_onus} ${olt} false
114
115Wait for subscribers to be Authenticated
116 [Documentation] Check that all subscribers have successfully authenticated
117 [Tags] non-critical authentication plot-onos-auth
118 Wait for AAA Authentication ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus}
119
120Provision subscribers
121 [Documentation] Provision data plane flows for all the subscribers
122 [Tags] non-critical provision
123 Should Be Equal ${enableSubscriberProvisioning} true
124 ${olts}= List OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
125 FOR ${olt} IN @{olts}
126 Provision all subscribers on device ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${olt}
127 END
128
129Flows validation in VOLTHA after subscriber provisioning
130 [Documentation] Check that all the flows has been stored in the logical device
131 [Tags] non-critical flow-after plot-voltha-flows-after
132 # NOTE fail the test immediately if we're trying to check flows without provisioning them
133 Should Be Equal ${enableFlowProvisioning} true
134 Wait for Logical Devices flows ${workflow} ${total_onus} ${olt} true
135
136Flows validation in ONOS after subscriber provisioning
137 [Documentation] Check that all the flows has been acknowledged
138 [Tags] non-critical flow-after plot-onos-flows-after
139 # NOTE fail the test immediately if we're trying to check flows without provisioning them
140 Should Be Equal ${enableFlowProvisioning} true
141 Wait for all flows to in ADDED state ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
142 ... ${workflow} ${total_onus} ${olt} true
143
144Wait for subscribers to have an IP
145 [Documentation] Check that all subscribers have received a DHCP_ACK
146 [Tags] non-critical dhcp plot-onos-dhcp
147 Wait for DHCP Ack ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus}
148
149Disable and Delete devices
150 [Documentation] Disable and delete the OLTs in VOLTHA
151 [Tags] non-critical teardown
152 FOR ${olt_device_id} IN @{olt_device_ids}
153 Disable Device ${olt_device_id}
154 Delete Device ${olt_device_id}
155 END
156
157 Set Suite Variable ${olt_device_ids}
158
159*** Keywords ***
160Setup Suite
161 [Documentation] Setup test global variables and starts a timer
162 Set Suite Variable ${KUBECTL_CONFIG} export KUBECONFIG=%{KUBECONFIG}
163 Set Suite Variable ${VOLTCTL_CONFIG} export VOLTCONFIG=%{VOLTCONFIG}
164
165 ${total_onus}= Evaluate ${olt} * ${pon} * ${onu}
166 Set Suite Variable ${total_onus}
167
168 Configure Timer 10 minutes 0 seconds SuiteTimer
169 Start Timer SuiteTimer
170
171Teardown Suite
172 [Documentation] Verify the timer
173 Stop Timer SuiteTimer
174 Verify Single Timer 10 minutes 0 seconds SuiteTimer