blob: a1617f090ce45a6373c6eb99d1ea90f88c034868 [file] [log] [blame]
TorstenThieme136ebf72021-02-26 14:27:07 +00001# Copyright 2021 - 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 functional end-to-end scenarios for TT workflow
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
34Resource ../../libraries/power_switch.robot
35
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
Hardik Windlass04896f62021-03-05 16:15:11 +053052${teardown_device} True
TorstenThieme136ebf72021-02-26 14:27:07 +000053${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${suppressaddsubscriber} True
59
60*** Test Cases ***
Hardik Windlass364ec452021-04-14 07:12:28 +000061Verify ONU after Rebooting Physically for TT
62 [Documentation] Test the ONU functionality by physically turning on/off ONU.
63 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityTT test was executed)
64 ... Test case runs only on the PODs that are configured with PowerSwitch that
65 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
66 [Tags] functionalTT PowerSwitchOnuRebootTT PowerSwitch
67 [Setup] Start Logging RebootOnu_PowerSwitch_TT
68 [Teardown] Run Keywords Collect Logs
69 ... AND Stop Logging RebootOnu_PowerSwitch_TT
70 ... AND Delete All Devices and Verify
71 # Add OLT device
72 Setup
73 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
74 Run Keyword If ${has_dataplane} Clean Up Linux
75 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
76 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
77 Run Keyword If ${has_dataplane} Clean Up Linux
78 FOR ${I} IN RANGE 0 ${num_all_onus}
79 ${src}= Set Variable ${hosts.src[${I}]}
80 ${dst}= Set Variable ${hosts.dst[${I}]}
81 ${service_type}= Get Variable Value ${src['service_type']} "null"
82 ${of_id}= Get ofID From OLT List ${src['olt']}
83 ${onu_device_id}= Get Device ID From SN ${src['onu']}
84 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
85 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
86 # Disable Power Switch
87 Disable Switch Outlet ${src['power_switch_port']}
88 # TODO: Add verification for MCAST
89 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure
90 ... Wait Until Keyword Succeeds 60s 2s
91 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
92 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
93 # Remove Subscriber Access (To replicate TT workflow)
94 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
95 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
96 Sleep 5s
97 # Enable Power Switch
98 Enable Switch Outlet ${src['power_switch_port']}
99 # 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} ${src['onu']}
102 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}
105 # Verify ONU state in voltha
106 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
107 ... ENABLED ACTIVE REACHABLE
108 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
109 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast'
110 ... 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']}
112 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
113 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
114 ... ${dst['container_name']}
115 ... ELSE IF ${has_dataplane} and '${service_type}' == 'mcast' Run Keyword And Continue On Failure
116 ... Wait Until Keyword Succeeds ${timeout} 2s Sanity Test TT MCAST one ONU ${src}
117 ... ${dst} ${suppressaddsubscriber}
118 END
119
120Verify OLT after Rebooting Physically for TT
121 [Documentation] Test the physical reboot of the OLT
122 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityTT test was executed)
123 ... Test performs a physical reboot, performs "reboot" from the OLT CLI
124 [Tags] functionalTT PhysicalOltRebootTT
125 [Setup] Start Logging RebootOlt_Physical_TT
126 [Teardown] Run Keywords Collect Logs
127 ... AND Stop Logging RebootOlt_Physical_TT
128 ... AND Delete All Devices and Verify
129 # Add OLT device
130 Setup
131 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
132 Run Keyword If ${has_dataplane} Clean Up Linux
133 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
134 # Reboot the OLT from the OLT CLI
135 FOR ${I} IN RANGE 0 ${olt_count}
136 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
137 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
138 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
139 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
140 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
141 Run Keyword If ${has_dataplane} Login And Run Command On Remote System
142 ... reboot ${olt_ssh_ip} ${olt_user} ${olt_pass} prompt=#
143 END
144 FOR ${I} IN RANGE 0 ${num_all_onus}
145 ${src}= Set Variable ${hosts.src[${I}]}
146 ${dst}= Set Variable ${hosts.dst[${I}]}
147 ${service_type}= Get Variable Value ${src['service_type']} "null"
148 # TODO: Add verification for MCAST
149 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure
150 ... Wait Until Keyword Succeeds 60s 2s
151 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
152 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
153 END
154 # Wait for the OLT to come back up
155 FOR ${I} IN RANGE 0 ${olt_count}
156 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
157 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
158 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
159 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
160 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
161 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
162 ... Check Remote System Reachability True ${olt_ssh_ip}
163 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
164 ... Validate OLT Device ENABLED ACTIVE
165 ... REACHABLE ${olt_serial_number}
166 END
167 Run Keyword If ${has_dataplane} Clean Up Linux
168 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
169
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000170Verify ONU Soft Reboot for TT
171 [Documentation] Test the ONU Soft Reboot functionality.
172 [Tags] functionalTT OnuSoftRebootTT
173 [Setup] Start Logging SoftRebootOnu_TT
174 [Teardown] Run Keywords Collect Logs
175 ... AND Stop Logging SoftRebootOnu_TT
176 ... AND Delete All Devices and Verify
177 # Add OLT device
178 Setup
179 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
180 Run Keyword If ${has_dataplane} Clean Up Linux
181 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
182 FOR ${I} IN RANGE 0 ${num_all_onus}
183 ${src}= Set Variable ${hosts.src[${I}]}
184 ${dst}= Set Variable ${hosts.dst[${I}]}
185 ${service_type}= Get Variable Value ${src['service_type']} "null"
186 ${of_id}= Get ofID From OLT List ${src['olt']}
187 ${onu_device_id}= Get Device ID From SN ${src['onu']}
188 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
189 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
190 Reboot Device ${onu_device_id}
191 # TODO: Add verification for MCAST
192 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure
193 ... Wait Until Keyword Succeeds ${timeout} 2s
194 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
195 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
196 # Remove Subscriber Access (To replicate TT workflow)
197 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
198 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
199 # Check ONU port is Enabled in ONOS
200 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
201 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
202 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
203 ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
204 ... volt-add-subscriber-access ${of_id} ${onu_port}
205 # Verify ONU state in voltha
206 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
207 ... ENABLED ACTIVE REACHABLE
208 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
209 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast'
210 ... Run Keyword And Continue On Failure Validate DHCP and Ping True
211 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
212 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
213 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
214 ... ${dst['container_name']}
215 ... ELSE IF ${has_dataplane} and '${service_type}' == 'mcast' Run Keyword And Continue On Failure
216 ... Wait Until Keyword Succeeds ${timeout} 2s Sanity Test TT MCAST one ONU ${src}
217 ... ${dst} ${suppressaddsubscriber}
218 END
219 Run Keyword If ${has_dataplane} Clean Up Linux
220 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT ${suppressaddsubscriber}
221
Hardik Windlass656661a2021-04-23 03:46:31 +0000222Verify OLT Soft Reboot for TT
223 [Documentation] Test the OLT Soft Reboot functionality.
224 [Tags] functionalTT OltSoftRebootTT
225 [Setup] Start Logging SoftRebootOlt_TT
226 [Teardown] Run Keywords Collect Logs
227 ... AND Stop Logging SoftRebootOlt_TT
228 ... AND Delete All Devices and Verify
229 # Add OLT device
230 Setup
231 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
232 Run Keyword If ${has_dataplane} Clean Up Linux
233 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
234 # Reboot the OLT from the OLT CLI
235 FOR ${I} IN RANGE 0 ${olt_count}
236 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
237 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
238 # Reboot the OLT using "voltctl device reboot" command
239 Reboot Device ${olt_device_id}
240 END
241 FOR ${I} IN RANGE 0 ${num_all_onus}
242 ${src}= Set Variable ${hosts.src[${I}]}
243 ${dst}= Set Variable ${hosts.dst[${I}]}
244 ${service_type}= Get Variable Value ${src['service_type']} "null"
245 # TODO: Add verification for MCAST
246 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure
247 ... Wait Until Keyword Succeeds ${timeout} 2s
248 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
249 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
250 END
251 # Wait for the OLT to come back up
252 FOR ${I} IN RANGE 0 ${olt_count}
253 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
254 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
255 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
256 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
257 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
258 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
259 ... Check Remote System Reachability True ${olt_ssh_ip}
260 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
261 ... Validate OLT Device ENABLED ACTIVE
262 ... REACHABLE ${olt_serial_number}
263 END
264 Run Keyword If ${has_dataplane} Clean Up Linux
265 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
266
TorstenThieme136ebf72021-02-26 14:27:07 +0000267Verify restart openonu-adapter container after subscriber provisioning for TT
268 [Documentation] Restart openonu-adapter container after VOLTHA is operational.
269 ... Prerequisite : ONUs are authenticated and pingable.
Hardik Windlass04896f62021-03-05 16:15:11 +0530270 [Tags] functionalTT Restart-OpenOnu-TT
TorstenThieme136ebf72021-02-26 14:27:07 +0000271 [Setup] Start Logging Restart-OpenOnu-TT
272 [Teardown] Run Keywords Collect Logs
273 ... AND Stop Logging Restart-OpenOnu-TT
274 ... AND Delete All Devices and Verify
275 # Add OLT device
276 Setup
277 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
278 Run Keyword If ${has_dataplane} Clean Up Linux
279 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
280 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
281 Log ${podStatusOutput}
282 ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
283 ${podName} Set Variable adapter-open-onu
284 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
285 Sleep 5s
286 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
287 ... app ${podName} Running
288 Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
289 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT ${suppressaddsubscriber}
290 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
291 Log ${podStatusOutput}
292 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
293 Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart}
294 Log to console Pod ${podName} restarted and sanity checks passed successfully
295
Hardik Windlassd3f63892021-03-25 08:28:02 +0000296Verify restart openolt-adapter container after subscriber provisioning for TT
297 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
298 [Tags] functionalTT Restart-OpenOlt-TT
299 [Setup] Start Logging Restart-OpenOlt-TT
300 [Teardown] Run Keywords Collect Logs
301 ... AND Stop Logging Restart-OpenOlt-TT
302 Setup
303 Run Keyword If ${has_dataplane} Clean Up Linux
304 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
305 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
306 Log ${podStatusOutput}
307 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
308 ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL}
309 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
310 Sleep 5s
311 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
312 ... app ${podName} Running
313 Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
314 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT ${suppressaddsubscriber}
315 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
316 Log ${podStatusOutput}
317 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
318 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
319 Log to console Pod ${podName} restarted and sanity checks passed successfully
320
321Verify restart ofagent container after subscriber is provisioned for TT
322 [Documentation] Restart ofagent container after VOLTHA is operational.
323 [Tags] functionalTT ofagentRestart-TT notready
324 [Setup] Start Logging ofagentRestart-TT
325 [Teardown] Run Keywords Collect Logs
326 ... AND Stop Logging ofagentRestart-TT
327 ... AND Scale K8s Deployment ${NAMESPACE} voltha-voltha-ofagent 1
328 # set timeout value
329 ${waitforRestart} Set Variable 120s
330 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
331 Log ${podStatusOutput}
332 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
333 ${podName} Set Variable ofagent
334 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
335 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
336 ... app ${podName} Running
337 Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
338 Run Keyword If ${has_dataplane} Clean Up Linux
339 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT ${suppressaddsubscriber}
340 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
341 Log ${podStatusOutput}
342 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
343 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
344 # Scale Down the Of-Agent Deployment
345 Scale K8s Deployment ${NAMESPACE} voltha-voltha-ofagent 0
346 Sleep 30s
347 FOR ${I} IN RANGE 0 ${num_all_onus}
348 ${src}= Set Variable ${hosts.src[${I}]}
349 ${dst}= Set Variable ${hosts.dst[${I}]}
350 ${of_id}= Get ofID From OLT List ${src['olt']}
351 ${onu_device_id}= Get Device ID From SN ${src['onu']}
352 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
353 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
354 # Verify ONU state in voltha
355 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
356 ... ENABLED ACTIVE REACHABLE
357 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
358 # Check ONU port is Disabled in ONOS
359 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
360 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
361 # Verify Ping
362 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Check Ping True
363 ... ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']}
364 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
365 END
366 # Scale Up the Of-Agent Deployment
367 Scale K8s Deployment ${NAMESPACE} voltha-voltha-ofagent 1
368 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
369 ... Running
370 Run Keyword If ${has_dataplane} Clean Up Linux
371 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT ${suppressaddsubscriber}
372 Log to console Pod ${podName} restarted and sanity checks passed successfully
373
374Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart for TT
375 [Documentation] Deploys an device instance. After that rw-core deployment is scaled to 0 instances to
376 ... simulate a POD crash. The test then scales the rw-core back to a single instance
377 ... and configures ONOS for access. The test succeeds if the device is able to
378 ... complete the DHCP sequence.
Hardik Windlass3e3c9942021-04-09 11:37:15 +0000379 [Tags] functionalTT rwcore-restart-TT
Hardik Windlassd3f63892021-03-25 08:28:02 +0000380 [Setup] Run Keywords Start Logging RwCoreFailAndRestart-TT
381 ... AND Clear All Devices Then Create New Device
382 [Teardown] Run Keywords Collect Logs
383 ... AND Stop Logging RwCoreFailAndRestart-TT
384 Run Keyword If ${has_dataplane} Clean Up Linux
385 FOR ${I} IN RANGE 0 ${olt_count}
386 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
387 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
388 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
389 ... ${olt_serial_number}
390 ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
391 ... Get NNI Port in ONOS ${of_id}
392 END
393 FOR ${I} IN RANGE 0 ${num_all_onus}
394 ${src}= Set Variable ${hosts.src[${I}]}
395 ${dst}= Set Variable ${hosts.dst[${I}]}
396 ${of_id}= Get ofID From OLT List ${src['olt']}
397 ${onu_device_id}= Get Device ID From SN ${src['onu']}
398 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
399 ... ${of_id}
400 # Bring up the device and verify it authenticates
401 Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE
402 ... ${onu_device_id} onu=True onu_reason=initial-mib-downloaded
403 END
404
405 # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1
406 Scale K8s Deployment voltha voltha-voltha-rw-core 0
407 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-voltha-rw-core
408 # Ensure the ofagent POD goes "not-ready" as expected
409 Wait Until keyword Succeeds ${timeout} 2s
410 ... Check Expected Available Deployment Replicas voltha voltha-voltha-ofagent 0
411 # Scale up the core deployment and make sure both it and the ofagent deployment are back
412 Scale K8s Deployment voltha voltha-voltha-rw-core 1
413 Wait Until Keyword Succeeds ${timeout} 2s
414 ... Check Expected Available Deployment Replicas voltha voltha-voltha-rw-core 1
415 Wait Until Keyword Succeeds ${timeout} 2s
416 ... Check Expected Available Deployment Replicas voltha voltha-voltha-ofagent 1
417 # For some reason scaling down and up the POD behind a service causes the port forward to stop working,
418 # so restart the port forwarding for the API service
419 Restart VOLTHA Port Forward voltha-api
420 # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this
421 # represents system connectivity being restored
422 FOR ${I} IN RANGE 0 ${olt_count}
423 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
424 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
425 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
426 ... ${olt_serial_number}
427 Wait Until Keyword Succeeds 120s 2s Device Is Available In ONOS
428 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
429 END
Hardik Windlass3e3c9942021-04-09 11:37:15 +0000430 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
TorstenThieme136ebf72021-02-26 14:27:07 +0000431
432*** Keywords ***
433Setup Suite
434 [Documentation] Set up the test suite
435 Common Test Suite Setup
436 ${switch_type}= Get Variable Value ${web_power_switch.type}
437 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
438
TorstenThieme136ebf72021-02-26 14:27:07 +0000439Teardown Suite
440 [Documentation] Tear down steps for the suite
441 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass04896f62021-03-05 16:15:11 +0530442 Run Keyword If ${teardown_device} Delete All Devices and Verify
Hardik Windlassd3f63892021-03-25 08:28:02 +0000443
444Clear All Devices Then Create New Device
445 [Documentation] Remove any devices from VOLTHA and ONOS & then Create new devices
446 # Remove all devices from voltha and onos
447 Delete All Devices and Verify
448 # Execute normal test Setup Keyword
449 Setup