blob: 77fc1c0f5d2f9757cee86eb7bf42629560cc90d1 [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
74 [Tags] 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']}
87 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED DISCOVERED
88 ... UNREACHABLE ${src['onu']} onu=false
89 #Verify that ping fails
TorstenThieme754fec72020-02-18 07:24:46 +000090 Run Keyword If ${has_dataplane}
91 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
Hema93762cf2020-01-29 19:59:28 +053092 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
93 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}}
94 END
95 #Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
96 Enable Device ${olt_device_id}
97 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
98 ... ${olt_serial_number}
Hemaf64d34c2020-03-25 00:40:17 +053099 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
100 ... PON_OLT ETHERNET_NNI
Hema93762cf2020-01-29 19:59:28 +0530101 FOR ${I} IN RANGE 0 ${num_onus}
102 ${src}= Set Variable ${hosts.src[${I}]}
103 ${dst}= Set Variable ${hosts.dst[${I}]}
104 ${onu_device_id}= Get Device ID From SN ${src['onu']}
105 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
106 ... ${of_id}
107 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE
108 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
109 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800110 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hema93762cf2020-01-29 19:59:28 +0530111 #Verify that ping workss fine again
TorstenThieme754fec72020-02-18 07:24:46 +0000112 Run Keyword If ${has_dataplane}
113 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
Hema93762cf2020-01-29 19:59:28 +0530114 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
115 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}}
116 Run Keyword and Ignore Error Collect Logs
117 END
118
119
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800120Test Disable and Enable ONU
121 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
122 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
123 ... Perform disable on the ONUs and validate that the pings do not succeed
124 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800125 [Tags] functional DisableEnableONU released
Andy Baviere187eda2020-04-20 15:00:02 -0700126 [Setup] Start Logging DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700127 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700128 ... AND Stop Logging DisableEnableONU
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800129 FOR ${I} IN RANGE 0 ${num_onus}
130 ${src}= Set Variable ${hosts.src[${I}]}
131 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800132 ${onu_device_id}= Get Device ID From SN ${src['onu']}
133 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
134 ... ${of_id}
135 Disable Device ${onu_device_id}
Andy Bavier46c8be32020-01-21 10:06:27 -0700136 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
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 False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
140 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800141 Enable Device ${onu_device_id}
142 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800143 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530144 # Verify subscriber access flows are added for the ONU port
145 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
146 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
147 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700148 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
149 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700150 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
151 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
152 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
153 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800154 END
155
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800156Test Subscriber Delete and Add
157 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
158 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700159 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800160 ... Re-add the subscriber and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800161 [Tags] functional SubAddDelete released
Andy Baviere187eda2020-04-20 15:00:02 -0700162 [Setup] Start Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700163 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700164 ... AND Stop Logging SubAddDelete
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800165 FOR ${I} IN RANGE 0 ${num_onus}
166 ${src}= Set Variable ${hosts.src[${I}]}
167 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800168 ${onu_device_id}= Get Device ID From SN ${src['onu']}
169 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
170 ... ${of_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800171 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800172 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
173 Sleep 10s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800174 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
175 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700176 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
177 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700178 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
179 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800180 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800181 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
182 Sleep 10s
183 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800184 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
185 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800186 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530187 # Verify subscriber access flows are added for the ONU port
188 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
189 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
190 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700191 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
192 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700193 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
194 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
195 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
196 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800197 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800198
suraj gourd5cfdbb2019-12-13 12:44:55 +0000199Check DHCP attempt fails when subscriber is not added
200 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
201 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700202 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800203 [Tags] functional SubsRemoveDHCP released
Andy Baviere187eda2020-04-20 15:00:02 -0700204 [Setup] Start Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700205 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700206 ... AND Stop Logging SubsRemoveDHCP
suraj gourd5cfdbb2019-12-13 12:44:55 +0000207 FOR ${I} IN RANGE 0 ${num_onus}
208 ${src}= Set Variable ${hosts.src[${I}]}
209 ${dst}= Set Variable ${hosts.dst[${I}]}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700210 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000211 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
212 ... ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800213 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']}
214 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
215 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
216 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800217 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000218 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri8f1d3062020-02-28 11:57:37 -0800219 Sleep 15s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800220 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
221 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700222 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
223 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
224 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
225 Run Keyword And Ignore Error Login And Run Command On Remote System
226 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800227 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000228 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
229 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
230 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
231 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
232 ... ${dst['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800233 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000234 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800235 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
236 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530237 # Verify subscriber access flows are added for the ONU port
238 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
239 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
240 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000241 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
242 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
243 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
244 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
245 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800246 Run Keyword and Ignore Error Collect Logs
247 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800248
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800249Test Disable and Enable ONU scenario for ATT workflow
250 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
251 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
252 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700253 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
254 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800255 ... VOL-2284
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800256 [Tags] functional ATT_DisableEnableONU released
Andy Baviere187eda2020-04-20 15:00:02 -0700257 [Setup] Start Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700258 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700259 ... AND Stop Logging ATT_DisableEnableONU
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800260 FOR ${I} IN RANGE 0 ${num_onus}
261 ${src}= Set Variable ${hosts.src[${I}]}
262 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800263 ${onu_device_id}= Get Device ID From SN ${src['onu']}
264 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
265 ... ${of_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800266 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800267 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800268 Disable Device ${onu_device_id}
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800269 Sleep 5s
ubuntu6b6e7d42020-03-02 12:35:42 -0800270 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800271 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700272 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
273 ... Wait Until Keyword Succeeds 60s 2s Check Ping
274 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
275 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800276 ... ELSE sleep 60s
277 Enable Device ${onu_device_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800278 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800279 ... ${ONOS_SSH_PORT} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700280 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
281 ... Validate Authentication After Reassociate True
282 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800283 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800284 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700285 ... ${ONOS_SSH_PORT} ${onu_port}
ubuntu6b6e7d42020-03-02 12:35:42 -0800286 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800287 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
288 Sleep 10s
Hardik Windlass21807632020-04-14 16:24:55 +0530289 # Verify subscriber access flows are added for the ONU port
290 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
291 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
292 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800293 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700294 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800295 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
296 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
297 ... ${dst['container_name']}
298 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800299 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800300 Run Keyword and Ignore Error Collect Logs
suraj gourd5cfdbb2019-12-13 12:44:55 +0000301 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000302
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800303Delete OLT, ReAdd OLT and Perform Sanity Test
304 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
305 ... Disable and Delete the OLT
306 ... Create/Enable the same OLT again
307 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800308 [Tags] functional DeleteOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700309 [Setup] Start Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700310 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700311 ... AND Stop Logging DeleteOLT
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800312 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass480f3e22020-04-02 20:14:14 +0530313 Delete Device and Verify
314 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
315 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800316 Run Keyword and Ignore Error Collect Logs
317 # Recreate the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530318 Setup
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800319 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800320
Hema567f3012020-03-25 00:51:53 +0530321Check Mib State on OLT recreation after ONU, OLT deletion
322 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable,
323 ... Disable and Delete the ONU, Disable and Delete the OLT
324 ... Create/Enable the OLT again and Check for the Mib State of the ONUs
325 [Tags] functional CheckMibState notready
Andy Baviere187eda2020-04-20 15:00:02 -0700326 [Setup] Start Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530327 [Teardown] Run Keywords Collect Logs
328 ... AND Stop Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530329 #Disable and Delete the ONU
330 FOR ${I} IN RANGE 0 ${num_onus}
331 ${src}= Set Variable ${hosts.src[${I}]}
332 ${dst}= Set Variable ${hosts.dst[${I}]}
333 ${onu_device_id}= Get Device ID From SN ${src['onu']}
334 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
335 ... ${of_id}
336 Disable Device ${onu_device_id}
337 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
338 Delete Device ${onu_device_id}
339 END
340 #Disable and Delete the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530341 Delete Device and Verify
342 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
343 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
344 # Recreate the OLT
Hema567f3012020-03-25 00:51:53 +0530345 Run Keyword If ${has_dataplane} Sleep 180s
346 ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT}
347 Set Suite Variable ${olt_device_id}
348 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED
349 ... UNKNOWN UNKNOWN ${olt_device_id}
350 Enable Device ${olt_device_id}
351 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
352 ... ${olt_serial_number}
353 #Check for the ONU status and ONU Mib State should be "omci-flows-pushed"
354 FOR ${I} IN RANGE 0 ${num_onus}
355 ${src}= Set Variable ${hosts.src[${I}]}
356 ${dst}= Set Variable ${hosts.dst[${I}]}
357 ${onu_device_id}= Get Device ID From SN ${src['onu']}
358 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
359 ... ${of_id}
360 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE
361 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
362 END
363
Hema783279b2020-01-22 15:37:37 +0530364Test disable ONUs and OLT then delete ONUs and OLT
365 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
366 ... This TC is to confirm that ONU removal is not impacting OLT
367 ... Devices will be removed during the execution of this TC
368 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800369 [Tags] functional VOL-2354 DisableDeleteONUandOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700370 [Setup] Start Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700371 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700372 ... AND Stop Logging DisableDeleteONUandOLT
Suchitra Vemuriba4f3712020-01-24 16:18:26 -0800373 ${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Hema783279b2020-01-22 15:37:37 +0530374 FOR ${I} IN RANGE 0 ${num_onus}
375 ${src}= Set Variable ${hosts.src[${I}]}
376 ${dst}= Set Variable ${hosts.dst[${I}]}
377 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800378 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
379 ... Validate Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530380 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800381 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
382 ... Validate OLT Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530383 ... REACHABLE ${olt_serial_number}
384 ${rc} ${output}= Run and Return Rc and Output
385 ... ${VOLTCTL_CONFIG}; voltctl device disable ${onu_device_id}
386 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800387 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
388 ... Validate Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530389 ... REACHABLE ${src['onu']} onu=false
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800390 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
391 ... Validate OLT Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530392 ... REACHABLE ${olt_serial_number}
393 END
394 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
395 Should Be Equal As Integers ${rc} 0
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 REACHABLE
Hema783279b2020-01-22 15:37:37 +0530398 ... ${olt_serial_number}
399 FOR ${I} IN RANGE 0 ${num_onus}
400 ${src}= Set Variable ${hosts.src[${I}]}
401 ${dst}= Set Variable ${hosts.dst[${I}]}
402 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800403 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
404 ... Validate Device DISABLED DISCOVERED
405 ... UNREACHABLE ${src['onu']} onu=false
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530406 Delete Device ${onu_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800407 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
408 ... Validate OLT Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530409 ... REACHABLE ${olt_serial_number}
410 END
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530411 Delete Device ${olt_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800412 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
Hardik Windlass480f3e22020-04-02 20:14:14 +0530413 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
414 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
David Bainbridgef81cd642019-11-20 00:14:47 +0000415
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800416Validate authentication on a disabled ONU
suraj gour472da1c2020-02-25 05:44:51 +0000417 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
418 ... Perform disable on the ONUs and validate that the authentication do not succeed
419 ... Perform enable on the ONUs and validate that authentication successful
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800420 [Tags] functional DisableONU_AuthCheck
421 # Creates Devices in the Setup
Andy Baviere187eda2020-04-20 15:00:02 -0700422 [Setup] Run Keywords Start Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800423 ... AND Setup
424 [Teardown] Run Keywords Collect Logs
425 ... AND Stop Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800426 ... AND Delete Device and Verify
427 Run Keyword and Ignore Error Collect Logs
428 Run Keyword If ${has_dataplane} Clean Up Linux
429 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
430 Clean WPA Process
suraj gour472da1c2020-02-25 05:44:51 +0000431 FOR ${I} IN RANGE 0 ${num_onus}
432 ${src}= Set Variable ${hosts.src[${I}]}
433 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800434 Run Keyword and Ignore Error Collect Logs
suraj gour472da1c2020-02-25 05:44:51 +0000435 ${onu_device_id}= Get Device ID From SN ${src['onu']}
436 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
437 ... ${of_id}
438 Disable Device ${onu_device_id}
439 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
440 ... REACHABLE ${src['onu']} onu=false
Andy Bavier84834d42020-02-25 13:49:50 -0700441 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
442 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800443 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication False
444 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700445 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800446 Enable Device ${onu_device_id}
447 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
448 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
449 Run Keyword and Ignore Error Collect Logs
450 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
451 ... ENABLED ACTIVE REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
452 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
453 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700454 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
suraj gour472da1c2020-02-25 05:44:51 +0000455 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
456 END
457 Run Keyword and Ignore Error Collect Logs
458
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800459
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700460*** Keywords ***
461Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700462 [Documentation] Set up the test suite
463 Common Test Suite Setup
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700464
David Bainbridgef81cd642019-11-20 00:14:47 +0000465Clear All Devices Then Create New Device
466 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000467 # Remove all devices from voltha and nos
468 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000469 # Execute normal test Setup Keyword
470 Setup
471