blob: 7671f1a18d9f3febffa7d4037c4a34810566aa14 [file] [log] [blame]
David Bainbridgef81cd642019-11-20 00:14:47 +00001# Copyright 2017 - present Open Networking Foundation
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -07002#
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.
Matteo Scandolo1294aeb2019-09-24 16:20:32 -070014# FIXME Can we use the same test against BBSim and Hardware?
15
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070016*** Settings ***
Zack Williamsec53a1b2019-09-16 15:50:52 -070017Documentation Test various end-to-end scenarios
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070018Suite Setup Setup Suite
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070019Test Setup Setup
20Test Teardown Teardown
Andy Bavierba9866b2019-10-11 07:11:53 -070021Suite Teardown Teardown Suite
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070022Library Collections
23Library String
24Library OperatingSystem
25Library XML
26Library RequestsLibrary
Andy Bavierba9866b2019-10-11 07:11:53 -070027Library ../../libraries/DependencyLibrary.py
Suchitra Vemurib8ed2d52019-09-30 13:22:51 -070028Resource ../../libraries/onos.robot
29Resource ../../libraries/voltctl.robot
David Bainbridgef81cd642019-11-20 00:14:47 +000030Resource ../../libraries/voltha.robot
Suchitra Vemurib8ed2d52019-09-30 13:22:51 -070031Resource ../../libraries/utils.robot
Andy Bavierba9866b2019-10-11 07:11:53 -070032Resource ../../libraries/k8s.robot
Suchitra Vemurib8ed2d52019-09-30 13:22:51 -070033Resource ../../variables/variables.robot
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070034
35*** Variables ***
Zack Williamsec53a1b2019-09-16 15:50:52 -070036${POD_NAME} flex-ocp-cord
37${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
38${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs
39#${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
40${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
41${HELM_CHARTS_DIR} ~/helm-charts
42${VOLTHA_POD_NUM} 8
Zack Williamsa8fe75a2020-01-10 14:25:27 -070043${NAMESPACE} voltha
suraj gourd64356b2019-11-07 13:26:20 +000044# For below variable value, using deployment name as using grep for
45# parsing radius pod name, we can also use full radius pod name
Zack Williamsa8fe75a2020-01-10 14:25:27 -070046${RESTART_POD_NAME} radius
Andy Bavierba9866b2019-10-11 07:11:53 -070047${timeout} 60s
Zack Williamsec53a1b2019-09-16 15:50:52 -070048${of_id} 0
49${logical_id} 0
Andy Bavierba9866b2019-10-11 07:11:53 -070050${has_dataplane} True
Andy Bavierba9866b2019-10-11 07:11:53 -070051${teardown_device} False
Zack Williamsa8fe75a2020-01-10 14:25:27 -070052${scripts} ../../scripts
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070053
Andy Bavierabeba262020-02-07 16:22:16 -070054# Per-test logging on failure is turned off by default; set this variable to enable
55${container_log_dir} ${None}
56
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070057*** Test Cases ***
58Sanity E2E Test for OLT/ONU on POD
59 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
60 ... Validate successful authentication/DHCP/E2E ping for the tech profile that is used
Andy Bavierba9866b2019-10-11 07:11:53 -070061 [Tags] sanity test1
Andy Baviere187eda2020-04-20 15:00:02 -070062 [Setup] Run Keywords Start Logging SanityTest
Andy Bavier4a8450e2020-02-04 08:58:37 -070063 ... AND Setup
64 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -070065 ... AND Stop Logging SanityTest
Suchitra Vemuric5295a32019-12-15 20:32:04 -080066 Run Keyword If ${has_dataplane} Clean Up Linux
Zack Williamsa8fe75a2020-01-10 14:25:27 -070067 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070068
Hema93762cf2020-01-29 19:59:28 +053069Test Disable and Enable OLT
70 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
71 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
72 ... Perform disable on the OLT and validate that the pings do not succeed
73 ... Perform enable on the OLT and validate that the pings are successful
Andrea Campanella3e2f1a02020-04-30 20:23:18 +020074 [Tags] functional VOL-2410 DisableEnableOLT notready
Andy Baviere187eda2020-04-20 15:00:02 -070075 [Setup] Start Logging DisableEnableOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -070076 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -070077 ... AND Stop Logging DisableEnableOLT
Hema93762cf2020-01-29 19:59:28 +053078 #Disable the OLT and verify the OLT/ONUs are disabled properly
79 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
80 Should Be Equal As Integers ${rc} 0
81 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
82 ... ${olt_serial_number}
83 FOR ${I} IN RANGE 0 ${num_onus}
84 ${src}= Set Variable ${hosts.src[${I}]}
85 ${dst}= Set Variable ${hosts.dst[${I}]}
86 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Hardik Windlass7c801e62020-05-04 19:33:21 +053087 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
88 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
Hema93762cf2020-01-29 19:59:28 +053089 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED DISCOVERED
90 ... UNREACHABLE ${src['onu']} onu=false
91 #Verify that ping fails
TorstenThieme754fec72020-02-18 07:24:46 +000092 Run Keyword If ${has_dataplane}
93 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
Hema93762cf2020-01-29 19:59:28 +053094 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
Andrea Campanellaa6e17322020-05-04 14:31:44 +020095 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +053096 # Remove Subscriber Access (To replicate ATT workflow)
97 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
98 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Hema93762cf2020-01-29 19:59:28 +053099 END
100 #Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
101 Enable Device ${olt_device_id}
102 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
103 ... ${olt_serial_number}
Hemaf64d34c2020-03-25 00:40:17 +0530104 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
105 ... PON_OLT ETHERNET_NNI
Hardik Windlass7c801e62020-05-04 19:33:21 +0530106 Run Keyword If ${has_dataplane} Clean Up Linux
107 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Hema93762cf2020-01-29 19:59:28 +0530108
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800109Test Disable and Enable ONU
110 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
111 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
112 ... Perform disable on the ONUs and validate that the pings do not succeed
113 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800114 [Tags] functional DisableEnableONU released
Andy Baviere187eda2020-04-20 15:00:02 -0700115 [Setup] Start Logging DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700116 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700117 ... AND Stop Logging DisableEnableONU
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800118 FOR ${I} IN RANGE 0 ${num_onus}
119 ${src}= Set Variable ${hosts.src[${I}]}
120 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800121 ${onu_device_id}= Get Device ID From SN ${src['onu']}
122 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
123 ... ${of_id}
124 Disable Device ${onu_device_id}
Andy Bavier46c8be32020-01-21 10:06:27 -0700125 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700126 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
127 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700128 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
129 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800130 Enable Device ${onu_device_id}
131 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800132 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530133 # Verify subscriber access flows are added for the ONU port
134 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
135 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
136 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700137 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
138 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700139 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
140 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
141 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
142 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800143 END
144
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800145Test Subscriber Delete and Add
146 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
147 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700148 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800149 ... Re-add the subscriber and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800150 [Tags] functional SubAddDelete released
Andy Baviere187eda2020-04-20 15:00:02 -0700151 [Setup] Start Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700152 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700153 ... AND Stop Logging SubAddDelete
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800154 FOR ${I} IN RANGE 0 ${num_onus}
155 ${src}= Set Variable ${hosts.src[${I}]}
156 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800157 ${onu_device_id}= Get Device ID From SN ${src['onu']}
158 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
159 ... ${of_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800160 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800161 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
162 Sleep 10s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800163 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
164 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700165 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
166 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700167 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
168 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800169 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800170 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
171 Sleep 10s
172 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800173 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
174 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800175 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530176 # Verify subscriber access flows are added for the ONU port
177 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
178 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
179 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700180 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
181 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700182 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
183 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
184 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
185 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800186 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800187
suraj gourd5cfdbb2019-12-13 12:44:55 +0000188Check DHCP attempt fails when subscriber is not added
189 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
190 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700191 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800192 [Tags] functional SubsRemoveDHCP released
Andy Baviere187eda2020-04-20 15:00:02 -0700193 [Setup] Start Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700194 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700195 ... AND Stop Logging SubsRemoveDHCP
suraj gourd5cfdbb2019-12-13 12:44:55 +0000196 FOR ${I} IN RANGE 0 ${num_onus}
197 ${src}= Set Variable ${hosts.src[${I}]}
198 ${dst}= Set Variable ${hosts.dst[${I}]}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700199 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000200 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
201 ... ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800202 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']}
203 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
204 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
205 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800206 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000207 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri8f1d3062020-02-28 11:57:37 -0800208 Sleep 15s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800209 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
210 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700211 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
212 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
213 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
214 Run Keyword And Ignore Error Login And Run Command On Remote System
215 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800216 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000217 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
218 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
219 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
220 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
221 ... ${dst['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800222 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000223 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800224 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
225 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530226 # Verify subscriber access flows are added for the ONU port
227 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
228 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
229 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000230 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
231 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
232 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
233 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
234 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800235 Run Keyword and Ignore Error Collect Logs
236 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800237
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800238Test Disable and Enable ONU scenario for ATT workflow
239 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
240 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
241 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700242 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
243 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800244 ... VOL-2284
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800245 [Tags] functional ATT_DisableEnableONU released
Andy Baviere187eda2020-04-20 15:00:02 -0700246 [Setup] Start Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700247 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700248 ... AND Stop Logging ATT_DisableEnableONU
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800249 FOR ${I} IN RANGE 0 ${num_onus}
250 ${src}= Set Variable ${hosts.src[${I}]}
251 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800252 ${onu_device_id}= Get Device ID From SN ${src['onu']}
253 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
254 ... ${of_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800255 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800256 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800257 Disable Device ${onu_device_id}
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800258 Sleep 5s
ubuntu6b6e7d42020-03-02 12:35:42 -0800259 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800260 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700261 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
262 ... Wait Until Keyword Succeeds 60s 2s Check Ping
263 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
264 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800265 ... ELSE sleep 60s
266 Enable Device ${onu_device_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800267 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800268 ... ${ONOS_SSH_PORT} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700269 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
270 ... Validate Authentication After Reassociate True
271 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800272 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800273 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700274 ... ${ONOS_SSH_PORT} ${onu_port}
ubuntu6b6e7d42020-03-02 12:35:42 -0800275 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800276 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
277 Sleep 10s
Hardik Windlass21807632020-04-14 16:24:55 +0530278 # Verify subscriber access flows are added for the ONU port
279 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
280 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
281 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800282 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700283 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800284 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
285 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
286 ... ${dst['container_name']}
287 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800288 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800289 Run Keyword and Ignore Error Collect Logs
suraj gourd5cfdbb2019-12-13 12:44:55 +0000290 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000291
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800292Delete OLT, ReAdd OLT and Perform Sanity Test
293 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
294 ... Disable and Delete the OLT
295 ... Create/Enable the same OLT again
296 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800297 [Tags] functional DeleteOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700298 [Setup] Start Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700299 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700300 ... AND Stop Logging DeleteOLT
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800301 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass480f3e22020-04-02 20:14:14 +0530302 Delete Device and Verify
303 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
304 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800305 Run Keyword and Ignore Error Collect Logs
306 # Recreate the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530307 Setup
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800308 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800309
Hema567f3012020-03-25 00:51:53 +0530310Check Mib State on OLT recreation after ONU, OLT deletion
311 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable,
312 ... Disable and Delete the ONU, Disable and Delete the OLT
313 ... Create/Enable the OLT again and Check for the Mib State of the ONUs
314 [Tags] functional CheckMibState notready
Andy Baviere187eda2020-04-20 15:00:02 -0700315 [Setup] Start Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530316 [Teardown] Run Keywords Collect Logs
317 ... AND Stop Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530318 #Disable and Delete the ONU
319 FOR ${I} IN RANGE 0 ${num_onus}
320 ${src}= Set Variable ${hosts.src[${I}]}
321 ${dst}= Set Variable ${hosts.dst[${I}]}
322 ${onu_device_id}= Get Device ID From SN ${src['onu']}
323 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
324 ... ${of_id}
325 Disable Device ${onu_device_id}
326 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
327 Delete Device ${onu_device_id}
328 END
329 #Disable and Delete the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530330 Delete Device and Verify
331 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
332 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
333 # Recreate the OLT
Hema567f3012020-03-25 00:51:53 +0530334 Run Keyword If ${has_dataplane} Sleep 180s
335 ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT}
336 Set Suite Variable ${olt_device_id}
337 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED
338 ... UNKNOWN UNKNOWN ${olt_device_id}
339 Enable Device ${olt_device_id}
340 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
341 ... ${olt_serial_number}
342 #Check for the ONU status and ONU Mib State should be "omci-flows-pushed"
343 FOR ${I} IN RANGE 0 ${num_onus}
344 ${src}= Set Variable ${hosts.src[${I}]}
345 ${dst}= Set Variable ${hosts.dst[${I}]}
346 ${onu_device_id}= Get Device ID From SN ${src['onu']}
347 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
348 ... ${of_id}
349 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE
350 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
351 END
352
Hema783279b2020-01-22 15:37:37 +0530353Test disable ONUs and OLT then delete ONUs and OLT
354 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
355 ... This TC is to confirm that ONU removal is not impacting OLT
356 ... Devices will be removed during the execution of this TC
357 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800358 [Tags] functional VOL-2354 DisableDeleteONUandOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700359 [Setup] Start Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700360 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700361 ... AND Stop Logging DisableDeleteONUandOLT
Suchitra Vemuriba4f3712020-01-24 16:18:26 -0800362 ${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Hema783279b2020-01-22 15:37:37 +0530363 FOR ${I} IN RANGE 0 ${num_onus}
364 ${src}= Set Variable ${hosts.src[${I}]}
365 ${dst}= Set Variable ${hosts.dst[${I}]}
366 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800367 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
368 ... Validate Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530369 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800370 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
371 ... Validate OLT Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530372 ... REACHABLE ${olt_serial_number}
373 ${rc} ${output}= Run and Return Rc and Output
374 ... ${VOLTCTL_CONFIG}; voltctl device disable ${onu_device_id}
375 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800376 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
377 ... Validate Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530378 ... REACHABLE ${src['onu']} onu=false
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800379 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
380 ... Validate OLT Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530381 ... REACHABLE ${olt_serial_number}
382 END
383 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
384 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800385 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
386 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
Hema783279b2020-01-22 15:37:37 +0530387 ... ${olt_serial_number}
388 FOR ${I} IN RANGE 0 ${num_onus}
389 ${src}= Set Variable ${hosts.src[${I}]}
390 ${dst}= Set Variable ${hosts.dst[${I}]}
391 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800392 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
393 ... Validate Device DISABLED DISCOVERED
394 ... UNREACHABLE ${src['onu']} onu=false
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530395 Delete Device ${onu_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800396 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
397 ... Validate OLT Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530398 ... REACHABLE ${olt_serial_number}
399 END
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530400 Delete Device ${olt_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800401 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
Hardik Windlass480f3e22020-04-02 20:14:14 +0530402 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
403 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
David Bainbridgef81cd642019-11-20 00:14:47 +0000404
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800405Validate authentication on a disabled ONU
suraj gour472da1c2020-02-25 05:44:51 +0000406 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
407 ... Perform disable on the ONUs and validate that the authentication do not succeed
408 ... Perform enable on the ONUs and validate that authentication successful
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800409 [Tags] functional DisableONU_AuthCheck
410 # Creates Devices in the Setup
Andy Baviere187eda2020-04-20 15:00:02 -0700411 [Setup] Run Keywords Start Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800412 ... AND Setup
413 [Teardown] Run Keywords Collect Logs
414 ... AND Stop Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800415 ... AND Delete Device and Verify
416 Run Keyword and Ignore Error Collect Logs
417 Run Keyword If ${has_dataplane} Clean Up Linux
418 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
419 Clean WPA Process
suraj gour472da1c2020-02-25 05:44:51 +0000420 FOR ${I} IN RANGE 0 ${num_onus}
421 ${src}= Set Variable ${hosts.src[${I}]}
422 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800423 Run Keyword and Ignore Error Collect Logs
suraj gour472da1c2020-02-25 05:44:51 +0000424 ${onu_device_id}= Get Device ID From SN ${src['onu']}
425 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
426 ... ${of_id}
427 Disable Device ${onu_device_id}
428 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
429 ... REACHABLE ${src['onu']} onu=false
Andy Bavier84834d42020-02-25 13:49:50 -0700430 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
431 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800432 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication False
433 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700434 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800435 Enable Device ${onu_device_id}
436 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
437 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
438 Run Keyword and Ignore Error Collect Logs
439 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
440 ... ENABLED ACTIVE REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
441 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
442 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700443 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
suraj gour472da1c2020-02-25 05:44:51 +0000444 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
445 END
446 Run Keyword and Ignore Error Collect Logs
447
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800448
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700449*** Keywords ***
450Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700451 [Documentation] Set up the test suite
452 Common Test Suite Setup
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700453
David Bainbridgef81cd642019-11-20 00:14:47 +0000454Clear All Devices Then Create New Device
455 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000456 # Remove all devices from voltha and nos
457 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000458 # Execute normal test Setup Keyword
459 Setup
460