blob: 0287b97020883b152a5640aead5e587a87fde4dc [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}
Hardik Windlass21807632020-04-14 16:24:55 +0530150 # Verify subscriber access flows are added for the ONU port
151 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
152 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
153 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700154 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
155 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700156 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
157 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
158 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
159 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800160 END
161
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800162Test Subscriber Delete and Add
163 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
164 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700165 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800166 ... Re-add the subscriber and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800167 [Tags] functional SubAddDelete released
Andy Bavierabeba262020-02-07 16:22:16 -0700168 [Setup] Run Keywords Announce Message START TEST SubAddDelete
169 ... AND Start Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700170 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700171 ... AND Stop Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700172 ... AND Announce Message END TEST SubAddDelete
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800173 FOR ${I} IN RANGE 0 ${num_onus}
174 ${src}= Set Variable ${hosts.src[${I}]}
175 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800176 ${onu_device_id}= Get Device ID From SN ${src['onu']}
177 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
178 ... ${of_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800179 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800180 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
181 Sleep 10s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800182 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
183 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700184 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
185 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700186 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
187 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800188 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800189 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
190 Sleep 10s
191 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800192 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
193 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800194 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530195 # Verify subscriber access flows are added for the ONU port
196 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
197 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
198 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700199 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
200 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700201 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
202 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
203 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
204 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800205 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800206
suraj gourd5cfdbb2019-12-13 12:44:55 +0000207Check DHCP attempt fails when subscriber is not added
208 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
209 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700210 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800211 [Tags] functional SubsRemoveDHCP released
Andy Bavierabeba262020-02-07 16:22:16 -0700212 [Setup] Run Keywords Announce Message START TEST SubsRemoveDHCP
213 ... AND Start Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700214 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700215 ... AND Stop Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700216 ... AND Announce Message END TEST SubsRemoveDHCP
suraj gourd5cfdbb2019-12-13 12:44:55 +0000217 FOR ${I} IN RANGE 0 ${num_onus}
218 ${src}= Set Variable ${hosts.src[${I}]}
219 ${dst}= Set Variable ${hosts.dst[${I}]}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700220 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000221 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
222 ... ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800223 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${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 ps -ef | grep dhclient ${src['ip']}
226 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800227 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000228 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri8f1d3062020-02-28 11:57:37 -0800229 Sleep 15s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800230 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
231 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700232 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
233 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
234 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
235 Run Keyword And Ignore Error Login And Run Command On Remote System
236 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800237 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000238 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
239 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
240 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
241 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
242 ... ${dst['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800243 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000244 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800245 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
246 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530247 # Verify subscriber access flows are added for the ONU port
248 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
249 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
250 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000251 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
252 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
253 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
254 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
255 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800256 Run Keyword and Ignore Error Collect Logs
257 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800258
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800259Test Disable and Enable ONU scenario for ATT workflow
260 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
261 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
262 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700263 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
264 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800265 ... VOL-2284
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800266 [Tags] functional ATT_DisableEnableONU released
Andy Bavierabeba262020-02-07 16:22:16 -0700267 [Setup] Run Keywords Announce Message START TEST ATT_DisableEnableONU
268 ... AND Start Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700269 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700270 ... AND Stop Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700271 ... AND Announce Message END TEST ATT_DisableEnableONU
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800272 FOR ${I} IN RANGE 0 ${num_onus}
273 ${src}= Set Variable ${hosts.src[${I}]}
274 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800275 ${onu_device_id}= Get Device ID From SN ${src['onu']}
276 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
277 ... ${of_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800278 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800279 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800280 Disable Device ${onu_device_id}
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800281 Sleep 5s
ubuntu6b6e7d42020-03-02 12:35:42 -0800282 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800283 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700284 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
285 ... Wait Until Keyword Succeeds 60s 2s Check Ping
286 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
287 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800288 ... ELSE sleep 60s
289 Enable Device ${onu_device_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800290 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800291 ... ${ONOS_SSH_PORT} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700292 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
293 ... Validate Authentication After Reassociate True
294 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800295 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800296 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700297 ... ${ONOS_SSH_PORT} ${onu_port}
ubuntu6b6e7d42020-03-02 12:35:42 -0800298 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800299 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
300 Sleep 10s
Hardik Windlass21807632020-04-14 16:24:55 +0530301 # Verify subscriber access flows are added for the ONU port
302 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
303 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
304 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800305 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700306 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800307 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
308 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
309 ... ${dst['container_name']}
310 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800311 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800312 Run Keyword and Ignore Error Collect Logs
suraj gourd5cfdbb2019-12-13 12:44:55 +0000313 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000314
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800315Delete OLT, ReAdd OLT and Perform Sanity Test
316 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
317 ... Disable and Delete the OLT
318 ... Create/Enable the same OLT again
319 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800320 [Tags] functional DeleteOLT released
Andy Bavierabeba262020-02-07 16:22:16 -0700321 [Setup] Run Keywords Announce Message START TEST DeleteOLT
322 ... AND Start Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700323 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700324 ... AND Stop Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700325 ... AND Announce Message END TEST DeleteOLT
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800326 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass480f3e22020-04-02 20:14:14 +0530327 Delete Device and Verify
328 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
329 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800330 Run Keyword and Ignore Error Collect Logs
331 # Recreate the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530332 Setup
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800333 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800334
Hema567f3012020-03-25 00:51:53 +0530335Check Mib State on OLT recreation after ONU, OLT deletion
336 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable,
337 ... Disable and Delete the ONU, Disable and Delete the OLT
338 ... Create/Enable the OLT again and Check for the Mib State of the ONUs
339 [Tags] functional CheckMibState notready
340 [Setup] Run Keywords Announce Message START TEST CheckMibState
341 ... AND Start Logging CheckMibState
342 [Teardown] Run Keywords Collect Logs
343 ... AND Stop Logging CheckMibState
344 ... AND Announce Message END TEST CheckMibState
345 #Disable and Delete the ONU
346 FOR ${I} IN RANGE 0 ${num_onus}
347 ${src}= Set Variable ${hosts.src[${I}]}
348 ${dst}= Set Variable ${hosts.dst[${I}]}
349 ${onu_device_id}= Get Device ID From SN ${src['onu']}
350 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
351 ... ${of_id}
352 Disable Device ${onu_device_id}
353 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
354 Delete Device ${onu_device_id}
355 END
356 #Disable and Delete the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530357 Delete Device and Verify
358 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
359 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
360 # Recreate the OLT
Hema567f3012020-03-25 00:51:53 +0530361 Run Keyword If ${has_dataplane} Sleep 180s
362 ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT}
363 Set Suite Variable ${olt_device_id}
364 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED
365 ... UNKNOWN UNKNOWN ${olt_device_id}
366 Enable Device ${olt_device_id}
367 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
368 ... ${olt_serial_number}
369 #Check for the ONU status and ONU Mib State should be "omci-flows-pushed"
370 FOR ${I} IN RANGE 0 ${num_onus}
371 ${src}= Set Variable ${hosts.src[${I}]}
372 ${dst}= Set Variable ${hosts.dst[${I}]}
373 ${onu_device_id}= Get Device ID From SN ${src['onu']}
374 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
375 ... ${of_id}
376 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE
377 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
378 END
379
Hema783279b2020-01-22 15:37:37 +0530380Test disable ONUs and OLT then delete ONUs and OLT
381 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
382 ... This TC is to confirm that ONU removal is not impacting OLT
383 ... Devices will be removed during the execution of this TC
384 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800385 [Tags] functional VOL-2354 DisableDeleteONUandOLT released
Andy Bavierabeba262020-02-07 16:22:16 -0700386 [Setup] Run Keywords Announce Message START TEST DisableDeleteONUandOLT
387 ... AND Start Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700388 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700389 ... AND Stop Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700390 ... AND Announce Message END TEST DisableDeleteONUandOLT
Suchitra Vemuriba4f3712020-01-24 16:18:26 -0800391 ${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Hema783279b2020-01-22 15:37:37 +0530392 FOR ${I} IN RANGE 0 ${num_onus}
393 ${src}= Set Variable ${hosts.src[${I}]}
394 ${dst}= Set Variable ${hosts.dst[${I}]}
395 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800396 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
397 ... Validate Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530398 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800399 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
400 ... Validate OLT Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530401 ... REACHABLE ${olt_serial_number}
402 ${rc} ${output}= Run and Return Rc and Output
403 ... ${VOLTCTL_CONFIG}; voltctl device disable ${onu_device_id}
404 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800405 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
406 ... Validate Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530407 ... REACHABLE ${src['onu']} onu=false
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800408 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
409 ... Validate OLT Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530410 ... REACHABLE ${olt_serial_number}
411 END
412 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
413 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800414 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
415 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
Hema783279b2020-01-22 15:37:37 +0530416 ... ${olt_serial_number}
417 FOR ${I} IN RANGE 0 ${num_onus}
418 ${src}= Set Variable ${hosts.src[${I}]}
419 ${dst}= Set Variable ${hosts.dst[${I}]}
420 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800421 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
422 ... Validate Device DISABLED DISCOVERED
423 ... UNREACHABLE ${src['onu']} onu=false
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530424 Delete Device ${onu_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800425 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
426 ... Validate OLT Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530427 ... REACHABLE ${olt_serial_number}
428 END
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530429 Delete Device ${olt_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800430 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
Hardik Windlass480f3e22020-04-02 20:14:14 +0530431 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
432 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
David Bainbridgef81cd642019-11-20 00:14:47 +0000433
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800434Validate authentication on a disabled ONU
suraj gour472da1c2020-02-25 05:44:51 +0000435 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
436 ... Perform disable on the ONUs and validate that the authentication do not succeed
437 ... Perform enable on the ONUs and validate that authentication successful
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800438 [Tags] functional DisableONU_AuthCheck
439 # Creates Devices in the Setup
440 [Setup] Run Keywords Announce Message START TEST DisableDeleteONUandOLT
441 ... AND Start Logging DisableONU_AuthCheck
442 ... AND Setup
443 [Teardown] Run Keywords Collect Logs
444 ... AND Stop Logging DisableONU_AuthCheck
445 ... AND Announce Message END TEST DisableONU_AuthCheck
446 ... AND Delete Device and Verify
447 Run Keyword and Ignore Error Collect Logs
448 Run Keyword If ${has_dataplane} Clean Up Linux
449 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
450 Clean WPA Process
suraj gour472da1c2020-02-25 05:44:51 +0000451 FOR ${I} IN RANGE 0 ${num_onus}
452 ${src}= Set Variable ${hosts.src[${I}]}
453 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800454 Run Keyword and Ignore Error Collect Logs
suraj gour472da1c2020-02-25 05:44:51 +0000455 ${onu_device_id}= Get Device ID From SN ${src['onu']}
456 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
457 ... ${of_id}
458 Disable Device ${onu_device_id}
459 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
460 ... REACHABLE ${src['onu']} onu=false
Andy Bavier84834d42020-02-25 13:49:50 -0700461 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
462 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800463 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication False
464 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700465 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800466 Enable Device ${onu_device_id}
467 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
468 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
469 Run Keyword and Ignore Error Collect Logs
470 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
471 ... ENABLED ACTIVE REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
472 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
473 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700474 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
suraj gour472da1c2020-02-25 05:44:51 +0000475 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
476 END
477 Run Keyword and Ignore Error Collect Logs
478
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800479
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700480*** Keywords ***
481Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700482 [Documentation] Set up the test suite
483 Common Test Suite Setup
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700484
David Bainbridgef81cd642019-11-20 00:14:47 +0000485Clear All Devices Then Create New Device
486 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000487 # Remove all devices from voltha and nos
488 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000489 # Execute normal test Setup Keyword
490 Setup
491