blob: efa66394c2c97612ef9b820afbb48f2d178a5d17 [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 Depatie84cb1e72018-10-26 12:41:33 -040024Library volthaMngr.VolthaMngr
Kailash32ce8e52018-11-13 13:03:36 -080025Library preprovisioning.Preprovisioning
Gilles Depatie1be639b2018-12-06 10:51:08 -050026Library discovery.Discovery
Gilles Depatiea85fe812019-01-23 15:55:53 -050027Library authentication.Authentication
Gilles Depatie2e683692019-02-22 16:06:52 -050028Library dhcp.DHCP
Gilles Depatie9651e462018-11-21 15:58:33 -050029
Gilles Depatie1be639b2018-12-06 10:51:08 -050030Suite Setup Start Voltha
31Suite Teardown Stop Voltha
Gilles Depatiec68b3ad2018-08-21 16:29:03 -040032
Gilles Depatiec68b3ad2018-08-21 16:29:03 -040033*** Variables ***
Gilles Depatie2e683692019-02-22 16:06:52 -050034${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 Depatiec68b3ad2018-08-21 16:29:03 -040045
46*** Test Cases ***
Gilles Depatie1be639b2018-12-06 10:51:08 -050047Olt Pre Provisioning
48 [Documentation] Olt Pre Provisioning
Gilles Depatie84cb1e72018-10-26 12:41:33 -040049 ... 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 Depatie0bf31352019-02-04 13:48:41 -050053 P Set Log Dirs ${LOG_DIR}
54 P Configure ${OLT_IP_ADDR} ${OLT_PORT_ID} ${OLT_TYPE} ${ONU_TYPE}
Gilles Depatiec68b3ad2018-08-21 16:29:03 -040055 Preprovision Olt
Gilles Depatie2e683692019-02-22 16:06:52 -050056 Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Query Devices Before Enabling
Gilles Depatie9651e462018-11-21 15:58:33 -050057 Status Should Be Success After Preprovision Command
58 Check Olt Fields Before Enabling
Gilles Depatiec68b3ad2018-08-21 16:29:03 -040059 Enable
Gilles Depatie2e683692019-02-22 16:06:52 -050060 Wait Until Keyword Succeeds ${RETRY_TIMEOUT_60} ${RETRY_INTERVAL_2} Query Devices After Enabling
Gilles Depatie9651e462018-11-21 15:58:33 -050061 Status Should Be Success After Enable Command
62 Check Olt Fields After Enabling
63 Check Onu Fields After Enabling
Gilles Depatie1be639b2018-12-06 10:51:08 -050064
65Olt Onu Discovery
66 [Documentation] Olt Onu Discovery
67 ... This test covers both Onu Discovery and yet to be developped Olt Discovery
Gilles Depatie2e683692019-02-22 16:06:52 -050068 ... It aims to verify the integrity of all port fields under each discrete device, including
69 ... Logical Device.
Gilles Depatie1be639b2018-12-06 10:51:08 -050070 ... 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 Depatie0bf31352019-02-04 13:48:41 -050073 D Set Log Dirs ${LOG_DIR}
74 D Configure ${LOGICAL_TYPE} ${OLT_TYPE} ${ONU_TYPE}
Gilles Depatie1be639b2018-12-06 10:51:08 -050075 Olt Discovery
76 Onu Discovery
Kailasha4d45742019-02-11 14:46:43 -080077 Logical Device
Gilles Depatie82dd2022019-02-19 14:31:33 -050078 Logical Device Ports Should Exist
79 Logical Device Should Have At Least One Flow
Gilles Depatie1be639b2018-12-06 10:51:08 -050080 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 Depatiea85fe812019-01-23 15:55:53 -050085Radius 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 Depatie0bf31352019-02-04 13:48:41 -050090 A Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR}
Gilles Depatiea85fe812019-01-23 15:55:53 -050091 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 Depatie0bf31352019-02-04 13:48:41 -050096 Execute Authentication On RG
Gilles Depatiea85fe812019-01-23 15:55:53 -050097 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 Depatie2e683692019-02-22 16:06:52 -0500102Dhcp 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 Depatiec68b3ad2018-08-21 16:29:03 -0400124*** Keywords ***
125Start Voltha
126 [Documentation] Start Voltha infrastructure to run test(s). This includes starting all
Gilles Depatie84cb1e72018-10-26 12:41:33 -0400127 ... Kubernetes Pods and start collection of logs. PonsimV2 has now been
128 ... containerized and does not need to be managed separately
Gilles Depatie0bf31352019-02-04 13:48:41 -0500129 ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR} Dir Init ${LOG_DIR}
Gilles Depatiea85fe812019-01-23 15:55:53 -0500130 Set Suite Variable ${ROOT_DIR}
131 Set Suite Variable ${VOLTHA_DIR}
132 Set Suite Variable ${LOG_DIR}
Gilles Depatie0bf31352019-02-04 13:48:41 -0500133 V Set Log Dirs ${ROOT_DIR} ${VOLTHA_DIR} ${LOG_DIR}
Gilles Depatiec68b3ad2018-08-21 16:29:03 -0400134 Stop Voltha
Gilles Depatie84cb1e72018-10-26 12:41:33 -0400135 Start All Pods
Kailash2da848e2018-11-13 10:58:53 -0800136 Sleep 60
Kailash32ce8e52018-11-13 13:03:36 -0800137 ${pod_status} Run kubectl get pods --all-namespaces
Gilles Depatie0bf31352019-02-04 13:48:41 -0500138 Log To Console \n ${pod_status}
139 Alter Onos Net Cfg
Gilles Depatiec68b3ad2018-08-21 16:29:03 -0400140
Gilles Depatiec68b3ad2018-08-21 16:29:03 -0400141Stop Voltha
Gilles Depatie0bf31352019-02-04 13:48:41 -0500142 [Documentation] Stop Voltha infrastructure. This includes clearing all installation milestones
Kailash32ce8e52018-11-13 13:03:36 -0800143 ... files and stopping all Kubernetes pods
Kailash8ae83ac2019-02-11 12:23:52 -0800144 Collect Pod Logs
Gilles Depatie84cb1e72018-10-26 12:41:33 -0400145 Stop All Pods
Kailash32ce8e52018-11-13 13:03:36 -0800146 Reset Kube Adm