blob: 272f201f18fd06d50258056c4709cb7e91ab6d6e [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.
14
Matteo Scandolo1294aeb2019-09-24 16:20:32 -070015# FIXME Can we use the same test against BBSim and Hardware?
16
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070017*** Settings ***
Zack Williamsec53a1b2019-09-16 15:50:52 -070018Documentation Test various end-to-end scenarios
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070019Suite Setup Setup Suite
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070020Test Setup Setup
21Test Teardown Teardown
Andy Bavierba9866b2019-10-11 07:11:53 -070022Suite Teardown Teardown Suite
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070023Library Collections
24Library String
25Library OperatingSystem
26Library XML
27Library RequestsLibrary
Andy Bavierba9866b2019-10-11 07:11:53 -070028Library ../../libraries/DependencyLibrary.py
Suchitra Vemurib8ed2d52019-09-30 13:22:51 -070029Resource ../../libraries/onos.robot
30Resource ../../libraries/voltctl.robot
David Bainbridgef81cd642019-11-20 00:14:47 +000031Resource ../../libraries/voltha.robot
Suchitra Vemurib8ed2d52019-09-30 13:22:51 -070032Resource ../../libraries/utils.robot
Andy Bavierba9866b2019-10-11 07:11:53 -070033Resource ../../libraries/k8s.robot
Suchitra Vemurib8ed2d52019-09-30 13:22:51 -070034Resource ../../variables/variables.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
suraj gourd64356b2019-11-07 13:26:20 +000044${NAMESPACE} voltha
45# For below variable value, using deployment name as using grep for
46# parsing radius pod name, we can also use full radius pod name
47${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
52${external_libs} True
53${teardown_device} False
David Bainbridgef81cd642019-11-20 00:14:47 +000054${scripts} ../../scripts
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070055
56*** Test Cases ***
57Sanity E2E Test for OLT/ONU on POD
58 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
59 ... Validate successful authentication/DHCP/E2E ping for the tech profile that is used
Andy Bavierba9866b2019-10-11 07:11:53 -070060 [Tags] sanity test1
Suchitra Vemuri6db89412019-11-14 14:52:54 -080061 [Teardown] NONE
Suchitra Vemurib89b9ac2019-12-11 21:53:11 -080062 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 Vemuri582574b2019-12-10 21:11:54 -080070 [Tags] functional DisableEnableONU
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
74 FOR ${I} IN RANGE 0 ${num_onus}
75 ${src}= Set Variable ${hosts.src[${I}]}
76 ${dst}= Set Variable ${hosts.dst[${I}]}
77
78 ${onu_device_id}= Get Device ID From SN ${src['onu']}
79 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
80 ... ${of_id}
81 Disable Device ${onu_device_id}
82 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s Check Ping False ${dst['dp_iface_ip_qinq']}
83 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
84 Enable Device ${onu_device_id}
85 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
86 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
87 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s Check Ping True ${dst['dp_iface_ip_qinq']}
88 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri582574b2019-12-10 21:11:54 -080089 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
90 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri6db89412019-11-14 14:52:54 -080091 END
Suchitra Vemuri582574b2019-12-10 21:11:54 -080092 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri6db89412019-11-14 14:52:54 -080093
suraj gourd64356b2019-11-07 13:26:20 +000094Check OLT/ONU Authentication After Radius Pod Restart
suraj gour7f6d5fe2019-11-29 10:56:35 +000095 [Documentation] After radius restart, triggers reassociation, checks status and
96 ... authentication, validates dhcp and ping. Note : wpa reassociate works only when
97 ... wpa supplicant is running in background hence it is recommended to remove
98 ... teardown from previous test or uncomment 'Teardown None'.
99 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri582574b2019-12-10 21:11:54 -0800100 [Tags] functional RadiusRestart
suraj gourd5cfdbb2019-12-13 12:44:55 +0000101 [Setup] None
102 [Teardown] None
suraj gourd64356b2019-11-07 13:26:20 +0000103 Wait Until Keyword Succeeds ${timeout} 15s Restart Pod ${NAMESPACE} ${RESTART_POD_NAME}
104
105 FOR ${I} IN RANGE 0 ${num_onus}
106 ${src}= Set Variable ${hosts.src[${I}]}
107 ${dst}= Set Variable ${hosts.dst[${I}]}
108
109
110 ${onu_device_id}= Get Device ID From SN ${src['onu']}
111 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
112 ... ${of_id}
113 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip}
114 ... ${ONOS_SSH_PORT} ${onu_port}
suraj gour7f6d5fe2019-11-29 10:56:35 +0000115 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication After Reassociate
116 ... True ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
suraj gourd64356b2019-11-07 13:26:20 +0000117 ... ${src['container_type']} ${src['container_name']}
118 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
119 ... ${ONOS_SSH_PORT} ${onu_port}
120 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
121 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
122 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
123 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
124 ... ${dst['container_name']}
125 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
126 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri582574b2019-12-10 21:11:54 -0800127 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
128 Run Keyword and Ignore Error Collect Logs
suraj gourd64356b2019-11-07 13:26:20 +0000129 END
Suchitra Vemuri582574b2019-12-10 21:11:54 -0800130 Run Keyword and Ignore Error Collect Logs
suraj gourd64356b2019-11-07 13:26:20 +0000131
suraj gourd5cfdbb2019-12-13 12:44:55 +0000132Check DHCP attempt fails when subscriber is not added
133 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
134 ... when again added subscriber access, DHCP attempt, ping succeeds
135 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
136 [Tags] functional SubsRemoveDHCP
137 [Setup] None
138 #[Teardown] None
139
140 FOR ${I} IN RANGE 0 ${num_onus}
141 ${src}= Set Variable ${hosts.src[${I}]}
142 ${dst}= Set Variable ${hosts.dst[${I}]}
143
144 ${onu_device_id}= Get Device ID From SN ${src['onu']}
145 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
146 ... ${of_id}
147 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
148 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
149 # For releasing IP, also deleting lease file. Hence passing path where DHCP Client program writes the lease
150 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
151 ... Send Dhclient Request To Release Assigned IP ${src['dp_iface_name']} ${src['ip']}
152 ... ${src['user']} /var/lib/dhcp ${src['pass']} ${src['container_type']} ${src['container_name']}
153 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
154 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
155 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
156 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
157 ... ${dst['container_name']}
158 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
159 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
160 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
161 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
162 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
163 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
164 ... ${dst['container_name']}
165 END
166 Run Keyword and Ignore Error Collect Logs
167
David Bainbridgef81cd642019-11-20 00:14:47 +0000168Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart
169 [Documentation] Deploys an device instance and waits for it to authenticate. After
170 ... authentication is successful the rw-core deployment is scaled to 0 instances to
171 ... simulate a POD crash. The test then scales the rw-core back to a single instance
172 ... and configures ONOS for access. The test succeeds if the device is able to
173 ... complete the DHCP sequence.
174 [Tags] bbsim rwcore-restart
175 [Setup] Clear All Devices Then Create New Device
176 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
177 Set Global Variable ${of_id}
178
179 FOR ${I} IN RANGE 0 ${num_onus}
180 ${src}= Set Variable ${hosts.src[${I}]}
181 ${dst}= Set Variable ${hosts.dst[${I}]}
182 ${onu_device_id}= Get Device ID From SN ${src['onu']}
183 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
184 ... ${of_id}
185
186 # Bring up the device and verify it authenticates
187 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
188 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed
189 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip}
190 ... ${ONOS_SSH_PORT} ${onu_port}
191 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
192 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
193 ... ${src['container_type']} ${src['container_name']}
194 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
195 ... ${ONOS_SSH_PORT} ${onu_port}
196
197 # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1
198 Scale K8s Deployment voltha voltha-rw-core 0
199 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-rw-core
200 # Ensure the ofagent POD goes "not-ready" as expected
201 Wait Until keyword Succeeds ${timeout} 2s Check Expected Available Deployment Replicas voltha voltha-ofagent 0
202 # Scale up the core deployment and make sure both it and the ofagent deployment are back
203 Scale K8s Deployment voltha voltha-rw-core 1
204 Wait Until Keyword Succeeds ${timeout} 2s Check Expected Available Deployment Replicas voltha voltha-rw-core 1
205 Wait Until Keyword Succeeds ${timeout} 2s Check Expected Available Deployment Replicas voltha voltha-ofagent 1
206
207 # For some reason scaling down and up the POD behind a service causes the port forward to stop working,
208 # so restart the port forwarding for the API service
209 Restart VOLTHA Port Foward voltha-api-minimal
210
211 # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this
212 # represents system connectivity being restored
213 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
214 ... http://karaf:karaf@${k8s_node_ip}:${ONOS_REST_PORT} ${of_id}
215
216 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
217 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
218 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
219 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
220 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
221 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
222 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
223 ... ${dst['container_name']}
224 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
225 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
226 END
227
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700228*** Keywords ***
229Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700230 [Documentation] Set up the test suite
231 Common Test Suite Setup
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700232
233Setup
Zack Williamsec53a1b2019-09-16 15:50:52 -0700234 [Documentation] Pre-test Setup
Gilles Depatieb5682f82019-10-31 10:39:45 -0400235 #test for empty device list
David Bainbridgef81cd642019-11-20 00:14:47 +0000236 Test Empty Device List
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700237 #create/preprovision device
Suchitra Vemuric59eb272019-09-18 17:59:33 -0700238 ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT}
239 Set Suite Variable ${olt_device_id}
Gilles Depatieb5682f82019-10-31 10:39:45 -0400240 #validate olt states
241 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN
242 ... ${EMPTY} ${olt_device_id}
Suchitra Vemuric59eb272019-09-18 17:59:33 -0700243 Enable Device ${olt_device_id}
Gilles Depatieb5682f82019-10-31 10:39:45 -0400244 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
245 ... ${olt_serial_number}
Suchitra Vemuri00d147d2019-09-13 13:07:32 -0700246 ${logical_id}= Get Logical Device ID From SN ${olt_serial_number}
247 Set Suite Variable ${logical_id}
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700248
David Bainbridgef81cd642019-11-20 00:14:47 +0000249Delete All Devices and Verify
250 [Documentation] Remove any devices from VOLTHA and ONOS
251
252 # Clear devices from VOLTHA
253 Disable Devices In Voltha Root=true
254 Wait Until Keyword Succeeds ${timeout} 2s Test Devices Disabled In Voltha Root=true
255 Delete Devices In Voltha Root=true
256 Wait Until Keyword Succeeds ${timeout} 2s Test Empty Device List
257
258 # Clear devices from ONOS
259 Remove All Devices From ONOS
260 ... http://karaf:karaf@${k8s_node_ip}:${ONOS_REST_PORT}
261
262Clear All Devices Then Create New Device
263 [Documentation] Remove any devices from VOLTHA and ONOS
264
265 # Remove all devices from voltha and nos
266 Delete All Devices and Verify
267
268 # Execute normal test Setup Keyword
269 Setup
270
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700271Teardown
272 [Documentation] kills processes and cleans up interfaces on src+dst servers
Suchitra Vemuri582574b2019-12-10 21:11:54 -0800273 Run Keyword If ${has_dataplane} Clean Up Linux
274 Run Keyword If ${external_libs} Log Kubernetes Containers Logs Since Time ${datetime} ${container_list}
275
276Collect Logs
277 [Documentation] Collect Logs from voltha and onos cli for various commands
Suchitra Vemuri1a970a62019-11-26 12:52:16 -0800278 Run Keyword and Ignore Error Get Device List from Voltha
279 Run Keyword and Ignore Error Get Device Output from Voltha ${olt_device_id}
280 Run Keyword and Ignore Error Get Logical Device Output from Voltha ${logical_id}
Andy Bavierba9866b2019-10-11 07:11:53 -0700281 Run Keyword If ${external_libs} Get ONOS Status ${k8s_node_ip}
Andy Bavierba9866b2019-10-11 07:11:53 -0700282
283Teardown Suite
284 [Documentation] Clean up device if desired
David Bainbridgef81cd642019-11-20 00:14:47 +0000285 Run Keyword If ${teardown_device} Delete All Devices and Verify
Gilles Depatieb5682f82019-10-31 10:39:45 -0400286
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700287Clean Up Linux
288 [Documentation] Kill processes and clean up interfaces on src+dst servers
Suchitra Vemuri8a9c3782019-10-23 12:43:01 -0700289 FOR ${I} IN RANGE 0 ${num_onus}
290 ${src}= Set Variable ${hosts.src[${I}]}
291 ${dst}= Set Variable ${hosts.dst[${I}]}
292 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
293 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
294 Run Keyword And Ignore Error Kill Linux Process [d]hclient ${src['ip']}
295 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
296 Run Keyword If '${dst['ip']}' != '${None}' Run Keyword And Ignore Error
297 ... Kill Linux Process [d]hcpd ${dst['ip']} ${dst['user']}
298 ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']}
299 Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
300 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
301 Run Keyword If '${dst['ip']}' != '${None}' Delete Interface on Remote Host
302 ... ${dst['dp_iface_name']}.${src['s_tag']} ${dst['ip']} ${dst['user']} ${dst['pass']}
303 ... ${dst['container_type']} ${dst['container_name']}
304 END
Andy Bavierba9866b2019-10-11 07:11:53 -0700305
306Delete Device and Verify
307 [Documentation] Disable -> Delete devices via voltctl and verify its removed
Andy Bavierba9866b2019-10-11 07:11:53 -0700308 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
309 Should Be Equal As Integers ${rc} 0
Gilles Depatieb5682f82019-10-31 10:39:45 -0400310 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
311 ... ${olt_serial_number}
Andy Bavierba9866b2019-10-11 07:11:53 -0700312 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device delete ${olt_device_id}
313 Should Be Equal As Integers ${rc} 0
314 Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed ${olt_device_id}
Suchitra Vemurib89b9ac2019-12-11 21:53:11 -0800315
316Perform Sanity Test
317 [Documentation] This keyword performs Sanity Test Procedure
318 ... Sanity test performs authentication, dhcp and pings for all the ONUs given for the POD
319 ... This keyword can be used to call in any other tests where sanity check is required
320 ... and avoids duplication of code.
321
322 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
323 Set Global Variable ${of_id}
324
325 FOR ${I} IN RANGE 0 ${num_onus}
326 ${src}= Set Variable ${hosts.src[${I}]}
327 ${dst}= Set Variable ${hosts.dst[${I}]}
328
329 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
330 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
331
332 ${onu_device_id}= Get Device ID From SN ${src['onu']}
333 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
334 ... ${of_id}
335 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip}
336 ... ${ONOS_SSH_PORT} ${onu_port}
337 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
338 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
339 ... ${src['container_type']} ${src['container_name']}
340 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
341 ... ${ONOS_SSH_PORT} ${onu_port}
342 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
343 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
344 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
345 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
346 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
347 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
348 ... ${dst['container_name']}
349 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
350 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
351 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
352 Run Keyword and Ignore Error Collect Logs
353 END