blob: 24e690d976a1822757601ace68784f93e4a27a79 [file] [log] [blame]
Gilles Depatiec68b3ad2018-08-21 16:29:03 -04001# 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 ***
16Library Process
Kailashf8ff51a2018-11-13 13:49:53 -080017Library OperatingSystem
Gilles Depatiec68b3ad2018-08-21 16:29:03 -040018Library ../common/auto_test.py
19Library ../common/volthaMngr.py
Gilles Depatie84cb1e72018-10-26 12:41:33 -040020Library ../common/preprovisioning.py
Gilles Depatie1be639b2018-12-06 10:51:08 -050021Library ../common/discovery.py
Gilles Depatiea85fe812019-01-23 15:55:53 -050022Library ../common/authentication.py
Gilles Depatie2e683692019-02-22 16:06:52 -050023Library ../common/dhcp.py
Gilles Depatieed99efe2019-03-12 16:12:26 -040024Library ../common/unicast.py
Gilles Depatie84cb1e72018-10-26 12:41:33 -040025Library volthaMngr.VolthaMngr
Kailash32ce8e52018-11-13 13:03:36 -080026Library preprovisioning.Preprovisioning
Gilles Depatie1be639b2018-12-06 10:51:08 -050027Library discovery.Discovery
Gilles Depatiea85fe812019-01-23 15:55:53 -050028Library authentication.Authentication
Gilles Depatie2e683692019-02-22 16:06:52 -050029Library dhcp.DHCP
Gilles Depatieed99efe2019-03-12 16:12:26 -040030Library unicast.Unicast
Gilles Depatie9651e462018-11-21 15:58:33 -050031
Gilles Depatie1be639b2018-12-06 10:51:08 -050032Suite Setup Start Voltha
33Suite Teardown Stop Voltha
Gilles Depatiec68b3ad2018-08-21 16:29:03 -040034
Gilles Depatiec68b3ad2018-08-21 16:29:03 -040035*** Variables ***
Gilles Depatie2e683692019-02-22 16:06:52 -050036${LOG_DIR} /tmp/voltha_test_results
37${ROOT_DIR} ${EMPTY}
38${VOLTHA_DIR} ${EMPTY}
Gilles Depatie2e683692019-02-22 16:06:52 -050039${OLT_PORT_ID} 50060
Gilles Depatieea423712019-04-12 16:39:12 -040040${OLT_TYPE} ${EMPTY}
41${ONU_TYPE} ${EMPTY}
42${OLT_HOST_IP} ${EMPTY}
43${ONU_COUNT} ${EMPTY}
Gilles Depatie493ea242019-05-21 14:38:08 -040044${SIMTYPE} ${EMPTY}
Gilles Depatie2e683692019-02-22 16:06:52 -050045${RETRY_TIMEOUT_60} 60s
46${RETRY_INTERVAL_2} 2s
Gilles Depatiec9a26cf2019-05-10 15:43:12 -040047${PROCEED_TIMEOUT_180} 180s
48
Gilles Depatiec68b3ad2018-08-21 16:29:03 -040049
50*** Test Cases ***
Gilles Depatie1be639b2018-12-06 10:51:08 -050051Olt Pre Provisioning
52 [Documentation] Olt Pre Provisioning
Gilles Depatie84cb1e72018-10-26 12:41:33 -040053 ... 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 Depatie0bf31352019-02-04 13:48:41 -050057 P Set Log Dirs ${LOG_DIR}
Gilles Depatieea423712019-04-12 16:39:12 -040058 P Configure ${OLT_HOST_IP} ${OLT_PORT_ID} ${OLT_TYPE} ${ONU_TYPE} ${ONU_COUNT}
Gilles Depatiec68b3ad2018-08-21 16:29:03 -040059 Preprovision Olt
Gilles Depatie2e683692019-02-22 16:06:52 -050060 Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Query Devices Before Enabling
Gilles Depatie9651e462018-11-21 15:58:33 -050061 Status Should Be Success After Preprovision Command
62 Check Olt Fields Before Enabling
Gilles Depatiec68b3ad2018-08-21 16:29:03 -040063 Enable
Kailashf747d2c2019-05-23 11:00:48 -070064 Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Validate Number of Devices
Gilles Depatiec9a26cf2019-05-10 15:43:12 -040065 Wait Until Keyword Succeeds ${PROCEED_TIMEOUT_180} ${RETRY_INTERVAL_2} Proceed
Gilles Depatieea423712019-04-12 16:39:12 -040066
Gilles Depatie1be639b2018-12-06 10:51:08 -050067Olt Onu Discovery
68 [Documentation] Olt Onu Discovery
69 ... This test covers both Onu Discovery and yet to be developped Olt Discovery
Gilles Depatie2e683692019-02-22 16:06:52 -050070 ... It aims to verify the integrity of all port fields under each discrete device, including
71 ... Logical Device.
Gilles Depatie1be639b2018-12-06 10:51:08 -050072 ... 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 Depatie0bf31352019-02-04 13:48:41 -050075 D Set Log Dirs ${LOG_DIR}
Gilles Depatieea423712019-04-12 16:39:12 -040076 D Configure ${OLT_HOST_IP} ${OLT_TYPE} ${ONU_TYPE} ${ONU_COUNT}
Gilles Depatie1be639b2018-12-06 10:51:08 -050077 Olt Discovery
78 Onu Discovery
Kailasha4d45742019-02-11 14:46:43 -080079 Logical Device
Gilles Depatie82dd2022019-02-19 14:31:33 -050080 Logical Device Ports Should Exist
81 Logical Device Should Have At Least One Flow
Gilles Depatie1be639b2018-12-06 10:51:08 -050082 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 Depatiea85fe812019-01-23 15:55:53 -050087Radius Authentication
88 [Documentation] Radius Authentication
Gilles Depatie493ea242019-05-21 14:38:08 -040089 ... 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 Depatiea85fe812019-01-23 15:55:53 -050091 ... We then verify the generated log file confirming all the authentication steps
Gilles Depatie493ea242019-05-21 14:38:08 -040092 ... 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 Depatie0bf31352019-02-04 13:48:41 -050094 A Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR}
Gilles Depatie493ea242019-05-21 14:38:08 -040095 A Configure ${ONU_COUNT}
96 Run Keyword If '${SIMTYPE}' == 'ponsim' Ponsim Authentication Steps
97 ... ELSE IF '${SIMTYPE}' == 'bbsim' BBSim Authentication Verification Step
Gilles Depatiea85fe812019-01-23 15:55:53 -050098
Gilles Depatie88c281a2019-07-30 16:17:03 -040099Dhcp IP Address Assignment
Gilles Depatie2e683692019-02-22 16:06:52 -0500100 [Documentation] DHCP assigned IP Address
Gilles Depatie88c281a2019-07-30 16:17:03 -0400101 ... In the case where the simtype is 'ponsim' we do the following:
Gilles Depatie2e683692019-02-22 16:06:52 -0500102 ... 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 Depatie88c281a2019-07-30 16:17:03 -0400108 ... 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
Gilles Depatie2e683692019-02-22 16:06:52 -0500112 H Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR}
Gilles Depatie88c281a2019-07-30 16:17:03 -0400113 H Configure ${ONU_COUNT}
114 Run Keyword If '${SIMTYPE}' == 'ponsim' Ponsim DHCP Steps
115 ... ELSE IF '${SIMTYPE}' == 'bbsim' BBSim DHCP Verification Step
Gilles Depatie2e683692019-02-22 16:06:52 -0500116
Gilles Depatieed99efe2019-03-12 16:12:26 -0400117Unicast flow setup ctag/stag assignment
118 [Documentation] Unicast ctag/stag assignment
119 ... We call Ping from RG to a non-existant IP address an we ignore the
120 ... Destination Host Unreachable message. We then invoke tcpdump on 'pon1'
121 ... network looking for ARP request from RG IP address. These packets should
122 ... be double tagged with different s and c Tags but matching tag configuration
123 ... in sadis entry.
Gilles Depatieea423712019-04-12 16:39:12 -0400124 [Tags] ponsim
Gilles Depatieed99efe2019-03-12 16:12:26 -0400125 U Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR}
Gilles Depatieea423712019-04-12 16:39:12 -0400126 U Configure ${ONU_TYPE} ${ONU_COUNT}
127 Read Sadis Entries From Sadis Json
128 Retrieve Onu Serial Numbers
129 Manage Onu Testing
Gilles Depatieed99efe2019-03-12 16:12:26 -0400130
Gilles Depatiec68b3ad2018-08-21 16:29:03 -0400131*** Keywords ***
132Start Voltha
133 [Documentation] Start Voltha infrastructure to run test(s). This includes starting all
Gilles Depatie84cb1e72018-10-26 12:41:33 -0400134 ... Kubernetes Pods and start collection of logs. PonsimV2 has now been
135 ... containerized and does not need to be managed separately
Gilles Depatie493ea242019-05-21 14:38:08 -0400136 ... Initialize working DIRs as well as Simtype specific variables. We also
137 ... setup Freeradius and restart AAA app in onos in preparation for
138 ... authentication test case
Gilles Depatie0bf31352019-02-04 13:48:41 -0500139 ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR} Dir Init ${LOG_DIR}
Gilles Depatiea85fe812019-01-23 15:55:53 -0500140 Set Suite Variable ${ROOT_DIR}
141 Set Suite Variable ${VOLTHA_DIR}
142 Set Suite Variable ${LOG_DIR}
Gilles Depatie0bf31352019-02-04 13:48:41 -0500143 V Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR}
Gilles Depatie493ea242019-05-21 14:38:08 -0400144 ${OLT_TYPE} ${ONU_TYPE} ${OLT_HOST_IP} ${ONU_COUNT} Simtype Init ${SIMTYPE}
Gilles Depatieea423712019-04-12 16:39:12 -0400145 Set Suite Variable ${OLT_TYPE}
146 Set Suite Variable ${ONU_TYPE}
147 Set Suite Variable ${OLT_HOST_IP}
148 Set Suite Variable ${ONU_COUNT}
Gilles Depatiec68b3ad2018-08-21 16:29:03 -0400149 Stop Voltha
Gilles Depatie493ea242019-05-21 14:38:08 -0400150 Start All Pods ${SIMTYPE}
Kailash2da848e2018-11-13 10:58:53 -0800151 Sleep 60
Gilles Depatieea423712019-04-12 16:39:12 -0400152 ${pod_status} Run kubectl get pods --all-namespaces
153 Log To Console \n${pod_status}\n
Gilles Depatie0bf31352019-02-04 13:48:41 -0500154 Alter Onos Net Cfg
Gilles Depatiec9a26cf2019-05-10 15:43:12 -0400155 Discover Freeradius Pod Name
156 Discover Freeradius Ip Addr
157 Prepare Current Freeradius Ip
158 Alter Freeradius Ip In Onos AAA Application Configuration
Gilles Depatie493ea242019-05-21 14:38:08 -0400159 Deactivate Aaa App In Onos
160 Sleep 5
161 Activate Aaa App In Onos
Gilles Depatiec9a26cf2019-05-10 15:43:12 -0400162
Gilles Depatiec68b3ad2018-08-21 16:29:03 -0400163Stop Voltha
Gilles Depatie0bf31352019-02-04 13:48:41 -0500164 [Documentation] Stop Voltha infrastructure. This includes clearing all installation milestones
Kailash32ce8e52018-11-13 13:03:36 -0800165 ... files and stopping all Kubernetes pods
Kailash8ae83ac2019-02-11 12:23:52 -0800166 Collect Pod Logs
Gilles Depatie493ea242019-05-21 14:38:08 -0400167 Stop All Pods ${SIMTYPE}
168 Reset Kube Adm ${SIMTYPE}
169
170Ponsim Authentication Steps
171 [Documentation] List of steps required to run manual Authentication from RG
172 Execute Authentication On RG
173 Authentication Should Have Started
174 Authentication Should Have Completed
175 Authentication Should Have Disconnected
176 Authentication Should Have Terminated
177
178BBSim Authentication Verification Step
179 [Documentation] List of steps to verify that all BBSim ONUs have successfully authenticated
Kailashf747d2c2019-05-23 11:00:48 -0700180 Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Should Have All Onus Authenticated
181
182Validate Number of Devices
Gilles Depatie88c281a2019-07-30 16:17:03 -0400183 [Documentation] Validate the number of expected onus to be activated
Kailashf747d2c2019-05-23 11:00:48 -0700184 Query Devices After Enabling
185 Status Should Be Success After Enable Command
186 Check Olt Fields After Enabling
187 Check Onu Fields After Enabling
Gilles Depatie88c281a2019-07-30 16:17:03 -0400188
189Ponsim DHCP Steps
190 [Documentation] List of steps required to run DHCP IP Address Assignment on RG
191 Set Firewall Rules
192 Discover Authorized Users
193 Extract Authorized User Device Id And Port Number
194 Add Onu Bound Dhcp Flows
195 Should Now Have Two Dhcp Flows
196 Add Dhcp Server Configuration Data In Onos
197 Activate Dhcp Server In Onos
198 Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Query For Default Ip On Rg
199 De Assign Default Ip On Rg
200 Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Assign Dhcp Ip Addr To Rg
201 Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Should Have Dhcp Assigned Ip
202
203BBSim DHCP Verification Step
204 [Documentation] Validate that all ONUs were assigned an IP address
205 Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Should Have Ips Assigned To All Onus