blob: 6895aebc4f071c001ba0c940d6d4ae6ddf1c1af9 [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
Hardik Windlass4288c6a2021-09-28 07:22:06 +000045${INFRA_NAMESPACE} default
Matteo Scandoloa4e59522021-08-31 14:56:24 -070046${STACK_NAME} voltha
TorstenThieme136ebf72021-02-26 14:27:07 +000047# For below variable value, using deployment name as using grep for
48# parsing radius pod name, we can also use full radius pod name
49${RESTART_POD_NAME} radius
50${timeout} 60s
51${of_id} 0
52${logical_id} 0
53${has_dataplane} True
Hardik Windlass04896f62021-03-05 16:15:11 +053054${teardown_device} True
TorstenThieme136ebf72021-02-26 14:27:07 +000055${scripts} ../../scripts
56
57# Per-test logging on failure is turned off by default; set this variable to enable
58${container_log_dir} ${None}
59
Matteo Scandoloda1c64b2021-07-20 10:14:49 -070060# logging flag to enable Collect Logs, can be passed via the command line too
61# example: -v logging:False
62${logging} True
63
TorstenThieme136ebf72021-02-26 14:27:07 +000064${suppressaddsubscriber} True
65
Hardik Windlassb1bda362021-11-24 11:54:36 +000066# flag to choose the subscriber provisioning command type in ONOS
67# TT often provision a single services for a subscriber (eg: hsia, voip, ...) one after the other.
68# if set to True, command used is "volt-add-subscriber-unitag"
69# if set to False, comand used is "volt-add-subscriber-access"
70${unitag_sub} False
71
TorstenThieme136ebf72021-02-26 14:27:07 +000072*** Test Cases ***
Hardik Windlass364ec452021-04-14 07:12:28 +000073Verify ONU after Rebooting Physically for TT
74 [Documentation] Test the ONU functionality by physically turning on/off ONU.
75 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityTT test was executed)
76 ... Test case runs only on the PODs that are configured with PowerSwitch that
77 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
78 [Tags] functionalTT PowerSwitchOnuRebootTT PowerSwitch
79 [Setup] Start Logging RebootOnu_PowerSwitch_TT
80 [Teardown] Run Keywords Collect Logs
Hardik Windlass364ec452021-04-14 07:12:28 +000081 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -070082 ... AND Run Keyword If ${logging} Collect Logs
83 ... AND Stop Logging RebootOnu_PowerSwitch_TT
Hardik Windlass364ec452021-04-14 07:12:28 +000084 # Add OLT device
85 Setup
86 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
87 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5083b3a2021-11-11 12:16:22 +000088 Perform Sanity Tests TT
Hardik Windlass364ec452021-04-14 07:12:28 +000089 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
90 Run Keyword If ${has_dataplane} Clean Up Linux
91 FOR ${I} IN RANGE 0 ${num_all_onus}
92 ${src}= Set Variable ${hosts.src[${I}]}
93 ${dst}= Set Variable ${hosts.dst[${I}]}
94 ${service_type}= Get Variable Value ${src['service_type']} "null"
95 ${of_id}= Get ofID From OLT List ${src['olt']}
96 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Hardik Windlass5083b3a2021-11-11 12:16:22 +000097 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass364ec452021-04-14 07:12:28 +000098 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
Girish Gowdraa3a05c62022-02-16 13:54:37 -080099 # If the power switch port is not specified, continue
100 Continue For Loop If '${src["power_switch_port"]}' == '${None}'
Hardik Windlass364ec452021-04-14 07:12:28 +0000101 # Disable Power Switch
102 Disable Switch Outlet ${src['power_switch_port']}
103 # TODO: Add verification for MCAST
104 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000105 ... Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass364ec452021-04-14 07:12:28 +0000106 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
107 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
108 # Remove Subscriber Access (To replicate TT workflow)
Hardik Windlassb1bda362021-11-24 11:54:36 +0000109 ${del_sub_cmd}= Run Keyword If ${unitag_sub}
110 ... Catenate volt-remove-subscriber-unitag --tpId ${src['tp_id']} --sTag ${src['s_tag']}
111 ... --cTag ${src['c_tag']} ${src['onu']}-${src['uni_id']}
112 ... ELSE
113 ... Set Variable volt-remove-subscriber-access ${of_id} ${onu_port}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000114 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlassb1bda362021-11-24 11:54:36 +0000115 ... ${ONOS_SSH_PORT} ${del_sub_cmd}
Hardik Windlass364ec452021-04-14 07:12:28 +0000116 Sleep 5s
117 # Enable Power Switch
118 Enable Switch Outlet ${src['power_switch_port']}
119 # Check ONU port is Enabled in ONOS
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000120 Wait Until Keyword Succeeds 120s 5s
Hardik Windlass39015672021-07-05 05:48:08 +0000121 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassb1bda362021-11-24 11:54:36 +0000122 # Add Subscriber Access
123 ${add_sub_cmd}= Run Keyword If ${unitag_sub}
124 ... Catenate volt-add-subscriber-unitag --tpId ${src['tp_id']} --sTag ${src['s_tag']}
125 ... --cTag ${src['c_tag']} ${src['onu']}-${src['uni_id']}
126 ... ELSE
127 ... Set Variable volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000128 Wait Until Keyword Succeeds ${timeout} 2
Hardik Windlassb1bda362021-11-24 11:54:36 +0000129 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${add_sub_cmd}
Hardik Windlass364ec452021-04-14 07:12:28 +0000130 # Verify ONU state in voltha
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000131 Wait Until Keyword Succeeds ${timeout} 5s Validate Device
Hardik Windlass364ec452021-04-14 07:12:28 +0000132 ... ENABLED ACTIVE REACHABLE
133 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
134 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast'
135 ... Run Keyword And Continue On Failure Validate DHCP and Ping True
136 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
137 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
138 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
139 ... ${dst['container_name']}
140 ... ELSE IF ${has_dataplane} and '${service_type}' == 'mcast' Run Keyword And Continue On Failure
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000141 ... Sanity Test TT MCAST one ONU ${src}
Hardik Windlass364ec452021-04-14 07:12:28 +0000142 ... ${dst} ${suppressaddsubscriber}
143 END
144
145Verify OLT after Rebooting Physically for TT
146 [Documentation] Test the physical reboot of the OLT
147 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityTT test was executed)
148 ... Test performs a physical reboot, performs "reboot" from the OLT CLI
149 [Tags] functionalTT PhysicalOltRebootTT
150 [Setup] Start Logging RebootOlt_Physical_TT
151 [Teardown] Run Keywords Collect Logs
Hardik Windlass364ec452021-04-14 07:12:28 +0000152 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700153 ... AND Run Keyword If ${logging} Collect Logs
154 ... AND Stop Logging RebootOlt_Physical_TT
Hardik Windlass364ec452021-04-14 07:12:28 +0000155 # Add OLT device
156 Setup
157 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
158 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000159 Perform Sanity Tests TT
Hardik Windlass364ec452021-04-14 07:12:28 +0000160 # Reboot the OLT from the OLT CLI
161 FOR ${I} IN RANGE 0 ${olt_count}
162 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
163 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
164 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
165 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
166 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
167 Run Keyword If ${has_dataplane} Login And Run Command On Remote System
168 ... reboot ${olt_ssh_ip} ${olt_user} ${olt_pass} prompt=#
169 END
170 FOR ${I} IN RANGE 0 ${num_all_onus}
171 ${src}= Set Variable ${hosts.src[${I}]}
172 ${dst}= Set Variable ${hosts.dst[${I}]}
173 ${service_type}= Get Variable Value ${src['service_type']} "null"
174 # TODO: Add verification for MCAST
175 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000176 ... Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass364ec452021-04-14 07:12:28 +0000177 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
178 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
179 END
180 # Wait for the OLT to come back up
181 FOR ${I} IN RANGE 0 ${olt_count}
182 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
183 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
184 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
185 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
186 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
187 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
188 ... Check Remote System Reachability True ${olt_ssh_ip}
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000189 Wait Until Keyword Succeeds 360s 10s
Hardik Windlass364ec452021-04-14 07:12:28 +0000190 ... Validate OLT Device ENABLED ACTIVE
191 ... REACHABLE ${olt_serial_number}
192 END
193 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000194 Perform Sanity Tests TT
Hardik Windlass364ec452021-04-14 07:12:28 +0000195
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000196Verify ONU Soft Reboot for TT
197 [Documentation] Test the ONU Soft Reboot functionality.
198 [Tags] functionalTT OnuSoftRebootTT
199 [Setup] Start Logging SoftRebootOnu_TT
200 [Teardown] Run Keywords Collect Logs
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000201 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700202 ... AND Collect Logs
203 ... AND Stop Logging SoftRebootOnu_TT
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000204 # Add OLT device
205 Setup
206 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
207 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000208 Perform Sanity Tests TT
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000209 FOR ${I} IN RANGE 0 ${num_all_onus}
210 ${src}= Set Variable ${hosts.src[${I}]}
211 ${dst}= Set Variable ${hosts.dst[${I}]}
212 ${service_type}= Get Variable Value ${src['service_type']} "null"
213 ${of_id}= Get ofID From OLT List ${src['olt']}
214 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000215 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000216 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
217 Reboot Device ${onu_device_id}
218 # TODO: Add verification for MCAST
219 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000220 ... Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000221 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
222 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
223 # Remove Subscriber Access (To replicate TT workflow)
Hardik Windlassb1bda362021-11-24 11:54:36 +0000224 ${del_sub_cmd}= Run Keyword If ${unitag_sub}
225 ... Catenate volt-remove-subscriber-unitag --tpId ${src['tp_id']} --sTag ${src['s_tag']}
226 ... --cTag ${src['c_tag']} ${src['onu']}-${src['uni_id']}
227 ... ELSE
228 ... Set Variable volt-remove-subscriber-access ${of_id} ${onu_port}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000229 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlassb1bda362021-11-24 11:54:36 +0000230 ... ${ONOS_SSH_PORT} ${del_sub_cmd}
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000231 # Check ONU port is Enabled in ONOS
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000232 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass39015672021-07-05 05:48:08 +0000233 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassb1bda362021-11-24 11:54:36 +0000234 # Add Subscriber Access
235 ${add_sub_cmd}= Run Keyword If ${unitag_sub}
236 ... Catenate volt-add-subscriber-unitag --tpId ${src['tp_id']} --sTag ${src['s_tag']}
237 ... --cTag ${src['c_tag']} ${src['onu']}-${src['uni_id']}
238 ... ELSE
239 ... Set Variable volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000240 Wait Until Keyword Succeeds ${timeout} 2
Hardik Windlassb1bda362021-11-24 11:54:36 +0000241 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${add_sub_cmd}
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000242 # Verify ONU state in voltha
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000243 Wait Until Keyword Succeeds ${timeout} 5s Validate Device
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000244 ... ENABLED ACTIVE REACHABLE
245 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
246 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast'
247 ... Run Keyword And Continue On Failure Validate DHCP and Ping True
248 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
249 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
250 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
251 ... ${dst['container_name']}
252 ... ELSE IF ${has_dataplane} and '${service_type}' == 'mcast' Run Keyword And Continue On Failure
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000253 ... Sanity Test TT MCAST one ONU ${src}
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000254 ... ${dst} ${suppressaddsubscriber}
255 END
256 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000257 Perform Sanity Tests TT ${suppressaddsubscriber}
Hardik Windlass8a8d81c2021-04-22 15:33:42 +0000258
Hardik Windlass656661a2021-04-23 03:46:31 +0000259Verify OLT Soft Reboot for TT
260 [Documentation] Test the OLT Soft Reboot functionality.
261 [Tags] functionalTT OltSoftRebootTT
262 [Setup] Start Logging SoftRebootOlt_TT
263 [Teardown] Run Keywords Collect Logs
Hardik Windlass656661a2021-04-23 03:46:31 +0000264 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700265 ... AND Collect Logs
266 ... AND Stop Logging SoftRebootOlt_TT
Hardik Windlass656661a2021-04-23 03:46:31 +0000267 # Add OLT device
268 Setup
269 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
270 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000271 Perform Sanity Tests TT
Hardik Windlass656661a2021-04-23 03:46:31 +0000272 # Reboot the OLT from the OLT CLI
273 FOR ${I} IN RANGE 0 ${olt_count}
274 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
275 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
276 # Reboot the OLT using "voltctl device reboot" command
277 Reboot Device ${olt_device_id}
Andrea Campanella9d8d3a52021-06-17 12:18:23 +0200278 # Wait for the OLT to actually go down
279 Wait Until Keyword Succeeds 360s 5s Validate OLT Device ENABLED UNKNOWN UNREACHABLE
280 ... ${olt_serial_number}
Hardik Windlass656661a2021-04-23 03:46:31 +0000281 END
282 FOR ${I} IN RANGE 0 ${num_all_onus}
283 ${src}= Set Variable ${hosts.src[${I}]}
284 ${dst}= Set Variable ${hosts.dst[${I}]}
285 ${service_type}= Get Variable Value ${src['service_type']} "null"
286 # TODO: Add verification for MCAST
287 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000288 ... Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass656661a2021-04-23 03:46:31 +0000289 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
290 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
291 END
292 # Wait for the OLT to come back up
293 FOR ${I} IN RANGE 0 ${olt_count}
294 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
295 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
296 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
297 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
298 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
299 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
300 ... Check Remote System Reachability True ${olt_ssh_ip}
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000301 Wait Until Keyword Succeeds 360s 10s
Hardik Windlass656661a2021-04-23 03:46:31 +0000302 ... Validate OLT Device ENABLED ACTIVE
303 ... REACHABLE ${olt_serial_number}
304 END
305 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000306 Perform Sanity Tests TT
Hardik Windlass656661a2021-04-23 03:46:31 +0000307
Emrehan UZUN2884ed52021-05-04 15:36:31 +0000308Verify restart openolt-adapter container before subscriber provisioning for TT
309 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
310 [Tags] functionalTT Restart-OpenOlt-Before-Subscription-TT
311 [Setup] Start Logging Restart-OpenOlt-Before-Subscription-TT
312 [Teardown] Run Keywords Collect Logs
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700313 ... AND Stop Logging Restart-OpenOlt-Before-Subscription-TT
Emrehan UZUN2884ed52021-05-04 15:36:31 +0000314 # Add OLT device
315 Setup
316 Run Keyword If ${has_dataplane} Clean Up Linux
317 FOR ${I} IN RANGE 0 ${olt_count}
318 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
319 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
320 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
321 ... ${olt_serial_number}
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000322 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s
Emrehan UZUN2884ed52021-05-04 15:36:31 +0000323 ... Get NNI Port in ONOS ${of_id}
324 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
325 ... Verify Default Downstream Flows are added in ONOS for OLT TT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
326 ... ${nni_port}
327 END
328 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
329 Log ${podStatusOutput}
330 ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
331 ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL}
332 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
333 Sleep 5s
334 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
335 ... app ${podName} Running
336 Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
337 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
338 Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart}
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000339 Perform Sanity Tests TT
Emrehan UZUN2884ed52021-05-04 15:36:31 +0000340 Log to console Pod ${podName} restarted and sanity checks passed successfully
341
Hardik Windlassd3f63892021-03-25 08:28:02 +0000342Verify restart ofagent container after subscriber is provisioned for TT
343 [Documentation] Restart ofagent container after VOLTHA is operational.
Hardik Windlassa9ec90d2021-05-27 11:33:22 +0000344 [Tags] functionalTT ofagentRestart-TT
Hardik Windlassd3f63892021-03-25 08:28:02 +0000345 [Setup] Start Logging ofagentRestart-TT
346 [Teardown] Run Keywords Collect Logs
347 ... AND Stop Logging ofagentRestart-TT
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700348 ... AND Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 1
Hardik Windlassd3f63892021-03-25 08:28:02 +0000349 # set timeout value
350 ${waitforRestart} Set Variable 120s
351 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
352 Log ${podStatusOutput}
353 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
354 ${podName} Set Variable ofagent
355 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
356 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
357 ... app ${podName} Running
358 Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
359 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000360 Perform Sanity Test TT ${suppressaddsubscriber}
Hardik Windlassd3f63892021-03-25 08:28:02 +0000361 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
362 Log ${podStatusOutput}
363 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
364 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
365 # Scale Down the Of-Agent Deployment
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700366 Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 0
Hardik Windlassd3f63892021-03-25 08:28:02 +0000367 Sleep 30s
368 FOR ${I} IN RANGE 0 ${num_all_onus}
369 ${src}= Set Variable ${hosts.src[${I}]}
370 ${dst}= Set Variable ${hosts.dst[${I}]}
Hardik Windlassa9ec90d2021-05-27 11:33:22 +0000371 ${service_type}= Get Variable Value ${src['service_type']} "null"
Hardik Windlassd3f63892021-03-25 08:28:02 +0000372 ${of_id}= Get ofID From OLT List ${src['olt']}
373 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000374 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlassd3f63892021-03-25 08:28:02 +0000375 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
376 # Verify ONU state in voltha
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000377 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
Hardik Windlassd3f63892021-03-25 08:28:02 +0000378 ... ENABLED ACTIVE REACHABLE
379 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
380 # Check ONU port is Disabled in ONOS
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000381 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000382 ... Verify UNI Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassd3f63892021-03-25 08:28:02 +0000383 # Verify Ping
Hardik Windlassa9ec90d2021-05-27 11:33:22 +0000384 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast'
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000385 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Check Ping True
Hardik Windlassd3f63892021-03-25 08:28:02 +0000386 ... ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']}
387 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
388 END
389 # Scale Up the Of-Agent Deployment
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700390 Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 1
Hardik Windlassd3f63892021-03-25 08:28:02 +0000391 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
392 ... Running
393 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000394 Perform Sanity Tests TT ${suppressaddsubscriber}
Hardik Windlassd3f63892021-03-25 08:28:02 +0000395 Log to console Pod ${podName} restarted and sanity checks passed successfully
396
397Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart for TT
398 [Documentation] Deploys an device instance. After that rw-core deployment is scaled to 0 instances to
399 ... simulate a POD crash. The test then scales the rw-core back to a single instance
400 ... and configures ONOS for access. The test succeeds if the device is able to
401 ... complete the DHCP sequence.
Hardik Windlass3e3c9942021-04-09 11:37:15 +0000402 [Tags] functionalTT rwcore-restart-TT
Hardik Windlassd3f63892021-03-25 08:28:02 +0000403 [Setup] Run Keywords Start Logging RwCoreFailAndRestart-TT
404 ... AND Clear All Devices Then Create New Device
405 [Teardown] Run Keywords Collect Logs
406 ... AND Stop Logging RwCoreFailAndRestart-TT
407 Run Keyword If ${has_dataplane} Clean Up Linux
408 FOR ${I} IN RANGE 0 ${olt_count}
409 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
410 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
411 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
412 ... ${olt_serial_number}
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000413 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlassd3f63892021-03-25 08:28:02 +0000414 ... Get NNI Port in ONOS ${of_id}
415 END
416 FOR ${I} IN RANGE 0 ${num_all_onus}
417 ${src}= Set Variable ${hosts.src[${I}]}
418 ${dst}= Set Variable ${hosts.dst[${I}]}
419 ${of_id}= Get ofID From OLT List ${src['olt']}
420 ${onu_device_id}= Get Device ID From SN ${src['onu']}
421 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
422 ... ${of_id}
423 # Bring up the device and verify it authenticates
424 Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000425 ... ${onu_device_id} onu=True onu_reason=initial-mib-downloaded by_dev_id=True
Hardik Windlassd3f63892021-03-25 08:28:02 +0000426 END
427
428 # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1
429 Scale K8s Deployment voltha voltha-voltha-rw-core 0
430 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-voltha-rw-core
431 # Ensure the ofagent POD goes "not-ready" as expected
432 Wait Until keyword Succeeds ${timeout} 2s
433 ... Check Expected Available Deployment Replicas voltha voltha-voltha-ofagent 0
434 # Scale up the core deployment and make sure both it and the ofagent deployment are back
435 Scale K8s Deployment voltha voltha-voltha-rw-core 1
436 Wait Until Keyword Succeeds ${timeout} 2s
437 ... Check Expected Available Deployment Replicas voltha voltha-voltha-rw-core 1
438 Wait Until Keyword Succeeds ${timeout} 2s
439 ... Check Expected Available Deployment Replicas voltha voltha-voltha-ofagent 1
440 # For some reason scaling down and up the POD behind a service causes the port forward to stop working,
441 # so restart the port forwarding for the API service
442 Restart VOLTHA Port Forward voltha-api
443 # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this
444 # represents system connectivity being restored
445 FOR ${I} IN RANGE 0 ${olt_count}
446 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
447 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
448 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
449 ... ${olt_serial_number}
450 Wait Until Keyword Succeeds 120s 2s Device Is Available In ONOS
451 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
452 END
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000453 Perform Sanity Tests TT
TorstenThieme136ebf72021-02-26 14:27:07 +0000454
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000455Verify restart openonu-adapter container for TT
Hardik Windlassd50b0202021-09-02 14:45:09 +0000456 [Documentation] Restart openonu-adapter container after VOLTHA is operational.
457 ... Run the ping continuously in background during container restart,
458 ... and verify that there should be no affect on the dataplane.
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000459 ... Also, verify that the voltha control plane functionality is not affected.
Hardik Windlassb1bda362021-11-24 11:54:36 +0000460 [Tags] functionalTT Restart-OpenOnu-Ping-TT dataplaneTT
Hardik Windlassd50b0202021-09-02 14:45:09 +0000461 [Setup] Start Logging Restart-OpenOnu-Ping-TT
462 [Teardown] Run Keywords Collect Logs
463 ... AND Stop Logging Restart-OpenOnu-Ping-TT
464 Clear All Devices Then Create New Device
465 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
466 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000467 Perform Sanity Test TT
Hardik Windlassd50b0202021-09-02 14:45:09 +0000468 FOR ${I} IN RANGE 0 ${num_all_onus}
469 ${src}= Set Variable ${hosts.src[${I}]}
470 ${dst}= Set Variable ${hosts.dst[${I}]}
471 ${service_type}= Get Variable Value ${src['service_type']} "null"
472 Continue For Loop If '${service_type}' == 'mcast'
473 ${ping_output_file}= Set Variable /tmp/${src['onu']}_${service_type}_ping
474 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000475 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlassd50b0202021-09-02 14:45:09 +0000476 ... Run Ping In Background ${ping_output_file} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
477 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
478 END
479 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
480 Log ${podStatusOutput}
481 ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
482 ${podName} Set Variable adapter-open-onu
483 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
484 Sleep 5s
485 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
486 ... app ${podName} Running
487 Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
488 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
489 Log ${podStatusOutput}
490 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
491 Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart}
492 FOR ${I} IN RANGE 0 ${num_all_onus}
493 ${src}= Set Variable ${hosts.src[${I}]}
494 ${dst}= Set Variable ${hosts.dst[${I}]}
495 ${service_type}= Get Variable Value ${src['service_type']} "null"
496 Continue For Loop If '${service_type}' == 'mcast'
497 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000498 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlassd50b0202021-09-02 14:45:09 +0000499 ... Stop Ping Running In Background ${src['ip']} ${src['user']} ${src['pass']}
500 ... ${src['container_type']} ${src['container_name']}
501 END
502 FOR ${I} IN RANGE 0 ${num_all_onus}
503 ${src}= Set Variable ${hosts.src[${I}]}
504 ${dst}= Set Variable ${hosts.dst[${I}]}
505 ${service_type}= Get Variable Value ${src['service_type']} "null"
506 Continue For Loop If '${service_type}' == 'mcast'
507 ${ping_output_file}= Set Variable /tmp/${src['onu']}_${service_type}_ping
508 ${ping_output}= Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000509 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlassd50b0202021-09-02 14:45:09 +0000510 ... Retrieve Remote File Contents ${ping_output_file} ${src['ip']} ${src['user']} ${src['pass']}
511 ... ${src['container_type']} ${src['container_name']}
512 Check Ping Result True ${ping_output}
513 END
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000514 # Verify Control Plane Functionality by Deleting and Re-adding the Subscriber
515 Verify Control Plane After Pod Restart TT
Hardik Windlassd50b0202021-09-02 14:45:09 +0000516
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000517Verify restart openolt-adapter container for TT
Hardik Windlassd50b0202021-09-02 14:45:09 +0000518 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
519 ... Run the ping continuously in background during container restart,
520 ... and verify that there should be no affect on the dataplane.
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000521 ... Also, verify that the voltha control plane functionality is not affected.
Hardik Windlassb1bda362021-11-24 11:54:36 +0000522 [Tags] functionalTT Restart-OpenOlt-Ping-TT dataplaneTT
Hardik Windlassd50b0202021-09-02 14:45:09 +0000523 [Setup] Start Logging Restart-OpenOlt-Ping-TT
524 [Teardown] Run Keywords Collect Logs
525 ... AND Stop Logging Restart-OpenOlt-Ping-TT
526 Clear All Devices Then Create New Device
527 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
528 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000529 Perform Sanity Test TT
Hardik Windlassd50b0202021-09-02 14:45:09 +0000530 FOR ${I} IN RANGE 0 ${num_all_onus}
531 ${src}= Set Variable ${hosts.src[${I}]}
532 ${dst}= Set Variable ${hosts.dst[${I}]}
533 ${service_type}= Get Variable Value ${src['service_type']} "null"
534 Continue For Loop If '${service_type}' == 'mcast'
535 ${ping_output_file}= Set Variable /tmp/${src['onu']}_${service_type}_ping
536 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000537 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlassd50b0202021-09-02 14:45:09 +0000538 ... Run Ping In Background ${ping_output_file} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
539 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
540 END
541 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
542 Log ${podStatusOutput}
543 ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
544 ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL}
545 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
546 Sleep 5s
547 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
548 ... app ${podName} Running
549 Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
550 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
551 Log ${podStatusOutput}
552 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
553 Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart}
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 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000560 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlassd50b0202021-09-02 14:45:09 +0000561 ... Stop Ping Running In Background ${src['ip']} ${src['user']} ${src['pass']}
562 ... ${src['container_type']} ${src['container_name']}
563 END
564 FOR ${I} IN RANGE 0 ${num_all_onus}
565 ${src}= Set Variable ${hosts.src[${I}]}
566 ${dst}= Set Variable ${hosts.dst[${I}]}
567 ${service_type}= Get Variable Value ${src['service_type']} "null"
568 Continue For Loop If '${service_type}' == 'mcast'
569 ${ping_output_file}= Set Variable /tmp/${src['onu']}_${service_type}_ping
570 ${ping_output}= Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000571 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlassd50b0202021-09-02 14:45:09 +0000572 ... Retrieve Remote File Contents ${ping_output_file} ${src['ip']} ${src['user']} ${src['pass']}
573 ... ${src['container_type']} ${src['container_name']}
574 Check Ping Result True ${ping_output}
575 END
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000576 # Verify Control Plane Functionality by Deleting and Re-adding the Subscriber
577 Verify Control Plane After Pod Restart TT
578
579Verify restart rw-core container for TT
580 [Documentation] Restart rw-core container after VOLTHA is operational.
581 ... Run the ping continuously in background during container restart,
582 ... and verify that there should be no affect on the dataplane.
583 ... Also, verify that the voltha control plane functionality is not affected.
Hardik Windlassb1bda362021-11-24 11:54:36 +0000584 [Tags] functionalTT Restart-RwCore-Ping-TT dataplaneTT
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000585 [Setup] Start Logging Restart-RwCore-Ping-TT
586 [Teardown] Run Keywords Collect Logs
587 ... AND Stop Logging Restart-RwCore-Ping-TT
588 Clear All Devices Then Create New Device
589 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
590 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000591 Perform Sanity Test TT
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000592 FOR ${I} IN RANGE 0 ${num_all_onus}
593 ${src}= Set Variable ${hosts.src[${I}]}
594 ${dst}= Set Variable ${hosts.dst[${I}]}
595 ${service_type}= Get Variable Value ${src['service_type']} "null"
596 Continue For Loop If '${service_type}' == 'mcast'
597 ${ping_output_file}= Set Variable /tmp/${src['onu']}_${service_type}_ping
598 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000599 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000600 ... Run Ping In Background ${ping_output_file} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
601 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
602 END
603 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
604 Log ${podStatusOutput}
605 ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
606 ${podName} Set Variable rw-core
607 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
608 Sleep 5s
609 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
610 ... app ${podName} Running
611 Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
612 # For some reason scaling down and up the POD behind a service causes the port forward to stop working,
613 # so restart the port forwarding for the API service
614 Restart VOLTHA Port Forward voltha-api
615 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
616 Log ${podStatusOutput}
617 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
618 Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart}
619 FOR ${I} IN RANGE 0 ${num_all_onus}
620 ${src}= Set Variable ${hosts.src[${I}]}
621 ${dst}= Set Variable ${hosts.dst[${I}]}
622 ${service_type}= Get Variable Value ${src['service_type']} "null"
623 Continue For Loop If '${service_type}' == 'mcast'
624 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000625 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000626 ... Stop Ping Running In Background ${src['ip']} ${src['user']} ${src['pass']}
627 ... ${src['container_type']} ${src['container_name']}
628 END
629 FOR ${I} IN RANGE 0 ${num_all_onus}
630 ${src}= Set Variable ${hosts.src[${I}]}
631 ${dst}= Set Variable ${hosts.dst[${I}]}
632 ${service_type}= Get Variable Value ${src['service_type']} "null"
633 Continue For Loop If '${service_type}' == 'mcast'
634 ${ping_output_file}= Set Variable /tmp/${src['onu']}_${service_type}_ping
635 ${ping_output}= Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000636 ... Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000637 ... Retrieve Remote File Contents ${ping_output_file} ${src['ip']} ${src['user']} ${src['pass']}
638 ... ${src['container_type']} ${src['container_name']}
639 Check Ping Result True ${ping_output}
640 END
641 # Verify Control Plane Functionality by Deleting and Re-adding the Subscriber
642 Verify Control Plane After Pod Restart TT
Hardik Windlassd50b0202021-09-02 14:45:09 +0000643
TorstenThieme136ebf72021-02-26 14:27:07 +0000644*** Keywords ***
645Setup Suite
646 [Documentation] Set up the test suite
647 Common Test Suite Setup
648 ${switch_type}= Get Variable Value ${web_power_switch.type}
649 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
650
Hardik Windlassd3f63892021-03-25 08:28:02 +0000651Clear All Devices Then Create New Device
652 [Documentation] Remove any devices from VOLTHA and ONOS & then Create new devices
653 # Remove all devices from voltha and onos
654 Delete All Devices and Verify
655 # Execute normal test Setup Keyword
656 Setup
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000657
658Verify Control Plane After Pod Restart TT
659 [Documentation] Verifies the control plane functionality after the voltha pod restart
660 ... by deleting and re-adding the subscriber
661 Run Keyword If ${has_dataplane} Clean Up Linux
662 FOR ${I} IN RANGE 0 ${num_all_onus}
663 ${src}= Set Variable ${hosts.src[${I}]}
664 ${dst}= Set Variable ${hosts.dst[${I}]}
665 ${service_type}= Get Variable Value ${src['service_type']} "null"
666 ${of_id}= Get ofID From OLT List ${src['olt']}
667 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
668 ... ${of_id} ${src['uni_id']}
669 # Remove Subscriber Access
Hardik Windlassb1bda362021-11-24 11:54:36 +0000670 ${del_sub_cmd}= Run Keyword If ${unitag_sub}
671 ... Catenate volt-remove-subscriber-unitag --tpId ${src['tp_id']} --sTag ${src['s_tag']}
672 ... --cTag ${src['c_tag']} ${src['onu']}-${src['uni_id']}
673 ... ELSE
674 ... Set Variable volt-remove-subscriber-access ${of_id} ${onu_port}
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000675 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlassb1bda362021-11-24 11:54:36 +0000676 ... ${ONOS_SSH_PORT} ${del_sub_cmd}
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000677 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast'
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000678 ... Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000679 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
680 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
681 # Add Subscriber Access
Hardik Windlassb1bda362021-11-24 11:54:36 +0000682 ${add_sub_cmd}= Run Keyword If ${unitag_sub}
683 ... Catenate volt-add-subscriber-unitag --tpId ${src['tp_id']} --sTag ${src['s_tag']}
684 ... --cTag ${src['c_tag']} ${src['onu']}-${src['uni_id']}
685 ... ELSE
Matteo Scandolo2786d212021-12-06 12:22:53 -0800686 ... Set Variable volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000687 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlassb1bda362021-11-24 11:54:36 +0000688 ... ${ONOS_SSH_PORT} ${add_sub_cmd}
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000689 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000690 ... Validate Device ENABLED ACTIVE
691 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hardik Windlass5a2d1f42021-11-12 12:52:04 +0000692 Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast'
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000693 ... Sanity Test TT one ONU ${src} ${dst} ${suppressaddsubscriber}
Hardik Windlass5a2d1f42021-11-12 12:52:04 +0000694 ... ELSE IF ${has_dataplane} and '${service_type}' == 'mcast'
Hardik Windlass5083b3a2021-11-11 12:16:22 +0000695 ... Sanity Test TT MCAST one ONU ${src} ${dst} ${suppressaddsubscriber}
Hardik Windlasscf46ec42021-09-28 08:05:49 +0000696 END