Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [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 | *** Settings *** |
| 16 | Library Process |
Kailash | f8ff51a | 2018-11-13 13:49:53 -0800 | [diff] [blame] | 17 | Library OperatingSystem |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 18 | Library ../common/auto_test.py |
| 19 | Library ../common/volthaMngr.py |
Gilles Depatie | 84cb1e7 | 2018-10-26 12:41:33 -0400 | [diff] [blame] | 20 | Library ../common/preprovisioning.py |
Gilles Depatie | 1be639b | 2018-12-06 10:51:08 -0500 | [diff] [blame] | 21 | Library ../common/discovery.py |
Gilles Depatie | a85fe81 | 2019-01-23 15:55:53 -0500 | [diff] [blame] | 22 | Library ../common/authentication.py |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 23 | Library ../common/dhcp.py |
Gilles Depatie | ed99efe | 2019-03-12 16:12:26 -0400 | [diff] [blame] | 24 | Library ../common/unicast.py |
Gilles Depatie | 84cb1e7 | 2018-10-26 12:41:33 -0400 | [diff] [blame] | 25 | Library volthaMngr.VolthaMngr |
Kailash | 32ce8e5 | 2018-11-13 13:03:36 -0800 | [diff] [blame] | 26 | Library preprovisioning.Preprovisioning |
Gilles Depatie | 1be639b | 2018-12-06 10:51:08 -0500 | [diff] [blame] | 27 | Library discovery.Discovery |
Gilles Depatie | a85fe81 | 2019-01-23 15:55:53 -0500 | [diff] [blame] | 28 | Library authentication.Authentication |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 29 | Library dhcp.DHCP |
Gilles Depatie | ed99efe | 2019-03-12 16:12:26 -0400 | [diff] [blame] | 30 | Library unicast.Unicast |
Gilles Depatie | 9651e46 | 2018-11-21 15:58:33 -0500 | [diff] [blame] | 31 | |
Gilles Depatie | 1be639b | 2018-12-06 10:51:08 -0500 | [diff] [blame] | 32 | Suite Setup Start Voltha |
| 33 | Suite Teardown Stop Voltha |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 34 | |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 35 | *** Variables *** |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 36 | ${LOG_DIR} /tmp/voltha_test_results |
| 37 | ${ROOT_DIR} ${EMPTY} |
| 38 | ${VOLTHA_DIR} ${EMPTY} |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 39 | ${OLT_PORT_ID} 50060 |
Gilles Depatie | ea42371 | 2019-04-12 16:39:12 -0400 | [diff] [blame] | 40 | ${OLT_TYPE} ${EMPTY} |
| 41 | ${ONU_TYPE} ${EMPTY} |
| 42 | ${OLT_HOST_IP} ${EMPTY} |
| 43 | ${ONU_COUNT} ${EMPTY} |
Gilles Depatie | 493ea24 | 2019-05-21 14:38:08 -0400 | [diff] [blame] | 44 | ${SIMTYPE} ${EMPTY} |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 45 | ${RETRY_TIMEOUT_60} 60s |
| 46 | ${RETRY_INTERVAL_2} 2s |
Gilles Depatie | c9a26cf | 2019-05-10 15:43:12 -0400 | [diff] [blame] | 47 | ${PROCEED_TIMEOUT_180} 180s |
| 48 | |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 49 | |
| 50 | *** Test Cases *** |
Gilles Depatie | 1be639b | 2018-12-06 10:51:08 -0500 | [diff] [blame] | 51 | Olt Pre Provisioning |
| 52 | [Documentation] Olt Pre Provisioning |
Gilles Depatie | 84cb1e7 | 2018-10-26 12:41:33 -0400 | [diff] [blame] | 53 | ... This test preprovisions a ponsim-OLT with given IP address and TCP port |
| 54 | ... and then enables both it and a number of ponsim-ONUs with predefined IP/port |
| 55 | ... information. It then verifies that all the physical and logical devices are ACTIVE |
| 56 | ... and REACHEABLE |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 57 | P Set Log Dirs ${LOG_DIR} |
Gilles Depatie | ea42371 | 2019-04-12 16:39:12 -0400 | [diff] [blame] | 58 | P Configure ${OLT_HOST_IP} ${OLT_PORT_ID} ${OLT_TYPE} ${ONU_TYPE} ${ONU_COUNT} |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 59 | Preprovision Olt |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 60 | Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Query Devices Before Enabling |
Gilles Depatie | 9651e46 | 2018-11-21 15:58:33 -0500 | [diff] [blame] | 61 | Status Should Be Success After Preprovision Command |
| 62 | Check Olt Fields Before Enabling |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 63 | Enable |
Kailash | f747d2c | 2019-05-23 11:00:48 -0700 | [diff] [blame] | 64 | Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Validate Number of Devices |
Gilles Depatie | c9a26cf | 2019-05-10 15:43:12 -0400 | [diff] [blame] | 65 | Wait Until Keyword Succeeds ${PROCEED_TIMEOUT_180} ${RETRY_INTERVAL_2} Proceed |
Gilles Depatie | ea42371 | 2019-04-12 16:39:12 -0400 | [diff] [blame] | 66 | |
Gilles Depatie | 1be639b | 2018-12-06 10:51:08 -0500 | [diff] [blame] | 67 | Olt Onu Discovery |
| 68 | [Documentation] Olt Onu Discovery |
| 69 | ... This test covers both Onu Discovery and yet to be developped Olt Discovery |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 70 | ... It aims to verify the integrity of all port fields under each discrete device, including |
| 71 | ... Logical Device. |
Gilles Depatie | 1be639b | 2018-12-06 10:51:08 -0500 | [diff] [blame] | 72 | ... It also insures that the peers fields contains device Id entries for the corresponding |
| 73 | ... Olt or Onu device. Functionality to support multiple ONU accomodated |
| 74 | ... The extent of the flow validation is limited to checking whether number of Flows is > 0 |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 75 | D Set Log Dirs ${LOG_DIR} |
Gilles Depatie | ea42371 | 2019-04-12 16:39:12 -0400 | [diff] [blame] | 76 | D Configure ${OLT_HOST_IP} ${OLT_TYPE} ${ONU_TYPE} ${ONU_COUNT} |
Gilles Depatie | 1be639b | 2018-12-06 10:51:08 -0500 | [diff] [blame] | 77 | Olt Discovery |
| 78 | Onu Discovery |
Kailash | a4d4574 | 2019-02-11 14:46:43 -0800 | [diff] [blame] | 79 | Logical Device |
Gilles Depatie | 82dd202 | 2019-02-19 14:31:33 -0500 | [diff] [blame] | 80 | Logical Device Ports Should Exist |
| 81 | Logical Device Should Have At Least One Flow |
Gilles Depatie | 1be639b | 2018-12-06 10:51:08 -0500 | [diff] [blame] | 82 | Olt Ports Should Be Enabled and Active |
| 83 | Onu Ports Should Be Enabled and Active |
| 84 | Olt Should Have At Least One Flow |
| 85 | Onu Should Have At Least One Flow |
| 86 | |
Gilles Depatie | a85fe81 | 2019-01-23 15:55:53 -0500 | [diff] [blame] | 87 | Radius Authentication |
| 88 | [Documentation] Radius Authentication |
Gilles Depatie | 493ea24 | 2019-05-21 14:38:08 -0400 | [diff] [blame] | 89 | ... This test attempts to perform a Radius Authentication from the RG in the case |
| 90 | ... of the 'ponsim' simtype. It uses the wpa_supplicant app to authenticate using EAPOL. |
Gilles Depatie | a85fe81 | 2019-01-23 15:55:53 -0500 | [diff] [blame] | 91 | ... We then verify the generated log file confirming all the authentication steps |
Gilles Depatie | 493ea24 | 2019-05-21 14:38:08 -0400 | [diff] [blame] | 92 | ... In the case where the simtype is 'bbsim' we simply verify that all ONUs have |
| 93 | ... authenticated. We do this by executing the 'aaa-users command on onos |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 94 | A Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR} |
Gilles Depatie | 493ea24 | 2019-05-21 14:38:08 -0400 | [diff] [blame] | 95 | A Configure ${ONU_COUNT} |
| 96 | Run Keyword If '${SIMTYPE}' == 'ponsim' Ponsim Authentication Steps |
| 97 | ... ELSE IF '${SIMTYPE}' == 'bbsim' BBSim Authentication Verification Step |
Gilles Depatie | a85fe81 | 2019-01-23 15:55:53 -0500 | [diff] [blame] | 98 | |
Gilles Depatie | 88c281a | 2019-07-30 16:17:03 -0400 | [diff] [blame] | 99 | Dhcp IP Address Assignment |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 100 | [Documentation] DHCP assigned IP Address |
Gilles Depatie | 88c281a | 2019-07-30 16:17:03 -0400 | [diff] [blame] | 101 | ... In the case where the simtype is 'ponsim' we do the following: |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 102 | ... A DHCP server is configured and Activated on Onos. We need to change |
| 103 | ... the Firewall rules so as to allow packets to flow between RG and OLT/ONU |
| 104 | ... We also must add a second DHCP flow rule in onos in the direction from NNI |
| 105 | ... by calling 'add subscriber access' on onos. We then deassign the default |
| 106 | ... IP address granted to RG upon instantiating the RG pod. Finally we invoke |
| 107 | ... 'dhclient' on RG to request a DHCP IP address. |
Gilles Depatie | 88c281a | 2019-07-30 16:17:03 -0400 | [diff] [blame] | 108 | ... In the case where the symtype is 'bbsim' we simply confirm that all ONUs |
| 109 | ... were assigned an IP address. This happens automatically once all ONUs have |
| 110 | ... been authenticated and the DHCP requests transition between the bbsim |
| 111 | ... dhclient, dhcp server via the dhcpl2relay |
Kailash | 3a9b20e | 2019-08-21 07:26:31 -0700 | [diff] [blame] | 112 | [Tags] nc |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 113 | H Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR} |
Gilles Depatie | 88c281a | 2019-07-30 16:17:03 -0400 | [diff] [blame] | 114 | H Configure ${ONU_COUNT} |
| 115 | Run Keyword If '${SIMTYPE}' == 'ponsim' Ponsim DHCP Steps |
| 116 | ... ELSE IF '${SIMTYPE}' == 'bbsim' BBSim DHCP Verification Step |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 117 | |
Gilles Depatie | ed99efe | 2019-03-12 16:12:26 -0400 | [diff] [blame] | 118 | Unicast flow setup ctag/stag assignment |
| 119 | [Documentation] Unicast ctag/stag assignment |
| 120 | ... We call Ping from RG to a non-existant IP address an we ignore the |
| 121 | ... Destination Host Unreachable message. We then invoke tcpdump on 'pon1' |
| 122 | ... network looking for ARP request from RG IP address. These packets should |
| 123 | ... be double tagged with different s and c Tags but matching tag configuration |
| 124 | ... in sadis entry. |
Gilles Depatie | ea42371 | 2019-04-12 16:39:12 -0400 | [diff] [blame] | 125 | [Tags] ponsim |
Gilles Depatie | ed99efe | 2019-03-12 16:12:26 -0400 | [diff] [blame] | 126 | U Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR} |
Gilles Depatie | ea42371 | 2019-04-12 16:39:12 -0400 | [diff] [blame] | 127 | U Configure ${ONU_TYPE} ${ONU_COUNT} |
| 128 | Read Sadis Entries From Sadis Json |
| 129 | Retrieve Onu Serial Numbers |
| 130 | Manage Onu Testing |
Gilles Depatie | ed99efe | 2019-03-12 16:12:26 -0400 | [diff] [blame] | 131 | |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 132 | *** Keywords *** |
| 133 | Start Voltha |
| 134 | [Documentation] Start Voltha infrastructure to run test(s). This includes starting all |
Gilles Depatie | 84cb1e7 | 2018-10-26 12:41:33 -0400 | [diff] [blame] | 135 | ... Kubernetes Pods and start collection of logs. PonsimV2 has now been |
| 136 | ... containerized and does not need to be managed separately |
Gilles Depatie | 493ea24 | 2019-05-21 14:38:08 -0400 | [diff] [blame] | 137 | ... Initialize working DIRs as well as Simtype specific variables. We also |
| 138 | ... setup Freeradius and restart AAA app in onos in preparation for |
| 139 | ... authentication test case |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 140 | ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR} Dir Init ${LOG_DIR} |
Gilles Depatie | a85fe81 | 2019-01-23 15:55:53 -0500 | [diff] [blame] | 141 | Set Suite Variable ${ROOT_DIR} |
| 142 | Set Suite Variable ${VOLTHA_DIR} |
| 143 | Set Suite Variable ${LOG_DIR} |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 144 | V Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR} |
Gilles Depatie | 493ea24 | 2019-05-21 14:38:08 -0400 | [diff] [blame] | 145 | ${OLT_TYPE} ${ONU_TYPE} ${OLT_HOST_IP} ${ONU_COUNT} Simtype Init ${SIMTYPE} |
Gilles Depatie | ea42371 | 2019-04-12 16:39:12 -0400 | [diff] [blame] | 146 | Set Suite Variable ${OLT_TYPE} |
| 147 | Set Suite Variable ${ONU_TYPE} |
| 148 | Set Suite Variable ${OLT_HOST_IP} |
| 149 | Set Suite Variable ${ONU_COUNT} |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 150 | Stop Voltha |
Gilles Depatie | 493ea24 | 2019-05-21 14:38:08 -0400 | [diff] [blame] | 151 | Start All Pods ${SIMTYPE} |
Kailash | 2da848e | 2018-11-13 10:58:53 -0800 | [diff] [blame] | 152 | Sleep 60 |
Gilles Depatie | ea42371 | 2019-04-12 16:39:12 -0400 | [diff] [blame] | 153 | ${pod_status} Run kubectl get pods --all-namespaces |
| 154 | Log To Console \n${pod_status}\n |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 155 | Alter Onos Net Cfg |
Gilles Depatie | c9a26cf | 2019-05-10 15:43:12 -0400 | [diff] [blame] | 156 | Discover Freeradius Pod Name |
| 157 | Discover Freeradius Ip Addr |
| 158 | Prepare Current Freeradius Ip |
| 159 | Alter Freeradius Ip In Onos AAA Application Configuration |
Gilles Depatie | 493ea24 | 2019-05-21 14:38:08 -0400 | [diff] [blame] | 160 | Deactivate Aaa App In Onos |
| 161 | Sleep 5 |
| 162 | Activate Aaa App In Onos |
Gilles Depatie | c9a26cf | 2019-05-10 15:43:12 -0400 | [diff] [blame] | 163 | |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 164 | Stop Voltha |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 165 | [Documentation] Stop Voltha infrastructure. This includes clearing all installation milestones |
Kailash | 32ce8e5 | 2018-11-13 13:03:36 -0800 | [diff] [blame] | 166 | ... files and stopping all Kubernetes pods |
Kailash | 8ae83ac | 2019-02-11 12:23:52 -0800 | [diff] [blame] | 167 | Collect Pod Logs |
Gilles Depatie | 493ea24 | 2019-05-21 14:38:08 -0400 | [diff] [blame] | 168 | Stop All Pods ${SIMTYPE} |
| 169 | Reset Kube Adm ${SIMTYPE} |
| 170 | |
| 171 | Ponsim Authentication Steps |
| 172 | [Documentation] List of steps required to run manual Authentication from RG |
| 173 | Execute Authentication On RG |
| 174 | Authentication Should Have Started |
| 175 | Authentication Should Have Completed |
| 176 | Authentication Should Have Disconnected |
| 177 | Authentication Should Have Terminated |
| 178 | |
| 179 | BBSim Authentication Verification Step |
| 180 | [Documentation] List of steps to verify that all BBSim ONUs have successfully authenticated |
Kailash | f747d2c | 2019-05-23 11:00:48 -0700 | [diff] [blame] | 181 | Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Should Have All Onus Authenticated |
| 182 | |
| 183 | Validate Number of Devices |
Gilles Depatie | 88c281a | 2019-07-30 16:17:03 -0400 | [diff] [blame] | 184 | [Documentation] Validate the number of expected onus to be activated |
Kailash | f747d2c | 2019-05-23 11:00:48 -0700 | [diff] [blame] | 185 | Query Devices After Enabling |
| 186 | Status Should Be Success After Enable Command |
| 187 | Check Olt Fields After Enabling |
| 188 | Check Onu Fields After Enabling |
Gilles Depatie | 88c281a | 2019-07-30 16:17:03 -0400 | [diff] [blame] | 189 | |
| 190 | Ponsim DHCP Steps |
| 191 | [Documentation] List of steps required to run DHCP IP Address Assignment on RG |
| 192 | Set Firewall Rules |
| 193 | Discover Authorized Users |
| 194 | Extract Authorized User Device Id And Port Number |
| 195 | Add Onu Bound Dhcp Flows |
| 196 | Should Now Have Two Dhcp Flows |
| 197 | Add Dhcp Server Configuration Data In Onos |
| 198 | Activate Dhcp Server In Onos |
| 199 | Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Query For Default Ip On Rg |
| 200 | De Assign Default Ip On Rg |
| 201 | Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Assign Dhcp Ip Addr To Rg |
| 202 | Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Should Have Dhcp Assigned Ip |
| 203 | |
| 204 | BBSim DHCP Verification Step |
| 205 | [Documentation] Validate that all ONUs were assigned an IP address |
Kailash | 3a9b20e | 2019-08-21 07:26:31 -0700 | [diff] [blame] | 206 | Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Should Have Ips Assigned To All Onus |