blob: c1d4885db9aa100f49ed22861d4cc4e72452e84d [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
Matteo Scandoloa4e59522021-08-31 14:56:24 -070045${STACK_NAME} voltha
TorstenThieme136ebf72021-02-26 14:27:07 +000046# For below variable value, using deployment name as using grep for
47# parsing radius pod name, we can also use full radius pod name
48${RESTART_POD_NAME} radius
49${timeout} 60s
50${of_id} 0
51${logical_id} 0
52${has_dataplane} True
Hardik Windlass04896f62021-03-05 16:15:11 +053053${teardown_device} True
TorstenThieme136ebf72021-02-26 14:27:07 +000054${scripts} ../../scripts
55
56# Per-test logging on failure is turned off by default; set this variable to enable
57${container_log_dir} ${None}
58
Matteo Scandoloda1c64b2021-07-20 10:14:49 -070059# logging flag to enable Collect Logs, can be passed via the command line too
60# example: -v logging:False
61${logging} True
62
TorstenThieme136ebf72021-02-26 14:27:07 +000063${suppressaddsubscriber} True
64
65*** Test Cases ***
Hardik Windlass364ec452021-04-14 07:12:28 +000066Verify ONU after Rebooting Physically for TT
67 [Documentation] Test the ONU functionality by physically turning on/off ONU.
68 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityTT test was executed)
69 ... Test case runs only on the PODs that are configured with PowerSwitch that
70 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
71 [Tags] functionalTT PowerSwitchOnuRebootTT PowerSwitch
72 [Setup] Start Logging RebootOnu_PowerSwitch_TT
73 [Teardown] Run Keywords Collect Logs
Hardik Windlass364ec452021-04-14 07:12:28 +000074 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -070075 ... AND Run Keyword If ${logging} Collect Logs
76 ... AND Stop Logging RebootOnu_PowerSwitch_TT
Hardik Windlass364ec452021-04-14 07:12:28 +000077 # Add OLT device
78 Setup
79 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
80 Run Keyword If ${has_dataplane} Clean Up Linux
81 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
82 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
83 Run Keyword If ${has_dataplane} Clean Up Linux
84 FOR ${I} IN RANGE 0 ${num_all_onus}
85 ${src}= Set Variable ${hosts.src[${I}]}
86 ${dst}= Set Variable ${hosts.dst[${I}]}
87 ${service_type}= Get Variable Value ${src['service_type']} "null"
88 ${of_id}= Get ofID From OLT List ${src['olt']}
89 ${onu_device_id}= Get Device ID From SN ${src['onu']}
90 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
91 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
92 # Disable Power Switch
93 Disable Switch Outlet ${src['power_switch_port']}
94 # TODO: Add verification for MCAST
95 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure
96 ... Wait Until Keyword Succeeds 60s 2s
97 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
98 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
99 # Remove Subscriber Access (To replicate TT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000100 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass364ec452021-04-14 07:12:28 +0000101 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
102 Sleep 5s
103 # Enable Power Switch
104 Enable Switch Outlet ${src['power_switch_port']}
105 # Check ONU port is Enabled in ONOS
106 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000107 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlass364ec452021-04-14 07:12:28 +0000108 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
TorstenThieme4e2168e2021-06-22 14:01:47 +0000109 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hardik Windlass364ec452021-04-14 07:12:28 +0000110 ... volt-add-subscriber-access ${of_id} ${onu_port}
111 # Verify ONU state in voltha
112 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
113 ... ENABLED ACTIVE REACHABLE
114 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
115 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast'
116 ... Run Keyword And Continue On Failure Validate DHCP and Ping True
117 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
118 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
119 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
120 ... ${dst['container_name']}
121 ... ELSE IF ${has_dataplane} and '${service_type}' == 'mcast' Run Keyword And Continue On Failure
122 ... Wait Until Keyword Succeeds ${timeout} 2s Sanity Test TT MCAST one ONU ${src}
123 ... ${dst} ${suppressaddsubscriber}
124 END
125
126Verify OLT after Rebooting Physically for TT
127 [Documentation] Test the physical reboot of the OLT
128 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityTT test was executed)
129 ... Test performs a physical reboot, performs "reboot" from the OLT CLI
130 [Tags] functionalTT PhysicalOltRebootTT
131 [Setup] Start Logging RebootOlt_Physical_TT
132 [Teardown] Run Keywords Collect Logs
Hardik Windlass364ec452021-04-14 07:12:28 +0000133 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700134 ... AND Run Keyword If ${logging} Collect Logs
135 ... AND Stop Logging RebootOlt_Physical_TT
Hardik Windlass364ec452021-04-14 07:12:28 +0000136 # Add OLT device
137 Setup
138 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
139 Run Keyword If ${has_dataplane} Clean Up Linux
140 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
141 # Reboot the OLT from the OLT CLI
142 FOR ${I} IN RANGE 0 ${olt_count}
143 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
144 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
145 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
146 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
147 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
148 Run Keyword If ${has_dataplane} Login And Run Command On Remote System
149 ... reboot ${olt_ssh_ip} ${olt_user} ${olt_pass} prompt=#
150 END
151 FOR ${I} IN RANGE 0 ${num_all_onus}
152 ${src}= Set Variable ${hosts.src[${I}]}
153 ${dst}= Set Variable ${hosts.dst[${I}]}
154 ${service_type}= Get Variable Value ${src['service_type']} "null"
155 # TODO: Add verification for MCAST
156 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure
157 ... Wait Until Keyword Succeeds 60s 2s
158 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
159 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
160 END
161 # Wait for the OLT to come back up
162 FOR ${I} IN RANGE 0 ${olt_count}
163 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
164 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
165 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
166 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
167 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
168 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
169 ... Check Remote System Reachability True ${olt_ssh_ip}
170 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
171 ... Validate OLT Device ENABLED ACTIVE
172 ... REACHABLE ${olt_serial_number}
173 END
174 Run Keyword If ${has_dataplane} Clean Up Linux
175 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
176
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000177Verify ONU Soft Reboot for TT
178 [Documentation] Test the ONU Soft Reboot functionality.
179 [Tags] functionalTT OnuSoftRebootTT
180 [Setup] Start Logging SoftRebootOnu_TT
181 [Teardown] Run Keywords Collect Logs
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000182 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700183 ... AND Collect Logs
184 ... AND Stop Logging SoftRebootOnu_TT
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000185 # Add OLT device
186 Setup
187 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
188 Run Keyword If ${has_dataplane} Clean Up Linux
189 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
190 FOR ${I} IN RANGE 0 ${num_all_onus}
191 ${src}= Set Variable ${hosts.src[${I}]}
192 ${dst}= Set Variable ${hosts.dst[${I}]}
193 ${service_type}= Get Variable Value ${src['service_type']} "null"
194 ${of_id}= Get ofID From OLT List ${src['olt']}
195 ${onu_device_id}= Get Device ID From SN ${src['onu']}
196 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
197 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
198 Reboot Device ${onu_device_id}
199 # TODO: Add verification for MCAST
200 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure
201 ... Wait Until Keyword Succeeds ${timeout} 2s
202 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
203 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
204 # Remove Subscriber Access (To replicate TT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000205 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000206 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
207 # Check ONU port is Enabled in ONOS
208 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000209 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000210 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
TorstenThieme4e2168e2021-06-22 14:01:47 +0000211 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000212 ... volt-add-subscriber-access ${of_id} ${onu_port}
213 # Verify ONU state in voltha
214 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
215 ... ENABLED ACTIVE REACHABLE
216 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
217 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast'
218 ... Run Keyword And Continue On Failure Validate DHCP and Ping True
219 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
220 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
221 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
222 ... ${dst['container_name']}
223 ... ELSE IF ${has_dataplane} and '${service_type}' == 'mcast' Run Keyword And Continue On Failure
224 ... Wait Until Keyword Succeeds ${timeout} 2s Sanity Test TT MCAST one ONU ${src}
225 ... ${dst} ${suppressaddsubscriber}
226 END
227 Run Keyword If ${has_dataplane} Clean Up Linux
228 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT ${suppressaddsubscriber}
229
Hardik Windlass656661a2021-04-23 03:46:31 +0000230Verify OLT Soft Reboot for TT
231 [Documentation] Test the OLT Soft Reboot functionality.
232 [Tags] functionalTT OltSoftRebootTT
233 [Setup] Start Logging SoftRebootOlt_TT
234 [Teardown] Run Keywords Collect Logs
Hardik Windlass656661a2021-04-23 03:46:31 +0000235 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700236 ... AND Collect Logs
237 ... AND Stop Logging SoftRebootOlt_TT
Hardik Windlass656661a2021-04-23 03:46:31 +0000238 # Add OLT device
239 Setup
240 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
241 Run Keyword If ${has_dataplane} Clean Up Linux
242 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
243 # Reboot the OLT from the OLT CLI
244 FOR ${I} IN RANGE 0 ${olt_count}
245 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
246 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
247 # Reboot the OLT using "voltctl device reboot" command
248 Reboot Device ${olt_device_id}
Andrea Campanella9d8d3a52021-06-17 12:18:23 +0200249 # Wait for the OLT to actually go down
250 Wait Until Keyword Succeeds 360s 5s Validate OLT Device ENABLED UNKNOWN UNREACHABLE
251 ... ${olt_serial_number}
Hardik Windlass656661a2021-04-23 03:46:31 +0000252 END
253 FOR ${I} IN RANGE 0 ${num_all_onus}
254 ${src}= Set Variable ${hosts.src[${I}]}
255 ${dst}= Set Variable ${hosts.dst[${I}]}
256 ${service_type}= Get Variable Value ${src['service_type']} "null"
257 # TODO: Add verification for MCAST
258 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure
259 ... Wait Until Keyword Succeeds ${timeout} 2s
260 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
261 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
262 END
263 # Wait for the OLT to come back up
264 FOR ${I} IN RANGE 0 ${olt_count}
265 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
266 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
267 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
268 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
269 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
270 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
271 ... Check Remote System Reachability True ${olt_ssh_ip}
272 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
273 ... Validate OLT Device ENABLED ACTIVE
274 ... REACHABLE ${olt_serial_number}
275 END
276 Run Keyword If ${has_dataplane} Clean Up Linux
277 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
278
TorstenThieme136ebf72021-02-26 14:27:07 +0000279Verify restart openonu-adapter container after subscriber provisioning for TT
280 [Documentation] Restart openonu-adapter container after VOLTHA is operational.
281 ... Prerequisite : ONUs are authenticated and pingable.
Hardik Windlass04896f62021-03-05 16:15:11 +0530282 [Tags] functionalTT Restart-OpenOnu-TT
TorstenThieme136ebf72021-02-26 14:27:07 +0000283 [Setup] Start Logging Restart-OpenOnu-TT
284 [Teardown] Run Keywords Collect Logs
TorstenThieme136ebf72021-02-26 14:27:07 +0000285 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700286 ... AND Collect Logs
287 ... AND Stop Logging Restart-OpenOnu-TT
TorstenThieme136ebf72021-02-26 14:27:07 +0000288 # Add OLT device
289 Setup
290 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
291 Run Keyword If ${has_dataplane} Clean Up Linux
292 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
293 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
294 Log ${podStatusOutput}
295 ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
296 ${podName} Set Variable adapter-open-onu
297 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
298 Sleep 5s
299 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
300 ... app ${podName} Running
301 Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
302 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT ${suppressaddsubscriber}
303 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
304 Log ${podStatusOutput}
305 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
306 Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart}
307 Log to console Pod ${podName} restarted and sanity checks passed successfully
308
Emrehan UZUN2884ed52021-05-04 15:36:31 +0000309Verify restart openolt-adapter container before subscriber provisioning for TT
310 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
311 [Tags] functionalTT Restart-OpenOlt-Before-Subscription-TT
312 [Setup] Start Logging Restart-OpenOlt-Before-Subscription-TT
313 [Teardown] Run Keywords Collect Logs
Emrehan UZUN2884ed52021-05-04 15:36:31 +0000314 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700315 ... AND Collect Logs
316 ... AND Stop Logging Restart-OpenOlt-Before-Subscription-TT
Emrehan UZUN2884ed52021-05-04 15:36:31 +0000317 # Add OLT device
318 Setup
319 Run Keyword If ${has_dataplane} Clean Up Linux
320 FOR ${I} IN RANGE 0 ${olt_count}
321 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
322 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
323 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
324 ... ${olt_serial_number}
325 ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
326 ... Get NNI Port in ONOS ${of_id}
327 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
328 ... Verify Default Downstream Flows are added in ONOS for OLT TT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
329 ... ${nni_port}
330 END
331 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
332 Log ${podStatusOutput}
333 ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
334 ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL}
335 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
336 Sleep 5s
337 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
338 ... app ${podName} Running
339 Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
340 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
341 Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart}
342 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
343 Log to console Pod ${podName} restarted and sanity checks passed successfully
344
Hardik Windlassd3f63892021-03-25 08:28:02 +0000345Verify restart openolt-adapter container after subscriber provisioning for TT
346 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
347 [Tags] functionalTT Restart-OpenOlt-TT
348 [Setup] Start Logging Restart-OpenOlt-TT
349 [Teardown] Run Keywords Collect Logs
350 ... AND Stop Logging Restart-OpenOlt-TT
351 Setup
352 Run Keyword If ${has_dataplane} Clean Up Linux
353 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
354 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
355 Log ${podStatusOutput}
356 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
357 ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL}
358 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
359 Sleep 5s
360 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
361 ... app ${podName} Running
362 Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
363 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT ${suppressaddsubscriber}
364 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
365 Log ${podStatusOutput}
366 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
367 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
368 Log to console Pod ${podName} restarted and sanity checks passed successfully
369
370Verify restart ofagent container after subscriber is provisioned for TT
371 [Documentation] Restart ofagent container after VOLTHA is operational.
Hardik Windlassa9ec90d2021-05-27 11:33:22 +0000372 [Tags] functionalTT ofagentRestart-TT
Hardik Windlassd3f63892021-03-25 08:28:02 +0000373 [Setup] Start Logging ofagentRestart-TT
374 [Teardown] Run Keywords Collect Logs
375 ... AND Stop Logging ofagentRestart-TT
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700376 ... AND Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 1
Hardik Windlassd3f63892021-03-25 08:28:02 +0000377 # set timeout value
378 ${waitforRestart} Set Variable 120s
379 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
380 Log ${podStatusOutput}
381 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
382 ${podName} Set Variable ofagent
383 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
384 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
385 ... app ${podName} Running
386 Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
387 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlassa9ec90d2021-05-27 11:33:22 +0000388 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test TT ${suppressaddsubscriber}
Hardik Windlassd3f63892021-03-25 08:28:02 +0000389 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
390 Log ${podStatusOutput}
391 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
392 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
393 # Scale Down the Of-Agent Deployment
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700394 Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 0
Hardik Windlassd3f63892021-03-25 08:28:02 +0000395 Sleep 30s
396 FOR ${I} IN RANGE 0 ${num_all_onus}
397 ${src}= Set Variable ${hosts.src[${I}]}
398 ${dst}= Set Variable ${hosts.dst[${I}]}
Hardik Windlassa9ec90d2021-05-27 11:33:22 +0000399 ${service_type}= Get Variable Value ${src['service_type']} "null"
Hardik Windlassd3f63892021-03-25 08:28:02 +0000400 ${of_id}= Get ofID From OLT List ${src['olt']}
401 ${onu_device_id}= Get Device ID From SN ${src['onu']}
402 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
403 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
404 # Verify ONU state in voltha
405 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
406 ... ENABLED ACTIVE REACHABLE
407 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
408 # Check ONU port is Disabled in ONOS
409 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000410 ... Verify UNI Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassd3f63892021-03-25 08:28:02 +0000411 # Verify Ping
Hardik Windlassa9ec90d2021-05-27 11:33:22 +0000412 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast'
413 ... Run Keyword And Continue On Failure Check Ping True
Hardik Windlassd3f63892021-03-25 08:28:02 +0000414 ... ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']}
415 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
416 END
417 # Scale Up the Of-Agent Deployment
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700418 Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 1
Hardik Windlassd3f63892021-03-25 08:28:02 +0000419 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
420 ... Running
421 Run Keyword If ${has_dataplane} Clean Up Linux
422 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT ${suppressaddsubscriber}
423 Log to console Pod ${podName} restarted and sanity checks passed successfully
424
425Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart for TT
426 [Documentation] Deploys an device instance. After that rw-core deployment is scaled to 0 instances to
427 ... simulate a POD crash. The test then scales the rw-core back to a single instance
428 ... and configures ONOS for access. The test succeeds if the device is able to
429 ... complete the DHCP sequence.
Hardik Windlass3e3c9942021-04-09 11:37:15 +0000430 [Tags] functionalTT rwcore-restart-TT
Hardik Windlassd3f63892021-03-25 08:28:02 +0000431 [Setup] Run Keywords Start Logging RwCoreFailAndRestart-TT
432 ... AND Clear All Devices Then Create New Device
433 [Teardown] Run Keywords Collect Logs
434 ... AND Stop Logging RwCoreFailAndRestart-TT
435 Run Keyword If ${has_dataplane} Clean Up Linux
436 FOR ${I} IN RANGE 0 ${olt_count}
437 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
438 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
439 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
440 ... ${olt_serial_number}
441 ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
442 ... Get NNI Port in ONOS ${of_id}
443 END
444 FOR ${I} IN RANGE 0 ${num_all_onus}
445 ${src}= Set Variable ${hosts.src[${I}]}
446 ${dst}= Set Variable ${hosts.dst[${I}]}
447 ${of_id}= Get ofID From OLT List ${src['olt']}
448 ${onu_device_id}= Get Device ID From SN ${src['onu']}
449 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
450 ... ${of_id}
451 # Bring up the device and verify it authenticates
452 Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000453 ... ${onu_device_id} onu=True onu_reason=initial-mib-downloaded by_dev_id=True
Hardik Windlassd3f63892021-03-25 08:28:02 +0000454 END
455
456 # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1
457 Scale K8s Deployment voltha voltha-voltha-rw-core 0
458 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-voltha-rw-core
459 # Ensure the ofagent POD goes "not-ready" as expected
460 Wait Until keyword Succeeds ${timeout} 2s
461 ... Check Expected Available Deployment Replicas voltha voltha-voltha-ofagent 0
462 # Scale up the core deployment and make sure both it and the ofagent deployment are back
463 Scale K8s Deployment voltha voltha-voltha-rw-core 1
464 Wait Until Keyword Succeeds ${timeout} 2s
465 ... Check Expected Available Deployment Replicas voltha voltha-voltha-rw-core 1
466 Wait Until Keyword Succeeds ${timeout} 2s
467 ... Check Expected Available Deployment Replicas voltha voltha-voltha-ofagent 1
468 # For some reason scaling down and up the POD behind a service causes the port forward to stop working,
469 # so restart the port forwarding for the API service
470 Restart VOLTHA Port Forward voltha-api
471 # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this
472 # represents system connectivity being restored
473 FOR ${I} IN RANGE 0 ${olt_count}
474 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
475 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
476 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
477 ... ${olt_serial_number}
478 Wait Until Keyword Succeeds 120s 2s Device Is Available In ONOS
479 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
480 END
Hardik Windlass3e3c9942021-04-09 11:37:15 +0000481 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
TorstenThieme136ebf72021-02-26 14:27:07 +0000482
Hardik Windlassd50b0202021-09-02 14:45:09 +0000483Verify restart openonu-adapter container while continuously running ping in background for TT
484 [Documentation] Restart openonu-adapter container after VOLTHA is operational.
485 ... Run the ping continuously in background during container restart,
486 ... and verify that there should be no affect on the dataplane.
487 [Tags] functionalTT Restart-OpenOnu-Ping-TT non-critical
488 [Setup] Start Logging Restart-OpenOnu-Ping-TT
489 [Teardown] Run Keywords Collect Logs
490 ... AND Stop Logging Restart-OpenOnu-Ping-TT
491 Clear All Devices Then Create New Device
492 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
493 Run Keyword If ${has_dataplane} Clean Up Linux
494 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test TT
495 FOR ${I} IN RANGE 0 ${num_all_onus}
496 ${src}= Set Variable ${hosts.src[${I}]}
497 ${dst}= Set Variable ${hosts.dst[${I}]}
498 ${service_type}= Get Variable Value ${src['service_type']} "null"
499 Continue For Loop If '${service_type}' == 'mcast'
500 ${ping_output_file}= Set Variable /tmp/${src['onu']}_${service_type}_ping
501 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
502 ... Wait Until Keyword Succeeds 60s 2s
503 ... Run Ping In Background ${ping_output_file} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
504 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
505 END
506 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
507 Log ${podStatusOutput}
508 ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
509 ${podName} Set Variable adapter-open-onu
510 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
511 Sleep 5s
512 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
513 ... app ${podName} Running
514 Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
515 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
516 Log ${podStatusOutput}
517 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
518 Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart}
519 FOR ${I} IN RANGE 0 ${num_all_onus}
520 ${src}= Set Variable ${hosts.src[${I}]}
521 ${dst}= Set Variable ${hosts.dst[${I}]}
522 ${service_type}= Get Variable Value ${src['service_type']} "null"
523 Continue For Loop If '${service_type}' == 'mcast'
524 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
525 ... Wait Until Keyword Succeeds 60s 2s
526 ... Stop Ping Running In Background ${src['ip']} ${src['user']} ${src['pass']}
527 ... ${src['container_type']} ${src['container_name']}
528 END
529 FOR ${I} IN RANGE 0 ${num_all_onus}
530 ${src}= Set Variable ${hosts.src[${I}]}
531 ${dst}= Set Variable ${hosts.dst[${I}]}
532 ${service_type}= Get Variable Value ${src['service_type']} "null"
533 Continue For Loop If '${service_type}' == 'mcast'
534 ${ping_output_file}= Set Variable /tmp/${src['onu']}_${service_type}_ping
535 ${ping_output}= Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
536 ... Wait Until Keyword Succeeds 60s 2s
537 ... Retrieve Remote File Contents ${ping_output_file} ${src['ip']} ${src['user']} ${src['pass']}
538 ... ${src['container_type']} ${src['container_name']}
539 Check Ping Result True ${ping_output}
540 END
541
542Verify restart openolt-adapter container while continuously running ping in background for TT
543 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
544 ... Run the ping continuously in background during container restart,
545 ... and verify that there should be no affect on the dataplane.
546 [Tags] functionalTT Restart-OpenOlt-Ping-TT non-critical
547 [Setup] Start Logging Restart-OpenOlt-Ping-TT
548 [Teardown] Run Keywords Collect Logs
549 ... AND Stop Logging Restart-OpenOlt-Ping-TT
550 Clear All Devices Then Create New Device
551 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
552 Run Keyword If ${has_dataplane} Clean Up Linux
553 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test TT
554 FOR ${I} IN RANGE 0 ${num_all_onus}
555 ${src}= Set Variable ${hosts.src[${I}]}
556 ${dst}= Set Variable ${hosts.dst[${I}]}
557 ${service_type}= Get Variable Value ${src['service_type']} "null"
558 Continue For Loop If '${service_type}' == 'mcast'
559 ${ping_output_file}= Set Variable /tmp/${src['onu']}_${service_type}_ping
560 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
561 ... Wait Until Keyword Succeeds 60s 2s
562 ... Run Ping In Background ${ping_output_file} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
563 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
564 END
565 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
566 Log ${podStatusOutput}
567 ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
568 ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL}
569 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
570 Sleep 5s
571 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
572 ... app ${podName} Running
573 Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
574 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
575 Log ${podStatusOutput}
576 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
577 Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart}
578 FOR ${I} IN RANGE 0 ${num_all_onus}
579 ${src}= Set Variable ${hosts.src[${I}]}
580 ${dst}= Set Variable ${hosts.dst[${I}]}
581 ${service_type}= Get Variable Value ${src['service_type']} "null"
582 Continue For Loop If '${service_type}' == 'mcast'
583 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
584 ... Wait Until Keyword Succeeds 60s 2s
585 ... Stop Ping Running In Background ${src['ip']} ${src['user']} ${src['pass']}
586 ... ${src['container_type']} ${src['container_name']}
587 END
588 FOR ${I} IN RANGE 0 ${num_all_onus}
589 ${src}= Set Variable ${hosts.src[${I}]}
590 ${dst}= Set Variable ${hosts.dst[${I}]}
591 ${service_type}= Get Variable Value ${src['service_type']} "null"
592 Continue For Loop If '${service_type}' == 'mcast'
593 ${ping_output_file}= Set Variable /tmp/${src['onu']}_${service_type}_ping
594 ${ping_output}= Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
595 ... Wait Until Keyword Succeeds 60s 2s
596 ... Retrieve Remote File Contents ${ping_output_file} ${src['ip']} ${src['user']} ${src['pass']}
597 ... ${src['container_type']} ${src['container_name']}
598 Check Ping Result True ${ping_output}
599 END
600
TorstenThieme136ebf72021-02-26 14:27:07 +0000601*** Keywords ***
602Setup Suite
603 [Documentation] Set up the test suite
604 Common Test Suite Setup
605 ${switch_type}= Get Variable Value ${web_power_switch.type}
606 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
607
TorstenThieme136ebf72021-02-26 14:27:07 +0000608Teardown Suite
609 [Documentation] Tear down steps for the suite
610 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass04896f62021-03-05 16:15:11 +0530611 Run Keyword If ${teardown_device} Delete All Devices and Verify
TorstenThieme4e2168e2021-06-22 14:01:47 +0000612 Close All ONOS SSH Connections
Hardik Windlassd3f63892021-03-25 08:28:02 +0000613
614Clear All Devices Then Create New Device
615 [Documentation] Remove any devices from VOLTHA and ONOS & then Create new devices
616 # Remove all devices from voltha and onos
617 Delete All Devices and Verify
618 # Execute normal test Setup Keyword
619 Setup