blob: 405a32787f309c2a18f71107188ce8e4fdb0ab95 [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 Vemuri77f7abf2020-06-19 15:52:25 -070034Resource ../../libraries/power_switch.robot
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070035
36*** Variables ***
Zack Williamsec53a1b2019-09-16 15:50:52 -070037${POD_NAME} flex-ocp-cord
38${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
39${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs
40#${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
41${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
42${HELM_CHARTS_DIR} ~/helm-charts
43${VOLTHA_POD_NUM} 8
Zack Williamsa8fe75a2020-01-10 14:25:27 -070044${NAMESPACE} voltha
suraj gourd64356b2019-11-07 13:26:20 +000045# For below variable value, using deployment name as using grep for
46# parsing radius pod name, we can also use full radius pod name
Zack Williamsa8fe75a2020-01-10 14:25:27 -070047${RESTART_POD_NAME} radius
Andy Bavierba9866b2019-10-11 07:11:53 -070048${timeout} 60s
Zack Williamsec53a1b2019-09-16 15:50:52 -070049${of_id} 0
50${logical_id} 0
Andy Bavierba9866b2019-10-11 07:11:53 -070051${has_dataplane} True
Andy Bavierba9866b2019-10-11 07:11:53 -070052${teardown_device} False
Zack Williamsa8fe75a2020-01-10 14:25:27 -070053${scripts} ../../scripts
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070054
Andy Bavierabeba262020-02-07 16:22:16 -070055# Per-test logging on failure is turned off by default; set this variable to enable
56${container_log_dir} ${None}
57
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070058*** Test Cases ***
Suchitra Vemuri77f7abf2020-06-19 15:52:25 -070059Reboot ONUs Physically
60 [Documentation] This test reboots ONUs physically before execution all the tests
61 ... Test case runs only on the PODs that are configured with PowerSwitch that
62 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
63 [Tags] functional PowerSwitch RebootAllONUs
64 [Setup] Start Logging RebootAllONUs
65 [Teardown] Run Keywords Collect Logs
66 ... AND Stop Logging RebootAllONUs
67 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
68 FOR ${I} IN RANGE 0 ${num_onus}
69 ${src}= Set Variable ${hosts.src[${I}]}
70 Disable Switch Outlet ${src['power_switch_port']}
71 Sleep 60s
72 Enable Switch Outlet ${src['power_switch_port']}
73 Sleep 60s
74 END
75
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070076Sanity E2E Test for OLT/ONU on POD
77 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
78 ... Validate successful authentication/DHCP/E2E ping for the tech profile that is used
Andy Bavierba9866b2019-10-11 07:11:53 -070079 [Tags] sanity test1
Andy Bavier4a8450e2020-02-04 08:58:37 -070080 [Setup] Run Keywords Announce Message START TEST SanityTest
Andy Bavierabeba262020-02-07 16:22:16 -070081 ... AND Start Logging SanityTest
Andy Bavier4a8450e2020-02-04 08:58:37 -070082 ... AND Setup
83 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -070084 ... AND Stop Logging SanityTest
Andy Bavier4a8450e2020-02-04 08:58:37 -070085 ... AND Announce Message END TEST SanityTest
Suchitra Vemuric5295a32019-12-15 20:32:04 -080086 Run Keyword If ${has_dataplane} Clean Up Linux
Zack Williamsa8fe75a2020-01-10 14:25:27 -070087 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070088
Hema93762cf2020-01-29 19:59:28 +053089Test Disable and Enable OLT
90 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
91 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
92 ... Perform disable on the OLT and validate that the pings do not succeed
93 ... Perform enable on the OLT and validate that the pings are successful
94 [Tags] VOL-2410 DisableEnableOLT notready
Andy Bavierabeba262020-02-07 16:22:16 -070095 [Setup] Run Keywords Announce Message START TEST DisableEnableOLT
96 ... AND Start Logging DisableEnableOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -070097 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -070098 ... AND Stop Logging DisableEnableOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -070099 ... AND Announce Message END TEST DisableEnableOLT
Hema93762cf2020-01-29 19:59:28 +0530100 #Disable the OLT and verify the OLT/ONUs are disabled properly
101 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
102 Should Be Equal As Integers ${rc} 0
103 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
104 ... ${olt_serial_number}
105 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 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED DISCOVERED
110 ... UNREACHABLE ${src['onu']} onu=false
111 #Verify that ping fails
TorstenThieme754fec72020-02-18 07:24:46 +0000112 Run Keyword If ${has_dataplane}
113 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
Hema93762cf2020-01-29 19:59:28 +0530114 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
115 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}}
116 END
117 #Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
118 Enable Device ${olt_device_id}
119 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
120 ... ${olt_serial_number}
Hemaf64d34c2020-03-25 00:40:17 +0530121 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
122 ... PON_OLT ETHERNET_NNI
Hema93762cf2020-01-29 19:59:28 +0530123 FOR ${I} IN RANGE 0 ${num_onus}
124 ${src}= Set Variable ${hosts.src[${I}]}
125 ${dst}= Set Variable ${hosts.dst[${I}]}
126 ${onu_device_id}= Get Device ID From SN ${src['onu']}
127 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
128 ... ${of_id}
129 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE
130 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
131 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800132 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hema93762cf2020-01-29 19:59:28 +0530133 #Verify that ping workss fine again
TorstenThieme754fec72020-02-18 07:24:46 +0000134 Run Keyword If ${has_dataplane}
135 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
Hema93762cf2020-01-29 19:59:28 +0530136 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
137 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}}
138 Run Keyword and Ignore Error Collect Logs
139 END
140
141
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800142Test Disable and Enable ONU
143 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
144 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
145 ... Perform disable on the ONUs and validate that the pings do not succeed
146 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800147 [Tags] functional DisableEnableONU released
Andy Bavierabeba262020-02-07 16:22:16 -0700148 [Setup] Run Keywords Announce Message START TEST DisableEnableONU
149 ... AND Start Logging DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700150 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700151 ... AND Stop Logging DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700152 ... AND Announce Message END TEST DisableEnableONU
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800153 FOR ${I} IN RANGE 0 ${num_onus}
154 ${src}= Set Variable ${hosts.src[${I}]}
155 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800156 ${onu_device_id}= Get Device ID From SN ${src['onu']}
157 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
158 ... ${of_id}
159 Disable Device ${onu_device_id}
Andy Bavier46c8be32020-01-21 10:06:27 -0700160 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700161 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
162 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700163 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
164 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800165 Enable Device ${onu_device_id}
166 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800167 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700168 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
169 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700170 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
171 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
172 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
173 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800174 END
175
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800176Test Subscriber Delete and Add
177 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
178 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700179 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800180 ... Re-add the subscriber and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800181 [Tags] functional SubAddDelete released
Andy Bavierabeba262020-02-07 16:22:16 -0700182 [Setup] Run Keywords Announce Message START TEST SubAddDelete
183 ... AND Start Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700184 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700185 ... AND Stop Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700186 ... AND Announce Message END TEST SubAddDelete
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800187 FOR ${I} IN RANGE 0 ${num_onus}
188 ${src}= Set Variable ${hosts.src[${I}]}
189 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800190 ${onu_device_id}= Get Device ID From SN ${src['onu']}
191 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
192 ... ${of_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800193 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800194 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
195 Sleep 10s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800196 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
197 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700198 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
199 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700200 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
201 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800202 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800203 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
204 Sleep 10s
205 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800206 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
207 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800208 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700209 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
210 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700211 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
212 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
213 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
214 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800215 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800216
suraj gourd5cfdbb2019-12-13 12:44:55 +0000217Check DHCP attempt fails when subscriber is not added
218 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
219 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700220 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800221 [Tags] functional SubsRemoveDHCP released
Andy Bavierabeba262020-02-07 16:22:16 -0700222 [Setup] Run Keywords Announce Message START TEST SubsRemoveDHCP
223 ... AND Start Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700224 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700225 ... AND Stop Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700226 ... AND Announce Message END TEST SubsRemoveDHCP
suraj gourd5cfdbb2019-12-13 12:44:55 +0000227 FOR ${I} IN RANGE 0 ${num_onus}
228 ${src}= Set Variable ${hosts.src[${I}]}
229 ${dst}= Set Variable ${hosts.dst[${I}]}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700230 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000231 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
232 ... ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800233 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${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 ps -ef | grep dhclient ${src['ip']}
236 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800237 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000238 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri8f1d3062020-02-28 11:57:37 -0800239 Sleep 15s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800240 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
241 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700242 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
243 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
244 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
245 Run Keyword And Ignore Error Login And Run Command On Remote System
246 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800247 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000248 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
249 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
250 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
251 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
252 ... ${dst['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800253 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000254 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800255 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
256 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000257 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
258 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
259 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
260 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
261 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800262 Run Keyword and Ignore Error Collect Logs
263 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800264
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800265Test Disable and Enable ONU scenario for ATT workflow
266 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
267 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
268 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700269 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
270 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800271 ... VOL-2284
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800272 [Tags] functional ATT_DisableEnableONU released
Andy Bavierabeba262020-02-07 16:22:16 -0700273 [Setup] Run Keywords Announce Message START TEST ATT_DisableEnableONU
274 ... AND Start Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700275 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700276 ... AND Stop Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700277 ... AND Announce Message END TEST ATT_DisableEnableONU
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800278 FOR ${I} IN RANGE 0 ${num_onus}
279 ${src}= Set Variable ${hosts.src[${I}]}
280 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800281 ${onu_device_id}= Get Device ID From SN ${src['onu']}
282 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
283 ... ${of_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800284 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Suchitra Vemuri1ed9be72020-06-18 11:22:18 -0700285 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800286 Disable Device ${onu_device_id}
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800287 Sleep 5s
ubuntu6b6e7d42020-03-02 12:35:42 -0800288 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800289 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700290 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
291 ... Wait Until Keyword Succeeds 60s 2s Check Ping
292 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
293 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800294 ... ELSE sleep 60s
295 Enable Device ${onu_device_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800296 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800297 ... ${ONOS_SSH_PORT} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700298 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
299 ... Validate Authentication After Reassociate True
300 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800301 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800302 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700303 ... ${ONOS_SSH_PORT} ${onu_port}
ubuntu6b6e7d42020-03-02 12:35:42 -0800304 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800305 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
306 Sleep 10s
307 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700308 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800309 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
310 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
311 ... ${dst['container_name']}
312 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800313 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800314 Run Keyword and Ignore Error Collect Logs
suraj gourd5cfdbb2019-12-13 12:44:55 +0000315 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000316
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800317Delete OLT, ReAdd OLT and Perform Sanity Test
318 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
319 ... Disable and Delete the OLT
320 ... Create/Enable the same OLT again
321 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800322 [Tags] functional DeleteOLT released
Andy Bavierabeba262020-02-07 16:22:16 -0700323 [Setup] Run Keywords Announce Message START TEST DeleteOLT
324 ... AND Start Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700325 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700326 ... AND Stop Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700327 ... AND Announce Message END TEST DeleteOLT
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800328 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlassb80b25b2020-04-02 20:14:14 +0530329 Delete Device and Verify
330 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
331 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800332 Run Keyword and Ignore Error Collect Logs
333 # Recreate the OLT
Hardik Windlassb80b25b2020-04-02 20:14:14 +0530334 Setup
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800335 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800336
Hema567f3012020-03-25 00:51:53 +0530337Check Mib State on OLT recreation after ONU, OLT deletion
338 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable,
339 ... Disable and Delete the ONU, Disable and Delete the OLT
340 ... Create/Enable the OLT again and Check for the Mib State of the ONUs
341 [Tags] functional CheckMibState notready
342 [Setup] Run Keywords Announce Message START TEST CheckMibState
343 ... AND Start Logging CheckMibState
344 [Teardown] Run Keywords Collect Logs
345 ... AND Stop Logging CheckMibState
346 ... AND Announce Message END TEST CheckMibState
347 #Disable and Delete the ONU
348 FOR ${I} IN RANGE 0 ${num_onus}
349 ${src}= Set Variable ${hosts.src[${I}]}
350 ${dst}= Set Variable ${hosts.dst[${I}]}
351 ${onu_device_id}= Get Device ID From SN ${src['onu']}
352 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
353 ... ${of_id}
354 Disable Device ${onu_device_id}
355 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
356 Delete Device ${onu_device_id}
357 END
358 #Disable and Delete the OLT
Hardik Windlassb80b25b2020-04-02 20:14:14 +0530359 Delete Device and Verify
360 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
361 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
362 # Recreate the OLT
Hema567f3012020-03-25 00:51:53 +0530363 Run Keyword If ${has_dataplane} Sleep 180s
364 ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT}
365 Set Suite Variable ${olt_device_id}
366 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED
367 ... UNKNOWN UNKNOWN ${olt_device_id}
368 Enable Device ${olt_device_id}
369 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
370 ... ${olt_serial_number}
371 #Check for the ONU status and ONU Mib State should be "omci-flows-pushed"
372 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']}
376 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
377 ... ${of_id}
378 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE
379 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
380 END
381
Hema783279b2020-01-22 15:37:37 +0530382Test disable ONUs and OLT then delete ONUs and OLT
383 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
384 ... This TC is to confirm that ONU removal is not impacting OLT
385 ... Devices will be removed during the execution of this TC
386 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800387 [Tags] functional VOL-2354 DisableDeleteONUandOLT released
Andy Bavierabeba262020-02-07 16:22:16 -0700388 [Setup] Run Keywords Announce Message START TEST DisableDeleteONUandOLT
389 ... AND Start Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700390 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700391 ... AND Stop Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700392 ... AND Announce Message END TEST DisableDeleteONUandOLT
Suchitra Vemuriba4f3712020-01-24 16:18:26 -0800393 ${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Hema783279b2020-01-22 15:37:37 +0530394 FOR ${I} IN RANGE 0 ${num_onus}
395 ${src}= Set Variable ${hosts.src[${I}]}
396 ${dst}= Set Variable ${hosts.dst[${I}]}
397 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800398 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
399 ... Validate Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530400 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800401 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
402 ... Validate OLT Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530403 ... REACHABLE ${olt_serial_number}
404 ${rc} ${output}= Run and Return Rc and Output
405 ... ${VOLTCTL_CONFIG}; voltctl device disable ${onu_device_id}
406 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800407 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
408 ... Validate Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530409 ... REACHABLE ${src['onu']} onu=false
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800410 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
411 ... Validate OLT Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530412 ... REACHABLE ${olt_serial_number}
413 END
414 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
415 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800416 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
417 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
Hema783279b2020-01-22 15:37:37 +0530418 ... ${olt_serial_number}
419 FOR ${I} IN RANGE 0 ${num_onus}
420 ${src}= Set Variable ${hosts.src[${I}]}
421 ${dst}= Set Variable ${hosts.dst[${I}]}
422 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800423 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
424 ... Validate Device DISABLED DISCOVERED
425 ... UNREACHABLE ${src['onu']} onu=false
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530426 Delete Device ${onu_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800427 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
428 ... Validate OLT Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530429 ... REACHABLE ${olt_serial_number}
430 END
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530431 Delete Device ${olt_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800432 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
Hardik Windlassb80b25b2020-04-02 20:14:14 +0530433 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
434 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
David Bainbridgef81cd642019-11-20 00:14:47 +0000435
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800436Validate authentication on a disabled ONU
suraj gour472da1c2020-02-25 05:44:51 +0000437 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
438 ... Perform disable on the ONUs and validate that the authentication do not succeed
439 ... Perform enable on the ONUs and validate that authentication successful
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800440 [Tags] functional DisableONU_AuthCheck
441 # Creates Devices in the Setup
442 [Setup] Run Keywords Announce Message START TEST DisableDeleteONUandOLT
443 ... AND Start Logging DisableONU_AuthCheck
444 ... AND Setup
445 [Teardown] Run Keywords Collect Logs
446 ... AND Stop Logging DisableONU_AuthCheck
447 ... AND Announce Message END TEST DisableONU_AuthCheck
448 ... AND Delete Device and Verify
449 Run Keyword and Ignore Error Collect Logs
450 Run Keyword If ${has_dataplane} Clean Up Linux
451 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
452 Clean WPA Process
suraj gour472da1c2020-02-25 05:44:51 +0000453 FOR ${I} IN RANGE 0 ${num_onus}
454 ${src}= Set Variable ${hosts.src[${I}]}
455 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800456 Run Keyword and Ignore Error Collect Logs
suraj gour472da1c2020-02-25 05:44:51 +0000457 ${onu_device_id}= Get Device ID From SN ${src['onu']}
458 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
459 ... ${of_id}
460 Disable Device ${onu_device_id}
461 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
462 ... REACHABLE ${src['onu']} onu=false
Andy Bavier84834d42020-02-25 13:49:50 -0700463 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
464 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800465 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication False
466 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700467 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800468 Enable Device ${onu_device_id}
469 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
470 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
471 Run Keyword and Ignore Error Collect Logs
472 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
473 ... ENABLED ACTIVE REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
474 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
475 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700476 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
suraj gour472da1c2020-02-25 05:44:51 +0000477 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
478 END
479 Run Keyword and Ignore Error Collect Logs
480
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800481
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700482*** Keywords ***
483Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700484 [Documentation] Set up the test suite
485 Common Test Suite Setup
Hung-Wei Chiu228d7ae2020-05-29 22:16:56 +0000486 #Restore all ONUs
Hung-Wei Chiu5a2a55f2020-06-19 10:29:53 -0700487 #Run Keyword If ${has_dataplane} RestoreONUs ${num_onus}
Suchitra Vemuri77f7abf2020-06-19 15:52:25 -0700488 ${switch_type}= Get Variable Value ${web_power_switch.type}
489 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
490
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700491
David Bainbridgef81cd642019-11-20 00:14:47 +0000492Clear All Devices Then Create New Device
493 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000494 # Remove all devices from voltha and nos
495 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000496 # Execute normal test Setup Keyword
497 Setup
498