blob: 1ebfb40b283c018560a47311bc7236a2a5f25a69 [file] [log] [blame]
Hardik Windlassb9bdd502020-04-17 14:46:21 +05301# Copyright 2017 - present Open Networking Foundation
2#
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# FIXME Can we use the same test against BBSim and Hardware?
15
16*** Settings ***
17Documentation Test various end-to-end scenarios
18Suite Setup Setup Suite
19Test Setup Setup
20Test Teardown Teardown
21Suite Teardown Teardown Suite
22Library Collections
23Library String
24Library OperatingSystem
25Library XML
26Library RequestsLibrary
27Library ../../libraries/DependencyLibrary.py
28Resource ../../libraries/onos.robot
29Resource ../../libraries/voltctl.robot
30Resource ../../libraries/voltha.robot
31Resource ../../libraries/utils.robot
32Resource ../../libraries/k8s.robot
33Resource ../../variables/variables.robot
Andrea Campanella15619c72020-04-30 09:48:04 +020034Resource ../../libraries/power_switch.robot
Hardik Windlassb9bdd502020-04-17 14:46:21 +053035
36*** Variables ***
37${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
44${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
48${timeout} 60s
49${of_id} 0
50${logical_id} 0
51${has_dataplane} True
52${teardown_device} False
53${scripts} ../../scripts
54
55# Per-test logging on failure is turned off by default; set this variable to enable
56${container_log_dir} ${None}
57
58*** Test Cases ***
59Verify ONU after Rebooting Physically for DT
60 [Documentation] Test the ONU functionality by physically turning on/off ONU.
61 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
62 ... Test case runs only on the PODs that are configured with PowerSwitch that
63 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
64 [Tags] functionalDt PowerSwitchOnuRebootDt VOL-2819 PowerSwitch
Hardik Windlass9df139e2020-04-24 14:54:54 +053065 [Setup] Start Logging RebootOnu_PowerSwitch_Dt
Hardik Windlassb9bdd502020-04-17 14:46:21 +053066 [Teardown] Run Keywords Collect Logs
67 ... AND Stop Logging RebootOnu_PowerSwitch_Dt
68 ... AND Delete Device and Verify
69 # Add OLT device
70 Setup
71 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
72 Run Keyword If ${has_dataplane} Clean Up Linux
73 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
74 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
75 FOR ${I} IN RANGE 0 ${num_onus}
76 ${src}= Set Variable ${hosts.src[${I}]}
77 ${dst}= Set Variable ${hosts.dst[${I}]}
78 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
79 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
80 Disable Switch Outlet ${src['power_switch_port']}
81 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
82 ... Wait Until Keyword Succeeds 60s 2s
83 ... 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']}
85
86 Enable Switch Outlet ${src['power_switch_port']}
87 # Check ONU port is Enabled in ONOS
88 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
89 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
90 # Verify ONU state in voltha
91 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
92 ... ENABLED ACTIVE REACHABLE
Andrea Campanella5e9051c2020-04-30 14:38:35 +020093 ... ${src['onu']} onu=True onu_reason=discovery-mibsync-complete
Hardik Windlassb9bdd502020-04-17 14:46:21 +053094 # Verify subscriber access flows are added for the ONU port
95 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
96 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
97 ... ${onu_port} ${nni_port} ${src['s_tag']}
98 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
99 ... Wait Until Keyword Succeeds 60s 2s
100 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
101 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
102 Run Keyword And Ignore Error Collect Logs
103 END
104 # Verify ONOS Flows
105 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
106 ${onos_flows_count}= Evaluate 4 * ${num_onus}
107 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
108 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
109 ... ${of_id} ${onos_flows_count}
110 # Verify VOLTHA Flows
111 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
112 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
113 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
114 ${onu_flows}= Set Variable 2
115 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
116 ${List_ONU_Serial} Create List
117 Set Suite Variable ${List_ONU_Serial}
118 Build ONU SN List ${List_ONU_Serial}
119 Log ${List_ONU_Serial}
120 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
121 ... ${List_ONU_Serial} ${onu_flows}
122
123Verify OLT after Rebooting Physically for DT
124 [Documentation] Test the physical reboot of the OLT
125 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
126 ... Test performs a physical reboot, performs "reboot" from the OLT CLI
127 [Tags] functionalDt PhysicalOltRebootDt VOL-2817
Hardik Windlass9df139e2020-04-24 14:54:54 +0530128 [Setup] Start Logging RebootOlt_Physical_Dt
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530129 [Teardown] Run Keywords Collect Logs
130 ... AND Stop Logging RebootOlt_Physical_Dt
131 ... AND Delete Device and Verify
132 # Add OLT device
133 Setup
134 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
135 Run Keyword If ${has_dataplane} Clean Up Linux
136 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
137 # Reboot the OLT from the OLT CLI
138 Run Keyword If ${has_dataplane} Login And Run Command On Remote System
139 ... sudo reboot ${olt_ip} ${olt_user} ${olt_pass} prompt=#
140 Run Keyword And Ignore Error Collect Logs
141 FOR ${I} IN RANGE 0 ${num_onus}
142 ${src}= Set Variable ${hosts.src[${I}]}
143 ${dst}= Set Variable ${hosts.dst[${I}]}
144 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
145 ... Wait Until Keyword Succeeds 60s 2s
146 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
147 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
148 END
149 # Wait for the OLT to come back up
150 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
151 ... Check Remote System Reachability True ${olt_ip}
152 # Waiting extra time for the ONUs to come up
153 Sleep 60s
154 Run Keyword And Ignore Error Collect Logs
155 Run Keyword If ${has_dataplane} Clean Up Linux
156 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
157
Hardik Windlass9df139e2020-04-24 14:54:54 +0530158Verify restart openolt-adapter container after subscriber provisioning for DT
159 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
160 ... Prerequisite : ONUs are authenticated and pingable.
161 [Tags] functionalDt Restart-OpenOlt-Dt
162 [Setup] Start Logging Restart-OpenOlt-Dt
163 [Teardown] Run Keywords Collect Logs
164 ... AND Stop Logging Restart-OpenOlt-Dt
165 # Add OLT device
166 setup
167 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
168 Run Keyword If ${has_dataplane} Clean Up Linux
169 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
170 ${waitforRestart} Set Variable 120s
171 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
172 Log ${podStatusOutput}
173 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
174 ${podName} Set Variable adapter-open-olt
175 Restart Pod ${NAMESPACE} ${podName}
176 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ${podName} ${NAMESPACE}
177 ... Running
178 # Wait for 1min after openolt adapter is restarted
179 Sleep 60s
180 Run Keyword If ${has_dataplane} Clean Up Linux
181 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
182 Run Keyword and Ignore Error Collect Logs
183 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
184 Log ${podStatusOutput}
185 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
186 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
187 Log to console Pod ${podName} restarted and sanity checks passed successfully
188
189Verify openolt adapter restart before subscriber provisioning for DT
190 [Documentation] Deploys an device instance and waits for it to authenticate. After
191 ... authentication is successful the rw-core deployment is scaled to 0 instances to
192 ... simulate a POD crash. The test then scales the rw-core back to a single instance
193 ... and configures ONOS for access. The test succeeds if the device is able to
194 ... complete the DHCP sequence.
195 [Tags] functionalDt olt-adapter-restart-Dt
196 [Setup] Start Logging OltAdapterRestart-Dt
197 #... AND Clear All Devices Then Create New Device
198 [Teardown] Run Keywords Collect Logs
199 ... AND Stop Logging OltAdapterRestart-Dt
200 # Add OLT and perform sanity test
201 #setup
202 Run Keyword If ${has_dataplane} Clean Up Linux
203 #Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
204 Set Global Variable ${of_id}
205
206 FOR ${I} IN RANGE 0 ${num_onus}
207 ${src}= Set Variable ${hosts.src[${I}]}
208 ${dst}= Set Variable ${hosts.dst[${I}]}
209 ${onu_device_id}= Get Device ID From SN ${src['onu']}
210 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
211 ... ${of_id}
212 # Bring up the device and verify it authenticates
213 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
214 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed
215 END
216 # Scale down the open OLT adapter deployment to 0 PODs and once confirmed, scale it back to 1
217 Scale K8s Deployment voltha adapter-open-olt 0
218 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha adapter-open-olt
219 # Scale up the open OLT adapter deployment and make sure both it and the ofagent deployment are back
220 Scale K8s Deployment voltha adapter-open-olt 1
221 Wait Until Keyword Succeeds ${timeout} 2s
222 ... Check Expected Available Deployment Replicas voltha adapter-open-olt 1
223
224 # Ensure the device is available in ONOS, this represents system connectivity being restored
225 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
226 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
227
228 FOR ${I} IN RANGE 0 ${num_onus}
229 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
230 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
231 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
232 # Verify subscriber access flows are added for the ONU port
233 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
234 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
235 ... ${onu_port} ${nni_port} ${src['s_tag']}
236 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
237 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
238 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
239 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
240 ... ${dst['container_name']}
241 END
242
243Verify restart ofagent container after subscriber is provisioned for DT
244 [Documentation] Restart ofagent container after VOLTHA is operational.
245 ... Prerequisite : ONUs are authenticated and pingable.
246 [Tags] functionalDt ofagentRestart-Dt
247 [Setup] Start Logging ofagentRestart-Dt
248 [Teardown] Run Keywords Collect Logs
249 ... AND Stop Logging ofagentRestart-Dt
250 ... AND Scale K8s Deployment ${NAMESPACE} voltha-ofagent 1
251 # set timeout value
252 ${waitforRestart} Set Variable 120s
253 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
254 Log ${podStatusOutput}
255 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
256 ${podName} Set Variable ofagent
257 Restart Pod ${NAMESPACE} ${podName}
258 Sleep 60s
259 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
260 ... Running
261 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
262 Run Keyword If ${has_dataplane} Clean Up Linux
263 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
264 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
265 Log ${podStatusOutput}
266 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
267 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
268 # Scale Down the Of-Agent Deployment
269 Scale K8s Deployment ${NAMESPACE} voltha-ofagent 0
270 Sleep 30s
271 FOR ${I} IN RANGE 0 ${num_onus}
272 ${src}= Set Variable ${hosts.src[${I}]}
273 ${dst}= Set Variable ${hosts.dst[${I}]}
274 Run Keyword and Ignore Error Collect Logs
275 ${onu_device_id}= Get Device ID From SN ${src['onu']}
276 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
277 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
278 # Verify ONU state in voltha
279 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
280 ... ENABLED ACTIVE REACHABLE
281 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
282 # Check ONU port is Disabled in ONOS
283 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
284 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
285 # Verify subscriber access flows are added for the ONU port
286 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
287 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
288 ... ${onu_port} ${nni_port} ${src['s_tag']}
289 # Verify Ping
290 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Check Ping True
291 ... ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']}
292 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
293 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
294 Run Keyword and Ignore Error Collect Logs
295 END
296 # Scale Up the Of-Agent Deployment
297 Scale K8s Deployment ${NAMESPACE} voltha-ofagent 1
298 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
299 ... Running
300 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
301 Run Keyword If ${has_dataplane} Clean Up Linux
302 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
303 Log to console Pod ${podName} restarted and sanity checks passed successfully
304
305Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart for DT
306 [Documentation] Deploys an device instance and waits for it to authenticate. After
307 ... authentication is successful the rw-core deployment is scaled to 0 instances to
308 ... simulate a POD crash. The test then scales the rw-core back to a single instance
309 ... and configures ONOS for access. The test succeeds if the device is able to
310 ... complete the DHCP sequence.
311 [Tags] functionalDt rwcore-restart-Dt
312 [Setup] Run Keywords Start Logging RwCoreFailAndRestart-Dt
313 ... AND Clear All Devices Then Create New Device
314 [Teardown] Run Keywords Collect Logs
315 ... AND Stop Logging RwCoreFailAndRestart-Dt
316 #... AND Delete Device and Verify
317 Run Keyword and Ignore Error Collect Logs
318 Run Keyword If ${has_dataplane} Clean Up Linux
319 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
320 Set Global Variable ${of_id}
321 ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
322 ... Get NNI Port in ONOS ${of_id}
323 Set Global Variable ${nni_port}
324 FOR ${I} IN RANGE 0 ${num_onus}
325 ${src}= Set Variable ${hosts.src[${I}]}
326 ${dst}= Set Variable ${hosts.dst[${I}]}
327 ${onu_device_id}= Get Device ID From SN ${src['onu']}
328 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
329 ... ${of_id}
330 # Bring up the device and verify it authenticates
331 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
332 ... ${onu_device_id} onu=True onu_reason=initial-mib-downloaded
333 END
334
335 # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1
336 Scale K8s Deployment voltha voltha-rw-core 0
337 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-rw-core
338 # Ensure the ofagent POD goes "not-ready" as expected
339 Wait Until keyword Succeeds ${timeout} 2s
340 ... Check Expected Available Deployment Replicas voltha voltha-ofagent 0
341 # Scale up the core deployment and make sure both it and the ofagent deployment are back
342 Scale K8s Deployment voltha voltha-rw-core 1
343 Wait Until Keyword Succeeds ${timeout} 2s
344 ... Check Expected Available Deployment Replicas voltha voltha-rw-core 1
345 Wait Until Keyword Succeeds ${timeout} 2s
346 ... Check Expected Available Deployment Replicas voltha voltha-ofagent 1
347 # For some reason scaling down and up the POD behind a service causes the port forward to stop working,
348 # so restart the port forwarding for the API service
349 Restart VOLTHA Port Foward voltha-api-minimal
350 # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this
351 # represents system connectivity being restored
352 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
353 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
354
355 FOR ${I} IN RANGE 0 ${num_onus}
356 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
357 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
358 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
359 # Verify subscriber access flows are added for the ONU port
360 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
361 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
362 ... ${onu_port} ${nni_port} ${src['s_tag']}
363 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
364 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
365 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
366 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
367 ... ${dst['container_name']}
368 END
369
Hemadf003682020-04-28 21:22:22 +0530370Verify OLT Soft Reboot for DT
371 [Documentation] Test soft reboot of the OLT using voltctl command
372 [Tags] VOL-2818 OLTSoftRebootDt notready
373 [Setup] Start Logging OLTSoftRebootDt
374 #... AND Setup
375 [Teardown] Run Keywords Collect Logs
376 ... AND Stop Logging OLTSoftRebootDt
377 #... AND Delete Device and Verify
378 ## Performing Sanity Test to make sure subscribers are all DHCP and pingable
379 #Run Keyword If ${has_dataplane} Clean Up Linux
380 #Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
381 # Reboot the OLT using "voltctl device reboot" command
382 Reboot Device ${olt_device_id}
383 Run Keyword And Ignore Error Collect Logs
384 #Verify that ping fails
385 FOR ${I} IN RANGE 0 ${num_onus}
386 ${src}= Set Variable ${hosts.src[${I}]}
387 ${dst}= Set Variable ${hosts.dst[${I}]}
388 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
389 ... Wait Until Keyword Succeeds 60s 2s
390 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
391 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
392 END
393 # Wait for the OLT to come back up
394 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
395 ... Check Remote System Reachability True ${olt_ip}
396 # Waiting extra time for the ONUs to come up
397 Sleep 60s
398 # Check OLT states
399 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
400 ... ${olt_serial_number}
401 Run Keyword And Ignore Error Collect Logs
402 #Check after reboot that ONUs are active, DHCP and pingable
403 Run Keyword If ${has_dataplane} Clean Up Linux
404 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
405
406
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530407*** Keywords ***
408Setup Suite
409 [Documentation] Set up the test suite
410 Common Test Suite Setup
Andrea Campanella15619c72020-04-30 09:48:04 +0200411 #power_switch.robot needs it to support different vendor's power switch
412 ${switch_type}= Get Variable Value ${web_power_switch.type}
413 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530414
415Clear All Devices Then Create New Device
416 [Documentation] Remove any devices from VOLTHA and ONOS
417 # Remove all devices from voltha and nos
418 Delete All Devices and Verify
419 # Execute normal test Setup Keyword
420 Setup
421