blob: ccd71066d01a1be77380d0cf89f4413422ca90f1 [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
Hardik Windlassb9bdd502020-04-17 14:46:21 +053075 ... AND Stop Logging RebootOnu_PowerSwitch_Dt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080076 ... AND Delete All Devices and Verify
Hardik Windlassb9bdd502020-04-17 14:46:21 +053077 # Add OLT device
78 Setup
79 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
80 Run Keyword If ${has_dataplane} Clean Up Linux
81 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
82 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Hardik Windlass2eb47182020-05-19 20:24:12 +053083 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080084 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlassb9bdd502020-04-17 14:46:21 +053085 ${src}= Set Variable ${hosts.src[${I}]}
86 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080087 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass0560f802020-05-06 23:06:53 +053088 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Hardik Windlassb9bdd502020-04-17 14:46:21 +053089 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
90 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
Hardik Windlass7c801e62020-05-04 19:33:21 +053091 # Disable Power Switch
Hardik Windlassb9bdd502020-04-17 14:46:21 +053092 Disable Switch Outlet ${src['power_switch_port']}
93 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
94 ... Wait Until Keyword Succeeds 60s 2s
95 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
96 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +053097 # Remove Subscriber Access (To replicate DT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +000098 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass7c801e62020-05-04 19:33:21 +053099 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Girish Gowdrae0c711e2021-07-20 14:30:17 -0700100 # Allow the remove subscriber command to clean up all the flows, schedulers and queues before deleting the device
101 Sleep 5s
Hardik Windlass7c801e62020-05-04 19:33:21 +0530102 # Delete ONU Device (To replicate DT workflow)
103 Delete Device ${onu_device_id}
104 Sleep 5s
105 # Enable Power Switch
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530106 Enable Switch Outlet ${src['power_switch_port']}
Hardik Windlass40ccffb2020-05-11 14:12:07 +0530107 # Waiting extra time for the ONU to come up
108 Sleep 60s
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530109 # Check ONU port is Enabled in ONOS
110 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000111 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530112 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
TorstenThieme4e2168e2021-06-22 14:01:47 +0000113 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530114 ... volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530115 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700116 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530117 ... ENABLED ACTIVE REACHABLE
Hardik Windlass7c801e62020-05-04 19:33:21 +0530118 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530119 # Verify subscriber access flows are added for the ONU port
120 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
121 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
122 ... ${onu_port} ${nni_port} ${src['s_tag']}
Hardik Windlass2eb47182020-05-19 20:24:12 +0530123 #Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass7c801e62020-05-04 19:33:21 +0530124 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
125 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530126 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530127 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
128 ... ${dst['container_name']}
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530129 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800130 # Verify flows for all OLTs
131 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate All OLT Flows
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530132
133Verify OLT after Rebooting Physically for DT
134 [Documentation] Test the physical reboot of the OLT
135 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
136 ... Test performs a physical reboot, performs "reboot" from the OLT CLI
137 [Tags] functionalDt PhysicalOltRebootDt VOL-2817
Hardik Windlass9df139e2020-04-24 14:54:54 +0530138 [Setup] Start Logging RebootOlt_Physical_Dt
Hardik Windlass43531332021-05-19 07:07:03 +0000139 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530140 ... AND Stop Logging RebootOlt_Physical_Dt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800141 ... AND Delete All Devices and Verify
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530142 # Add OLT device
143 Setup
144 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
145 Run Keyword If ${has_dataplane} Clean Up Linux
146 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
147 # Reboot the OLT from the OLT CLI
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800148 FOR ${I} IN RANGE 0 ${olt_count}
149 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
150 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
151 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
152 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
153 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
154 Run Keyword If ${has_dataplane} Login And Run Command On Remote System
Andrea Campanella5ef88142021-02-02 14:34:50 +0100155 ... reboot ${olt_ssh_ip} ${olt_user} ${olt_pass} prompt=#
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800156 END
157 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530158 ${src}= Set Variable ${hosts.src[${I}]}
159 ${dst}= Set Variable ${hosts.dst[${I}]}
160 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
161 ... Wait Until Keyword Succeeds 60s 2s
162 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
163 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
164 END
165 # Wait for the OLT to come back up
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800166 FOR ${I} IN RANGE 0 ${olt_count}
167 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
168 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
169 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
170 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
171 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
172 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
173 ... Check Remote System Reachability True ${olt_ssh_ip}
174 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
175 ... Validate OLT Device ENABLED ACTIVE
176 ... REACHABLE ${olt_serial_number}
177 END
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530178 # Waiting extra time for the ONUs to come up
179 Sleep 60s
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530180 Run Keyword If ${has_dataplane} Clean Up Linux
181 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
182
TorstenThiemeed3332f2021-02-02 10:30:48 +0000183Verify restart openonu-adapter container after subscriber provisioning for DT
184 [Documentation] Restart openonu-adapter container after VOLTHA is operational.
185 ... Prerequisite : ONUs are authenticated and pingable.
Hardik Windlass43531332021-05-19 07:07:03 +0000186 [Tags] functionalDt Restart-OpenOnu-Dt soak
TorstenThiemeed3332f2021-02-02 10:30:48 +0000187 [Setup] Start Logging Restart-OpenOnu-Dt
Hardik Windlass43531332021-05-19 07:07:03 +0000188 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
TorstenThiemeed3332f2021-02-02 10:30:48 +0000189 ... AND Stop Logging Restart-OpenOnu-Dt
TorstenThiemeed3332f2021-02-02 10:30:48 +0000190 # Add OLT device
Hardik Windlass3280f2d2021-05-20 07:38:31 +0000191 Run Keyword If '${SOAK_TEST}'=='False' Setup
TorstenThiemeed3332f2021-02-02 10:30:48 +0000192 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
193 Run Keyword If ${has_dataplane} Clean Up Linux
194 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
195 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
196 Log ${podStatusOutput}
197 ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
198 ${podName} Set Variable adapter-open-onu
199 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
TorstenThiemeed3332f2021-02-02 10:30:48 +0000200 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
201 ... app ${podName} Running
202 # Wait for 1 min after openonu adapter is restarted
203 Sleep 60s
204 Run Keyword If ${has_dataplane} Clean Up Linux
205 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
TorstenThiemeed3332f2021-02-02 10:30:48 +0000206 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
207 Log ${podStatusOutput}
208 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
209 Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart}
210 Log to console Pod ${podName} restarted and sanity checks passed successfully
Hardik Windlass3280f2d2021-05-20 07:38:31 +0000211 Run Keyword If '${SOAK_TEST}'=='False' Delete All Devices and Verify
TorstenThiemeed3332f2021-02-02 10:30:48 +0000212
Hardik Windlass9df139e2020-04-24 14:54:54 +0530213Verify restart openolt-adapter container after subscriber provisioning for DT
214 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
215 ... Prerequisite : ONUs are authenticated and pingable.
Hardik Windlass43531332021-05-19 07:07:03 +0000216 [Tags] functionalDt Restart-OpenOlt-Dt soak
Hardik Windlass9df139e2020-04-24 14:54:54 +0530217 [Setup] Start Logging Restart-OpenOlt-Dt
Hardik Windlass43531332021-05-19 07:07:03 +0000218 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass9df139e2020-04-24 14:54:54 +0530219 ... AND Stop Logging Restart-OpenOlt-Dt
220 # Add OLT device
Hardik Windlass3280f2d2021-05-20 07:38:31 +0000221 Run Keyword If '${SOAK_TEST}'=='False' setup
Hardik Windlass9df139e2020-04-24 14:54:54 +0530222 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
223 Run Keyword If ${has_dataplane} Clean Up Linux
224 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Hardik Windlass9df139e2020-04-24 14:54:54 +0530225 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
226 Log ${podStatusOutput}
227 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Andrea Campanella3dcce272021-01-15 16:04:47 +0100228 ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530229 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530230 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
231 ... app ${podName} Running
TorstenThiemeed3332f2021-02-02 10:30:48 +0000232 # Wait for 1 min after openolt adapter is restarted
Hardik Windlass9df139e2020-04-24 14:54:54 +0530233 Sleep 60s
234 Run Keyword If ${has_dataplane} Clean Up Linux
235 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Hardik Windlass9df139e2020-04-24 14:54:54 +0530236 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
237 Log ${podStatusOutput}
238 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
239 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
240 Log to console Pod ${podName} restarted and sanity checks passed successfully
241
242Verify openolt adapter restart before subscriber provisioning for DT
243 [Documentation] Deploys an device instance and waits for it to authenticate. After
244 ... authentication is successful the rw-core deployment is scaled to 0 instances to
245 ... simulate a POD crash. The test then scales the rw-core back to a single instance
246 ... and configures ONOS for access. The test succeeds if the device is able to
247 ... complete the DHCP sequence.
Hardik Windlass4ed54502021-05-14 07:34:15 +0000248 [Tags] functionalDt olt-adapter-restart-Dt soak
Hardik Windlass9df139e2020-04-24 14:54:54 +0530249 [Setup] Start Logging OltAdapterRestart-Dt
250 #... AND Clear All Devices Then Create New Device
Hardik Windlass43531332021-05-19 07:07:03 +0000251 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass9df139e2020-04-24 14:54:54 +0530252 ... AND Stop Logging OltAdapterRestart-Dt
253 # Add OLT and perform sanity test
254 #setup
255 Run Keyword If ${has_dataplane} Clean Up Linux
256 #Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
257 Set Global Variable ${of_id}
258
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800259 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530260 ${src}= Set Variable ${hosts.src[${I}]}
261 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800262 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530263 ${onu_device_id}= Get Device ID From SN ${src['onu']}
264 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
265 ... ${of_id}
266 # Bring up the device and verify it authenticates
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700267 Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000268 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed by_dev_id=True
Hardik Windlass9df139e2020-04-24 14:54:54 +0530269 END
270 # 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 +0100271 Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 0
272 Wait Until Keyword Succeeds ${timeout} 2s Pods Do Not Exist By Label ${NAMESPACE} app
273 ... ${OLT_ADAPTER_APP_LABEL}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530274 # 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 +0100275 Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1
Hardik Windlass9df139e2020-04-24 14:54:54 +0530276 Wait Until Keyword Succeeds ${timeout} 2s
Andrea Campanella3dcce272021-01-15 16:04:47 +0100277 ... Check Expected Available Deployment Replicas By Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1
Hardik Windlass9df139e2020-04-24 14:54:54 +0530278
279 # Ensure the device is available in ONOS, this represents system connectivity being restored
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800280 FOR ${I} IN RANGE 0 ${olt_count}
281 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
282 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
283 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
284 ... ${olt_serial_number}
285 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
286 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
287 END
Hardik Windlass9df139e2020-04-24 14:54:54 +0530288
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800289 FOR ${I} IN RANGE 0 ${num_all_onus}
290 ${src}= Set Variable ${hosts.src[${I}]}
291 ${dst}= Set Variable ${hosts.dst[${I}]}
292 ${of_id}= Get ofID From OLT List ${src['olt']}
293 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
294 ... ${of_id}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530295 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000296 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530297 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
298 # Verify subscriber access flows are added for the ONU port
299 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
300 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
301 ... ${onu_port} ${nni_port} ${src['s_tag']}
302 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
303 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
304 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
305 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
306 ... ${dst['container_name']}
307 END
308
309Verify restart ofagent container after subscriber is provisioned for DT
310 [Documentation] Restart ofagent container after VOLTHA is operational.
311 ... Prerequisite : ONUs are authenticated and pingable.
Hardik Windlass4ed54502021-05-14 07:34:15 +0000312 [Tags] functionalDt ofagentRestart-Dt soak
Hardik Windlass9df139e2020-04-24 14:54:54 +0530313 [Setup] Start Logging ofagentRestart-Dt
Hardik Windlass43531332021-05-19 07:07:03 +0000314 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass9df139e2020-04-24 14:54:54 +0530315 ... AND Stop Logging ofagentRestart-Dt
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700316 ... AND Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 1
Hardik Windlass9df139e2020-04-24 14:54:54 +0530317 # set timeout value
318 ${waitforRestart} Set Variable 120s
319 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
320 Log ${podStatusOutput}
321 ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
322 ${podName} Set Variable ofagent
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530323 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530324 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
325 ... app ${podName} Running
Hardik Windlass5e214b22021-02-26 10:37:14 +0000326 Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530327 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
328 Run Keyword If ${has_dataplane} Clean Up Linux
329 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
330 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
331 Log ${podStatusOutput}
332 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
333 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
334 # Scale Down the Of-Agent Deployment
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700335 Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 0
Hardik Windlass9df139e2020-04-24 14:54:54 +0530336 Sleep 30s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800337 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530338 ${src}= Set Variable ${hosts.src[${I}]}
339 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800340 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530341 ${onu_device_id}= Get Device ID From SN ${src['onu']}
342 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
343 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
344 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700345 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Hardik Windlass9df139e2020-04-24 14:54:54 +0530346 ... ENABLED ACTIVE REACHABLE
347 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
348 # Check ONU port is Disabled in ONOS
349 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000350 ... Verify UNI Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530351 # Verify subscriber access flows are added for the ONU port
352 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
353 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
354 ... ${onu_port} ${nni_port} ${src['s_tag']}
355 # Verify Ping
356 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Check Ping True
357 ... ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']}
358 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530359 END
360 # Scale Up the Of-Agent Deployment
Matteo Scandoloa4e59522021-08-31 14:56:24 -0700361 Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 1
Hardik Windlass9df139e2020-04-24 14:54:54 +0530362 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
363 ... Running
364 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
365 Run Keyword If ${has_dataplane} Clean Up Linux
366 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
367 Log to console Pod ${podName} restarted and sanity checks passed successfully
368
369Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart for DT
370 [Documentation] Deploys an device instance and waits for it to authenticate. After
371 ... authentication is successful the rw-core deployment is scaled to 0 instances to
372 ... simulate a POD crash. The test then scales the rw-core back to a single instance
373 ... and configures ONOS for access. The test succeeds if the device is able to
374 ... complete the DHCP sequence.
Hardik Windlass43531332021-05-19 07:07:03 +0000375 [Tags] functionalDt rwcore-restart-Dt
Hardik Windlass9df139e2020-04-24 14:54:54 +0530376 [Setup] Run Keywords Start Logging RwCoreFailAndRestart-Dt
377 ... AND Clear All Devices Then Create New Device
Hardik Windlass43531332021-05-19 07:07:03 +0000378 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass9df139e2020-04-24 14:54:54 +0530379 ... AND Stop Logging RwCoreFailAndRestart-Dt
380 #... AND Delete Device and Verify
Hardik Windlass9df139e2020-04-24 14:54:54 +0530381 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800382 FOR ${I} IN RANGE 0 ${olt_count}
383 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
384 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
385 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
386 ... ${olt_serial_number}
387 ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
388 ... Get NNI Port in ONOS ${of_id}
389 # Set Global Variable ${nni_port}
390 END
391 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530392 ${src}= Set Variable ${hosts.src[${I}]}
393 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800394 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530395 ${onu_device_id}= Get Device ID From SN ${src['onu']}
396 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
397 ... ${of_id}
398 # Bring up the device and verify it authenticates
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700399 Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE
Hardik Windlass8b446492021-06-10 06:25:23 +0000400 ... ${onu_device_id} onu=True onu_reason=initial-mib-downloaded by_dev_id=True
Hardik Windlass9df139e2020-04-24 14:54:54 +0530401 END
402
403 # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530404 Scale K8s Deployment voltha voltha-voltha-rw-core 0
405 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-voltha-rw-core
Hardik Windlass9df139e2020-04-24 14:54:54 +0530406 # Ensure the ofagent POD goes "not-ready" as expected
407 Wait Until keyword Succeeds ${timeout} 2s
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530408 ... Check Expected Available Deployment Replicas voltha voltha-voltha-ofagent 0
Hardik Windlass9df139e2020-04-24 14:54:54 +0530409 # Scale up the core deployment and make sure both it and the ofagent deployment are back
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530410 Scale K8s Deployment voltha voltha-voltha-rw-core 1
Hardik Windlass9df139e2020-04-24 14:54:54 +0530411 Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass79b40ff2020-06-11 22:55:47 +0530412 ... Check Expected Available Deployment Replicas 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-ofagent 1
Hardik Windlass9df139e2020-04-24 14:54:54 +0530415 # For some reason scaling down and up the POD behind a service causes the port forward to stop working,
416 # so restart the port forwarding for the API service
David Bainbridge07321ff2020-06-12 13:55:42 -0700417 Restart VOLTHA Port Forward voltha-api
Hardik Windlass9df139e2020-04-24 14:54:54 +0530418 # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this
419 # represents system connectivity being restored
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800420 FOR ${I} IN RANGE 0 ${olt_count}
421 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
422 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
423 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
424 ... ${olt_serial_number}
Girish Gowdrae4de3b32021-03-23 22:20:00 -0700425 Wait Until Keyword Succeeds 120s 2s Device Is Available In ONOS
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800426 ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id}
427 END
Hardik Windlass9df139e2020-04-24 14:54:54 +0530428
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800429 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Bavier52094622020-05-12 15:54:24 -0700430 ${src}= Set Variable ${hosts.src[${I}]}
431 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800432 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavier52094622020-05-12 15:54:24 -0700433 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
434 ... ${of_id}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530435 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
TorstenThieme4e2168e2021-06-22 14:01:47 +0000436 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass9df139e2020-04-24 14:54:54 +0530437 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
438 # Verify subscriber access flows are added for the ONU port
439 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
440 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
441 ... ${onu_port} ${nni_port} ${src['s_tag']}
442 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
443 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
444 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
445 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
446 ... ${dst['container_name']}
447 END
448
Hemadf003682020-04-28 21:22:22 +0530449Verify OLT Soft Reboot for DT
450 [Documentation] Test soft reboot of the OLT using voltctl command
Hardik Windlass20a503d2021-06-21 11:58:08 +0000451 [Tags] VOL-2818 OLTSoftRebootDt functionalDt
Hemadf003682020-04-28 21:22:22 +0530452 [Setup] Start Logging OLTSoftRebootDt
Hardik Windlass20a503d2021-06-21 11:58:08 +0000453 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hemadf003682020-04-28 21:22:22 +0530454 ... AND Stop Logging OLTSoftRebootDt
Hardik Windlass20a503d2021-06-21 11:58:08 +0000455 FOR ${I} IN RANGE 0 ${olt_count}
456 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
457 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
458 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
459 ... Validate OLT Device ENABLED ACTIVE
460 ... REACHABLE ${olt_serial_number}
461 # Reboot the OLT using "voltctl device reboot" command
462 Reboot Device ${olt_device_id}
463 # Wait for the OLT to actually go down
464 Wait Until Keyword Succeeds 360s 5s Validate OLT Device ENABLED UNKNOWN UNREACHABLE
465 ... ${olt_serial_number}
466 END
Hemadf003682020-04-28 21:22:22 +0530467 #Verify that ping fails
Hardik Windlass20a503d2021-06-21 11:58:08 +0000468 FOR ${I} IN RANGE 0 ${num_all_onus}
Hemadf003682020-04-28 21:22:22 +0530469 ${src}= Set Variable ${hosts.src[${I}]}
470 ${dst}= Set Variable ${hosts.dst[${I}]}
471 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
472 ... Wait Until Keyword Succeeds 60s 2s
473 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
474 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
475 END
Hardik Windlass20a503d2021-06-21 11:58:08 +0000476 # Check OLT states
477 FOR ${I} IN RANGE 0 ${olt_count}
478 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
479 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
480 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
481 # Wait for the OLT to come back up
482 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s
483 ... Check Remote System Reachability True ${olt_ssh_ip}
484 # Check OLT states
485 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
486 ... Validate OLT Device ENABLED ACTIVE
487 ... REACHABLE ${olt_serial_number}
488 END
Hemadf003682020-04-28 21:22:22 +0530489 # Waiting extra time for the ONUs to come up
490 Sleep 60s
Hardik Windlass20a503d2021-06-21 11:58:08 +0000491 #Check after reboot that ONUs are active, DHCP/pingable
Hemadf003682020-04-28 21:22:22 +0530492 Run Keyword If ${has_dataplane} Clean Up Linux
493 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
494
Hema8c1a0322020-05-26 16:02:32 +0530495Verify ONU Soft Reboot for DT
496 [Documentation] Test soft reboot of the ONU using voltctl command
497 [Tags] VOL-2820 ONUSoftRebootDt notready
498 [Setup] Start Logging ONUSoftRebootDt
499 #... AND Setup
500 [Teardown] Run Keywords Collect Logs
501 ... AND Stop Logging ONUSoftRebootDt
502 #... AND Delete Device and Verify
Hema8c1a0322020-05-26 16:02:32 +0530503 #Reboot the ONU and verify that ping fails
504 FOR ${I} IN RANGE 0 ${num_onus}
505 ${src}= Set Variable ${hosts.src[${I}]}
506 ${dst}= Set Variable ${hosts.dst[${I}]}
507 ${onu_device_id}= Get Device ID From SN ${src['onu']}
508 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
509 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
510 Reboot Device ${onu_device_id}
511 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
512 ... Wait Until Keyword Succeeds 60s 2s
513 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
514 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
515 Verify ping is succesful except for given device ${num_onus} ${onu_device_id}
516 # Remove Subscriber Access (To replicate DT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000517 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hema8c1a0322020-05-26 16:02:32 +0530518 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
519 # Delete ONU Device (To replicate DT workflow)
520 Delete Device ${onu_device_id}
521 Sleep 40s
522 # Check ONU port is Enabled in ONOS
523 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000524 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hema8c1a0322020-05-26 16:02:32 +0530525 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
TorstenThieme4e2168e2021-06-22 14:01:47 +0000526 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hema8c1a0322020-05-26 16:02:32 +0530527 ... volt-add-subscriber-access ${of_id} ${onu_port}
528 # Verify ONU state in voltha
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700529 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device
Hema8c1a0322020-05-26 16:02:32 +0530530 ... ENABLED ACTIVE REACHABLE
531 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
532 # Verify subscriber access flows are added for the ONU port
533 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
534 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
535 ... ${onu_port} ${nni_port} ${src['s_tag']}
536 #Run Keyword If ${has_dataplane} Clean Up Linux
537 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
538 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
539 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
540 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
541 ... ${dst['container_name']}
Hema8c1a0322020-05-26 16:02:32 +0530542 END
543 # Verify ONOS Flows
544 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
545 ${onos_flows_count}= Evaluate 4 * ${num_onus}
546 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
547 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
548 ... ${of_id} ${onos_flows_count}
549 # Verify VOLTHA Flows
550 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
551 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
552 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
553 ${onu_flows}= Set Variable 2
554 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
555 ${List_ONU_Serial} Create List
556 Set Suite Variable ${List_ONU_Serial}
557 Build ONU SN List ${List_ONU_Serial}
558 Log ${List_ONU_Serial}
559 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
560 ... ${List_ONU_Serial} ${onu_flows}
Hemadf003682020-04-28 21:22:22 +0530561
Hardik Windlassd19af862021-08-12 11:40:20 +0000562Verify restart openonu-adapter container while continuously running ping in background for DT
563 [Documentation] Restart openonu-adapter container after VOLTHA is operational.
564 ... Run the ping continuously in background during container restart,
565 ... and verify that there should be no affect on the dataplane.
Hardik Windlass4e0e7c12021-08-26 08:07:35 +0000566 [Tags] functionalDt RestartOpenOnuPingDt non-critical
Hardik Windlassd19af862021-08-12 11:40:20 +0000567 [Setup] Start Logging RestartOpenOnuPingDt
568 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
569 ... AND Stop Logging RestartOpenOnuPingDt
570 Clear All Devices Then Create New Device
571 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
572 Run Keyword If ${has_dataplane} Clean Up Linux
573 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
574 FOR ${I} IN RANGE 0 ${num_all_onus}
575 ${src}= Set Variable ${hosts.src[${I}]}
576 ${dst}= Set Variable ${hosts.dst[${I}]}
577 ${ping_output_file}= Set Variable /tmp/${src['onu']}_ping
578 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
579 ... Wait Until Keyword Succeeds 60s 2s
580 ... Run Ping In Background ${ping_output_file} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
581 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
582 END
583 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
584 Log ${podStatusOutput}
585 ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
586 ${podName} Set Variable adapter-open-onu
587 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
588 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
589 ... app ${podName} Running
590 # Wait for 1 min after openonu adapter is restarted
591 Sleep 60s
592 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
593 Log ${podStatusOutput}
594 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
595 Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart}
596 FOR ${I} IN RANGE 0 ${num_all_onus}
597 ${src}= Set Variable ${hosts.src[${I}]}
598 ${dst}= Set Variable ${hosts.dst[${I}]}
Hardik Windlassd19af862021-08-12 11:40:20 +0000599 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
600 ... Wait Until Keyword Succeeds 60s 2s
601 ... Stop Ping Running In Background ${src['ip']} ${src['user']} ${src['pass']}
602 ... ${src['container_type']} ${src['container_name']}
Hardik Windlass6763ba52021-08-17 03:14:23 +0000603 END
604 FOR ${I} IN RANGE 0 ${num_all_onus}
605 ${src}= Set Variable ${hosts.src[${I}]}
606 ${dst}= Set Variable ${hosts.dst[${I}]}
607 ${ping_output_file}= Set Variable /tmp/${src['onu']}_ping
Hardik Windlassd19af862021-08-12 11:40:20 +0000608 ${ping_output}= Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
609 ... Wait Until Keyword Succeeds 60s 2s
610 ... Retrieve Remote File Contents ${ping_output_file} ${src['ip']} ${src['user']} ${src['pass']}
611 ... ${src['container_type']} ${src['container_name']}
612 Check Ping Result True ${ping_output}
613 END
614
Hardik Windlassa04efa52021-08-13 08:17:24 +0000615Verify restart openolt-adapter container while continuously running ping in background for DT
616 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
617 ... Run the ping continuously in background during container restart,
618 ... and verify that there should be no affect on the dataplane.
Hardik Windlass4e0e7c12021-08-26 08:07:35 +0000619 [Tags] functionalDt RestartOpenOltPingDt non-critical
Hardik Windlassa04efa52021-08-13 08:17:24 +0000620 [Setup] Start Logging RestartOpenOltPingDt
621 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
622 ... AND Stop Logging RestartOpenOltPingDt
623 Clear All Devices Then Create New Device
624 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
625 Run Keyword If ${has_dataplane} Clean Up Linux
626 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
627 FOR ${I} IN RANGE 0 ${num_all_onus}
628 ${src}= Set Variable ${hosts.src[${I}]}
629 ${dst}= Set Variable ${hosts.dst[${I}]}
630 ${ping_output_file}= Set Variable /tmp/${src['onu']}_ping
631 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
632 ... Wait Until Keyword Succeeds 60s 2s
633 ... Run Ping In Background ${ping_output_file} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
634 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
635 END
636 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
637 Log ${podStatusOutput}
638 ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
639 ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL}
640 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
641 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
642 ... app ${podName} Running
643 # Wait for 1 min after openolt adapter is restarted
644 Sleep 60s
645 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
646 Log ${podStatusOutput}
647 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
648 Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart}
649 FOR ${I} IN RANGE 0 ${num_all_onus}
650 ${src}= Set Variable ${hosts.src[${I}]}
651 ${dst}= Set Variable ${hosts.dst[${I}]}
Hardik Windlassa04efa52021-08-13 08:17:24 +0000652 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
653 ... Wait Until Keyword Succeeds 60s 2s
654 ... Stop Ping Running In Background ${src['ip']} ${src['user']} ${src['pass']}
655 ... ${src['container_type']} ${src['container_name']}
Hardik Windlass6763ba52021-08-17 03:14:23 +0000656 END
657 FOR ${I} IN RANGE 0 ${num_all_onus}
658 ${src}= Set Variable ${hosts.src[${I}]}
659 ${dst}= Set Variable ${hosts.dst[${I}]}
660 ${ping_output_file}= Set Variable /tmp/${src['onu']}_ping
Hardik Windlassa04efa52021-08-13 08:17:24 +0000661 ${ping_output}= Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
662 ... Wait Until Keyword Succeeds 60s 2s
663 ... Retrieve Remote File Contents ${ping_output_file} ${src['ip']} ${src['user']} ${src['pass']}
664 ... ${src['container_type']} ${src['container_name']}
665 Check Ping Result True ${ping_output}
666 END
667
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530668*** Keywords ***
669Setup Suite
670 [Documentation] Set up the test suite
671 Common Test Suite Setup
Andrea Campanella15619c72020-04-30 09:48:04 +0200672 #power_switch.robot needs it to support different vendor's power switch
673 ${switch_type}= Get Variable Value ${web_power_switch.type}
674 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Hardik Windlass4ed54502021-05-14 07:34:15 +0000675 # Run Pre-test Setup for Soak Job
676 # Note: As soak requirement, it expects that the devices under test are already created and enabled
677 Run Keyword If '${SOAK_TEST}'=='True' Setup Soak
678
Hardik Windlassb9bdd502020-04-17 14:46:21 +0530679
680Clear All Devices Then Create New Device
681 [Documentation] Remove any devices from VOLTHA and ONOS
682 # Remove all devices from voltha and nos
683 Delete All Devices and Verify
684 # Execute normal test Setup Keyword
685 Setup
686