blob: 323e979dc7e2f60395f2f3778d67628f226c92bc [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
51${external_libs} True
52${teardown_device} False
Zack Williamsa8fe75a2020-01-10 14:25:27 -070053${scripts} ../../scripts
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070054
55*** Test Cases ***
56Sanity E2E Test for OLT/ONU on POD
57 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
58 ... Validate successful authentication/DHCP/E2E ping for the tech profile that is used
Andy Bavierba9866b2019-10-11 07:11:53 -070059 [Tags] sanity test1
Andy Bavier4a8450e2020-02-04 08:58:37 -070060 [Setup] Run Keywords Announce Message START TEST SanityTest
61 ... AND Setup
62 [Teardown] Run Keywords Collect Logs
63 ... AND Announce Message END TEST SanityTest
Suchitra Vemuric5295a32019-12-15 20:32:04 -080064 Run Keyword If ${has_dataplane} Clean Up Linux
Zack Williamsa8fe75a2020-01-10 14:25:27 -070065 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070066
Hema93762cf2020-01-29 19:59:28 +053067Test Disable and Enable OLT
68 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
69 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
70 ... Perform disable on the OLT and validate that the pings do not succeed
71 ... Perform enable on the OLT and validate that the pings are successful
72 [Tags] VOL-2410 DisableEnableOLT notready
Andy Bavier4a8450e2020-02-04 08:58:37 -070073 [Setup] Announce Message START TEST DisableEnableOLT
74 [Teardown] Run Keywords Collect Logs
75 ... AND Announce Message END TEST DisableEnableOLT
Hema93762cf2020-01-29 19:59:28 +053076 #Disable the OLT and verify the OLT/ONUs are disabled properly
77 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
78 Should Be Equal As Integers ${rc} 0
79 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
80 ... ${olt_serial_number}
81 FOR ${I} IN RANGE 0 ${num_onus}
82 ${src}= Set Variable ${hosts.src[${I}]}
83 ${dst}= Set Variable ${hosts.dst[${I}]}
84 ${onu_device_id}= Get Device ID From SN ${src['onu']}
85 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED DISCOVERED
86 ... UNREACHABLE ${src['onu']} onu=false
87 #Verify that ping fails
88 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
89 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
90 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}}
91 END
92 #Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
93 Enable Device ${olt_device_id}
94 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
95 ... ${olt_serial_number}
96 FOR ${I} IN RANGE 0 ${num_onus}
97 ${src}= Set Variable ${hosts.src[${I}]}
98 ${dst}= Set Variable ${hosts.dst[${I}]}
99 ${onu_device_id}= Get Device ID From SN ${src['onu']}
100 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
101 ... ${of_id}
102 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE
103 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
104 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
105 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
106 #Verify that ping workss fine again
107 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
108 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
109 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}}
110 Run Keyword and Ignore Error Collect Logs
111 END
112
113
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800114Test Disable and Enable ONU
115 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
116 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
117 ... Perform disable on the ONUs and validate that the pings do not succeed
118 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800119 [Tags] functional DisableEnableONU released
Andy Bavier4a8450e2020-02-04 08:58:37 -0700120 [Setup] Announce Message START TEST DisableEnableONU
121 [Teardown] Run Keywords Collect Logs
122 ... AND Announce Message END TEST DisableEnableONU
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800123 FOR ${I} IN RANGE 0 ${num_onus}
124 ${src}= Set Variable ${hosts.src[${I}]}
125 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800126 ${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 Disable Device ${onu_device_id}
Suchitra Vemuri15e15252020-01-20 17:38:49 -0800130 #Test Devices Disabled in VOLTHA Id=${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700131 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
132 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700133 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
134 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800135 Enable Device ${onu_device_id}
136 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
137 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700138 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
139 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700140 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
141 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
142 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
143 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800144 END
145
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800146Test Subscriber Delete and Add
147 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
148 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700149 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800150 ... Re-add the subscriber and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800151 [Tags] functional SubAddDelete released
Andy Bavier4a8450e2020-02-04 08:58:37 -0700152 [Setup] Announce Message START TEST SubAddDelete
153 [Teardown] Run Keywords Collect Logs
154 ... AND Announce Message END TEST SubAddDelete
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800155 FOR ${I} IN RANGE 0 ${num_onus}
156 ${src}= Set Variable ${hosts.src[${I}]}
157 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800158 ${onu_device_id}= Get Device ID From SN ${src['onu']}
159 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
160 ... ${of_id}
161 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
162 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
163 Sleep 10s
Andy Bavier33e6dd32020-01-16 13:35:20 -0700164 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
165 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700166 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
167 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800168 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
169 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
170 Sleep 10s
171 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
172 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700173 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
174 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700175 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
176 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
177 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
178 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800179 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800180
suraj gourd64356b2019-11-07 13:26:20 +0000181Check OLT/ONU Authentication After Radius Pod Restart
suraj gour7f6d5fe2019-11-29 10:56:35 +0000182 [Documentation] After radius restart, triggers reassociation, checks status and
183 ... authentication, validates dhcp and ping. Note : wpa reassociate works only when
184 ... wpa supplicant is running in background hence it is recommended to remove
185 ... teardown from previous test or uncomment 'Teardown None'.
186 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800187 [Tags] functional RadiusRestart released
Andy Bavier4a8450e2020-02-04 08:58:37 -0700188 [Setup] Announce Message START TEST RadiusRestart
189 [Teardown] Run Keywords Collect Logs
190 ... AND Announce Message END TEST RadiusRestart
suraj gourd64356b2019-11-07 13:26:20 +0000191 Wait Until Keyword Succeeds ${timeout} 15s Restart Pod ${NAMESPACE} ${RESTART_POD_NAME}
suraj gourd64356b2019-11-07 13:26:20 +0000192 FOR ${I} IN RANGE 0 ${num_onus}
193 ${src}= Set Variable ${hosts.src[${I}]}
194 ${dst}= Set Variable ${hosts.dst[${I}]}
suraj gourd64356b2019-11-07 13:26:20 +0000195 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700196 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
197 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
198 Wait Until Keyword Succeeds ${timeout} 2s
199 ... Verify Eapol Flows Added For ONU ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
200 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
201 ... Validate Authentication After Reassociate True ${src['dp_iface_name']}
202 ... ${src['ip']} ${src['user']} ${src['pass']}
suraj gourd64356b2019-11-07 13:26:20 +0000203 ... ${src['container_type']} ${src['container_name']}
204 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700205 ... ${ONOS_SSH_PORT} ${onu_port}
206 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
207 ... Validate DHCP and Ping True True ${src['dp_iface_name']}
208 ... ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
209 ... ${src['ip']} ${src['user']} ${src['pass']}
210 ... ${src['container_type']} ${src['container_name']}
211 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']}
212 ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']}
suraj gourd64356b2019-11-07 13:26:20 +0000213 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
214 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700215 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
216 Run Keyword and Ignore Error Collect Logs
suraj gourd64356b2019-11-07 13:26:20 +0000217 END
218
suraj gourd5cfdbb2019-12-13 12:44:55 +0000219Check DHCP attempt fails when subscriber is not added
220 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
221 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700222 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800223 [Tags] functional SubsRemoveDHCP released
Andy Bavier4a8450e2020-02-04 08:58:37 -0700224 [Setup] Announce Message START TEST SubsRemoveDHCP
225 [Teardown] Run Keywords Collect Logs
226 ... 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']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000237 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
238 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700239 Sleep 5s
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']}
253 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
254 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
255 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
256 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
257 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
258 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
259 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800260 Run Keyword and Ignore Error Collect Logs
261 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800262
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800263Test Disable and Enable ONU scenario for ATT workflow
264 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
265 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
266 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700267 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
268 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800269 ... VOL-2284
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800270 [Tags] functional ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700271 [Setup] Announce Message START TEST ATT_DisableEnableONU
272 [Teardown] Run Keywords Collect Logs
273 ... AND Announce Message END TEST ATT_DisableEnableONU
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800274 FOR ${I} IN RANGE 0 ${num_onus}
275 ${src}= Set Variable ${hosts.src[${I}]}
276 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800277 ${onu_device_id}= Get Device ID From SN ${src['onu']}
278 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
279 ... ${of_id}
280 Disable Device ${onu_device_id}
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800281 Sleep 5s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800282 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
283 ... ${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}
290 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip}
291 ... ${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']}
296 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700297 ... ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800298 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
299 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
300 Sleep 10s
301 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700302 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800303 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
304 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
305 ... ${dst['container_name']}
306 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
307 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800308 Run Keyword and Ignore Error Collect Logs
suraj gourd5cfdbb2019-12-13 12:44:55 +0000309 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000310
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800311Delete OLT, ReAdd OLT and Perform Sanity Test
312 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
313 ... Disable and Delete the OLT
314 ... Create/Enable the same OLT again
315 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuri2fa9bba2020-01-22 17:38:48 -0800316 [Tags] functional DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700317 [Setup] Announce Message START TEST DeleteOLT
318 [Teardown] Run Keywords Collect Logs
319 ... AND Announce Message END TEST DeleteOLT
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800320 Run Keyword If ${has_dataplane} Clean Up Linux
321 Run Keyword If ${has_dataplane} Delete Device and Verify
322 Run Keyword and Ignore Error Collect Logs
323 # Recreate the OLT
324 Run Keyword If ${has_dataplane} Setup
325 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800326
Hema783279b2020-01-22 15:37:37 +0530327Test disable ONUs and OLT then delete ONUs and OLT
328 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
329 ... This TC is to confirm that ONU removal is not impacting OLT
330 ... Devices will be removed during the execution of this TC
331 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuriba4f3712020-01-24 16:18:26 -0800332 [Tags] functional VOL-2354 DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700333 [Setup] Announce Message START TEST DisableDeleteONUandOLT
334 [Teardown] Run Keywords Collect Logs
335 ... AND Announce Message END TEST DisableDeleteONUandOLT
Suchitra Vemuriba4f3712020-01-24 16:18:26 -0800336 ${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Hema783279b2020-01-22 15:37:37 +0530337 FOR ${I} IN RANGE 0 ${num_onus}
338 ${src}= Set Variable ${hosts.src[${I}]}
339 ${dst}= Set Variable ${hosts.dst[${I}]}
340 ${onu_device_id}= Get Device ID From SN ${src['onu']}
341 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE
342 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
343 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE
344 ... REACHABLE ${olt_serial_number}
345 ${rc} ${output}= Run and Return Rc and Output
346 ... ${VOLTCTL_CONFIG}; voltctl device disable ${onu_device_id}
347 Should Be Equal As Integers ${rc} 0
348 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
349 ... REACHABLE ${src['onu']} onu=false
350 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE
351 ... REACHABLE ${olt_serial_number}
352 END
353 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
354 Should Be Equal As Integers ${rc} 0
355 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
356 ... ${olt_serial_number}
357 FOR ${I} IN RANGE 0 ${num_onus}
358 ${src}= Set Variable ${hosts.src[${I}]}
359 ${dst}= Set Variable ${hosts.dst[${I}]}
360 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuriba4f3712020-01-24 16:18:26 -0800361 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
362 ... REACHABLE ${src['onu']} onu=false
Hema783279b2020-01-22 15:37:37 +0530363 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device delete ${onu_device_id}
364 Should Be Equal As Integers ${rc} 0
365 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN
366 ... REACHABLE ${olt_serial_number}
367 END
368 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device delete ${olt_device_id}
369 Should Be Equal As Integers ${rc} 0
370 Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
371 #Adding setup here to add the devices back since this TC removes the devices
372 Run Keyword If ${has_dataplane} sleep 180s
373 setup
374
David Bainbridgef81cd642019-11-20 00:14:47 +0000375Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart
376 [Documentation] Deploys an device instance and waits for it to authenticate. After
377 ... authentication is successful the rw-core deployment is scaled to 0 instances to
378 ... simulate a POD crash. The test then scales the rw-core back to a single instance
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700379 ... and configures ONOS for access. The test succeeds if the device is able to
David Bainbridgef81cd642019-11-20 00:14:47 +0000380 ... complete the DHCP sequence.
381 [Tags] bbsim rwcore-restart
Andy Bavier4a8450e2020-02-04 08:58:37 -0700382 [Setup] Run Keywords Announce Message START TEST RwCoreFailAndRestart
383 ... AND Clear All Devices Then Create New Device
384 [Teardown] Run Keywords Collect Logs
385 ... AND Announce Message END TEST RwCoreFailAndRestart
David Bainbridgef81cd642019-11-20 00:14:47 +0000386 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
387 Set Global Variable ${of_id}
David Bainbridgef81cd642019-11-20 00:14:47 +0000388 FOR ${I} IN RANGE 0 ${num_onus}
389 ${src}= Set Variable ${hosts.src[${I}]}
390 ${dst}= Set Variable ${hosts.dst[${I}]}
391 ${onu_device_id}= Get Device ID From SN ${src['onu']}
392 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
393 ... ${of_id}
David Bainbridgef81cd642019-11-20 00:14:47 +0000394 # Bring up the device and verify it authenticates
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700395 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
David Bainbridgef81cd642019-11-20 00:14:47 +0000396 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed
397 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip}
398 ... ${ONOS_SSH_PORT} ${onu_port}
399 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
400 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
401 ... ${src['container_type']} ${src['container_name']}
402 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
David Bainbridge3d6d5d32019-12-17 19:05:35 +0000403 ... ${ONOS_SSH_PORT} ${onu_port}
404 END
405
406 # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1
407 Scale K8s Deployment voltha voltha-rw-core 0
408 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-rw-core
409 # Ensure the ofagent POD goes "not-ready" as expected
410 Wait Until keyword Succeeds ${timeout} 2s
411 ... Check Expected Available Deployment Replicas voltha voltha-ofagent 0
412 # Scale up the core deployment and make sure both it and the ofagent deployment are back
413 Scale K8s Deployment voltha voltha-rw-core 1
414 Wait Until Keyword Succeeds ${timeout} 2s
415 ... Check Expected Available Deployment Replicas voltha voltha-rw-core 1
416 Wait Until Keyword Succeeds ${timeout} 2s
417 ... Check Expected Available Deployment Replicas voltha voltha-ofagent 1
418 # For some reason scaling down and up the POD behind a service causes the port forward to stop working,
419 # so restart the port forwarding for the API service
420 Restart VOLTHA Port Foward voltha-api-minimal
421 # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this
422 # represents system connectivity being restored
423 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
424 ... http://karaf:karaf@${k8s_node_ip}:${ONOS_REST_PORT} ${of_id}
425
426 FOR ${I} IN RANGE 0 ${num_onus}
427 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
428 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
429 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
430 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
431 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
432 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
433 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
434 ... ${dst['container_name']}
435 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
436 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
437 END
438
439Sanity E2E Test for OLT/ONU on POD With OLT Adapters Fail and Restart
440 [Documentation] Deploys an device instance and waits for it to authenticate. After
441 ... authentication is successful the rw-core deployment is scaled to 0 instances to
442 ... simulate a POD crash. The test then scales the rw-core back to a single instance
443 ... and configures ONOS for access. The test succeeds if the device is able to
444 ... complete the DHCP sequence.
445 [Tags] bbsim olt-adapter-restart
446 [Setup] Clear All Devices Then Create New Device
447 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
448 Set Global Variable ${of_id}
449
450 FOR ${I} IN RANGE 0 ${num_onus}
451 ${src}= Set Variable ${hosts.src[${I}]}
452 ${dst}= Set Variable ${hosts.dst[${I}]}
453 ${onu_device_id}= Get Device ID From SN ${src['onu']}
454 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
455 ... ${of_id}
456
457 # Bring up the device and verify it authenticates
458 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
459 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed
460 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700461 ... ${ONOS_SSH_PORT} ${onu_port}
David Bainbridge3d6d5d32019-12-17 19:05:35 +0000462 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
463 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
464 ... ${src['container_type']} ${src['container_name']}
465 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
466 ... ${ONOS_SSH_PORT} ${onu_port}
467 END
468
469 # Scale down the open OLT adapter deployment to 0 PODs and once confirmed, scale it back to 1
470 Scale K8s Deployment voltha adapter-open-olt 0
471 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha adapter-open-olt
472 # Scale up the open OLT adapter deployment and make sure both it and the ofagent deployment are back
473 Scale K8s Deployment voltha adapter-open-olt 1
474 Wait Until Keyword Succeeds ${timeout} 2s
475 ... Check Expected Available Deployment Replicas voltha adapter-open-olt 1
476
477 # Ensure the device is available in ONOS, this represents system connectivity being restored
478 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
479 ... http://karaf:karaf@${k8s_node_ip}:${ONOS_REST_PORT} ${of_id}
480
481 FOR ${I} IN RANGE 0 ${num_onus}
David Bainbridgef81cd642019-11-20 00:14:47 +0000482 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
483 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
484 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
485 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
486 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
487 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
488 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
489 ... ${dst['container_name']}
490 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
491 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
492 END
493
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700494*** Keywords ***
495Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700496 [Documentation] Set up the test suite
497 Common Test Suite Setup
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700498
David Bainbridgef81cd642019-11-20 00:14:47 +0000499Clear All Devices Then Create New Device
500 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000501 # Remove all devices from voltha and nos
502 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000503 # Execute normal test Setup Keyword
504 Setup
505