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