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} |
| 39 | ${ONOS_SSH_PORT} 8101 |
| 40 | ${OLT_IP_ADDR} olt.voltha.svc |
| 41 | ${OLT_PORT_ID} 50060 |
| 42 | ${LOGICAL_TYPE} olt.voltha.svc |
| 43 | ${OLT_TYPE} ponsim_olt |
| 44 | ${ONU_TYPE} ponsim_onu |
| 45 | ${RETRY_TIMEOUT_60} 60s |
| 46 | ${RETRY_INTERVAL_2} 2s |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 47 | |
| 48 | *** Test Cases *** |
Gilles Depatie | 1be639b | 2018-12-06 10:51:08 -0500 | [diff] [blame] | 49 | Olt Pre Provisioning |
| 50 | [Documentation] Olt Pre Provisioning |
Gilles Depatie | 84cb1e7 | 2018-10-26 12:41:33 -0400 | [diff] [blame] | 51 | ... This test preprovisions a ponsim-OLT with given IP address and TCP port |
| 52 | ... and then enables both it and a number of ponsim-ONUs with predefined IP/port |
| 53 | ... information. It then verifies that all the physical and logical devices are ACTIVE |
| 54 | ... and REACHEABLE |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 55 | P Set Log Dirs ${LOG_DIR} |
| 56 | P Configure ${OLT_IP_ADDR} ${OLT_PORT_ID} ${OLT_TYPE} ${ONU_TYPE} |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 57 | Preprovision Olt |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 58 | 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] | 59 | Status Should Be Success After Preprovision Command |
| 60 | Check Olt Fields Before Enabling |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 61 | Enable |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 62 | Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Query Devices After Enabling |
Gilles Depatie | 9651e46 | 2018-11-21 15:58:33 -0500 | [diff] [blame] | 63 | Status Should Be Success After Enable Command |
| 64 | Check Olt Fields After Enabling |
| 65 | Check Onu Fields After Enabling |
Gilles Depatie | 1be639b | 2018-12-06 10:51:08 -0500 | [diff] [blame] | 66 | |
| 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} |
| 76 | D Configure ${LOGICAL_TYPE} ${OLT_TYPE} ${ONU_TYPE} |
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 |
| 89 | ... This test attempts to perform a Radius Authentication from the RG |
| 90 | ... It uses the wpa_supplicant app to authenticate using EAPOL. |
| 91 | ... We then verify the generated log file confirming all the authentication steps |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 92 | A Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR} |
Gilles Depatie | a85fe81 | 2019-01-23 15:55:53 -0500 | [diff] [blame] | 93 | Discover Freeradius Pod Name |
| 94 | Discover Freeradius Ip Addr |
| 95 | Set Current Freeradius Ip In AAA Json |
| 96 | Alter AAA Application Configuration In Onos Using AAA Json |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 97 | Execute Authentication On RG |
Gilles Depatie | a85fe81 | 2019-01-23 15:55:53 -0500 | [diff] [blame] | 98 | Verify Authentication Should Have Started |
| 99 | Verify Authentication Should Have Completed |
| 100 | Verify Authentication Should Have Disconnected |
| 101 | Verify Authentication Should Have Terminated |
| 102 | |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 103 | Dhcp IP Address Assignment on RG |
| 104 | [Documentation] DHCP assigned IP Address |
| 105 | ... A DHCP server is configured and Activated on Onos. We need to change |
| 106 | ... the Firewall rules so as to allow packets to flow between RG and OLT/ONU |
| 107 | ... We also must add a second DHCP flow rule in onos in the direction from NNI |
| 108 | ... by calling 'add subscriber access' on onos. We then deassign the default |
| 109 | ... IP address granted to RG upon instantiating the RG pod. Finally we invoke |
| 110 | ... 'dhclient' on RG to request a DHCP IP address. |
| 111 | H Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR} |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 112 | Set Firewall Rules |
| 113 | Discover Authorized Users |
| 114 | Retrieve Authorized Users Device Id And Port Number |
| 115 | Add Subscriber Access |
| 116 | Should Now Have Two Dhcp Flows |
| 117 | Add Dhcp Server Configuration Data In Onos |
| 118 | Activate Dhcp Server In Onos |
| 119 | Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Query For Default Ip On Rg |
| 120 | De Assign Default Ip On Rg |
| 121 | Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Assign Dhcp Ip Addr To Rg |
| 122 | Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Should Have Dhcp Assigned Ip |
| 123 | |
Gilles Depatie | ed99efe | 2019-03-12 16:12:26 -0400 | [diff] [blame] | 124 | Unicast flow setup ctag/stag assignment |
| 125 | [Documentation] Unicast ctag/stag assignment |
| 126 | ... We call Ping from RG to a non-existant IP address an we ignore the |
| 127 | ... Destination Host Unreachable message. We then invoke tcpdump on 'pon1' |
| 128 | ... network looking for ARP request from RG IP address. These packets should |
| 129 | ... be double tagged with different s and c Tags but matching tag configuration |
| 130 | ... in sadis entry. |
| 131 | U Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR} |
| 132 | Execute Ping Test |
| 133 | Should Have Q In Q Vlan Tagging |
| 134 | Retrieve Stag And Ctag From Sadis Entries |
| 135 | Stag And Ctag Should Match Sadis Entry |
| 136 | |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 137 | *** Keywords *** |
| 138 | Start Voltha |
| 139 | [Documentation] Start Voltha infrastructure to run test(s). This includes starting all |
Gilles Depatie | 84cb1e7 | 2018-10-26 12:41:33 -0400 | [diff] [blame] | 140 | ... Kubernetes Pods and start collection of logs. PonsimV2 has now been |
| 141 | ... containerized and does not need to be managed separately |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 142 | ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR} Dir Init ${LOG_DIR} |
Gilles Depatie | a85fe81 | 2019-01-23 15:55:53 -0500 | [diff] [blame] | 143 | Set Suite Variable ${ROOT_DIR} |
| 144 | Set Suite Variable ${VOLTHA_DIR} |
| 145 | Set Suite Variable ${LOG_DIR} |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 146 | V Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR} |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 147 | Stop Voltha |
Gilles Depatie | 84cb1e7 | 2018-10-26 12:41:33 -0400 | [diff] [blame] | 148 | Start All Pods |
Kailash | 2da848e | 2018-11-13 10:58:53 -0800 | [diff] [blame] | 149 | Sleep 60 |
Kailash | 32ce8e5 | 2018-11-13 13:03:36 -0800 | [diff] [blame] | 150 | ${pod_status} Run kubectl get pods --all-namespaces |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 151 | Log To Console \n ${pod_status} |
| 152 | Alter Onos Net Cfg |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 153 | |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 154 | Stop Voltha |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 155 | [Documentation] Stop Voltha infrastructure. This includes clearing all installation milestones |
Kailash | 32ce8e5 | 2018-11-13 13:03:36 -0800 | [diff] [blame] | 156 | ... files and stopping all Kubernetes pods |
Kailash | 8ae83ac | 2019-02-11 12:23:52 -0800 | [diff] [blame] | 157 | Collect Pod Logs |
Gilles Depatie | 84cb1e7 | 2018-10-26 12:41:33 -0400 | [diff] [blame] | 158 | Stop All Pods |
Kailash | 32ce8e5 | 2018-11-13 13:03:36 -0800 | [diff] [blame] | 159 | Reset Kube Adm |