blob: c4f7074167c3f1a1aa3918c354bf99b1c29f22a0 [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
Suchitra Vemuri6db89412019-11-14 14:52:54 -080060 [Teardown] NONE
Suchitra Vemuric5295a32019-12-15 20:32:04 -080061 Run Keyword If ${has_dataplane} Clean Up Linux
Zack Williamsa8fe75a2020-01-10 14:25:27 -070062 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri582574b2019-12-10 21:11:54 -080063 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070064
Suchitra Vemuri6db89412019-11-14 14:52:54 -080065Test Disable and Enable ONU
66 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
67 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
68 ... Perform disable on the ONUs and validate that the pings do not succeed
69 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -080070 [Tags] functional DisableEnableONU released
Suchitra Vemuri6db89412019-11-14 14:52:54 -080071 [Setup] None
suraj gour7f6d5fe2019-11-29 10:56:35 +000072 [Teardown] None
Suchitra Vemuri6db89412019-11-14 14:52:54 -080073 FOR ${I} IN RANGE 0 ${num_onus}
74 ${src}= Set Variable ${hosts.src[${I}]}
75 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri6db89412019-11-14 14:52:54 -080076 ${onu_device_id}= Get Device ID From SN ${src['onu']}
77 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
78 ... ${of_id}
79 Disable Device ${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -070080 Test Devices Disabled in VOLTHA Id=${onu_device_id}
81 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
82 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -070083 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
84 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -080085 Enable Device ${onu_device_id}
86 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
87 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -070088 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
89 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -070090 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
91 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
92 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
93 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri6db89412019-11-14 14:52:54 -080094 END
Zack Williamsa8fe75a2020-01-10 14:25:27 -070095 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri6db89412019-11-14 14:52:54 -080096
Suchitra Vemuri5994cd12019-12-17 22:20:55 -080097Test Subscriber Delete and Add
98 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
99 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700100 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800101 ... Re-add the subscriber and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800102 [Tags] functional SubAddDelete released
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800103 [Setup] None
104 [Teardown] None
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800105 FOR ${I} IN RANGE 0 ${num_onus}
106 ${src}= Set Variable ${hosts.src[${I}]}
107 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800108 ${onu_device_id}= Get Device ID From SN ${src['onu']}
109 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
110 ... ${of_id}
111 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
112 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
113 Sleep 10s
Andy Bavier33e6dd32020-01-16 13:35:20 -0700114 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
115 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700116 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
117 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800118 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
119 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
120 Sleep 10s
121 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
122 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700123 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
124 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700125 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
126 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
127 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
128 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800129 END
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700130 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800131
suraj gourd64356b2019-11-07 13:26:20 +0000132Check OLT/ONU Authentication After Radius Pod Restart
suraj gour7f6d5fe2019-11-29 10:56:35 +0000133 [Documentation] After radius restart, triggers reassociation, checks status and
134 ... authentication, validates dhcp and ping. Note : wpa reassociate works only when
135 ... wpa supplicant is running in background hence it is recommended to remove
136 ... teardown from previous test or uncomment 'Teardown None'.
137 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800138 [Tags] functional RadiusRestart released
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700139 [Setup] None
140 [Teardown] None
suraj gourd64356b2019-11-07 13:26:20 +0000141 Wait Until Keyword Succeeds ${timeout} 15s Restart Pod ${NAMESPACE} ${RESTART_POD_NAME}
suraj gourd64356b2019-11-07 13:26:20 +0000142 FOR ${I} IN RANGE 0 ${num_onus}
143 ${src}= Set Variable ${hosts.src[${I}]}
144 ${dst}= Set Variable ${hosts.dst[${I}]}
suraj gourd64356b2019-11-07 13:26:20 +0000145 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700146 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
147 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
148 Wait Until Keyword Succeeds ${timeout} 2s
149 ... Verify Eapol Flows Added For ONU ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
150 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
151 ... Validate Authentication After Reassociate True ${src['dp_iface_name']}
152 ... ${src['ip']} ${src['user']} ${src['pass']}
suraj gourd64356b2019-11-07 13:26:20 +0000153 ... ${src['container_type']} ${src['container_name']}
154 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700155 ... ${ONOS_SSH_PORT} ${onu_port}
156 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
157 ... Validate DHCP and Ping True True ${src['dp_iface_name']}
158 ... ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
159 ... ${src['ip']} ${src['user']} ${src['pass']}
160 ... ${src['container_type']} ${src['container_name']}
161 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']}
162 ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']}
suraj gourd64356b2019-11-07 13:26:20 +0000163 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
164 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700165 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
166 Run Keyword and Ignore Error Collect Logs
suraj gourd64356b2019-11-07 13:26:20 +0000167 END
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700168 Run Keyword and Ignore Error Collect Logs
suraj gourd64356b2019-11-07 13:26:20 +0000169
suraj gourd5cfdbb2019-12-13 12:44:55 +0000170Check DHCP attempt fails when subscriber is not added
171 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
172 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700173 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800174 [Tags] functional SubsRemoveDHCP released
suraj gourd5cfdbb2019-12-13 12:44:55 +0000175 [Setup] None
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800176 [Teardown] None
suraj gourd5cfdbb2019-12-13 12:44:55 +0000177 FOR ${I} IN RANGE 0 ${num_onus}
178 ${src}= Set Variable ${hosts.src[${I}]}
179 ${dst}= Set Variable ${hosts.dst[${I}]}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700180 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000181 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
182 ... ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800183 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']}
184 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
185 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
186 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000187 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
188 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700189 Sleep 5s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800190 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
191 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700192 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
193 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
194 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
195 Run Keyword And Ignore Error Login And Run Command On Remote System
196 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800197 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000198 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
199 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
200 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
201 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
202 ... ${dst['container_name']}
203 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
204 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
205 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
206 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
207 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
208 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
209 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800210 Run Keyword and Ignore Error Collect Logs
211 END
212 Run Keyword and Ignore Error Collect Logs
213
suraj gour1ecfae92019-12-20 15:11:40 +0000214Check ONU adapter crash not forcing authentication again
215 [Documentation] After ONU adapter restart, checks wpa log for 'authentication started'
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700216 ... message count to make sure auth not started again and validates EAP status and ping.
suraj gour1ecfae92019-12-20 15:11:40 +0000217 ... Assuming that test1 or sanity was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800218 [Tags] functional ONUAdaptCrash notready
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700219 [Setup] None
220 [Teardown] None
suraj gour1ecfae92019-12-20 15:11:40 +0000221 @{before_list}= Create List
222 @{after_list}= Create List
223 FOR ${I} IN RANGE 0 ${num_onus}
224 ${src}= Set Variable ${hosts.src[${I}]}
225 ${dst}= Set Variable ${hosts.dst[${I}]}
226 ${onu_device_id}= Get Device ID From SN ${src['onu']}
227 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
228 ... ${of_id}
229 ${before}= Run Keyword If ${has_dataplane} Check Remote File Contents For WPA Logs
230 ... True /tmp/wpa.log authentication started ${src['ip']} ${src['user']} ${src['pass']}
231 ... ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700232 Append To List ${before_list} ${before}
suraj gour1ecfae92019-12-20 15:11:40 +0000233 END
234 Wait Until Keyword Succeeds ${timeout} 15s Restart Pod ${NAMESPACE} adapter-open-onu
235 Wait Until Keyword Succeeds ${timeout} 2s Validate Pod Status ${podName} ${NAMESPACE}
236 ... Running
237 FOR ${I} IN RANGE 0 ${num_onus}
238 ${src}= Set Variable ${hosts.src[${I}]}
239 ${dst}= Set Variable ${hosts.dst[${I}]}
240 ${onu_device_id}= Get Device ID From SN ${src['onu']}
241 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
242 ... ${of_id}
243 ${after}= Run Keyword If ${has_dataplane} Check Remote File Contents For WPA Logs
244 ... True /tmp/wpa.log authentication started ${src['ip']} ${src['user']} ${src['pass']}
245 ... ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700246 Append To List ${after_list} ${after}
247 ${output}= Run Keyword If ${has_dataplane} Login And Run Command On Remote System
248 ... wpa_cli status | grep SUCCESS ${src['ip']} ${src['user']} ${src['pass']}
249 ... ${src['container_type']} ${src['container_name']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700250 Run Keyword If ${has_dataplane} Should Contain ${output} SUCCESS
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700251 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
252 ... Wait Until Keyword Succeeds 60s 2s Check Ping
suraj gour1ecfae92019-12-20 15:11:40 +0000253 ... True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']} ${src['user']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700254 ... ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gour1ecfae92019-12-20 15:11:40 +0000255 END
256 Lists Should Be Equal ${after_list} ${before_list}
257 Log ${after_list}
258 Log ${before_list}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700259 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800260
261Test Disable and Enable ONU scenario for ATT workflow
262 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
263 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
264 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700265 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
266 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800267 ... VOL-2284
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800268 [Tags] functional ATT_DisableEnableONU
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800269 [Setup] None
270 #[Teardown] None
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800271 FOR ${I} IN RANGE 0 ${num_onus}
272 ${src}= Set Variable ${hosts.src[${I}]}
273 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800274 ${onu_device_id}= Get Device ID From SN ${src['onu']}
275 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
276 ... ${of_id}
277 Disable Device ${onu_device_id}
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800278 Sleep 5s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800279 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
280 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700281 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
282 ... Wait Until Keyword Succeeds 60s 2s Check Ping
283 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
284 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800285 ... ELSE sleep 60s
286 Enable Device ${onu_device_id}
287 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip}
288 ... ${ONOS_SSH_PORT} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700289 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
290 ... Validate Authentication After Reassociate True
291 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800292 ... ${src['container_type']} ${src['container_name']}
293 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700294 ... ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800295 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
296 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
297 Sleep 10s
298 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700299 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800300 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
301 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
302 ... ${dst['container_name']}
303 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
304 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800305 Run Keyword and Ignore Error Collect Logs
suraj gourd5cfdbb2019-12-13 12:44:55 +0000306 END
307 Run Keyword and Ignore Error Collect Logs
308
Gayathri.Selvan49398962020-01-13 07:19:12 +0000309Verify restart any container after VOLTHA is operational
310 [Documentation] Restart any container after VOLTHA is operational.
311 ... Prerequisite : ONUs are authenticated and pingable.
Suchitra Vemurid1e2b712020-01-13 23:06:22 -0800312 [Tags] functional VOL-1958 RestartPods
Gayathri.Selvan49398962020-01-13 07:19:12 +0000313 [Setup] NONE
314 [Teardown] NONE
315 ${waitforRestart} Set Variable 120s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700316 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
Gayathri.Selvan49398962020-01-13 07:19:12 +0000317 Log ${podStatusOutput}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700318 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Gayathri.Selvan49398962020-01-13 07:19:12 +0000319 ${podName} Set Variable adapter-open-olt
320 Restart Pod ${NAMESPACE} ${podName}
321 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ${podName} ${NAMESPACE}
322 ... Running
323 Repeat Sanity Test
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700324 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
Gayathri.Selvan49398962020-01-13 07:19:12 +0000325 Log ${podStatusOutput}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700326 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Gayathri.Selvan49398962020-01-13 07:19:12 +0000327 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
328 Log to console Pod ${podName} restarted and sanity checks passed successfully
329
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800330Delete OLT, ReAdd OLT and Perform Sanity Test
331 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
332 ... Disable and Delete the OLT
333 ... Create/Enable the same OLT again
334 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
335 [Tags] functional DeleteOLT
336 [Setup] None
337 [Teardown] NONE
338 Run Keyword If ${has_dataplane} Clean Up Linux
339 Run Keyword If ${has_dataplane} Delete Device and Verify
340 Run Keyword and Ignore Error Collect Logs
341 # Recreate the OLT
342 Run Keyword If ${has_dataplane} Setup
343 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
344 Run Keyword and Ignore Error Collect Logs
345
Hemae6d223d2019-12-30 19:21:26 +0530346Adding the same OLT after enabling the device
347 [Documentation] Create OLT, enable it, Create the same OLT again and Check for the Error message
Suchitra Vemuric9f2bc92020-01-16 21:21:08 -0800348 [Tags] VOL-2406 AddEnableOLT_AddTheSameOLTAgain functional
Hemae6d223d2019-12-30 19:21:26 +0530349 [Setup] Delete Device and Verify
350 [Teardown] None
351 Run Keyword If ${has_dataplane} Sleep 180s
352 #create/preprovision device
353 ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT}
354 Set Suite Variable ${olt_device_id}
355 #validate olt states
356 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN
357 ... ${EMPTY} ${olt_device_id}
358 #Enable the created OLT device
359 Enable Device ${olt_device_id}
360 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
361 ... ${olt_serial_number}
362 #Create the same OLT again
363 ${rc} ${output}= Run and Return Rc and Output
364 ... ${VOLTCTL_CONFIG}; voltctl device create -t openolt -H ${olt_ip}:${OLT_PORT}
365 Should Not Be Equal As Integers ${rc} 0
366 Log ${output}
Suchitra Vemuri3ed95ab2020-01-15 21:28:04 -0800367 Should Contain '${output}' 'Device is already pre-provisioned'
Hemae6d223d2019-12-30 19:21:26 +0530368 Log "This OLT is added already and enabled"
369
David Bainbridgef81cd642019-11-20 00:14:47 +0000370Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart
371 [Documentation] Deploys an device instance and waits for it to authenticate. After
372 ... authentication is successful the rw-core deployment is scaled to 0 instances to
373 ... simulate a POD crash. The test then scales the rw-core back to a single instance
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700374 ... and configures ONOS for access. The test succeeds if the device is able to
David Bainbridgef81cd642019-11-20 00:14:47 +0000375 ... complete the DHCP sequence.
376 [Tags] bbsim rwcore-restart
377 [Setup] Clear All Devices Then Create New Device
378 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
379 Set Global Variable ${of_id}
David Bainbridgef81cd642019-11-20 00:14:47 +0000380 FOR ${I} IN RANGE 0 ${num_onus}
381 ${src}= Set Variable ${hosts.src[${I}]}
382 ${dst}= Set Variable ${hosts.dst[${I}]}
383 ${onu_device_id}= Get Device ID From SN ${src['onu']}
384 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
385 ... ${of_id}
David Bainbridgef81cd642019-11-20 00:14:47 +0000386 # Bring up the device and verify it authenticates
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700387 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
David Bainbridgef81cd642019-11-20 00:14:47 +0000388 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed
389 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip}
390 ... ${ONOS_SSH_PORT} ${onu_port}
391 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
392 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
393 ... ${src['container_type']} ${src['container_name']}
394 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700395 ... ${ONOS_SSH_PORT} ${onu_port}
David Bainbridgef81cd642019-11-20 00:14:47 +0000396 # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1
397 Scale K8s Deployment voltha voltha-rw-core 0
398 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-rw-core
399 # Ensure the ofagent POD goes "not-ready" as expected
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700400 Wait Until keyword Succeeds ${timeout} 2s
401 ... Check Expected Available Deployment Replicas voltha voltha-ofagent 0
David Bainbridgef81cd642019-11-20 00:14:47 +0000402 # Scale up the core deployment and make sure both it and the ofagent deployment are back
403 Scale K8s Deployment voltha voltha-rw-core 1
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700404 Wait Until Keyword Succeeds ${timeout} 2s
405 ... Check Expected Available Deployment Replicas voltha voltha-rw-core 1
406 Wait Until Keyword Succeeds ${timeout} 2s
407 ... Check Expected Available Deployment Replicas voltha voltha-ofagent 1
David Bainbridgef81cd642019-11-20 00:14:47 +0000408 # For some reason scaling down and up the POD behind a service causes the port forward to stop working,
409 # so restart the port forwarding for the API service
410 Restart VOLTHA Port Foward voltha-api-minimal
David Bainbridgef81cd642019-11-20 00:14:47 +0000411 # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this
412 # represents system connectivity being restored
413 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
414 ... http://karaf:karaf@${k8s_node_ip}:${ONOS_REST_PORT} ${of_id}
David Bainbridgef81cd642019-11-20 00:14:47 +0000415 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
416 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
417 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
418 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
419 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
420 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
421 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
422 ... ${dst['container_name']}
423 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
424 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
425 END
426
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700427*** Keywords ***
428Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700429 [Documentation] Set up the test suite
430 Common Test Suite Setup
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700431
432Setup
Zack Williamsec53a1b2019-09-16 15:50:52 -0700433 [Documentation] Pre-test Setup
Gilles Depatieb5682f82019-10-31 10:39:45 -0400434 #test for empty device list
David Bainbridgef81cd642019-11-20 00:14:47 +0000435 Test Empty Device List
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800436 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s Openolt is Up
437 ... ${olt_ip} ${olt_user} ${olt_pass}
438 Sleep 60s
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700439 #create/preprovision device
Suchitra Vemuric59eb272019-09-18 17:59:33 -0700440 ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT}
441 Set Suite Variable ${olt_device_id}
Gilles Depatieb5682f82019-10-31 10:39:45 -0400442 #validate olt states
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700443 Wait Until Keyword Succeeds ${timeout} 5s
444 ... Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN ${EMPTY} ${olt_device_id}
Suchitra Vemuric59eb272019-09-18 17:59:33 -0700445 Enable Device ${olt_device_id}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700446 Wait Until Keyword Succeeds ${timeout} 5s
447 ... Validate OLT Device ENABLED ACTIVE REACHABLE ${olt_serial_number}
Suchitra Vemuri00d147d2019-09-13 13:07:32 -0700448 ${logical_id}= Get Logical Device ID From SN ${olt_serial_number}
449 Set Suite Variable ${logical_id}
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700450
David Bainbridgef81cd642019-11-20 00:14:47 +0000451Delete All Devices and Verify
452 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000453 # Clear devices from VOLTHA
454 Disable Devices In Voltha Root=true
455 Wait Until Keyword Succeeds ${timeout} 2s Test Devices Disabled In Voltha Root=true
456 Delete Devices In Voltha Root=true
457 Wait Until Keyword Succeeds ${timeout} 2s Test Empty Device List
David Bainbridgef81cd642019-11-20 00:14:47 +0000458 # Clear devices from ONOS
459 Remove All Devices From ONOS
460 ... http://karaf:karaf@${k8s_node_ip}:${ONOS_REST_PORT}
461
462Clear All Devices Then Create New Device
463 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000464 # Remove all devices from voltha and nos
465 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000466 # Execute normal test Setup Keyword
467 Setup
468
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700469Teardown
470 [Documentation] kills processes and cleans up interfaces on src+dst servers
Suchitra Vemuri582574b2019-12-10 21:11:54 -0800471 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri3ed95ab2020-01-15 21:28:04 -0800472 Run Keyword If ${external_libs} Run Keyword and Ignore Error
473 ... Log Kubernetes Containers Logs Since Time
474 ... ${datetime} ${container_list}
Suchitra Vemuri582574b2019-12-10 21:11:54 -0800475
476Collect Logs
477 [Documentation] Collect Logs from voltha and onos cli for various commands
Suchitra Vemuri1a970a62019-11-26 12:52:16 -0800478 Run Keyword and Ignore Error Get Device List from Voltha
479 Run Keyword and Ignore Error Get Device Output from Voltha ${olt_device_id}
480 Run Keyword and Ignore Error Get Logical Device Output from Voltha ${logical_id}
Andy Bavierba9866b2019-10-11 07:11:53 -0700481 Run Keyword If ${external_libs} Get ONOS Status ${k8s_node_ip}
Andy Bavierba9866b2019-10-11 07:11:53 -0700482
483Teardown Suite
484 [Documentation] Clean up device if desired
David Bainbridgef81cd642019-11-20 00:14:47 +0000485 Run Keyword If ${teardown_device} Delete All Devices and Verify
Gilles Depatieb5682f82019-10-31 10:39:45 -0400486
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700487Clean Up Linux
488 [Documentation] Kill processes and clean up interfaces on src+dst servers
Suchitra Vemuri8a9c3782019-10-23 12:43:01 -0700489 FOR ${I} IN RANGE 0 ${num_onus}
490 ${src}= Set Variable ${hosts.src[${I}]}
491 ${dst}= Set Variable ${hosts.dst[${I}]}
492 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
493 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
494 Run Keyword And Ignore Error Kill Linux Process [d]hclient ${src['ip']}
495 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
496 Run Keyword If '${dst['ip']}' != '${None}' Run Keyword And Ignore Error
497 ... Kill Linux Process [d]hcpd ${dst['ip']} ${dst['user']}
498 ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']}
499 Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
500 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
501 Run Keyword If '${dst['ip']}' != '${None}' Delete Interface on Remote Host
502 ... ${dst['dp_iface_name']}.${src['s_tag']} ${dst['ip']} ${dst['user']} ${dst['pass']}
503 ... ${dst['container_type']} ${dst['container_name']}
504 END
Andy Bavierba9866b2019-10-11 07:11:53 -0700505
506Delete Device and Verify
507 [Documentation] Disable -> Delete devices via voltctl and verify its removed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700508 ${rc} ${output}= Run and Return Rc and Output
509 ... ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
Andy Bavierba9866b2019-10-11 07:11:53 -0700510 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800511 Sleep 5s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700512 Wait Until Keyword Succeeds ${timeout} 5s
513 ... Validate OLT Device DISABLED UNKNOWN REACHABLE ${olt_serial_number}
514 ${rc} ${output}= Run and Return Rc and Output
515 ... ${VOLTCTL_CONFIG}; voltctl device delete ${olt_device_id}
Suchitra Vemuric9f2bc92020-01-16 21:21:08 -0800516 Sleep 50s
Andy Bavierba9866b2019-10-11 07:11:53 -0700517 Should Be Equal As Integers ${rc} 0
518 Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed ${olt_device_id}
Suchitra Vemurib89b9ac2019-12-11 21:53:11 -0800519
520Perform Sanity Test
521 [Documentation] This keyword performs Sanity Test Procedure
522 ... Sanity test performs authentication, dhcp and pings for all the ONUs given for the POD
523 ... This keyword can be used to call in any other tests where sanity check is required
524 ... and avoids duplication of code.
Suchitra Vemurib89b9ac2019-12-11 21:53:11 -0800525 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
526 Set Global Variable ${of_id}
Suchitra Vemurib89b9ac2019-12-11 21:53:11 -0800527 FOR ${I} IN RANGE 0 ${num_onus}
528 ${src}= Set Variable ${hosts.src[${I}]}
529 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri50aa9802019-12-20 14:25:46 -0800530 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
531 ... ENABLED ACTIVE REACHABLE
Suchitra Vemurib89b9ac2019-12-11 21:53:11 -0800532 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Suchitra Vemurib89b9ac2019-12-11 21:53:11 -0800533 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700534 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
535 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
536 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
537 ... Verify Eapol Flows Added For ONU ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
538 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
Suchitra Vemurib89b9ac2019-12-11 21:53:11 -0800539 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
540 ... ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700541 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
542 ... Verify ONU in AAA-Users ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
543 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
544 ... Execute ONOS CLI Command ${k8s_node_ip} ${ONOS_SSH_PORT}
545 ... volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemurib89b9ac2019-12-11 21:53:11 -0800546 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
547 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
548 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
549 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
550 ... ${dst['container_name']}
551 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
552 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700553 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
554 Run Keyword and Ignore Error Collect Logs
Suchitra Vemurib89b9ac2019-12-11 21:53:11 -0800555 END
Gayathri.Selvan49398962020-01-13 07:19:12 +0000556
557Repeat Sanity Test
558 [Documentation] This keyword performs Sanity Test Procedure
559 ... Sanity test performs authentication, dhcp and pings for all the ONUs given for the POD
560 ... This keyword can be used to call in any other tests where sanity check is required
561 ... with wpa reassociation
562
563 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
564 Set Global Variable ${of_id}
565
566 FOR ${I} IN RANGE 0 ${num_onus}
567 ${src}= Set Variable ${hosts.src[${I}]}
568 ${dst}= Set Variable ${hosts.dst[${I}]}
569
570
571 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700572 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
573 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
574 Wait Until Keyword Succeeds ${timeout} 2s
575 ... Verify Eapol Flows Added For ONU ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
576 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
577 ... Validate Authentication After Reassociate
Gayathri.Selvan49398962020-01-13 07:19:12 +0000578 ... True ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
579 ... ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700580 Wait Until Keyword Succeeds ${timeout} 2s
581 ... Verify ONU in AAA-Users ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
582 Wait Until Keyword Succeeds ${timeout} 2s
583 ... Execute ONOS CLI Command ${k8s_node_ip} ${ONOS_SSH_PORT}
584 ... volt-add-subscriber-access ${of_id} ${onu_port}
585 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
586 ... Validate DHCP and Ping True True
587 ... ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Gayathri.Selvan49398962020-01-13 07:19:12 +0000588 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
589 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
590 ... ${dst['container_name']}
591 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
592 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
593 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
594 Run Keyword and Ignore Error Collect Logs
595 END
596