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 | 84cb1e7 | 2018-10-26 12:41:33 -0400 | [diff] [blame] | 24 | Library volthaMngr.VolthaMngr |
Kailash | 32ce8e5 | 2018-11-13 13:03:36 -0800 | [diff] [blame] | 25 | Library preprovisioning.Preprovisioning |
Gilles Depatie | 1be639b | 2018-12-06 10:51:08 -0500 | [diff] [blame] | 26 | Library discovery.Discovery |
Gilles Depatie | a85fe81 | 2019-01-23 15:55:53 -0500 | [diff] [blame] | 27 | Library authentication.Authentication |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 28 | Library dhcp.DHCP |
Gilles Depatie | 9651e46 | 2018-11-21 15:58:33 -0500 | [diff] [blame] | 29 | |
Gilles Depatie | 1be639b | 2018-12-06 10:51:08 -0500 | [diff] [blame] | 30 | Suite Setup Start Voltha |
| 31 | Suite Teardown Stop Voltha |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 32 | |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 33 | *** Variables *** |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 34 | ${LOG_DIR} /tmp/voltha_test_results |
| 35 | ${ROOT_DIR} ${EMPTY} |
| 36 | ${VOLTHA_DIR} ${EMPTY} |
| 37 | ${ONOS_SSH_PORT} 8101 |
| 38 | ${OLT_IP_ADDR} olt.voltha.svc |
| 39 | ${OLT_PORT_ID} 50060 |
| 40 | ${LOGICAL_TYPE} olt.voltha.svc |
| 41 | ${OLT_TYPE} ponsim_olt |
| 42 | ${ONU_TYPE} ponsim_onu |
| 43 | ${RETRY_TIMEOUT_60} 60s |
| 44 | ${RETRY_INTERVAL_2} 2s |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 45 | |
| 46 | *** Test Cases *** |
Gilles Depatie | 1be639b | 2018-12-06 10:51:08 -0500 | [diff] [blame] | 47 | Olt Pre Provisioning |
| 48 | [Documentation] Olt Pre Provisioning |
Gilles Depatie | 84cb1e7 | 2018-10-26 12:41:33 -0400 | [diff] [blame] | 49 | ... This test preprovisions a ponsim-OLT with given IP address and TCP port |
| 50 | ... and then enables both it and a number of ponsim-ONUs with predefined IP/port |
| 51 | ... information. It then verifies that all the physical and logical devices are ACTIVE |
| 52 | ... and REACHEABLE |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 53 | P Set Log Dirs ${LOG_DIR} |
| 54 | P Configure ${OLT_IP_ADDR} ${OLT_PORT_ID} ${OLT_TYPE} ${ONU_TYPE} |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 55 | Preprovision Olt |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 56 | 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] | 57 | Status Should Be Success After Preprovision Command |
| 58 | Check Olt Fields Before Enabling |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 59 | Enable |
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 After Enabling |
Gilles Depatie | 9651e46 | 2018-11-21 15:58:33 -0500 | [diff] [blame] | 61 | Status Should Be Success After Enable Command |
| 62 | Check Olt Fields After Enabling |
| 63 | Check Onu Fields After Enabling |
Gilles Depatie | 1be639b | 2018-12-06 10:51:08 -0500 | [diff] [blame] | 64 | |
| 65 | Olt Onu Discovery |
| 66 | [Documentation] Olt Onu Discovery |
| 67 | ... 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] | 68 | ... It aims to verify the integrity of all port fields under each discrete device, including |
| 69 | ... Logical Device. |
Gilles Depatie | 1be639b | 2018-12-06 10:51:08 -0500 | [diff] [blame] | 70 | ... It also insures that the peers fields contains device Id entries for the corresponding |
| 71 | ... Olt or Onu device. Functionality to support multiple ONU accomodated |
| 72 | ... 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] | 73 | D Set Log Dirs ${LOG_DIR} |
| 74 | D Configure ${LOGICAL_TYPE} ${OLT_TYPE} ${ONU_TYPE} |
Gilles Depatie | 1be639b | 2018-12-06 10:51:08 -0500 | [diff] [blame] | 75 | Olt Discovery |
| 76 | Onu Discovery |
Kailash | a4d4574 | 2019-02-11 14:46:43 -0800 | [diff] [blame] | 77 | Logical Device |
Gilles Depatie | 82dd202 | 2019-02-19 14:31:33 -0500 | [diff] [blame] | 78 | Logical Device Ports Should Exist |
| 79 | Logical Device Should Have At Least One Flow |
Gilles Depatie | 1be639b | 2018-12-06 10:51:08 -0500 | [diff] [blame] | 80 | Olt Ports Should Be Enabled and Active |
| 81 | Onu Ports Should Be Enabled and Active |
| 82 | Olt Should Have At Least One Flow |
| 83 | Onu Should Have At Least One Flow |
| 84 | |
Gilles Depatie | a85fe81 | 2019-01-23 15:55:53 -0500 | [diff] [blame] | 85 | Radius Authentication |
| 86 | [Documentation] Radius Authentication |
| 87 | ... This test attempts to perform a Radius Authentication from the RG |
| 88 | ... It uses the wpa_supplicant app to authenticate using EAPOL. |
| 89 | ... We then verify the generated log file confirming all the authentication steps |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 90 | A Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR} |
Gilles Depatie | a85fe81 | 2019-01-23 15:55:53 -0500 | [diff] [blame] | 91 | Discover RG Pod Name |
| 92 | Discover Freeradius Pod Name |
| 93 | Discover Freeradius Ip Addr |
| 94 | Set Current Freeradius Ip In AAA Json |
| 95 | Alter AAA Application Configuration In Onos Using AAA Json |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 96 | Execute Authentication On RG |
Gilles Depatie | a85fe81 | 2019-01-23 15:55:53 -0500 | [diff] [blame] | 97 | Verify Authentication Should Have Started |
| 98 | Verify Authentication Should Have Completed |
| 99 | Verify Authentication Should Have Disconnected |
| 100 | Verify Authentication Should Have Terminated |
| 101 | |
Gilles Depatie | 2e68369 | 2019-02-22 16:06:52 -0500 | [diff] [blame] | 102 | Dhcp IP Address Assignment on RG |
| 103 | [Documentation] DHCP assigned IP Address |
| 104 | ... A DHCP server is configured and Activated on Onos. We need to change |
| 105 | ... the Firewall rules so as to allow packets to flow between RG and OLT/ONU |
| 106 | ... We also must add a second DHCP flow rule in onos in the direction from NNI |
| 107 | ... by calling 'add subscriber access' on onos. We then deassign the default |
| 108 | ... IP address granted to RG upon instantiating the RG pod. Finally we invoke |
| 109 | ... 'dhclient' on RG to request a DHCP IP address. |
| 110 | H Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR} |
| 111 | Lookup Rg Pod Name |
| 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 | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 124 | *** Keywords *** |
| 125 | Start Voltha |
| 126 | [Documentation] Start Voltha infrastructure to run test(s). This includes starting all |
Gilles Depatie | 84cb1e7 | 2018-10-26 12:41:33 -0400 | [diff] [blame] | 127 | ... Kubernetes Pods and start collection of logs. PonsimV2 has now been |
| 128 | ... containerized and does not need to be managed separately |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 129 | ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR} Dir Init ${LOG_DIR} |
Gilles Depatie | a85fe81 | 2019-01-23 15:55:53 -0500 | [diff] [blame] | 130 | Set Suite Variable ${ROOT_DIR} |
| 131 | Set Suite Variable ${VOLTHA_DIR} |
| 132 | Set Suite Variable ${LOG_DIR} |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 133 | V Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR} |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 134 | Stop Voltha |
Gilles Depatie | 84cb1e7 | 2018-10-26 12:41:33 -0400 | [diff] [blame] | 135 | Start All Pods |
Kailash | 2da848e | 2018-11-13 10:58:53 -0800 | [diff] [blame] | 136 | Sleep 60 |
Kailash | 32ce8e5 | 2018-11-13 13:03:36 -0800 | [diff] [blame] | 137 | ${pod_status} Run kubectl get pods --all-namespaces |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 138 | Log To Console \n ${pod_status} |
| 139 | Alter Onos Net Cfg |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 140 | |
Gilles Depatie | c68b3ad | 2018-08-21 16:29:03 -0400 | [diff] [blame] | 141 | Stop Voltha |
Gilles Depatie | 0bf3135 | 2019-02-04 13:48:41 -0500 | [diff] [blame] | 142 | [Documentation] Stop Voltha infrastructure. This includes clearing all installation milestones |
Kailash | 32ce8e5 | 2018-11-13 13:03:36 -0800 | [diff] [blame] | 143 | ... files and stopping all Kubernetes pods |
Kailash | 8ae83ac | 2019-02-11 12:23:52 -0800 | [diff] [blame] | 144 | Collect Pod Logs |
Gilles Depatie | 84cb1e7 | 2018-10-26 12:41:33 -0400 | [diff] [blame] | 145 | Stop All Pods |
Kailash | 32ce8e5 | 2018-11-13 13:03:36 -0800 | [diff] [blame] | 146 | Reset Kube Adm |