Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 1 | # 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 *** |
| 37 | Documentation Collect measurements on VOLTHA performances |
| 38 | Suite Setup Setup Suite |
| 39 | #Test Setup Setup |
| 40 | #Test Teardown Teardown |
Matteo Scandolo | 37bca8d | 2020-07-31 11:28:40 -0700 | [diff] [blame] | 41 | Suite Teardown Teardown Suite |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 42 | Library Collections |
| 43 | Library String |
| 44 | Library OperatingSystem |
| 45 | Library XML |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 46 | Library RequestsLibrary |
| 47 | Library ../../libraries/DependencyLibrary.py |
| 48 | Resource ../../libraries/onos.robot |
| 49 | Resource ../../libraries/voltctl.robot |
| 50 | Resource ../../libraries/voltha.robot |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 51 | Resource ../../libraries/flows.robot |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 52 | Resource ../../libraries/k8s.robot |
| 53 | Resource ../../variables/variables.robot |
| 54 | |
| 55 | *** Variables *** |
| 56 | ${ONOS_SSH_IP} 127.0.0.1 |
| 57 | ${ONOS_SSH_PORT} 8101 |
Matteo Scandolo | 96dbe43 | 2020-05-28 10:51:57 -0700 | [diff] [blame] | 58 | ${ONOS_REST_PORT} 8181 |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 59 | |
| 60 | # Scale pipeline values |
Matteo Scandolo | 50be75c | 2020-11-12 11:14:12 -0800 | [diff] [blame] | 61 | ${stackId} 1 |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 62 | ${olt} 1 |
| 63 | ${pon} 1 |
| 64 | ${onu} 1 |
| 65 | |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 66 | ${enableFlowProvisioning} true |
| 67 | ${enableSubscriberProvisioning} true |
| 68 | |
| 69 | ${workflow} att |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 70 | ${withEapol} false |
| 71 | ${withDhcp} false |
| 72 | ${withIgmp} false |
Andrea Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 73 | # as of now the LLDP flow is always installed |
| 74 | ${withLLDP} true |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 75 | |
| 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 | |
| 81 | Create and Enable devices |
| 82 | [Documentation] Create and enable the OLTs in VOLTHA |
Andrea Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 83 | [Tags] non-critical setup |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 84 | ${olt_device_ids}= Create List |
| 85 | FOR ${INDEX} IN RANGE 0 ${olt} |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 86 | ${olt_device_id}= Create Device bbsim${INDEX} 50060 openolt |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 87 | 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 | |
| 93 | Onu 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 | |
| 98 | Port Discovery in ONOS |
| 99 | [Documentation] Check that all the UNI ports show up in ONOS |
| 100 | [Tags] non-critical activation plot-onos-ports |
Matteo Scandolo | 50be75c | 2020-11-12 11:14:12 -0800 | [diff] [blame] | 101 | ${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 Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 105 | |
| 106 | Flows validation in VOLTHA before subscriber provisioning |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 107 | [Documentation] Check that all the flows has been stored in the logical device |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 108 | [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 Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 112 | ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 113 | |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 114 | Flows validation in VOLTHA Adapters before subscriber provisioning |
| 115 | [Documentation] Check that all flows has been store in devices of type openolt |
Matteo Scandolo | 96dbe43 | 2020-05-28 10:51:57 -0700 | [diff] [blame] | 116 | [Tags] non-critical flow-before plot-voltha-openolt-flows-before only-me |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 117 | Should Be Equal ${enableFlowProvisioning} true |
| 118 | Wait for OpenOLT Devices flows ${workflow} ${total_onus} ${olt} false |
Andrea Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 119 | ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP} |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 120 | |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 121 | Flows validation in ONOS before subscriber provisioning |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 122 | [Documentation] Check that all the flows has been acknowledged |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 123 | [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 Scandolo | 50be75c | 2020-11-12 11:14:12 -0800 | [diff] [blame] | 126 | |
| 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 Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 133 | |
| 134 | Wait for subscribers to be Authenticated |
| 135 | [Documentation] Check that all subscribers have successfully authenticated |
| 136 | [Tags] non-critical authentication plot-onos-auth |
Matteo Scandolo | 50be75c | 2020-11-12 11:14:12 -0800 | [diff] [blame] | 137 | |
| 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 Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 142 | |
| 143 | Provision subscribers |
| 144 | [Documentation] Provision data plane flows for all the subscribers |
| 145 | [Tags] non-critical provision |
| 146 | Should Be Equal ${enableSubscriberProvisioning} true |
Matteo Scandolo | 50be75c | 2020-11-12 11:14:12 -0800 | [diff] [blame] | 147 | ${onos_devices}= Compute Device IDs |
| 148 | FOR ${olt} IN @{onos_devices} |
Matteo Scandolo | 37bca8d | 2020-07-31 11:28:40 -0700 | [diff] [blame] | 149 | Provision all subscribers on device ${onos_ssh_connection} ${ONOS_SSH_IP} ${ONOS_REST_PORT} ${olt} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 150 | END |
| 151 | |
| 152 | Flows 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 Scandolo | 50be75c | 2020-11-12 11:14:12 -0800 | [diff] [blame] | 157 | |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 158 | Wait for Logical Devices flows ${workflow} ${total_onus} ${olt} true |
Andrea Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 159 | ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 160 | |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 161 | Flows validation in VOLTHA Adapters after subscriber provisioning |
| 162 | [Documentation] Check that all flows has been store in devices of type openolt |
Matteo Scandolo | 96dbe43 | 2020-05-28 10:51:57 -0700 | [diff] [blame] | 163 | [Tags] non-critical flow-after plot-voltha-openolt-flows-after only-me |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 164 | Should Be Equal ${enableFlowProvisioning} true |
| 165 | Wait for OpenOLT Devices flows ${workflow} ${total_onus} ${olt} true |
Andrea Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 166 | ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP} |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 167 | |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 168 | Flows 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 Scandolo | 50be75c | 2020-11-12 11:14:12 -0800 | [diff] [blame] | 173 | |
| 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 Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 180 | |
| 181 | Wait 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 Scandolo | 50be75c | 2020-11-12 11:14:12 -0800 | [diff] [blame] | 184 | ${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 Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 188 | |
| 189 | Disable 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 Scandolo | 5899be1 | 2020-11-11 15:38:07 -0800 | [diff] [blame] | 195 | Remove Values From List ${olt_device_ids} ${olt_device_id} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 196 | END |
| 197 | |
| 198 | Set Suite Variable ${olt_device_ids} |
| 199 | |
| 200 | *** Keywords *** |
| 201 | Setup Suite |
Matteo Scandolo | 37bca8d | 2020-07-31 11:28:40 -0700 | [diff] [blame] | 202 | [Documentation] Setup test global variables, open an SSH connection to ONOS and starts a timer |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 203 | Set Suite Variable ${KUBECTL_CONFIG} export KUBECONFIG=%{KUBECONFIG} |
Matteo Scandolo | 5899be1 | 2020-11-11 15:38:07 -0800 | [diff] [blame] | 204 | Set Suite Variable ${VOLTCTL_CONFIG} %{VOLTCONFIG} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 205 | |
| 206 | ${total_onus}= Evaluate ${olt} * ${pon} * ${onu} |
| 207 | Set Suite Variable ${total_onus} |
| 208 | |
Matteo Scandolo | 50be75c | 2020-11-12 11:14:12 -0800 | [diff] [blame] | 209 | ${total_onus_per_olt}= Evaluate ${pon} * ${onu} |
| 210 | Set Suite Variable ${total_onus_per_olt} |
| 211 | |
Matteo Scandolo | 37bca8d | 2020-07-31 11:28:40 -0700 | [diff] [blame] | 212 | ${onos_ssh_connection} Open ONOS SSH Connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 213 | Set Suite Variable ${onos_ssh_connection} |
| 214 | |
| 215 | Teardown Suite |
| 216 | [Documentation] Close the SSH connection to ONOS |
Matteo Scandolo | 50be75c | 2020-11-12 11:14:12 -0800 | [diff] [blame] | 217 | Close ONOS SSH Connection ${onos_ssh_connection} |
| 218 | |
| 219 | Compute 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} |