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 |
| 61 | ${olt} 1 |
| 62 | ${pon} 1 |
| 63 | ${onu} 1 |
| 64 | |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 65 | ${enableFlowProvisioning} true |
| 66 | ${enableSubscriberProvisioning} true |
| 67 | |
| 68 | ${workflow} att |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 69 | ${withEapol} false |
| 70 | ${withDhcp} false |
| 71 | ${withIgmp} false |
Andrea Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 72 | # as of now the LLDP flow is always installed |
| 73 | ${withLLDP} true |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 74 | |
| 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 | |
| 80 | Create and Enable devices |
| 81 | [Documentation] Create and enable the OLTs in VOLTHA |
Andrea Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 82 | [Tags] non-critical setup |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 83 | ${olt_device_ids}= Create List |
| 84 | FOR ${INDEX} IN RANGE 0 ${olt} |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 85 | ${olt_device_id}= Create Device bbsim${INDEX} 50060 openolt |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 86 | 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 | |
| 92 | Onu 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 | |
| 97 | Port Discovery in ONOS |
| 98 | [Documentation] Check that all the UNI ports show up in ONOS |
| 99 | [Tags] non-critical activation plot-onos-ports |
Matteo Scandolo | 37bca8d | 2020-07-31 11:28:40 -0700 | [diff] [blame] | 100 | Wait for Ports in ONOS ${onos_ssh_connection} ${total_onus} BBSM |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 101 | |
| 102 | Flows validation in VOLTHA before subscriber provisioning |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 103 | [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] | 104 | [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 Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 108 | ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 109 | |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 110 | Flows validation in VOLTHA Adapters before subscriber provisioning |
| 111 | [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] | 112 | [Tags] non-critical flow-before plot-voltha-openolt-flows-before only-me |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 113 | Should Be Equal ${enableFlowProvisioning} true |
| 114 | Wait for OpenOLT Devices flows ${workflow} ${total_onus} ${olt} false |
Andrea Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 115 | ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP} |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 116 | |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 117 | Flows validation in ONOS before subscriber provisioning |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 118 | [Documentation] Check that all the flows has been acknowledged |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 119 | [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 |
Matteo Scandolo | 37bca8d | 2020-07-31 11:28:40 -0700 | [diff] [blame] | 122 | Wait for all flows to in ADDED state ${onos_ssh_connection} |
Andrea Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 123 | ... ${workflow} ${total_onus} ${olt} false ${withEapol} ${withDhcp} |
| 124 | ... ${withIgmp} ${withLLDP} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 125 | |
| 126 | Wait for subscribers to be Authenticated |
| 127 | [Documentation] Check that all subscribers have successfully authenticated |
| 128 | [Tags] non-critical authentication plot-onos-auth |
Matteo Scandolo | 37bca8d | 2020-07-31 11:28:40 -0700 | [diff] [blame] | 129 | Wait for AAA Authentication ${onos_ssh_connection} ${total_onus} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 130 | |
| 131 | Provision subscribers |
| 132 | [Documentation] Provision data plane flows for all the subscribers |
| 133 | [Tags] non-critical provision |
| 134 | Should Be Equal ${enableSubscriberProvisioning} true |
Matteo Scandolo | 37bca8d | 2020-07-31 11:28:40 -0700 | [diff] [blame] | 135 | ${olts}= List OLTs ${onos_ssh_connection} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 136 | FOR ${olt} IN @{olts} |
Matteo Scandolo | 37bca8d | 2020-07-31 11:28:40 -0700 | [diff] [blame] | 137 | 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] | 138 | END |
| 139 | |
| 140 | Flows 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 Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 146 | ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 147 | |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 148 | Flows validation in VOLTHA Adapters after subscriber provisioning |
| 149 | [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] | 150 | [Tags] non-critical flow-after plot-voltha-openolt-flows-after only-me |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 151 | Should Be Equal ${enableFlowProvisioning} true |
| 152 | Wait for OpenOLT Devices flows ${workflow} ${total_onus} ${olt} true |
Andrea Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 153 | ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP} |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 154 | |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 155 | Flows 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 |
Matteo Scandolo | 37bca8d | 2020-07-31 11:28:40 -0700 | [diff] [blame] | 160 | Wait for all flows to in ADDED state ${onos_ssh_connection} |
Andrea Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 161 | ... ${workflow} ${total_onus} ${olt} true ${withEapol} ${withDhcp} |
| 162 | ... ${withIgmp} ${withLLDP} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 163 | |
| 164 | Wait 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 |
Matteo Scandolo | da854b0 | 2020-09-01 16:20:51 -0700 | [diff] [blame] | 167 | Wait for DHCP Ack ${onos_ssh_connection} ${total_onus} ${workflow} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 168 | |
| 169 | Disable 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} |
Matteo Scandolo | 5899be1 | 2020-11-11 15:38:07 -0800 | [diff] [blame] | 175 | Remove Values From List ${olt_device_ids} ${olt_device_id} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 176 | END |
| 177 | |
| 178 | Set Suite Variable ${olt_device_ids} |
| 179 | |
| 180 | *** Keywords *** |
| 181 | Setup Suite |
Matteo Scandolo | 37bca8d | 2020-07-31 11:28:40 -0700 | [diff] [blame] | 182 | [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] | 183 | Set Suite Variable ${KUBECTL_CONFIG} export KUBECONFIG=%{KUBECONFIG} |
Matteo Scandolo | 5899be1 | 2020-11-11 15:38:07 -0800 | [diff] [blame] | 184 | Set Suite Variable ${VOLTCTL_CONFIG} %{VOLTCONFIG} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 185 | |
| 186 | ${total_onus}= Evaluate ${olt} * ${pon} * ${onu} |
| 187 | Set Suite Variable ${total_onus} |
| 188 | |
Matteo Scandolo | 37bca8d | 2020-07-31 11:28:40 -0700 | [diff] [blame] | 189 | ${onos_ssh_connection} Open ONOS SSH Connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 190 | Set Suite Variable ${onos_ssh_connection} |
| 191 | |
| 192 | Teardown Suite |
| 193 | [Documentation] Close the SSH connection to ONOS |
| 194 | Close ONOS SSH Connection ${onos_ssh_connection} |