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