blob: 10a9f3427f2d4103e71feef0276f3d0096a67ca7 [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}
44${ADAPTER} ${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
Gilles Depatie2e683692019-02-22 16:06:52 -050064 Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Query Devices After Enabling
Gilles Depatie9651e462018-11-21 15:58:33 -050065 Status Should Be Success After Enable Command
66 Check Olt Fields After Enabling
67 Check Onu Fields After Enabling
Gilles Depatiec9a26cf2019-05-10 15:43:12 -040068 Wait Until Keyword Succeeds ${PROCEED_TIMEOUT_180} ${RETRY_INTERVAL_2} Proceed
Gilles Depatieea423712019-04-12 16:39:12 -040069
Gilles Depatie1be639b2018-12-06 10:51:08 -050070Olt Onu Discovery
71 [Documentation] Olt Onu Discovery
72 ... This test covers both Onu Discovery and yet to be developped Olt Discovery
Gilles Depatie2e683692019-02-22 16:06:52 -050073 ... It aims to verify the integrity of all port fields under each discrete device, including
74 ... Logical Device.
Gilles Depatie1be639b2018-12-06 10:51:08 -050075 ... It also insures that the peers fields contains device Id entries for the corresponding
76 ... Olt or Onu device. Functionality to support multiple ONU accomodated
77 ... The extent of the flow validation is limited to checking whether number of Flows is > 0
Gilles Depatie0bf31352019-02-04 13:48:41 -050078 D Set Log Dirs ${LOG_DIR}
Gilles Depatieea423712019-04-12 16:39:12 -040079 D Configure ${OLT_HOST_IP} ${OLT_TYPE} ${ONU_TYPE} ${ONU_COUNT}
Gilles Depatie1be639b2018-12-06 10:51:08 -050080 Olt Discovery
81 Onu Discovery
Kailasha4d45742019-02-11 14:46:43 -080082 Logical Device
Gilles Depatie82dd2022019-02-19 14:31:33 -050083 Logical Device Ports Should Exist
84 Logical Device Should Have At Least One Flow
Gilles Depatie1be639b2018-12-06 10:51:08 -050085 Olt Ports Should Be Enabled and Active
86 Onu Ports Should Be Enabled and Active
87 Olt Should Have At Least One Flow
88 Onu Should Have At Least One Flow
89
Gilles Depatiea85fe812019-01-23 15:55:53 -050090Radius Authentication
91 [Documentation] Radius Authentication
92 ... This test attempts to perform a Radius Authentication from the RG
93 ... It uses the wpa_supplicant app to authenticate using EAPOL.
94 ... We then verify the generated log file confirming all the authentication steps
Gilles Depatieea423712019-04-12 16:39:12 -040095 [Tags] ponsim
Gilles Depatie0bf31352019-02-04 13:48:41 -050096 A Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR}
Gilles Depatie0bf31352019-02-04 13:48:41 -050097 Execute Authentication On RG
Gilles Depatiea85fe812019-01-23 15:55:53 -050098 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 Depatie2e683692019-02-22 16:06:52 -0500103Dhcp 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.
Gilles Depatieea423712019-04-12 16:39:12 -0400111 [Tags] ponsim
Gilles Depatie2e683692019-02-22 16:06:52 -0500112 H Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR}
Gilles Depatie2e683692019-02-22 16:06:52 -0500113 Set Firewall Rules
114 Discover Authorized Users
115 Retrieve Authorized Users Device Id And Port Number
116 Add Subscriber Access
117 Should Now Have Two Dhcp Flows
118 Add Dhcp Server Configuration Data In Onos
119 Activate Dhcp Server In Onos
120 Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Query For Default Ip On Rg
121 De Assign Default Ip On Rg
122 Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Assign Dhcp Ip Addr To Rg
123 Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Should Have Dhcp Assigned Ip
124
Gilles Depatieed99efe2019-03-12 16:12:26 -0400125Unicast flow setup ctag/stag assignment
126 [Documentation] Unicast ctag/stag assignment
127 ... We call Ping from RG to a non-existant IP address an we ignore the
128 ... Destination Host Unreachable message. We then invoke tcpdump on 'pon1'
129 ... network looking for ARP request from RG IP address. These packets should
130 ... be double tagged with different s and c Tags but matching tag configuration
131 ... in sadis entry.
Gilles Depatieea423712019-04-12 16:39:12 -0400132 [Tags] ponsim
Gilles Depatieed99efe2019-03-12 16:12:26 -0400133 U Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR}
Gilles Depatieea423712019-04-12 16:39:12 -0400134 U Configure ${ONU_TYPE} ${ONU_COUNT}
135 Read Sadis Entries From Sadis Json
136 Retrieve Onu Serial Numbers
137 Manage Onu Testing
Gilles Depatieed99efe2019-03-12 16:12:26 -0400138
Gilles Depatiec68b3ad2018-08-21 16:29:03 -0400139*** Keywords ***
140Start Voltha
141 [Documentation] Start Voltha infrastructure to run test(s). This includes starting all
Gilles Depatie84cb1e72018-10-26 12:41:33 -0400142 ... Kubernetes Pods and start collection of logs. PonsimV2 has now been
143 ... containerized and does not need to be managed separately
Gilles Depatieea423712019-04-12 16:39:12 -0400144 ... Initialize working DIRs as well as Adapter specific variables
Gilles Depatie0bf31352019-02-04 13:48:41 -0500145 ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR} Dir Init ${LOG_DIR}
Gilles Depatiea85fe812019-01-23 15:55:53 -0500146 Set Suite Variable ${ROOT_DIR}
147 Set Suite Variable ${VOLTHA_DIR}
148 Set Suite Variable ${LOG_DIR}
Gilles Depatie0bf31352019-02-04 13:48:41 -0500149 V Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR}
Gilles Depatieea423712019-04-12 16:39:12 -0400150 ${OLT_TYPE} ${ONU_TYPE} ${OLT_HOST_IP} ${ONU_COUNT} Adapter Init ${ADAPTER}
151 Set Suite Variable ${OLT_TYPE}
152 Set Suite Variable ${ONU_TYPE}
153 Set Suite Variable ${OLT_HOST_IP}
154 Set Suite Variable ${ONU_COUNT}
Gilles Depatiec68b3ad2018-08-21 16:29:03 -0400155 Stop Voltha
Gilles Depatieea423712019-04-12 16:39:12 -0400156 Start All Pods ${ADAPTER}
Kailash2da848e2018-11-13 10:58:53 -0800157 Sleep 60
Gilles Depatieea423712019-04-12 16:39:12 -0400158 ${pod_status} Run kubectl get pods --all-namespaces
159 Log To Console \n${pod_status}\n
Gilles Depatie0bf31352019-02-04 13:48:41 -0500160 Alter Onos Net Cfg
Gilles Depatiec9a26cf2019-05-10 15:43:12 -0400161 Discover Freeradius Pod Name
162 Discover Freeradius Ip Addr
163 Prepare Current Freeradius Ip
164 Alter Freeradius Ip In Onos AAA Application Configuration
165
Gilles Depatiec68b3ad2018-08-21 16:29:03 -0400166Stop Voltha
Gilles Depatie0bf31352019-02-04 13:48:41 -0500167 [Documentation] Stop Voltha infrastructure. This includes clearing all installation milestones
Kailash32ce8e52018-11-13 13:03:36 -0800168 ... files and stopping all Kubernetes pods
Kailash8ae83ac2019-02-11 12:23:52 -0800169 Collect Pod Logs
Gilles Depatieea423712019-04-12 16:39:12 -0400170 Stop All Pods ${ADAPTER}
171 Reset Kube Adm ${ADAPTER}