blob: 67d5cce9caedb6816fa9fb405984d6daddbb0ce8 [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}
Hardik Windlass7c801e62020-05-04 19:33:21 +053080 # Disable Power Switch
Hardik Windlassb9bdd502020-04-17 14:46:21 +053081 Disable Switch Outlet ${src['power_switch_port']}
82 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
83 ... Wait Until Keyword Succeeds 60s 2s
84 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
85 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +053086 # Remove Subscriber Access (To replicate DT workflow)
87 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
88 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
89 # Delete ONU Device (To replicate DT workflow)
90 Delete Device ${onu_device_id}
91 Sleep 5s
92 # Enable Power Switch
Hardik Windlassb9bdd502020-04-17 14:46:21 +053093 Enable Switch Outlet ${src['power_switch_port']}
Hardik Windlass7c801e62020-05-04 19:33:21 +053094 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Hardik Windlassb9bdd502020-04-17 14:46:21 +053095 # Check ONU port is Enabled in ONOS
96 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
97 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass7c801e62020-05-04 19:33:21 +053098 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
99 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
100 ... volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530101 # Verify ONU state in voltha
102 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
103 ... ENABLED ACTIVE REACHABLE
Hardik Windlass7c801e62020-05-04 19:33:21 +0530104 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530105 # Verify subscriber access flows are added for the ONU port
106 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
107 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
108 ... ${onu_port} ${nni_port} ${src['s_tag']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530109 Run Keyword If ${has_dataplane} Clean Up Linux
110 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
111 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530112 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530113 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
114 ... ${dst['container_name']}
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530115 Run Keyword And Ignore Error Collect Logs
116 END
117 # Verify ONOS Flows
118 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
119 ${onos_flows_count}= Evaluate 4 * ${num_onus}
120 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
121 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
122 ... ${of_id} ${onos_flows_count}
123 # Verify VOLTHA Flows
124 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
125 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
126 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
127 ${onu_flows}= Set Variable 2
128 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
129 ${List_ONU_Serial} Create List
130 Set Suite Variable ${List_ONU_Serial}
131 Build ONU SN List ${List_ONU_Serial}
132 Log ${List_ONU_Serial}
133 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
134 ... ${List_ONU_Serial} ${onu_flows}
135
136Verify OLT after Rebooting Physically for DT
137 [Documentation] Test the physical reboot of the OLT
138 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
139 ... Test performs a physical reboot, performs "reboot" from the OLT CLI
140 [Tags] functionalDt PhysicalOltRebootDt VOL-2817
Hardik Windlass9df139e2020-04-24 14:54:54 +0530141 [Setup] Start Logging RebootOlt_Physical_Dt
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530142 [Teardown] Run Keywords Collect Logs
143 ... AND Stop Logging RebootOlt_Physical_Dt
144 ... AND Delete Device and Verify
145 # Add OLT device
146 Setup
147 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
148 Run Keyword If ${has_dataplane} Clean Up Linux
149 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
150 # Reboot the OLT from the OLT CLI
151 Run Keyword If ${has_dataplane} Login And Run Command On Remote System
152 ... sudo reboot ${olt_ip} ${olt_user} ${olt_pass} prompt=#
153 Run Keyword And Ignore Error Collect Logs
154 FOR ${I} IN RANGE 0 ${num_onus}
155 ${src}= Set Variable ${hosts.src[${I}]}
156 ${dst}= Set Variable ${hosts.dst[${I}]}
157 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
158 ... Wait Until Keyword Succeeds 60s 2s
159 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
160 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
161 END
162 # Wait for the OLT to come back up
163 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
164 ... Check Remote System Reachability True ${olt_ip}
165 # Waiting extra time for the ONUs to come up
166 Sleep 60s
167 Run Keyword And Ignore Error Collect Logs
168 Run Keyword If ${has_dataplane} Clean Up Linux
169 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
170
Hardik Windlass9df139e2020-04-24 14:54:54 +0530171Verify restart openolt-adapter container after subscriber provisioning for DT
172 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
173 ... Prerequisite : ONUs are authenticated and pingable.
174 [Tags] functionalDt Restart-OpenOlt-Dt
175 [Setup] Start Logging Restart-OpenOlt-Dt
176 [Teardown] Run Keywords Collect Logs
177 ... AND Stop Logging Restart-OpenOlt-Dt
178 # Add OLT device
179 setup
180 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
181 Run Keyword If ${has_dataplane} Clean Up Linux
182 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
183 ${waitforRestart} Set Variable 120s
184 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
185 Log ${podStatusOutput}
186 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
187 ${podName} Set Variable adapter-open-olt
188 Restart Pod ${NAMESPACE} ${podName}
189 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ${podName} ${NAMESPACE}
190 ... Running
191 # Wait for 1min after openolt adapter is restarted
192 Sleep 60s
193 Run Keyword If ${has_dataplane} Clean Up Linux
194 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
195 Run Keyword and Ignore Error Collect Logs
196 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
197 Log ${podStatusOutput}
198 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
199 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
200 Log to console Pod ${podName} restarted and sanity checks passed successfully
201
202Verify openolt adapter restart before subscriber provisioning for DT
203 [Documentation] Deploys an device instance and waits for it to authenticate. After
204 ... authentication is successful the rw-core deployment is scaled to 0 instances to
205 ... simulate a POD crash. The test then scales the rw-core back to a single instance
206 ... and configures ONOS for access. The test succeeds if the device is able to
207 ... complete the DHCP sequence.
208 [Tags] functionalDt olt-adapter-restart-Dt
209 [Setup] Start Logging OltAdapterRestart-Dt
210 #... AND Clear All Devices Then Create New Device
211 [Teardown] Run Keywords Collect Logs
212 ... AND Stop Logging OltAdapterRestart-Dt
213 # Add OLT and perform sanity test
214 #setup
215 Run Keyword If ${has_dataplane} Clean Up Linux
216 #Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
217 Set Global Variable ${of_id}
218
219 FOR ${I} IN RANGE 0 ${num_onus}
220 ${src}= Set Variable ${hosts.src[${I}]}
221 ${dst}= Set Variable ${hosts.dst[${I}]}
222 ${onu_device_id}= Get Device ID From SN ${src['onu']}
223 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
224 ... ${of_id}
225 # Bring up the device and verify it authenticates
226 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
227 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed
228 END
229 # Scale down the open OLT adapter deployment to 0 PODs and once confirmed, scale it back to 1
230 Scale K8s Deployment voltha adapter-open-olt 0
231 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha adapter-open-olt
232 # Scale up the open OLT adapter deployment and make sure both it and the ofagent deployment are back
233 Scale K8s Deployment voltha adapter-open-olt 1
234 Wait Until Keyword Succeeds ${timeout} 2s
235 ... Check Expected Available Deployment Replicas voltha adapter-open-olt 1
236
237 # Ensure the device is available in ONOS, this represents system connectivity being restored
238 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
239 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
240
241 FOR ${I} IN RANGE 0 ${num_onus}
242 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
243 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
244 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
245 # Verify subscriber access flows are added for the ONU port
246 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
247 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
248 ... ${onu_port} ${nni_port} ${src['s_tag']}
249 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
250 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
251 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
252 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
253 ... ${dst['container_name']}
254 END
255
256Verify restart ofagent container after subscriber is provisioned for DT
257 [Documentation] Restart ofagent container after VOLTHA is operational.
258 ... Prerequisite : ONUs are authenticated and pingable.
259 [Tags] functionalDt ofagentRestart-Dt
260 [Setup] Start Logging ofagentRestart-Dt
261 [Teardown] Run Keywords Collect Logs
262 ... AND Stop Logging ofagentRestart-Dt
263 ... AND Scale K8s Deployment ${NAMESPACE} voltha-ofagent 1
264 # set timeout value
265 ${waitforRestart} Set Variable 120s
266 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
267 Log ${podStatusOutput}
268 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
269 ${podName} Set Variable ofagent
270 Restart Pod ${NAMESPACE} ${podName}
271 Sleep 60s
272 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
273 ... Running
274 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
275 Run Keyword If ${has_dataplane} Clean Up Linux
276 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
277 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
278 Log ${podStatusOutput}
279 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
280 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
281 # Scale Down the Of-Agent Deployment
282 Scale K8s Deployment ${NAMESPACE} voltha-ofagent 0
283 Sleep 30s
284 FOR ${I} IN RANGE 0 ${num_onus}
285 ${src}= Set Variable ${hosts.src[${I}]}
286 ${dst}= Set Variable ${hosts.dst[${I}]}
287 Run Keyword and Ignore Error Collect Logs
288 ${onu_device_id}= Get Device ID From SN ${src['onu']}
289 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
290 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
291 # Verify ONU state in voltha
292 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
293 ... ENABLED ACTIVE REACHABLE
294 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
295 # Check ONU port is Disabled in ONOS
296 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
297 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
298 # Verify subscriber access flows are added for the ONU port
299 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
300 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
301 ... ${onu_port} ${nni_port} ${src['s_tag']}
302 # Verify Ping
303 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Check Ping True
304 ... ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']}
305 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
306 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
307 Run Keyword and Ignore Error Collect Logs
308 END
309 # Scale Up the Of-Agent Deployment
310 Scale K8s Deployment ${NAMESPACE} voltha-ofagent 1
311 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
312 ... Running
313 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
314 Run Keyword If ${has_dataplane} Clean Up Linux
315 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
316 Log to console Pod ${podName} restarted and sanity checks passed successfully
317
318Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart for DT
319 [Documentation] Deploys an device instance and waits for it to authenticate. After
320 ... authentication is successful the rw-core deployment is scaled to 0 instances to
321 ... simulate a POD crash. The test then scales the rw-core back to a single instance
322 ... and configures ONOS for access. The test succeeds if the device is able to
323 ... complete the DHCP sequence.
324 [Tags] functionalDt rwcore-restart-Dt
325 [Setup] Run Keywords Start Logging RwCoreFailAndRestart-Dt
326 ... AND Clear All Devices Then Create New Device
327 [Teardown] Run Keywords Collect Logs
328 ... AND Stop Logging RwCoreFailAndRestart-Dt
329 #... AND Delete Device and Verify
330 Run Keyword and Ignore Error Collect Logs
331 Run Keyword If ${has_dataplane} Clean Up Linux
332 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
333 Set Global Variable ${of_id}
334 ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
335 ... Get NNI Port in ONOS ${of_id}
336 Set Global Variable ${nni_port}
337 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 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
342 ... ${of_id}
343 # Bring up the device and verify it authenticates
344 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
345 ... ${onu_device_id} onu=True onu_reason=initial-mib-downloaded
346 END
347
348 # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1
349 Scale K8s Deployment voltha voltha-rw-core 0
350 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-rw-core
351 # Ensure the ofagent POD goes "not-ready" as expected
352 Wait Until keyword Succeeds ${timeout} 2s
353 ... Check Expected Available Deployment Replicas voltha voltha-ofagent 0
354 # Scale up the core deployment and make sure both it and the ofagent deployment are back
355 Scale K8s Deployment voltha voltha-rw-core 1
356 Wait Until Keyword Succeeds ${timeout} 2s
357 ... Check Expected Available Deployment Replicas voltha voltha-rw-core 1
358 Wait Until Keyword Succeeds ${timeout} 2s
359 ... Check Expected Available Deployment Replicas voltha voltha-ofagent 1
360 # For some reason scaling down and up the POD behind a service causes the port forward to stop working,
361 # so restart the port forwarding for the API service
362 Restart VOLTHA Port Foward voltha-api-minimal
363 # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this
364 # represents system connectivity being restored
365 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
366 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
367
368 FOR ${I} IN RANGE 0 ${num_onus}
369 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
370 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
371 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
372 # Verify subscriber access flows are added for the ONU port
373 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
374 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
375 ... ${onu_port} ${nni_port} ${src['s_tag']}
376 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
377 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
378 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
379 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
380 ... ${dst['container_name']}
381 END
382
Hemadf003682020-04-28 21:22:22 +0530383Verify OLT Soft Reboot for DT
384 [Documentation] Test soft reboot of the OLT using voltctl command
385 [Tags] VOL-2818 OLTSoftRebootDt notready
386 [Setup] Start Logging OLTSoftRebootDt
387 #... AND Setup
388 [Teardown] Run Keywords Collect Logs
389 ... AND Stop Logging OLTSoftRebootDt
390 #... AND Delete Device and Verify
391 ## Performing Sanity Test to make sure subscribers are all DHCP and pingable
392 #Run Keyword If ${has_dataplane} Clean Up Linux
393 #Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
394 # Reboot the OLT using "voltctl device reboot" command
395 Reboot Device ${olt_device_id}
396 Run Keyword And Ignore Error Collect Logs
397 #Verify that ping fails
398 FOR ${I} IN RANGE 0 ${num_onus}
399 ${src}= Set Variable ${hosts.src[${I}]}
400 ${dst}= Set Variable ${hosts.dst[${I}]}
401 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
402 ... Wait Until Keyword Succeeds 60s 2s
403 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
404 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
405 END
406 # Wait for the OLT to come back up
407 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
408 ... Check Remote System Reachability True ${olt_ip}
409 # Waiting extra time for the ONUs to come up
410 Sleep 60s
411 # Check OLT states
412 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
413 ... ${olt_serial_number}
414 Run Keyword And Ignore Error Collect Logs
415 #Check after reboot that ONUs are active, DHCP and pingable
416 Run Keyword If ${has_dataplane} Clean Up Linux
417 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
418
419
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530420*** Keywords ***
421Setup Suite
422 [Documentation] Set up the test suite
423 Common Test Suite Setup
Andrea Campanella15619c72020-04-30 09:48:04 +0200424 #power_switch.robot needs it to support different vendor's power switch
425 ${switch_type}= Get Variable Value ${web_power_switch.type}
426 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530427
428Clear All Devices Then Create New Device
429 [Documentation] Remove any devices from VOLTHA and ONOS
430 # Remove all devices from voltha and nos
431 Delete All Devices and Verify
432 # Execute normal test Setup Keyword
433 Setup
434