blob: 3f2574480bfb155fde272672f301dc575edf5b1f [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 Bavier4a8450e2020-02-04 08:58:37 -070062 [Setup] Run Keywords Announce Message START TEST SanityTest
Andy Bavierabeba262020-02-07 16:22:16 -070063 ... AND Start Logging SanityTest
Andy Bavier4a8450e2020-02-04 08:58:37 -070064 ... AND Setup
65 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -070066 ... AND Stop Logging SanityTest
Andy Bavier4a8450e2020-02-04 08:58:37 -070067 ... AND Announce Message END TEST SanityTest
Suchitra Vemuric5295a32019-12-15 20:32:04 -080068 Run Keyword If ${has_dataplane} Clean Up Linux
Zack Williamsa8fe75a2020-01-10 14:25:27 -070069 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070070
Hema93762cf2020-01-29 19:59:28 +053071Test Disable and Enable OLT
72 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
73 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
74 ... Perform disable on the OLT and validate that the pings do not succeed
75 ... Perform enable on the OLT and validate that the pings are successful
76 [Tags] VOL-2410 DisableEnableOLT notready
Andy Bavierabeba262020-02-07 16:22:16 -070077 [Setup] Run Keywords Announce Message START TEST DisableEnableOLT
78 ... AND Start Logging DisableEnableOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -070079 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -070080 ... AND Stop Logging DisableEnableOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -070081 ... AND Announce Message END TEST DisableEnableOLT
Hema93762cf2020-01-29 19:59:28 +053082 #Disable the OLT and verify the OLT/ONUs are disabled properly
83 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
84 Should Be Equal As Integers ${rc} 0
85 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
86 ... ${olt_serial_number}
87 FOR ${I} IN RANGE 0 ${num_onus}
88 ${src}= Set Variable ${hosts.src[${I}]}
89 ${dst}= Set Variable ${hosts.dst[${I}]}
90 ${onu_device_id}= Get Device ID From SN ${src['onu']}
91 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED DISCOVERED
92 ... UNREACHABLE ${src['onu']} onu=false
93 #Verify that ping fails
TorstenThieme754fec72020-02-18 07:24:46 +000094 Run Keyword If ${has_dataplane}
95 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
Hema93762cf2020-01-29 19:59:28 +053096 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
97 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}}
98 END
99 #Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
100 Enable Device ${olt_device_id}
101 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
102 ... ${olt_serial_number}
Hemaf64d34c2020-03-25 00:40:17 +0530103 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
104 ... PON_OLT ETHERNET_NNI
Hema93762cf2020-01-29 19:59:28 +0530105 FOR ${I} IN RANGE 0 ${num_onus}
106 ${src}= Set Variable ${hosts.src[${I}]}
107 ${dst}= Set Variable ${hosts.dst[${I}]}
108 ${onu_device_id}= Get Device ID From SN ${src['onu']}
109 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
110 ... ${of_id}
111 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE
112 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
113 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800114 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hema93762cf2020-01-29 19:59:28 +0530115 #Verify that ping workss fine again
TorstenThieme754fec72020-02-18 07:24:46 +0000116 Run Keyword If ${has_dataplane}
117 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
Hema93762cf2020-01-29 19:59:28 +0530118 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
119 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}}
120 Run Keyword and Ignore Error Collect Logs
121 END
122
123
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800124Test Disable and Enable ONU
125 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
126 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
127 ... Perform disable on the ONUs and validate that the pings do not succeed
128 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800129 [Tags] functional DisableEnableONU released
Andy Bavierabeba262020-02-07 16:22:16 -0700130 [Setup] Run Keywords Announce Message START TEST DisableEnableONU
131 ... AND Start Logging DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700132 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700133 ... AND Stop Logging DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700134 ... AND Announce Message END TEST DisableEnableONU
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800135 FOR ${I} IN RANGE 0 ${num_onus}
136 ${src}= Set Variable ${hosts.src[${I}]}
137 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800138 ${onu_device_id}= Get Device ID From SN ${src['onu']}
139 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
140 ... ${of_id}
141 Disable Device ${onu_device_id}
Andy Bavier46c8be32020-01-21 10:06:27 -0700142 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700143 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
144 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700145 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
146 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800147 Enable Device ${onu_device_id}
148 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800149 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700150 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
151 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700152 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
153 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
154 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
155 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800156 END
157
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800158Test Subscriber Delete and Add
159 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
160 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700161 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800162 ... Re-add the subscriber and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800163 [Tags] functional SubAddDelete released
Andy Bavierabeba262020-02-07 16:22:16 -0700164 [Setup] Run Keywords Announce Message START TEST SubAddDelete
165 ... AND Start Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700166 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700167 ... AND Stop Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700168 ... AND Announce Message END TEST SubAddDelete
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800169 FOR ${I} IN RANGE 0 ${num_onus}
170 ${src}= Set Variable ${hosts.src[${I}]}
171 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800172 ${onu_device_id}= Get Device ID From SN ${src['onu']}
173 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
174 ... ${of_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800175 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800176 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
177 Sleep 10s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800178 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
179 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
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 False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
183 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800184 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800185 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
186 Sleep 10s
187 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800188 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
189 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800190 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
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 Bavierabeba262020-02-07 16:22:16 -0700204 [Setup] Run Keywords Announce Message START TEST SubsRemoveDHCP
205 ... AND Start Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700206 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700207 ... AND Stop Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700208 ... AND Announce Message END TEST SubsRemoveDHCP
suraj gourd5cfdbb2019-12-13 12:44:55 +0000209 FOR ${I} IN RANGE 0 ${num_onus}
210 ${src}= Set Variable ${hosts.src[${I}]}
211 ${dst}= Set Variable ${hosts.dst[${I}]}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700212 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000213 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
214 ... ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800215 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']}
216 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
217 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
218 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800219 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000220 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri8f1d3062020-02-28 11:57:37 -0800221 Sleep 15s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800222 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
223 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700224 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
225 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
226 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
227 Run Keyword And Ignore Error Login And Run Command On Remote System
228 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800229 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000230 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
231 ... False ${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']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800235 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000236 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800237 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
238 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000239 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
240 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
241 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
242 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
243 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800244 Run Keyword and Ignore Error Collect Logs
245 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800246
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800247Test Disable and Enable ONU scenario for ATT workflow
248 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
249 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
250 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700251 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
252 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800253 ... VOL-2284
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800254 [Tags] functional ATT_DisableEnableONU released
Andy Bavierabeba262020-02-07 16:22:16 -0700255 [Setup] Run Keywords Announce Message START TEST ATT_DisableEnableONU
256 ... AND Start Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700257 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700258 ... AND Stop Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700259 ... AND Announce Message END TEST 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
289 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700290 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800291 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
292 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
293 ... ${dst['container_name']}
294 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800295 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800296 Run Keyword and Ignore Error Collect Logs
suraj gourd5cfdbb2019-12-13 12:44:55 +0000297 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000298
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800299Delete OLT, ReAdd OLT and Perform Sanity Test
300 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
301 ... Disable and Delete the OLT
302 ... Create/Enable the same OLT again
303 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800304 [Tags] functional DeleteOLT released
Andy Bavierabeba262020-02-07 16:22:16 -0700305 [Setup] Run Keywords Announce Message START TEST DeleteOLT
306 ... AND Start Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700307 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700308 ... AND Stop Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700309 ... AND Announce Message END TEST DeleteOLT
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800310 Run Keyword If ${has_dataplane} Clean Up Linux
311 Run Keyword If ${has_dataplane} Delete Device and Verify
312 Run Keyword and Ignore Error Collect Logs
313 # Recreate the OLT
314 Run Keyword If ${has_dataplane} Setup
315 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800316
Hema567f3012020-03-25 00:51:53 +0530317Check Mib State on OLT recreation after ONU, OLT deletion
318 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable,
319 ... Disable and Delete the ONU, Disable and Delete the OLT
320 ... Create/Enable the OLT again and Check for the Mib State of the ONUs
321 [Tags] functional CheckMibState notready
322 [Setup] Run Keywords Announce Message START TEST CheckMibState
323 ... AND Start Logging CheckMibState
324 [Teardown] Run Keywords Collect Logs
325 ... AND Stop Logging CheckMibState
326 ... AND Announce Message END TEST CheckMibState
327 #Disable and Delete the ONU
328 FOR ${I} IN RANGE 0 ${num_onus}
329 ${src}= Set Variable ${hosts.src[${I}]}
330 ${dst}= Set Variable ${hosts.dst[${I}]}
331 ${onu_device_id}= Get Device ID From SN ${src['onu']}
332 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
333 ... ${of_id}
334 Disable Device ${onu_device_id}
335 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
336 Delete Device ${onu_device_id}
337 END
338 #Disable and Delete the OLT
339 Run Keyword If ${has_dataplane} Delete Device and Verify
340 #Recreate the OLT back
341 Run Keyword If ${has_dataplane} Sleep 180s
342 ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT}
343 Set Suite Variable ${olt_device_id}
344 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED
345 ... UNKNOWN UNKNOWN ${olt_device_id}
346 Enable Device ${olt_device_id}
347 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
348 ... ${olt_serial_number}
349 #Check for the ONU status and ONU Mib State should be "omci-flows-pushed"
350 FOR ${I} IN RANGE 0 ${num_onus}
351 ${src}= Set Variable ${hosts.src[${I}]}
352 ${dst}= Set Variable ${hosts.dst[${I}]}
353 ${onu_device_id}= Get Device ID From SN ${src['onu']}
354 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
355 ... ${of_id}
356 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE
357 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
358 END
359
Hema783279b2020-01-22 15:37:37 +0530360Test disable ONUs and OLT then delete ONUs and OLT
361 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
362 ... This TC is to confirm that ONU removal is not impacting OLT
363 ... Devices will be removed during the execution of this TC
364 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800365 [Tags] functional VOL-2354 DisableDeleteONUandOLT released
Andy Bavierabeba262020-02-07 16:22:16 -0700366 [Setup] Run Keywords Announce Message START TEST DisableDeleteONUandOLT
367 ... AND Start Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700368 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700369 ... AND Stop Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700370 ... AND Announce Message END TEST DisableDeleteONUandOLT
Suchitra Vemuriba4f3712020-01-24 16:18:26 -0800371 ${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Hema783279b2020-01-22 15:37:37 +0530372 FOR ${I} IN RANGE 0 ${num_onus}
373 ${src}= Set Variable ${hosts.src[${I}]}
374 ${dst}= Set Variable ${hosts.dst[${I}]}
375 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800376 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
377 ... Validate Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530378 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
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 ${rc} ${output}= Run and Return Rc and Output
383 ... ${VOLTCTL_CONFIG}; voltctl device disable ${onu_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 Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530387 ... REACHABLE ${src['onu']} onu=false
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800388 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
389 ... Validate OLT Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530390 ... REACHABLE ${olt_serial_number}
391 END
392 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
393 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800394 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
395 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
Hema783279b2020-01-22 15:37:37 +0530396 ... ${olt_serial_number}
397 FOR ${I} IN RANGE 0 ${num_onus}
398 ${src}= Set Variable ${hosts.src[${I}]}
399 ${dst}= Set Variable ${hosts.dst[${I}]}
400 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800401 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
402 ... Validate Device DISABLED DISCOVERED
403 ... UNREACHABLE ${src['onu']} onu=false
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530404 Delete Device ${onu_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800405 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
406 ... Validate OLT Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530407 ... REACHABLE ${olt_serial_number}
408 END
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530409 Delete Device ${olt_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800410 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
David Bainbridgef81cd642019-11-20 00:14:47 +0000411
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800412Validate authentication on a disabled ONU
suraj gour472da1c2020-02-25 05:44:51 +0000413 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
414 ... Perform disable on the ONUs and validate that the authentication do not succeed
415 ... Perform enable on the ONUs and validate that authentication successful
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800416 [Tags] functional DisableONU_AuthCheck
417 # Creates Devices in the Setup
418 [Setup] Run Keywords Announce Message START TEST DisableDeleteONUandOLT
419 ... AND Start Logging DisableONU_AuthCheck
420 ... AND Setup
421 [Teardown] Run Keywords Collect Logs
422 ... AND Stop Logging DisableONU_AuthCheck
423 ... AND Announce Message END TEST DisableONU_AuthCheck
424 ... AND Delete Device and Verify
425 Run Keyword and Ignore Error Collect Logs
426 Run Keyword If ${has_dataplane} Clean Up Linux
427 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
428 Clean WPA Process
suraj gour472da1c2020-02-25 05:44:51 +0000429 FOR ${I} IN RANGE 0 ${num_onus}
430 ${src}= Set Variable ${hosts.src[${I}]}
431 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800432 Run Keyword and Ignore Error Collect Logs
suraj gour472da1c2020-02-25 05:44:51 +0000433 ${onu_device_id}= Get Device ID From SN ${src['onu']}
434 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
435 ... ${of_id}
436 Disable Device ${onu_device_id}
437 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
438 ... REACHABLE ${src['onu']} onu=false
Andy Bavier84834d42020-02-25 13:49:50 -0700439 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
440 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800441 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication False
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}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800444 Enable Device ${onu_device_id}
445 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
446 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
447 Run Keyword and Ignore Error Collect Logs
448 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
449 ... ENABLED ACTIVE REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
450 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
451 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700452 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
suraj gour472da1c2020-02-25 05:44:51 +0000453 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
454 END
455 Run Keyword and Ignore Error Collect Logs
456
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800457
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700458*** Keywords ***
459Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700460 [Documentation] Set up the test suite
461 Common Test Suite Setup
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700462
David Bainbridgef81cd642019-11-20 00:14:47 +0000463Clear All Devices Then Create New Device
464 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000465 # Remove all devices from voltha and nos
466 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000467 # Execute normal test Setup Keyword
468 Setup
469