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 |
| 41 | Suite Teardown Teardown Suite |
| 42 | Library Collections |
| 43 | Library String |
| 44 | Library OperatingSystem |
| 45 | Library XML |
| 46 | Library Timer |
| 47 | Library RequestsLibrary |
| 48 | Library ../../libraries/DependencyLibrary.py |
| 49 | Resource ../../libraries/onos.robot |
| 50 | Resource ../../libraries/voltctl.robot |
| 51 | Resource ../../libraries/voltha.robot |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 52 | Resource ../../libraries/flows.robot |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 53 | Resource ../../libraries/k8s.robot |
| 54 | Resource ../../variables/variables.robot |
| 55 | |
| 56 | *** Variables *** |
| 57 | ${ONOS_SSH_IP} 127.0.0.1 |
| 58 | ${ONOS_SSH_PORT} 8101 |
Matteo Scandolo | 96dbe43 | 2020-05-28 10:51:57 -0700 | [diff] [blame] | 59 | ${ONOS_REST_PORT} 8181 |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 60 | |
| 61 | # Scale pipeline values |
| 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 |
| 101 | Wait for Ports in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus} BBSM |
| 102 | |
| 103 | Flows validation in VOLTHA before subscriber provisioning |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 104 | [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] | 105 | [Tags] non-critical flow-before plot-voltha-flows-before |
| 106 | # NOTE fail the test immediately if we're trying to check flows without provisioning them |
| 107 | Should Be Equal ${enableFlowProvisioning} true |
| 108 | Wait for Logical Devices flows ${workflow} ${total_onus} ${olt} false |
Andrea Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 109 | ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 110 | |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 111 | Flows validation in VOLTHA Adapters before subscriber provisioning |
| 112 | [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] | 113 | [Tags] non-critical flow-before plot-voltha-openolt-flows-before only-me |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 114 | Should Be Equal ${enableFlowProvisioning} true |
| 115 | Wait for OpenOLT Devices flows ${workflow} ${total_onus} ${olt} false |
Andrea Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 116 | ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP} |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 117 | |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 118 | Flows validation in ONOS before subscriber provisioning |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 119 | [Documentation] Check that all the flows has been acknowledged |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 120 | [Tags] non-critical flow-before plot-onos-flows-before |
| 121 | # NOTE fail the test immediately if we're trying to check flows without provisioning them |
| 122 | Should Be Equal ${enableFlowProvisioning} true |
| 123 | Wait for all flows to in ADDED state ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Andrea Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 124 | ... ${workflow} ${total_onus} ${olt} false ${withEapol} ${withDhcp} |
| 125 | ... ${withIgmp} ${withLLDP} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 126 | |
| 127 | Wait for subscribers to be Authenticated |
| 128 | [Documentation] Check that all subscribers have successfully authenticated |
| 129 | [Tags] non-critical authentication plot-onos-auth |
| 130 | Wait for AAA Authentication ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus} |
| 131 | |
| 132 | Provision subscribers |
| 133 | [Documentation] Provision data plane flows for all the subscribers |
| 134 | [Tags] non-critical provision |
| 135 | Should Be Equal ${enableSubscriberProvisioning} true |
| 136 | ${olts}= List OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 137 | FOR ${olt} IN @{olts} |
Matteo Scandolo | 96dbe43 | 2020-05-28 10:51:57 -0700 | [diff] [blame] | 138 | Provision all subscribers on device ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${ONOS_REST_PORT} ${olt} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 139 | END |
| 140 | |
| 141 | Flows validation in VOLTHA after subscriber provisioning |
| 142 | [Documentation] Check that all the flows has been stored in the logical device |
| 143 | [Tags] non-critical flow-after plot-voltha-flows-after |
| 144 | # NOTE fail the test immediately if we're trying to check flows without provisioning them |
| 145 | Should Be Equal ${enableFlowProvisioning} true |
| 146 | Wait for Logical Devices flows ${workflow} ${total_onus} ${olt} true |
Andrea Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 147 | ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 148 | |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 149 | Flows validation in VOLTHA Adapters after subscriber provisioning |
| 150 | [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] | 151 | [Tags] non-critical flow-after plot-voltha-openolt-flows-after only-me |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 152 | Should Be Equal ${enableFlowProvisioning} true |
| 153 | Wait for OpenOLT Devices flows ${workflow} ${total_onus} ${olt} true |
Andrea Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 154 | ... ${withEapol} ${withDhcp} ${withIgmp} ${withLLDP} |
Matteo Scandolo | 616daab | 2020-05-13 11:49:24 -0700 | [diff] [blame] | 155 | |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 156 | Flows validation in ONOS after subscriber provisioning |
| 157 | [Documentation] Check that all the flows has been acknowledged |
| 158 | [Tags] non-critical flow-after plot-onos-flows-after |
| 159 | # NOTE fail the test immediately if we're trying to check flows without provisioning them |
| 160 | Should Be Equal ${enableFlowProvisioning} true |
| 161 | Wait for all flows to in ADDED state ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Andrea Campanella | 70cf0a7 | 2020-05-27 10:55:15 +0200 | [diff] [blame] | 162 | ... ${workflow} ${total_onus} ${olt} true ${withEapol} ${withDhcp} |
| 163 | ... ${withIgmp} ${withLLDP} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 164 | |
| 165 | Wait for subscribers to have an IP |
| 166 | [Documentation] Check that all subscribers have received a DHCP_ACK |
| 167 | [Tags] non-critical dhcp plot-onos-dhcp |
| 168 | Wait for DHCP Ack ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus} |
| 169 | |
| 170 | Disable and Delete devices |
| 171 | [Documentation] Disable and delete the OLTs in VOLTHA |
| 172 | [Tags] non-critical teardown |
| 173 | FOR ${olt_device_id} IN @{olt_device_ids} |
| 174 | Disable Device ${olt_device_id} |
| 175 | Delete Device ${olt_device_id} |
| 176 | END |
| 177 | |
| 178 | Set Suite Variable ${olt_device_ids} |
| 179 | |
| 180 | *** Keywords *** |
| 181 | Setup Suite |
| 182 | [Documentation] Setup test global variables and starts a timer |
| 183 | Set Suite Variable ${KUBECTL_CONFIG} export KUBECONFIG=%{KUBECONFIG} |
| 184 | Set Suite Variable ${VOLTCTL_CONFIG} export VOLTCONFIG=%{VOLTCONFIG} |
| 185 | |
| 186 | ${total_onus}= Evaluate ${olt} * ${pon} * ${onu} |
| 187 | Set Suite Variable ${total_onus} |
| 188 | |
| 189 | Configure Timer 10 minutes 0 seconds SuiteTimer |
| 190 | Start Timer SuiteTimer |
| 191 | |
| 192 | Teardown Suite |
| 193 | [Documentation] Verify the timer |
| 194 | Stop Timer SuiteTimer |
| 195 | Verify Single Timer 10 minutes 0 seconds SuiteTimer |