blob: d9cba37cc564a2c1499b89a50688ef2edd134d83 [file] [log] [blame]
Hardik Windlassb9bdd502020-04-17 14:46:21 +05301# Copyright 2017 - present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14# FIXME Can we use the same test against BBSim and Hardware?
15
16*** Settings ***
17Documentation Test various end-to-end scenarios
18Suite Setup Setup Suite
19Test Setup Setup
20Test Teardown Teardown
21Suite Teardown Teardown Suite
22Library Collections
23Library String
24Library OperatingSystem
25Library XML
26Library RequestsLibrary
27Library ../../libraries/DependencyLibrary.py
28Resource ../../libraries/onos.robot
29Resource ../../libraries/voltctl.robot
30Resource ../../libraries/voltha.robot
31Resource ../../libraries/utils.robot
32Resource ../../libraries/k8s.robot
33Resource ../../variables/variables.robot
Andrea Campanella15619c72020-04-30 09:48:04 +020034Resource ../../libraries/power_switch.robot
Hardik Windlassb9bdd502020-04-17 14:46:21 +053035
36*** Variables ***
37${POD_NAME} flex-ocp-cord
38${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
39${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs
40#${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
41${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
42${HELM_CHARTS_DIR} ~/helm-charts
43${VOLTHA_POD_NUM} 8
44${NAMESPACE} voltha
Matteo Scandoloa4e59522021-08-31 14:56:24 -070045${STACK_NAME} voltha
Hardik Windlassb9bdd502020-04-17 14:46:21 +053046# 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
53${teardown_device} False
54${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
Hardik Windlass43531332021-05-19 07:07:03 +000059# logging flag to enable Collect Logs, can be passed via the command line too
60# example: -v logging:False
61${logging} True
62
Hardik Windlass4ed54502021-05-14 07:34:15 +000063# Flag specific to Soak Jobs
64${SOAK_TEST} False
65
Hardik Windlassb9bdd502020-04-17 14:46:21 +053066*** Test Cases ***
67Verify ONU after Rebooting Physically for DT
68 [Documentation] Test the ONU functionality by physically turning on/off ONU.
69 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
70 ... Test case runs only on the PODs that are configured with PowerSwitch that
71 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
72 [Tags] functionalDt PowerSwitchOnuRebootDt VOL-2819 PowerSwitch
Hardik Windlass9df139e2020-04-24 14:54:54 +053073 [Setup] Start Logging RebootOnu_PowerSwitch_Dt
Hardik Windlass43531332021-05-19 07:07:03 +000074 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080075 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -070076 ... AND Run Keyword If ${logging} Collect Logs
77 ... AND Stop Logging RebootOnu_PowerSwitch_Dt
Hardik Windlassb9bdd502020-04-17 14:46:21 +053078 # Add OLT device
79 Setup
80 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
81 Run Keyword If ${has_dataplane} Clean Up Linux
82 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
83 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Hardik Windlass2eb47182020-05-19 20:24:12 +053084 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080085 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlassb9bdd502020-04-17 14:46:21 +053086 ${src}= Set Variable ${hosts.src[${I}]}
87 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080088 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass0560f802020-05-06 23:06:53 +053089 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Hardik Windlassb9bdd502020-04-17 14:46:21 +053090 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
91 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
Hardik Windlass7c801e62020-05-04 19:33:21 +053092 # Disable Power Switch
Hardik Windlassb9bdd502020-04-17 14:46:21 +053093 Disable Switch Outlet ${src['power_switch_port']}
94 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
95 ... Wait Until Keyword Succeeds 60s 2s
96 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
97 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +053098 # Remove Subscriber Access (To replicate DT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +000099 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530100 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Girish Gowdrae0c711e2021-07-20 14:30:17 -0700101 # Allow the remove subscriber command to clean up all the flows, schedulers and queues before deleting the device
102 Sleep 5s
Hardik Windlass7c801e62020-05-04 19:33:21 +0530103 # Delete ONU Device (To replicate DT workflow)
104 Delete Device ${onu_device_id}
105 Sleep 5s
106 # Enable Power Switch
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530107 Enable Switch Outlet ${src['power_switch_port']}
Hardik Windlass40ccffb2020-05-11 14:12:07 +0530108 # Waiting extra time for the ONU to come up
109 Sleep 60s
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530110 # Check ONU port is Enabled in ONOS
111 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000112 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530113 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
TorstenThieme4e2168e2021-06-22 14:01:47 +0000114 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530115 ... volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530116 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700117 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530118 ... ENABLED ACTIVE REACHABLE
Hardik Windlass7c801e62020-05-04 19:33:21 +0530119 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530120 # Verify subscriber access flows are added for the ONU port
121 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
122 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
123 ... ${onu_port} ${nni_port} ${src['s_tag']}
Hardik Windlass2eb47182020-05-19 20:24:12 +0530124 #Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass7c801e62020-05-04 19:33:21 +0530125 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
126 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530127 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530128 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
129 ... ${dst['container_name']}
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530130 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800131 # Verify flows for all OLTs
132 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate All OLT Flows
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530133
134Verify OLT after Rebooting Physically for DT
135 [Documentation] Test the physical reboot of the OLT
136 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
137 ... Test performs a physical reboot, performs "reboot" from the OLT CLI
138 [Tags] functionalDt PhysicalOltRebootDt VOL-2817
Hardik Windlass9df139e2020-04-24 14:54:54 +0530139 [Setup] Start Logging RebootOlt_Physical_Dt
Hardik Windlass43531332021-05-19 07:07:03 +0000140 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800141 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700142 ... AND Run Keyword If ${logging} Collect Logs
143 ... AND Stop Logging RebootOlt_Physical_Dt
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530144 # Add OLT device
145 Setup
146 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
147 Run Keyword If ${has_dataplane} Clean Up Linux
148 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
149 # Reboot the OLT from the OLT CLI
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800150 FOR ${I} IN RANGE 0 ${olt_count}
151 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
152 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
153 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
154 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
155 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
156 Run Keyword If ${has_dataplane} Login And Run Command On Remote System
Andrea Campanella5ef88142021-02-02 14:34:50 +0100157 ... reboot ${olt_ssh_ip} ${olt_user} ${olt_pass} prompt=#
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800158 END
159 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530160 ${src}= Set Variable ${hosts.src[${I}]}
161 ${dst}= Set Variable ${hosts.dst[${I}]}
162 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
163 ... Wait Until Keyword Succeeds 60s 2s
164 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
165 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
166 END
167 # Wait for the OLT to come back up
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800168 FOR ${I} IN RANGE 0 ${olt_count}
169 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
170 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
171 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
172 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
173 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
174 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
175 ... Check Remote System Reachability True ${olt_ssh_ip}
176 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
177 ... Validate OLT Device ENABLED ACTIVE
178 ... REACHABLE ${olt_serial_number}
179 END
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530180 # Waiting extra time for the ONUs to come up
181 Sleep 60s
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530182 Run Keyword If ${has_dataplane} Clean Up Linux
183 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
184
TorstenThiemeed3332f2021-02-02 10:30:48 +0000185Verify restart openonu-adapter container after subscriber provisioning for DT
186 [Documentation] Restart openonu-adapter container after VOLTHA is operational.
187 ... Prerequisite : ONUs are authenticated and pingable.
Hardik Windlass43531332021-05-19 07:07:03 +0000188 [Tags] functionalDt Restart-OpenOnu-Dt soak
TorstenThiemeed3332f2021-02-02 10:30:48 +0000189 [Setup] Start Logging Restart-OpenOnu-Dt
Hardik Windlass43531332021-05-19 07:07:03 +0000190 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
TorstenThiemeed3332f2021-02-02 10:30:48 +0000191 ... AND Stop Logging Restart-OpenOnu-Dt
TorstenThiemeed3332f2021-02-02 10:30:48 +0000192 # Add OLT device
Hardik Windlass3280f2d2021-05-20 07:38:31 +0000193 Run Keyword If '${SOAK_TEST}'=='False' Setup
TorstenThiemeed3332f2021-02-02 10:30:48 +0000194 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
195 Run Keyword If ${has_dataplane} Clean Up Linux
196 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
197 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
198 Log ${podStatusOutput}
199 ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
200 ${podName} Set Variable adapter-open-onu
201 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
TorstenThiemeed3332f2021-02-02 10:30:48 +0000202 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
203 ... app ${podName} Running
204 # Wait for 1 min after openonu adapter is restarted
205 Sleep 60s
206 Run Keyword If ${has_dataplane} Clean Up Linux
207 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
TorstenThiemeed3332f2021-02-02 10:30:48 +0000208 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
209 Log ${podStatusOutput}
210 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
211 Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart}
212 Log to console Pod ${podName} restarted and sanity checks passed successfully
Hardik Windlass3280f2d2021-05-20 07:38:31 +0000213 Run Keyword If '${SOAK_TEST}'=='False' Delete All Devices and Verify
TorstenThiemeed3332f2021-02-02 10:30:48 +0000214
Hardik Windlass9df139e2020-04-24 14:54:54 +0530215Verify restart openolt-adapter container after subscriber provisioning for DT
216 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
217 ... Prerequisite : ONUs are authenticated and pingable.
Hardik Windlass43531332021-05-19 07:07:03 +0000218 [Tags] functionalDt Restart-OpenOlt-Dt soak
Hardik Windlass9df139e2020-04-24 14:54:54 +0530219 [Setup] Start Logging Restart-OpenOlt-Dt
Hardik Windlass43531332021-05-19 07:07:03 +0000220 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass9df139e2020-04-24 14:54:54 +0530221 ... AND Stop Logging Restart-OpenOlt-Dt
222 # Add OLT device
Hardik Windlass3280f2d2021-05-20 07:38:31 +0000223 Run Keyword If '${SOAK_TEST}'=='False' setup
Hardik Windlass9df139e2020-04-24 14:54:54 +0530224 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
225 Run Keyword If ${has_dataplane} Clean Up Linux
226 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Hardik Windlass9df139e2020-04-24 14:54:54 +0530227 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
228 Log ${podStatusOutput}
229 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Andrea Campanella3dcce272021-01-15 16:04:47 +0100230 ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530231 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530232 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
233 ... app ${podName} Running
TorstenThiemeed3332f2021-02-02 10:30:48 +0000234 # Wait for 1 min after openolt adapter is restarted
Hardik Windlass9df139e2020-04-24 14:54:54 +0530235 Sleep 60s
236 Run Keyword If ${has_dataplane} Clean Up Linux
237 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Hardik Windlass9df139e2020-04-24 14:54:54 +0530238 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
239 Log ${podStatusOutput}
240 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
241 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
242 Log to console Pod ${podName} restarted and sanity checks passed successfully
243
244Verify openolt adapter restart before subscriber provisioning for DT
245 [Documentation] Deploys an device instance and waits for it to authenticate. After
246 ... authentication is successful the rw-core deployment is scaled to 0 instances to
247 ... simulate a POD crash. The test then scales the rw-core back to a single instance
248 ... and configures ONOS for access. The test succeeds if the device is able to
249 ... complete the DHCP sequence.
Hardik Windlass4ed54502021-05-14 07:34:15 +0000250 [Tags] functionalDt olt-adapter-restart-Dt soak
Hardik Windlass9df139e2020-04-24 14:54:54 +0530251 [Setup] Start Logging OltAdapterRestart-Dt
252 #... AND Clear All Devices Then Create New Device
Hardik Windlass43531332021-05-19 07:07:03 +0000253 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass9df139e2020-04-24 14:54:54 +0530254 ... AND Stop Logging OltAdapterRestart-Dt
255 # Add OLT and perform sanity test
256 #setup
257 Run Keyword If ${has_dataplane} Clean Up Linux
258 #Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
259 Set Global Variable ${of_id}
260
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800261 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530262 ${src}= Set Variable ${hosts.src[${I}]}
263 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800264 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530265 ${onu_device_id}= Get Device ID From SN ${src['onu']}
266 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
267 ... ${of_id}
268 # Bring up the device and verify it authenticates
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700269 Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000270 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed by_dev_id=True
Hardik Windlass9df139e2020-04-24 14:54:54 +0530271 END
272 # Scale down the open OLT adapter deployment to 0 PODs and once confirmed, scale it back to 1
Andrea Campanella3dcce272021-01-15 16:04:47 +0100273 Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 0
274 Wait Until Keyword Succeeds ${timeout} 2s Pods Do Not Exist By Label ${NAMESPACE} app
275 ... ${OLT_ADAPTER_APP_LABEL}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530276 # Scale up the open OLT adapter deployment and make sure both it and the ofagent deployment are back
Andrea Campanella3dcce272021-01-15 16:04:47 +0100277 Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1
Hardik Windlass9df139e2020-04-24 14:54:54 +0530278 Wait Until Keyword Succeeds ${timeout} 2s
Andrea Campanella3dcce272021-01-15 16:04:47 +0100279 ... Check Expected Available Deployment Replicas By Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1
Hardik Windlass9df139e2020-04-24 14:54:54 +0530280
281 # Ensure the device is available in ONOS, this represents system connectivity being restored
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800282 FOR ${I} IN RANGE 0 ${olt_count}
283 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
284 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
285 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
286 ... ${olt_serial_number}
287 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
288 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
289 END
Hardik Windlass9df139e2020-04-24 14:54:54 +0530290
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800291 FOR ${I} IN RANGE 0 ${num_all_onus}
292 ${src}= Set Variable ${hosts.src[${I}]}
293 ${dst}= Set Variable ${hosts.dst[${I}]}
294 ${of_id}= Get ofID From OLT List ${src['olt']}
295 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
296 ... ${of_id}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530297 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000298 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530299 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
300 # Verify subscriber access flows are added for the ONU port
301 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
302 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
303 ... ${onu_port} ${nni_port} ${src['s_tag']}
304 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
305 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
306 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
307 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
308 ... ${dst['container_name']}
309 END
310
311Verify restart ofagent container after subscriber is provisioned for DT
312 [Documentation] Restart ofagent container after VOLTHA is operational.
313 ... Prerequisite : ONUs are authenticated and pingable.
Hardik Windlass4ed54502021-05-14 07:34:15 +0000314 [Tags] functionalDt ofagentRestart-Dt soak
Hardik Windlass9df139e2020-04-24 14:54:54 +0530315 [Setup] Start Logging ofagentRestart-Dt
Hardik Windlass43531332021-05-19 07:07:03 +0000316 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass9df139e2020-04-24 14:54:54 +0530317 ... AND Stop Logging ofagentRestart-Dt
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700318 ... AND Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 1
Hardik Windlass9df139e2020-04-24 14:54:54 +0530319 # set timeout value
320 ${waitforRestart} Set Variable 120s
321 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
322 Log ${podStatusOutput}
323 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
324 ${podName} Set Variable ofagent
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530325 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530326 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
327 ... app ${podName} Running
Hardik Windlass5e214b22021-02-26 10:37:14 +0000328 Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530329 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
330 Run Keyword If ${has_dataplane} Clean Up Linux
331 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
332 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
333 Log ${podStatusOutput}
334 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
335 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
336 # Scale Down the Of-Agent Deployment
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700337 Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 0
Hardik Windlass9df139e2020-04-24 14:54:54 +0530338 Sleep 30s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800339 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530340 ${src}= Set Variable ${hosts.src[${I}]}
341 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800342 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530343 ${onu_device_id}= Get Device ID From SN ${src['onu']}
344 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
345 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
346 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700347 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Hardik Windlass9df139e2020-04-24 14:54:54 +0530348 ... ENABLED ACTIVE REACHABLE
349 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
350 # Check ONU port is Disabled in ONOS
351 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000352 ... Verify UNI Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530353 # Verify subscriber access flows are added for the ONU port
354 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
355 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
356 ... ${onu_port} ${nni_port} ${src['s_tag']}
357 # Verify Ping
358 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Check Ping True
359 ... ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']}
360 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530361 END
362 # Scale Up the Of-Agent Deployment
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700363 Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 1
Hardik Windlass9df139e2020-04-24 14:54:54 +0530364 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
365 ... Running
366 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
367 Run Keyword If ${has_dataplane} Clean Up Linux
368 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
369 Log to console Pod ${podName} restarted and sanity checks passed successfully
370
371Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart for DT
372 [Documentation] Deploys an device instance and waits for it to authenticate. After
373 ... authentication is successful the rw-core deployment is scaled to 0 instances to
374 ... simulate a POD crash. The test then scales the rw-core back to a single instance
375 ... and configures ONOS for access. The test succeeds if the device is able to
376 ... complete the DHCP sequence.
Hardik Windlass43531332021-05-19 07:07:03 +0000377 [Tags] functionalDt rwcore-restart-Dt
Hardik Windlass9df139e2020-04-24 14:54:54 +0530378 [Setup] Run Keywords Start Logging RwCoreFailAndRestart-Dt
379 ... AND Clear All Devices Then Create New Device
Hardik Windlass43531332021-05-19 07:07:03 +0000380 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass9df139e2020-04-24 14:54:54 +0530381 ... AND Stop Logging RwCoreFailAndRestart-Dt
382 #... AND Delete Device and Verify
Hardik Windlass9df139e2020-04-24 14:54:54 +0530383 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800384 FOR ${I} IN RANGE 0 ${olt_count}
385 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
386 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
387 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
388 ... ${olt_serial_number}
389 ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
390 ... Get NNI Port in ONOS ${of_id}
391 # Set Global Variable ${nni_port}
392 END
393 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530394 ${src}= Set Variable ${hosts.src[${I}]}
395 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800396 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530397 ${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
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700401 Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000402 ... ${onu_device_id} onu=True onu_reason=initial-mib-downloaded by_dev_id=True
Hardik Windlass9df139e2020-04-24 14:54:54 +0530403 END
404
405 # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530406 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
Hardik Windlass9df139e2020-04-24 14:54:54 +0530408 # Ensure the ofagent POD goes "not-ready" as expected
409 Wait Until keyword Succeeds ${timeout} 2s
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530410 ... Check Expected Available Deployment Replicas voltha voltha-voltha-ofagent 0
Hardik Windlass9df139e2020-04-24 14:54:54 +0530411 # Scale up the core deployment and make sure both it and the ofagent deployment are back
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530412 Scale K8s Deployment voltha voltha-voltha-rw-core 1
Hardik Windlass9df139e2020-04-24 14:54:54 +0530413 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530414 ... Check Expected Available Deployment Replicas voltha voltha-voltha-rw-core 1
Hardik Windlass9df139e2020-04-24 14:54:54 +0530415 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530416 ... Check Expected Available Deployment Replicas voltha voltha-voltha-ofagent 1
Hardik Windlass9df139e2020-04-24 14:54:54 +0530417 # 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
David Bainbridge07321ff2020-06-12 13:55:42 -0700419 Restart VOLTHA Port Forward voltha-api
Hardik Windlass9df139e2020-04-24 14:54:54 +0530420 # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this
421 # represents system connectivity being restored
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800422 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}
Girish Gowdrae4de3b32021-03-23 22:20:00 -0700427 Wait Until Keyword Succeeds 120s 2s Device Is Available In ONOS
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800428 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
429 END
Hardik Windlass9df139e2020-04-24 14:54:54 +0530430
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800431 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Bavier52094622020-05-12 15:54:24 -0700432 ${src}= Set Variable ${hosts.src[${I}]}
433 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800434 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavier52094622020-05-12 15:54:24 -0700435 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
436 ... ${of_id}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530437 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000438 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530439 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
440 # Verify subscriber access flows are added for the ONU port
441 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
442 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
443 ... ${onu_port} ${nni_port} ${src['s_tag']}
444 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
445 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
446 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
447 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
448 ... ${dst['container_name']}
449 END
450
Hemadf003682020-04-28 21:22:22 +0530451Verify OLT Soft Reboot for DT
452 [Documentation] Test soft reboot of the OLT using voltctl command
Hardik Windlass20a503d2021-06-21 11:58:08 +0000453 [Tags] VOL-2818 OLTSoftRebootDt functionalDt
Hemadf003682020-04-28 21:22:22 +0530454 [Setup] Start Logging OLTSoftRebootDt
Hardik Windlass20a503d2021-06-21 11:58:08 +0000455 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hemadf003682020-04-28 21:22:22 +0530456 ... AND Stop Logging OLTSoftRebootDt
Hardik Windlass20a503d2021-06-21 11:58:08 +0000457 FOR ${I} IN RANGE 0 ${olt_count}
458 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
459 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
460 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
461 ... Validate OLT Device ENABLED ACTIVE
462 ... REACHABLE ${olt_serial_number}
463 # Reboot the OLT using "voltctl device reboot" command
464 Reboot Device ${olt_device_id}
465 # Wait for the OLT to actually go down
466 Wait Until Keyword Succeeds 360s 5s Validate OLT Device ENABLED UNKNOWN UNREACHABLE
467 ... ${olt_serial_number}
468 END
Hemadf003682020-04-28 21:22:22 +0530469 #Verify that ping fails
Hardik Windlass20a503d2021-06-21 11:58:08 +0000470 FOR ${I} IN RANGE 0 ${num_all_onus}
Hemadf003682020-04-28 21:22:22 +0530471 ${src}= Set Variable ${hosts.src[${I}]}
472 ${dst}= Set Variable ${hosts.dst[${I}]}
473 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
474 ... Wait Until Keyword Succeeds 60s 2s
475 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
476 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
477 END
Hardik Windlass20a503d2021-06-21 11:58:08 +0000478 # Check OLT states
479 FOR ${I} IN RANGE 0 ${olt_count}
480 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
481 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
482 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
483 # Wait for the OLT to come back up
484 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
485 ... Check Remote System Reachability True ${olt_ssh_ip}
486 # Check OLT states
487 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
488 ... Validate OLT Device ENABLED ACTIVE
489 ... REACHABLE ${olt_serial_number}
490 END
Hemadf003682020-04-28 21:22:22 +0530491 # Waiting extra time for the ONUs to come up
492 Sleep 60s
Hardik Windlass20a503d2021-06-21 11:58:08 +0000493 #Check after reboot that ONUs are active, DHCP/pingable
Hemadf003682020-04-28 21:22:22 +0530494 Run Keyword If ${has_dataplane} Clean Up Linux
495 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
496
Hema8c1a0322020-05-26 16:02:32 +0530497Verify ONU Soft Reboot for DT
498 [Documentation] Test soft reboot of the ONU using voltctl command
499 [Tags] VOL-2820 ONUSoftRebootDt notready
500 [Setup] Start Logging ONUSoftRebootDt
501 #... AND Setup
502 [Teardown] Run Keywords Collect Logs
503 ... AND Stop Logging ONUSoftRebootDt
504 #... AND Delete Device and Verify
Hema8c1a0322020-05-26 16:02:32 +0530505 #Reboot the ONU and verify that ping fails
506 FOR ${I} IN RANGE 0 ${num_onus}
507 ${src}= Set Variable ${hosts.src[${I}]}
508 ${dst}= Set Variable ${hosts.dst[${I}]}
509 ${onu_device_id}= Get Device ID From SN ${src['onu']}
510 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
511 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
512 Reboot Device ${onu_device_id}
513 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
514 ... Wait Until Keyword Succeeds 60s 2s
515 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
516 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
517 Verify ping is succesful except for given device ${num_onus} ${onu_device_id}
518 # Remove Subscriber Access (To replicate DT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000519 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hema8c1a0322020-05-26 16:02:32 +0530520 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
521 # Delete ONU Device (To replicate DT workflow)
522 Delete Device ${onu_device_id}
523 Sleep 40s
524 # Check ONU port is Enabled in ONOS
525 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000526 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hema8c1a0322020-05-26 16:02:32 +0530527 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
TorstenThieme4e2168e2021-06-22 14:01:47 +0000528 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hema8c1a0322020-05-26 16:02:32 +0530529 ... volt-add-subscriber-access ${of_id} ${onu_port}
530 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700531 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Hema8c1a0322020-05-26 16:02:32 +0530532 ... ENABLED ACTIVE REACHABLE
533 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
534 # Verify subscriber access flows are added for the ONU port
535 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
536 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
537 ... ${onu_port} ${nni_port} ${src['s_tag']}
538 #Run Keyword If ${has_dataplane} Clean Up Linux
539 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
540 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
541 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
542 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
543 ... ${dst['container_name']}
Hema8c1a0322020-05-26 16:02:32 +0530544 END
545 # Verify ONOS Flows
546 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
547 ${onos_flows_count}= Evaluate 4 * ${num_onus}
548 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
549 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
550 ... ${of_id} ${onos_flows_count}
551 # Verify VOLTHA Flows
552 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
553 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
554 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
555 ${onu_flows}= Set Variable 2
556 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
557 ${List_ONU_Serial} Create List
558 Set Suite Variable ${List_ONU_Serial}
559 Build ONU SN List ${List_ONU_Serial}
560 Log ${List_ONU_Serial}
561 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
562 ... ${List_ONU_Serial} ${onu_flows}
Hemadf003682020-04-28 21:22:22 +0530563
Hardik Windlassd19af862021-08-12 11:40:20 +0000564Verify restart openonu-adapter container while continuously running ping in background for DT
565 [Documentation] Restart openonu-adapter container after VOLTHA is operational.
566 ... Run the ping continuously in background during container restart,
567 ... and verify that there should be no affect on the dataplane.
Hardik Windlass4e0e7c12021-08-26 08:07:35 +0000568 [Tags] functionalDt RestartOpenOnuPingDt non-critical
Hardik Windlassd19af862021-08-12 11:40:20 +0000569 [Setup] Start Logging RestartOpenOnuPingDt
570 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
571 ... AND Stop Logging RestartOpenOnuPingDt
572 Clear All Devices Then Create New Device
573 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
574 Run Keyword If ${has_dataplane} Clean Up Linux
575 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
576 FOR ${I} IN RANGE 0 ${num_all_onus}
577 ${src}= Set Variable ${hosts.src[${I}]}
578 ${dst}= Set Variable ${hosts.dst[${I}]}
579 ${ping_output_file}= Set Variable /tmp/${src['onu']}_ping
580 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
581 ... Wait Until Keyword Succeeds 60s 2s
582 ... Run Ping In Background ${ping_output_file} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
583 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
584 END
585 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
586 Log ${podStatusOutput}
587 ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
588 ${podName} Set Variable adapter-open-onu
589 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
590 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
591 ... app ${podName} Running
592 # Wait for 1 min after openonu adapter is restarted
593 Sleep 60s
594 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
595 Log ${podStatusOutput}
596 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
597 Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart}
598 FOR ${I} IN RANGE 0 ${num_all_onus}
599 ${src}= Set Variable ${hosts.src[${I}]}
600 ${dst}= Set Variable ${hosts.dst[${I}]}
Hardik Windlassd19af862021-08-12 11:40:20 +0000601 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
602 ... Wait Until Keyword Succeeds 60s 2s
603 ... Stop Ping Running In Background ${src['ip']} ${src['user']} ${src['pass']}
604 ... ${src['container_type']} ${src['container_name']}
Hardik Windlass6763ba52021-08-17 03:14:23 +0000605 END
606 FOR ${I} IN RANGE 0 ${num_all_onus}
607 ${src}= Set Variable ${hosts.src[${I}]}
608 ${dst}= Set Variable ${hosts.dst[${I}]}
609 ${ping_output_file}= Set Variable /tmp/${src['onu']}_ping
Hardik Windlassd19af862021-08-12 11:40:20 +0000610 ${ping_output}= Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
611 ... Wait Until Keyword Succeeds 60s 2s
612 ... Retrieve Remote File Contents ${ping_output_file} ${src['ip']} ${src['user']} ${src['pass']}
613 ... ${src['container_type']} ${src['container_name']}
614 Check Ping Result True ${ping_output}
615 END
616
Hardik Windlassa04efa52021-08-13 08:17:24 +0000617Verify restart openolt-adapter container while continuously running ping in background for DT
618 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
619 ... Run the ping continuously in background during container restart,
620 ... and verify that there should be no affect on the dataplane.
Hardik Windlass4e0e7c12021-08-26 08:07:35 +0000621 [Tags] functionalDt RestartOpenOltPingDt non-critical
Hardik Windlassa04efa52021-08-13 08:17:24 +0000622 [Setup] Start Logging RestartOpenOltPingDt
623 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
624 ... AND Stop Logging RestartOpenOltPingDt
625 Clear All Devices Then Create New Device
626 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
627 Run Keyword If ${has_dataplane} Clean Up Linux
628 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
629 FOR ${I} IN RANGE 0 ${num_all_onus}
630 ${src}= Set Variable ${hosts.src[${I}]}
631 ${dst}= Set Variable ${hosts.dst[${I}]}
632 ${ping_output_file}= Set Variable /tmp/${src['onu']}_ping
633 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
634 ... Wait Until Keyword Succeeds 60s 2s
635 ... Run Ping In Background ${ping_output_file} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
636 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
637 END
638 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
639 Log ${podStatusOutput}
640 ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
641 ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL}
642 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
643 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
644 ... app ${podName} Running
645 # Wait for 1 min after openolt adapter is restarted
646 Sleep 60s
647 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
648 Log ${podStatusOutput}
649 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
650 Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart}
651 FOR ${I} IN RANGE 0 ${num_all_onus}
652 ${src}= Set Variable ${hosts.src[${I}]}
653 ${dst}= Set Variable ${hosts.dst[${I}]}
Hardik Windlassa04efa52021-08-13 08:17:24 +0000654 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
655 ... Wait Until Keyword Succeeds 60s 2s
656 ... Stop Ping Running In Background ${src['ip']} ${src['user']} ${src['pass']}
657 ... ${src['container_type']} ${src['container_name']}
Hardik Windlass6763ba52021-08-17 03:14:23 +0000658 END
659 FOR ${I} IN RANGE 0 ${num_all_onus}
660 ${src}= Set Variable ${hosts.src[${I}]}
661 ${dst}= Set Variable ${hosts.dst[${I}]}
662 ${ping_output_file}= Set Variable /tmp/${src['onu']}_ping
Hardik Windlassa04efa52021-08-13 08:17:24 +0000663 ${ping_output}= Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
664 ... Wait Until Keyword Succeeds 60s 2s
665 ... Retrieve Remote File Contents ${ping_output_file} ${src['ip']} ${src['user']} ${src['pass']}
666 ... ${src['container_type']} ${src['container_name']}
667 Check Ping Result True ${ping_output}
668 END
669
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530670*** Keywords ***
671Setup Suite
672 [Documentation] Set up the test suite
673 Common Test Suite Setup
Andrea Campanella15619c72020-04-30 09:48:04 +0200674 #power_switch.robot needs it to support different vendor's power switch
675 ${switch_type}= Get Variable Value ${web_power_switch.type}
676 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Hardik Windlass4ed54502021-05-14 07:34:15 +0000677 # Run Pre-test Setup for Soak Job
678 # Note: As soak requirement, it expects that the devices under test are already created and enabled
679 Run Keyword If '${SOAK_TEST}'=='True' Setup Soak
680
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530681
682Clear All Devices Then Create New Device
683 [Documentation] Remove any devices from VOLTHA and ONOS
684 # Remove all devices from voltha and nos
685 Delete All Devices and Verify
686 # Execute normal test Setup Keyword
687 Setup
688