blob: c8c79e2d8c32308c75992cc988ab0008d9838f4f [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}
103 FOR ${I} IN RANGE 0 ${num_onus}
104 ${src}= Set Variable ${hosts.src[${I}]}
105 ${dst}= Set Variable ${hosts.dst[${I}]}
106 ${onu_device_id}= Get Device ID From SN ${src['onu']}
107 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
108 ... ${of_id}
109 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE
110 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
111 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
112 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
113 #Verify that ping workss fine again
TorstenThieme754fec72020-02-18 07:24:46 +0000114 Run Keyword If ${has_dataplane}
115 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
Hema93762cf2020-01-29 19:59:28 +0530116 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
117 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}}
118 Run Keyword and Ignore Error Collect Logs
119 END
120
121
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800122Test Disable and Enable ONU
123 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
124 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
125 ... Perform disable on the ONUs and validate that the pings do not succeed
126 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800127 [Tags] functional DisableEnableONU released
Andy Bavierabeba262020-02-07 16:22:16 -0700128 [Setup] Run Keywords Announce Message START TEST DisableEnableONU
129 ... AND Start Logging DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700130 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700131 ... AND Stop Logging DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700132 ... AND Announce Message END TEST DisableEnableONU
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800133 FOR ${I} IN RANGE 0 ${num_onus}
134 ${src}= Set Variable ${hosts.src[${I}]}
135 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800136 ${onu_device_id}= Get Device ID From SN ${src['onu']}
137 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
138 ... ${of_id}
139 Disable Device ${onu_device_id}
Andy Bavier46c8be32020-01-21 10:06:27 -0700140 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700141 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
142 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700143 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
144 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800145 Enable Device ${onu_device_id}
146 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
147 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
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 Bavierabeba262020-02-07 16:22:16 -0700162 [Setup] Run Keywords Announce Message START TEST SubAddDelete
163 ... AND Start Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700164 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700165 ... AND Stop Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700166 ... AND Announce Message END TEST SubAddDelete
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800167 FOR ${I} IN RANGE 0 ${num_onus}
168 ${src}= Set Variable ${hosts.src[${I}]}
169 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800170 ${onu_device_id}= Get Device ID From SN ${src['onu']}
171 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
172 ... ${of_id}
173 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
174 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
175 Sleep 10s
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']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800180 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
181 ... ${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
184 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700185 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
186 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700187 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
188 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
189 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
190 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800191 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800192
suraj gourd5cfdbb2019-12-13 12:44:55 +0000193Check DHCP attempt fails when subscriber is not added
194 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
195 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700196 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800197 [Tags] functional SubsRemoveDHCP released
Andy Bavierabeba262020-02-07 16:22:16 -0700198 [Setup] Run Keywords Announce Message START TEST SubsRemoveDHCP
199 ... AND Start Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700200 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700201 ... AND Stop Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700202 ... AND Announce Message END TEST SubsRemoveDHCP
suraj gourd5cfdbb2019-12-13 12:44:55 +0000203 FOR ${I} IN RANGE 0 ${num_onus}
204 ${src}= Set Variable ${hosts.src[${I}]}
205 ${dst}= Set Variable ${hosts.dst[${I}]}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700206 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000207 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
208 ... ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800209 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']}
210 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
211 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
212 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000213 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
214 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri8f1d3062020-02-28 11:57:37 -0800215 Sleep 15s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800216 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
217 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700218 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
219 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
220 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
221 Run Keyword And Ignore Error Login And Run Command On Remote System
222 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800223 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000224 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
225 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
226 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
227 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
228 ... ${dst['container_name']}
229 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
230 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
231 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
232 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
233 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
234 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
235 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800236 Run Keyword and Ignore Error Collect Logs
237 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800238
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800239Test Disable and Enable ONU scenario for ATT workflow
240 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
241 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
242 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700243 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
244 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800245 ... VOL-2284
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800246 [Tags] functional ATT_DisableEnableONU released
Andy Bavierabeba262020-02-07 16:22:16 -0700247 [Setup] Run Keywords Announce Message START TEST ATT_DisableEnableONU
248 ... AND Start Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700249 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700250 ... AND Stop Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700251 ... AND Announce Message END TEST ATT_DisableEnableONU
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800252 FOR ${I} IN RANGE 0 ${num_onus}
253 ${src}= Set Variable ${hosts.src[${I}]}
254 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800255 ${onu_device_id}= Get Device ID From SN ${src['onu']}
256 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
257 ... ${of_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800258 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
259 ... Verify ONU Port Is Enabled ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800260 Disable Device ${onu_device_id}
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800261 Sleep 5s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800262 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
263 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700264 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
265 ... Wait Until Keyword Succeeds 60s 2s Check Ping
266 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
267 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800268 ... ELSE sleep 60s
269 Enable Device ${onu_device_id}
270 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip}
271 ... ${ONOS_SSH_PORT} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700272 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
273 ... Validate Authentication After Reassociate True
274 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800275 ... ${src['container_type']} ${src['container_name']}
276 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700277 ... ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800278 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
279 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
280 Sleep 10s
281 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700282 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800283 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
284 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
285 ... ${dst['container_name']}
286 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
287 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800288 Run Keyword and Ignore Error Collect Logs
suraj gourd5cfdbb2019-12-13 12:44:55 +0000289 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000290
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800291Delete OLT, ReAdd OLT and Perform Sanity Test
292 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
293 ... Disable and Delete the OLT
294 ... Create/Enable the same OLT again
295 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800296 [Tags] functional DeleteOLT released
Andy Bavierabeba262020-02-07 16:22:16 -0700297 [Setup] Run Keywords Announce Message START TEST DeleteOLT
298 ... AND Start Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700299 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700300 ... AND Stop Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700301 ... AND Announce Message END TEST DeleteOLT
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800302 Run Keyword If ${has_dataplane} Clean Up Linux
303 Run Keyword If ${has_dataplane} Delete Device and Verify
304 Run Keyword and Ignore Error Collect Logs
305 # Recreate the OLT
306 Run Keyword If ${has_dataplane} Setup
307 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800308
Hema783279b2020-01-22 15:37:37 +0530309Test disable ONUs and OLT then delete ONUs and OLT
310 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
311 ... This TC is to confirm that ONU removal is not impacting OLT
312 ... Devices will be removed during the execution of this TC
313 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800314 [Tags] functional VOL-2354 DisableDeleteONUandOLT released
Andy Bavierabeba262020-02-07 16:22:16 -0700315 [Setup] Run Keywords Announce Message START TEST DisableDeleteONUandOLT
316 ... AND Start Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700317 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700318 ... AND Stop Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700319 ... AND Announce Message END TEST DisableDeleteONUandOLT
Suchitra Vemuriba4f3712020-01-24 16:18:26 -0800320 ${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Hema783279b2020-01-22 15:37:37 +0530321 FOR ${I} IN RANGE 0 ${num_onus}
322 ${src}= Set Variable ${hosts.src[${I}]}
323 ${dst}= Set Variable ${hosts.dst[${I}]}
324 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800325 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
326 ... Validate Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530327 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800328 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
329 ... Validate OLT Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530330 ... REACHABLE ${olt_serial_number}
331 ${rc} ${output}= Run and Return Rc and Output
332 ... ${VOLTCTL_CONFIG}; voltctl device disable ${onu_device_id}
333 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800334 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
335 ... Validate Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530336 ... REACHABLE ${src['onu']} onu=false
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800337 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
338 ... Validate OLT Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530339 ... REACHABLE ${olt_serial_number}
340 END
341 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
342 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800343 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
344 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
Hema783279b2020-01-22 15:37:37 +0530345 ... ${olt_serial_number}
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']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800350 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
351 ... Validate Device DISABLED DISCOVERED
352 ... UNREACHABLE ${src['onu']} onu=false
Hema783279b2020-01-22 15:37:37 +0530353 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device delete ${onu_device_id}
354 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800355 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
356 ... Validate OLT Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530357 ... REACHABLE ${olt_serial_number}
358 END
359 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device delete ${olt_device_id}
360 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800361 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
David Bainbridgef81cd642019-11-20 00:14:47 +0000362
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800363Validate authentication on a disabled ONU
suraj gour472da1c2020-02-25 05:44:51 +0000364 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
365 ... Perform disable on the ONUs and validate that the authentication do not succeed
366 ... Perform enable on the ONUs and validate that authentication successful
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800367 [Tags] functional DisableONU_AuthCheck
368 # Creates Devices in the Setup
369 [Setup] Run Keywords Announce Message START TEST DisableDeleteONUandOLT
370 ... AND Start Logging DisableONU_AuthCheck
371 ... AND Setup
372 [Teardown] Run Keywords Collect Logs
373 ... AND Stop Logging DisableONU_AuthCheck
374 ... AND Announce Message END TEST DisableONU_AuthCheck
375 ... AND Delete Device and Verify
376 Run Keyword and Ignore Error Collect Logs
377 Run Keyword If ${has_dataplane} Clean Up Linux
378 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
379 Clean WPA Process
suraj gour472da1c2020-02-25 05:44:51 +0000380 FOR ${I} IN RANGE 0 ${num_onus}
381 ${src}= Set Variable ${hosts.src[${I}]}
382 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800383 Run Keyword and Ignore Error Collect Logs
suraj gour472da1c2020-02-25 05:44:51 +0000384 ${onu_device_id}= Get Device ID From SN ${src['onu']}
385 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
386 ... ${of_id}
387 Disable Device ${onu_device_id}
388 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
389 ... REACHABLE ${src['onu']} onu=false
Andy Bavier84834d42020-02-25 13:49:50 -0700390 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
391 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800392 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication False
393 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700394 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800395 Enable Device ${onu_device_id}
396 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
397 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
398 Run Keyword and Ignore Error Collect Logs
399 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
400 ... ENABLED ACTIVE REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
401 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
402 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700403 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
suraj gour472da1c2020-02-25 05:44:51 +0000404 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
405 END
406 Run Keyword and Ignore Error Collect Logs
407
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800408
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700409*** Keywords ***
410Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700411 [Documentation] Set up the test suite
412 Common Test Suite Setup
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700413
David Bainbridgef81cd642019-11-20 00:14:47 +0000414Clear All Devices Then Create New Device
415 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000416 # Remove all devices from voltha and nos
417 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000418 # Execute normal test Setup Keyword
419 Setup
420