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 |
| 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 |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 70 | ${withEapol} false |
| 71 | ${withDhcp} false |
| 72 | ${withIgmp} false |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 73 | |
| 74 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 75 | ${container_log_dir} ${None} |
| 76 | |
| 77 | *** Test Cases *** |
| 78 | |
| 79 | Create and Enable devices |
| 80 | [Documentation] Create and enable the OLTs in VOLTHA |
| 81 | [Tags] setup |
| 82 | ${olt_device_ids}= Create List |
| 83 | FOR ${INDEX} IN RANGE 0 ${olt} |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 84 | ${olt_device_id}= Create Device bbsim${INDEX} 50060 openolt |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 85 | Enable Device ${olt_device_id} |
| 86 | Append To List ${olt_device_ids} ${olt_device_id} |
| 87 | END |
| 88 | |
| 89 | Set Suite Variable ${olt_device_ids} |
| 90 | |
| 91 | Onu Activation in VOLTHA |
| 92 | [Documentation] Check that all ONUs reach the ACTIVE/ENABLED state in VOLTHA |
| 93 | [Tags] non-critical activation plot-voltha-onus |
| 94 | Wait For ONUs In VOLTHA ${total_onus} |
| 95 | |
| 96 | Port Discovery in ONOS |
| 97 | [Documentation] Check that all the UNI ports show up in ONOS |
| 98 | [Tags] non-critical activation plot-onos-ports |
| 99 | Wait for Ports in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus} BBSM |
| 100 | |
| 101 | Flows validation in VOLTHA before subscriber provisioning |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 102 | [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] | 103 | [Tags] non-critical flow-before plot-voltha-flows-before |
| 104 | # NOTE fail the test immediately if we're trying to check flows without provisioning them |
| 105 | Should Be Equal ${enableFlowProvisioning} true |
| 106 | Wait for Logical Devices flows ${workflow} ${total_onus} ${olt} false |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 107 | ... ${withEapol} ${withDhcp} ${withIgmp} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 108 | |
| 109 | Flows validation in ONOS before subscriber provisioning |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 110 | [Documentation] Check that all the flows has been acknowledged |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 111 | [Tags] non-critical flow-before plot-onos-flows-before |
| 112 | # NOTE fail the test immediately if we're trying to check flows without provisioning them |
| 113 | Should Be Equal ${enableFlowProvisioning} true |
| 114 | Wait for all flows to in ADDED state ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 115 | ... ${workflow} ${total_onus} ${olt} false ${withEapol} ${withDhcp} ${withIgmp} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 116 | |
| 117 | Wait for subscribers to be Authenticated |
| 118 | [Documentation] Check that all subscribers have successfully authenticated |
| 119 | [Tags] non-critical authentication plot-onos-auth |
| 120 | Wait for AAA Authentication ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus} |
| 121 | |
| 122 | Provision subscribers |
| 123 | [Documentation] Provision data plane flows for all the subscribers |
| 124 | [Tags] non-critical provision |
| 125 | Should Be Equal ${enableSubscriberProvisioning} true |
| 126 | ${olts}= List OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 127 | FOR ${olt} IN @{olts} |
| 128 | Provision all subscribers on device ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${olt} |
| 129 | END |
| 130 | |
| 131 | Flows validation in VOLTHA after subscriber provisioning |
| 132 | [Documentation] Check that all the flows has been stored in the logical device |
| 133 | [Tags] non-critical flow-after plot-voltha-flows-after |
| 134 | # NOTE fail the test immediately if we're trying to check flows without provisioning them |
| 135 | Should Be Equal ${enableFlowProvisioning} true |
| 136 | Wait for Logical Devices flows ${workflow} ${total_onus} ${olt} true |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 137 | ... ${withEapol} ${withDhcp} ${withIgmp} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 138 | |
| 139 | Flows validation in ONOS after subscriber provisioning |
| 140 | [Documentation] Check that all the flows has been acknowledged |
| 141 | [Tags] non-critical flow-after plot-onos-flows-after |
| 142 | # NOTE fail the test immediately if we're trying to check flows without provisioning them |
| 143 | Should Be Equal ${enableFlowProvisioning} true |
| 144 | Wait for all flows to in ADDED state ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Matteo Scandolo | eb26a84 | 2020-05-08 10:06:24 -0700 | [diff] [blame] | 145 | ... ${workflow} ${total_onus} ${olt} true ${withEapol} ${withDhcp} ${withIgmp} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 146 | |
| 147 | Wait for subscribers to have an IP |
| 148 | [Documentation] Check that all subscribers have received a DHCP_ACK |
| 149 | [Tags] non-critical dhcp plot-onos-dhcp |
| 150 | Wait for DHCP Ack ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${total_onus} |
| 151 | |
| 152 | Disable and Delete devices |
| 153 | [Documentation] Disable and delete the OLTs in VOLTHA |
| 154 | [Tags] non-critical teardown |
| 155 | FOR ${olt_device_id} IN @{olt_device_ids} |
| 156 | Disable Device ${olt_device_id} |
| 157 | Delete Device ${olt_device_id} |
| 158 | END |
| 159 | |
| 160 | Set Suite Variable ${olt_device_ids} |
| 161 | |
| 162 | *** Keywords *** |
| 163 | Setup Suite |
| 164 | [Documentation] Setup test global variables and starts a timer |
| 165 | Set Suite Variable ${KUBECTL_CONFIG} export KUBECONFIG=%{KUBECONFIG} |
| 166 | Set Suite Variable ${VOLTCTL_CONFIG} export VOLTCONFIG=%{VOLTCONFIG} |
| 167 | |
| 168 | ${total_onus}= Evaluate ${olt} * ${pon} * ${onu} |
| 169 | Set Suite Variable ${total_onus} |
| 170 | |
| 171 | Configure Timer 10 minutes 0 seconds SuiteTimer |
| 172 | Start Timer SuiteTimer |
| 173 | |
| 174 | Teardown Suite |
| 175 | [Documentation] Verify the timer |
| 176 | Stop Timer SuiteTimer |
| 177 | Verify Single Timer 10 minutes 0 seconds SuiteTimer |