Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 1 | # 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 *** |
| 17 | Documentation Test various end-to-end scenarios |
| 18 | Suite Setup Setup Suite |
| 19 | Test Setup Setup |
| 20 | Test Teardown Teardown |
| 21 | Suite Teardown Teardown Suite |
| 22 | Library Collections |
| 23 | Library String |
| 24 | Library OperatingSystem |
| 25 | Library XML |
| 26 | Library RequestsLibrary |
| 27 | Library ../../libraries/DependencyLibrary.py |
| 28 | Resource ../../libraries/onos.robot |
| 29 | Resource ../../libraries/voltctl.robot |
| 30 | Resource ../../libraries/voltha.robot |
| 31 | Resource ../../libraries/utils.robot |
| 32 | Resource ../../libraries/k8s.robot |
| 33 | Resource ../../variables/variables.robot |
Andrea Campanella | 15619c7 | 2020-04-30 09:48:04 +0200 | [diff] [blame] | 34 | Resource ../../libraries/power_switch.robot |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 35 | |
| 36 | *** Variables *** |
| 37 | ${POD_NAME} flex-ocp-cord |
| 38 | ${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 39 | ${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs |
| 40 | #${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 41 | ${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml |
| 42 | ${HELM_CHARTS_DIR} ~/helm-charts |
| 43 | ${VOLTHA_POD_NUM} 8 |
| 44 | ${NAMESPACE} voltha |
| 45 | # For below variable value, using deployment name as using grep for |
| 46 | # parsing radius pod name, we can also use full radius pod name |
| 47 | ${RESTART_POD_NAME} radius |
| 48 | ${timeout} 60s |
| 49 | ${of_id} 0 |
| 50 | ${logical_id} 0 |
| 51 | ${has_dataplane} True |
| 52 | ${teardown_device} False |
| 53 | ${scripts} ../../scripts |
| 54 | |
| 55 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 56 | ${container_log_dir} ${None} |
| 57 | |
Hardik Windlass | 4ed5450 | 2021-05-14 07:34:15 +0000 | [diff] [blame] | 58 | # Flag specific to Soak Jobs |
| 59 | ${SOAK_TEST} False |
| 60 | |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 61 | *** Test Cases *** |
| 62 | Verify ONU after Rebooting Physically for DT |
| 63 | [Documentation] Test the ONU functionality by physically turning on/off ONU. |
| 64 | ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed) |
| 65 | ... Test case runs only on the PODs that are configured with PowerSwitch that |
| 66 | ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot) |
| 67 | [Tags] functionalDt PowerSwitchOnuRebootDt VOL-2819 PowerSwitch |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 68 | [Setup] Start Logging RebootOnu_PowerSwitch_Dt |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 69 | [Teardown] Run Keywords Collect Logs |
| 70 | ... AND Stop Logging RebootOnu_PowerSwitch_Dt |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 71 | ... AND Delete All Devices and Verify |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 72 | # Add OLT device |
| 73 | Setup |
| 74 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 75 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 76 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 77 | Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password} |
Hardik Windlass | 2eb4718 | 2020-05-19 20:24:12 +0530 | [diff] [blame] | 78 | Run Keyword If ${has_dataplane} Clean Up Linux |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 79 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 80 | ${src}= Set Variable ${hosts.src[${I}]} |
| 81 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 82 | ${of_id}= Get ofID From OLT List ${src['olt']} |
Hardik Windlass | 0560f80 | 2020-05-06 23:06:53 +0530 | [diff] [blame] | 83 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 84 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 85 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
Hardik Windlass | 7c801e6 | 2020-05-04 19:33:21 +0530 | [diff] [blame] | 86 | # Disable Power Switch |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 87 | Disable Switch Outlet ${src['power_switch_port']} |
| 88 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 89 | ... Wait Until Keyword Succeeds 60s 2s |
| 90 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 91 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Hardik Windlass | 7c801e6 | 2020-05-04 19:33:21 +0530 | [diff] [blame] | 92 | # Remove Subscriber Access (To replicate DT workflow) |
| 93 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP} |
| 94 | ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port} |
| 95 | # Delete ONU Device (To replicate DT workflow) |
| 96 | Delete Device ${onu_device_id} |
| 97 | Sleep 5s |
| 98 | # Enable Power Switch |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 99 | Enable Switch Outlet ${src['power_switch_port']} |
Hardik Windlass | 40ccffb | 2020-05-11 14:12:07 +0530 | [diff] [blame] | 100 | # Waiting extra time for the ONU to come up |
| 101 | Sleep 60s |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 102 | # Check ONU port is Enabled in ONOS |
| 103 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
Suchitra Vemuri | 760bdd3 | 2020-06-17 12:34:48 -0700 | [diff] [blame] | 104 | ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Hardik Windlass | 7c801e6 | 2020-05-04 19:33:21 +0530 | [diff] [blame] | 105 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2 |
| 106 | ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 107 | ... volt-add-subscriber-access ${of_id} ${onu_port} |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 108 | # Verify ONU state in voltha |
Suchitra Vemuri | cdc32d8 | 2020-07-17 12:24:46 -0700 | [diff] [blame] | 109 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 110 | ... ENABLED ACTIVE REACHABLE |
Hardik Windlass | 7c801e6 | 2020-05-04 19:33:21 +0530 | [diff] [blame] | 111 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 112 | # Verify subscriber access flows are added for the ONU port |
| 113 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 114 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 115 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
Hardik Windlass | 2eb4718 | 2020-05-19 20:24:12 +0530 | [diff] [blame] | 116 | #Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 7c801e6 | 2020-05-04 19:33:21 +0530 | [diff] [blame] | 117 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 118 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 119 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Hardik Windlass | 7c801e6 | 2020-05-04 19:33:21 +0530 | [diff] [blame] | 120 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 121 | ... ${dst['container_name']} |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 122 | END |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 123 | # Verify flows for all OLTs |
| 124 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate All OLT Flows |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 125 | |
| 126 | Verify OLT after Rebooting Physically for DT |
| 127 | [Documentation] Test the physical reboot of the OLT |
| 128 | ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed) |
| 129 | ... Test performs a physical reboot, performs "reboot" from the OLT CLI |
| 130 | [Tags] functionalDt PhysicalOltRebootDt VOL-2817 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 131 | [Setup] Start Logging RebootOlt_Physical_Dt |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 132 | [Teardown] Run Keywords Collect Logs |
| 133 | ... AND Stop Logging RebootOlt_Physical_Dt |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 134 | ... AND Delete All Devices and Verify |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 135 | # Add OLT device |
| 136 | Setup |
| 137 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 138 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 139 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 140 | # Reboot the OLT from the OLT CLI |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 141 | FOR ${I} IN RANGE 0 ${olt_count} |
| 142 | ${olt_user}= Get From Dictionary ${list_olts}[${I}] user |
| 143 | ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass |
| 144 | ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship |
| 145 | ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn |
| 146 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 147 | Run Keyword If ${has_dataplane} Login And Run Command On Remote System |
Andrea Campanella | 5ef8814 | 2021-02-02 14:34:50 +0100 | [diff] [blame] | 148 | ... reboot ${olt_ssh_ip} ${olt_user} ${olt_pass} prompt=# |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 149 | END |
| 150 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 151 | ${src}= Set Variable ${hosts.src[${I}]} |
| 152 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 153 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 154 | ... Wait Until Keyword Succeeds 60s 2s |
| 155 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 156 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 157 | END |
| 158 | # Wait for the OLT to come back up |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 159 | FOR ${I} IN RANGE 0 ${olt_count} |
| 160 | ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn |
| 161 | ${olt_user}= Get From Dictionary ${list_olts}[${I}] user |
| 162 | ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass |
| 163 | ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship |
| 164 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 165 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s |
| 166 | ... Check Remote System Reachability True ${olt_ssh_ip} |
| 167 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s |
| 168 | ... Validate OLT Device ENABLED ACTIVE |
| 169 | ... REACHABLE ${olt_serial_number} |
| 170 | END |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 171 | # Waiting extra time for the ONUs to come up |
| 172 | Sleep 60s |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 173 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 174 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 175 | |
TorstenThieme | ed3332f | 2021-02-02 10:30:48 +0000 | [diff] [blame] | 176 | Verify restart openonu-adapter container after subscriber provisioning for DT |
| 177 | [Documentation] Restart openonu-adapter container after VOLTHA is operational. |
| 178 | ... Prerequisite : ONUs are authenticated and pingable. |
| 179 | [Tags] functionalDt Restart-OpenOnu-Dt |
| 180 | [Setup] Start Logging Restart-OpenOnu-Dt |
| 181 | [Teardown] Run Keywords Collect Logs |
| 182 | ... AND Stop Logging Restart-OpenOnu-Dt |
| 183 | ... AND Delete All Devices and Verify |
| 184 | # Add OLT device |
| 185 | Setup |
| 186 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 187 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 188 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 189 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 190 | Log ${podStatusOutput} |
| 191 | ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 192 | ${podName} Set Variable adapter-open-onu |
| 193 | Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName} |
TorstenThieme | ed3332f | 2021-02-02 10:30:48 +0000 | [diff] [blame] | 194 | Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE} |
| 195 | ... app ${podName} Running |
| 196 | # Wait for 1 min after openonu adapter is restarted |
| 197 | Sleep 60s |
| 198 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 199 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
TorstenThieme | ed3332f | 2021-02-02 10:30:48 +0000 | [diff] [blame] | 200 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 201 | Log ${podStatusOutput} |
| 202 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 203 | Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart} |
| 204 | Log to console Pod ${podName} restarted and sanity checks passed successfully |
| 205 | |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 206 | Verify restart openolt-adapter container after subscriber provisioning for DT |
| 207 | [Documentation] Restart openolt-adapter container after VOLTHA is operational. |
| 208 | ... Prerequisite : ONUs are authenticated and pingable. |
| 209 | [Tags] functionalDt Restart-OpenOlt-Dt |
| 210 | [Setup] Start Logging Restart-OpenOlt-Dt |
| 211 | [Teardown] Run Keywords Collect Logs |
| 212 | ... AND Stop Logging Restart-OpenOlt-Dt |
| 213 | # Add OLT device |
| 214 | setup |
| 215 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 216 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 217 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 218 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 219 | Log ${podStatusOutput} |
| 220 | ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
Andrea Campanella | 3dcce27 | 2021-01-15 16:04:47 +0100 | [diff] [blame] | 221 | ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL} |
Hardik Windlass | 79b40ff | 2020-06-11 22:55:47 +0530 | [diff] [blame] | 222 | Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName} |
Hardik Windlass | 79b40ff | 2020-06-11 22:55:47 +0530 | [diff] [blame] | 223 | Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE} |
| 224 | ... app ${podName} Running |
TorstenThieme | ed3332f | 2021-02-02 10:30:48 +0000 | [diff] [blame] | 225 | # Wait for 1 min after openolt adapter is restarted |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 226 | Sleep 60s |
| 227 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 228 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 229 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 230 | Log ${podStatusOutput} |
| 231 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 232 | Should Be Equal As Strings ${countAfterRestart} ${countBforRestart} |
| 233 | Log to console Pod ${podName} restarted and sanity checks passed successfully |
| 234 | |
| 235 | Verify openolt adapter restart before subscriber provisioning for DT |
| 236 | [Documentation] Deploys an device instance and waits for it to authenticate. After |
| 237 | ... authentication is successful the rw-core deployment is scaled to 0 instances to |
| 238 | ... simulate a POD crash. The test then scales the rw-core back to a single instance |
| 239 | ... and configures ONOS for access. The test succeeds if the device is able to |
| 240 | ... complete the DHCP sequence. |
Hardik Windlass | 4ed5450 | 2021-05-14 07:34:15 +0000 | [diff] [blame] | 241 | [Tags] functionalDt olt-adapter-restart-Dt soak |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 242 | [Setup] Start Logging OltAdapterRestart-Dt |
| 243 | #... AND Clear All Devices Then Create New Device |
| 244 | [Teardown] Run Keywords Collect Logs |
| 245 | ... AND Stop Logging OltAdapterRestart-Dt |
| 246 | # Add OLT and perform sanity test |
| 247 | #setup |
| 248 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 249 | #Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 250 | Set Global Variable ${of_id} |
| 251 | |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 252 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 253 | ${src}= Set Variable ${hosts.src[${I}]} |
| 254 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 255 | ${of_id}= Get ofID From OLT List ${src['olt']} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 256 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 257 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 258 | ... ${of_id} |
| 259 | # Bring up the device and verify it authenticates |
Suchitra Vemuri | cdc32d8 | 2020-07-17 12:24:46 -0700 | [diff] [blame] | 260 | Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 261 | ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed |
| 262 | END |
| 263 | # Scale down the open OLT adapter deployment to 0 PODs and once confirmed, scale it back to 1 |
Andrea Campanella | 3dcce27 | 2021-01-15 16:04:47 +0100 | [diff] [blame] | 264 | Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 0 |
| 265 | Wait Until Keyword Succeeds ${timeout} 2s Pods Do Not Exist By Label ${NAMESPACE} app |
| 266 | ... ${OLT_ADAPTER_APP_LABEL} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 267 | # Scale up the open OLT adapter deployment and make sure both it and the ofagent deployment are back |
Andrea Campanella | 3dcce27 | 2021-01-15 16:04:47 +0100 | [diff] [blame] | 268 | Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 269 | Wait Until Keyword Succeeds ${timeout} 2s |
Andrea Campanella | 3dcce27 | 2021-01-15 16:04:47 +0100 | [diff] [blame] | 270 | ... Check Expected Available Deployment Replicas By Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 271 | |
| 272 | # Ensure the device is available in ONOS, this represents system connectivity being restored |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 273 | FOR ${I} IN RANGE 0 ${olt_count} |
| 274 | ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn |
| 275 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 276 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 277 | ... ${olt_serial_number} |
| 278 | Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS |
| 279 | ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id} |
| 280 | END |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 281 | |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 282 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 283 | ${src}= Set Variable ${hosts.src[${I}]} |
| 284 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 285 | ${of_id}= Get ofID From OLT List ${src['olt']} |
| 286 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 287 | ... ${of_id} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 288 | # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly |
| 289 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP} |
| 290 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 291 | # Verify subscriber access flows are added for the ONU port |
| 292 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 293 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 294 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
| 295 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 296 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 297 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 298 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 299 | ... ${dst['container_name']} |
| 300 | END |
| 301 | |
| 302 | Verify restart ofagent container after subscriber is provisioned for DT |
| 303 | [Documentation] Restart ofagent container after VOLTHA is operational. |
| 304 | ... Prerequisite : ONUs are authenticated and pingable. |
Hardik Windlass | 4ed5450 | 2021-05-14 07:34:15 +0000 | [diff] [blame] | 305 | [Tags] functionalDt ofagentRestart-Dt soak |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 306 | [Setup] Start Logging ofagentRestart-Dt |
| 307 | [Teardown] Run Keywords Collect Logs |
| 308 | ... AND Stop Logging ofagentRestart-Dt |
Hardik Windlass | 79b40ff | 2020-06-11 22:55:47 +0530 | [diff] [blame] | 309 | ... AND Scale K8s Deployment ${NAMESPACE} voltha-voltha-ofagent 1 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 310 | # set timeout value |
| 311 | ${waitforRestart} Set Variable 120s |
| 312 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 313 | Log ${podStatusOutput} |
| 314 | ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 315 | ${podName} Set Variable ofagent |
Hardik Windlass | 79b40ff | 2020-06-11 22:55:47 +0530 | [diff] [blame] | 316 | Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName} |
Hardik Windlass | 79b40ff | 2020-06-11 22:55:47 +0530 | [diff] [blame] | 317 | Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE} |
| 318 | ... app ${podName} Running |
Hardik Windlass | 5e214b2 | 2021-02-26 10:37:14 +0000 | [diff] [blame] | 319 | Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 320 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 321 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 322 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 323 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 324 | Log ${podStatusOutput} |
| 325 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 326 | Should Be Equal As Strings ${countAfterRestart} ${countBforRestart} |
| 327 | # Scale Down the Of-Agent Deployment |
Hardik Windlass | 79b40ff | 2020-06-11 22:55:47 +0530 | [diff] [blame] | 328 | Scale K8s Deployment ${NAMESPACE} voltha-voltha-ofagent 0 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 329 | Sleep 30s |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 330 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 331 | ${src}= Set Variable ${hosts.src[${I}]} |
| 332 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 333 | ${of_id}= Get ofID From OLT List ${src['olt']} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 334 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 335 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 336 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 337 | # Verify ONU state in voltha |
Suchitra Vemuri | cdc32d8 | 2020-07-17 12:24:46 -0700 | [diff] [blame] | 338 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 339 | ... ENABLED ACTIVE REACHABLE |
| 340 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 341 | # Check ONU port is Disabled in ONOS |
| 342 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
Suchitra Vemuri | 760bdd3 | 2020-06-17 12:34:48 -0700 | [diff] [blame] | 343 | ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 344 | # Verify subscriber access flows are added for the ONU port |
| 345 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 346 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 347 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
| 348 | # Verify Ping |
| 349 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Check Ping True |
| 350 | ... ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']} |
| 351 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 352 | END |
| 353 | # Scale Up the Of-Agent Deployment |
Hardik Windlass | 79b40ff | 2020-06-11 22:55:47 +0530 | [diff] [blame] | 354 | Scale K8s Deployment ${NAMESPACE} voltha-voltha-ofagent 1 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 355 | Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE} |
| 356 | ... Running |
| 357 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 358 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 359 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 360 | Log to console Pod ${podName} restarted and sanity checks passed successfully |
| 361 | |
| 362 | Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart for DT |
| 363 | [Documentation] Deploys an device instance and waits for it to authenticate. After |
| 364 | ... authentication is successful the rw-core deployment is scaled to 0 instances to |
| 365 | ... simulate a POD crash. The test then scales the rw-core back to a single instance |
| 366 | ... and configures ONOS for access. The test succeeds if the device is able to |
| 367 | ... complete the DHCP sequence. |
Hardik Windlass | 4ed5450 | 2021-05-14 07:34:15 +0000 | [diff] [blame] | 368 | [Tags] functionalDt rwcore-restart-Dt soak |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 369 | [Setup] Run Keywords Start Logging RwCoreFailAndRestart-Dt |
| 370 | ... AND Clear All Devices Then Create New Device |
| 371 | [Teardown] Run Keywords Collect Logs |
| 372 | ... AND Stop Logging RwCoreFailAndRestart-Dt |
| 373 | #... AND Delete Device and Verify |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 374 | Run Keyword If ${has_dataplane} Clean Up Linux |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 375 | FOR ${I} IN RANGE 0 ${olt_count} |
| 376 | ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn |
| 377 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 378 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 379 | ... ${olt_serial_number} |
| 380 | ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 381 | ... Get NNI Port in ONOS ${of_id} |
| 382 | # Set Global Variable ${nni_port} |
| 383 | END |
| 384 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 385 | ${src}= Set Variable ${hosts.src[${I}]} |
| 386 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 387 | ${of_id}= Get ofID From OLT List ${src['olt']} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 388 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 389 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 390 | ... ${of_id} |
| 391 | # Bring up the device and verify it authenticates |
Suchitra Vemuri | cdc32d8 | 2020-07-17 12:24:46 -0700 | [diff] [blame] | 392 | Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 393 | ... ${onu_device_id} onu=True onu_reason=initial-mib-downloaded |
| 394 | END |
| 395 | |
| 396 | # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1 |
Hardik Windlass | 79b40ff | 2020-06-11 22:55:47 +0530 | [diff] [blame] | 397 | Scale K8s Deployment voltha voltha-voltha-rw-core 0 |
| 398 | Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-voltha-rw-core |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 399 | # Ensure the ofagent POD goes "not-ready" as expected |
| 400 | Wait Until keyword Succeeds ${timeout} 2s |
Hardik Windlass | 79b40ff | 2020-06-11 22:55:47 +0530 | [diff] [blame] | 401 | ... Check Expected Available Deployment Replicas voltha voltha-voltha-ofagent 0 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 402 | # Scale up the core deployment and make sure both it and the ofagent deployment are back |
Hardik Windlass | 79b40ff | 2020-06-11 22:55:47 +0530 | [diff] [blame] | 403 | Scale K8s Deployment voltha voltha-voltha-rw-core 1 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 404 | Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | 79b40ff | 2020-06-11 22:55:47 +0530 | [diff] [blame] | 405 | ... Check Expected Available Deployment Replicas voltha voltha-voltha-rw-core 1 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 406 | Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | 79b40ff | 2020-06-11 22:55:47 +0530 | [diff] [blame] | 407 | ... Check Expected Available Deployment Replicas voltha voltha-voltha-ofagent 1 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 408 | # For some reason scaling down and up the POD behind a service causes the port forward to stop working, |
| 409 | # so restart the port forwarding for the API service |
David Bainbridge | 07321ff | 2020-06-12 13:55:42 -0700 | [diff] [blame] | 410 | Restart VOLTHA Port Forward voltha-api |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 411 | # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this |
| 412 | # represents system connectivity being restored |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 413 | FOR ${I} IN RANGE 0 ${olt_count} |
| 414 | ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn |
| 415 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 416 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 417 | ... ${olt_serial_number} |
Girish Gowdra | e4de3b3 | 2021-03-23 22:20:00 -0700 | [diff] [blame] | 418 | Wait Until Keyword Succeeds 120s 2s Device Is Available In ONOS |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 419 | ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id} |
| 420 | END |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 421 | |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 422 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Andy Bavier | 5209462 | 2020-05-12 15:54:24 -0700 | [diff] [blame] | 423 | ${src}= Set Variable ${hosts.src[${I}]} |
| 424 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 425 | ${of_id}= Get ofID From OLT List ${src['olt']} |
Andy Bavier | 5209462 | 2020-05-12 15:54:24 -0700 | [diff] [blame] | 426 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 427 | ... ${of_id} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 428 | # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly |
| 429 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP} |
| 430 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 431 | # Verify subscriber access flows are added for the ONU port |
| 432 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 433 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 434 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
| 435 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 436 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 437 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 438 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 439 | ... ${dst['container_name']} |
| 440 | END |
| 441 | |
Hema | df00368 | 2020-04-28 21:22:22 +0530 | [diff] [blame] | 442 | Verify OLT Soft Reboot for DT |
| 443 | [Documentation] Test soft reboot of the OLT using voltctl command |
| 444 | [Tags] VOL-2818 OLTSoftRebootDt notready |
| 445 | [Setup] Start Logging OLTSoftRebootDt |
| 446 | #... AND Setup |
| 447 | [Teardown] Run Keywords Collect Logs |
| 448 | ... AND Stop Logging OLTSoftRebootDt |
| 449 | #... AND Delete Device and Verify |
Hema | df00368 | 2020-04-28 21:22:22 +0530 | [diff] [blame] | 450 | # Reboot the OLT using "voltctl device reboot" command |
| 451 | Reboot Device ${olt_device_id} |
Hema | df00368 | 2020-04-28 21:22:22 +0530 | [diff] [blame] | 452 | #Verify that ping fails |
| 453 | FOR ${I} IN RANGE 0 ${num_onus} |
| 454 | ${src}= Set Variable ${hosts.src[${I}]} |
| 455 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 456 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 457 | ... Wait Until Keyword Succeeds 60s 2s |
| 458 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 459 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 460 | END |
| 461 | # Wait for the OLT to come back up |
| 462 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s |
Suchitra Vemuri | b7253a5 | 2020-07-14 22:35:17 -0700 | [diff] [blame] | 463 | ... Check Remote System Reachability True ${olt_ssh_ip} |
Hema | df00368 | 2020-04-28 21:22:22 +0530 | [diff] [blame] | 464 | # Waiting extra time for the ONUs to come up |
| 465 | Sleep 60s |
| 466 | # Check OLT states |
Suchitra Vemuri | cdc32d8 | 2020-07-17 12:24:46 -0700 | [diff] [blame] | 467 | Wait Until Keyword Succeeds 360s 5s Validate OLT Device ENABLED ACTIVE REACHABLE |
Hema | df00368 | 2020-04-28 21:22:22 +0530 | [diff] [blame] | 468 | ... ${olt_serial_number} |
Hema | df00368 | 2020-04-28 21:22:22 +0530 | [diff] [blame] | 469 | #Check after reboot that ONUs are active, DHCP and pingable |
| 470 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 471 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 472 | |
Hema | 8c1a032 | 2020-05-26 16:02:32 +0530 | [diff] [blame] | 473 | Verify ONU Soft Reboot for DT |
| 474 | [Documentation] Test soft reboot of the ONU using voltctl command |
| 475 | [Tags] VOL-2820 ONUSoftRebootDt notready |
| 476 | [Setup] Start Logging ONUSoftRebootDt |
| 477 | #... AND Setup |
| 478 | [Teardown] Run Keywords Collect Logs |
| 479 | ... AND Stop Logging ONUSoftRebootDt |
| 480 | #... AND Delete Device and Verify |
Hema | 8c1a032 | 2020-05-26 16:02:32 +0530 | [diff] [blame] | 481 | #Reboot the ONU and verify that ping fails |
| 482 | FOR ${I} IN RANGE 0 ${num_onus} |
| 483 | ${src}= Set Variable ${hosts.src[${I}]} |
| 484 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 485 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 486 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 487 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 488 | Reboot Device ${onu_device_id} |
| 489 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 490 | ... Wait Until Keyword Succeeds 60s 2s |
| 491 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 492 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 493 | Verify ping is succesful except for given device ${num_onus} ${onu_device_id} |
| 494 | # Remove Subscriber Access (To replicate DT workflow) |
| 495 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP} |
| 496 | ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port} |
| 497 | # Delete ONU Device (To replicate DT workflow) |
| 498 | Delete Device ${onu_device_id} |
| 499 | Sleep 40s |
| 500 | # Check ONU port is Enabled in ONOS |
| 501 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
Suchitra Vemuri | 760bdd3 | 2020-06-17 12:34:48 -0700 | [diff] [blame] | 502 | ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Hema | 8c1a032 | 2020-05-26 16:02:32 +0530 | [diff] [blame] | 503 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2 |
| 504 | ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 505 | ... volt-add-subscriber-access ${of_id} ${onu_port} |
| 506 | # Verify ONU state in voltha |
Suchitra Vemuri | cdc32d8 | 2020-07-17 12:24:46 -0700 | [diff] [blame] | 507 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device |
Hema | 8c1a032 | 2020-05-26 16:02:32 +0530 | [diff] [blame] | 508 | ... ENABLED ACTIVE REACHABLE |
| 509 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 510 | # Verify subscriber access flows are added for the ONU port |
| 511 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 512 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 513 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
| 514 | #Run Keyword If ${has_dataplane} Clean Up Linux |
| 515 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 516 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 517 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 518 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 519 | ... ${dst['container_name']} |
Hema | 8c1a032 | 2020-05-26 16:02:32 +0530 | [diff] [blame] | 520 | END |
| 521 | # Verify ONOS Flows |
| 522 | # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream) |
| 523 | ${onos_flows_count}= Evaluate 4 * ${num_onus} |
| 524 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 525 | ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 526 | ... ${of_id} ${onos_flows_count} |
| 527 | # Verify VOLTHA Flows |
| 528 | # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP |
| 529 | ${olt_flows}= Evaluate 2 * ${num_onus} + 1 |
| 530 | # Number of per ONU Flows equals 2 (one each for downstream and upstream) |
| 531 | ${onu_flows}= Set Variable 2 |
| 532 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows} |
| 533 | ${List_ONU_Serial} Create List |
| 534 | Set Suite Variable ${List_ONU_Serial} |
| 535 | Build ONU SN List ${List_ONU_Serial} |
| 536 | Log ${List_ONU_Serial} |
| 537 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows |
| 538 | ... ${List_ONU_Serial} ${onu_flows} |
Hema | df00368 | 2020-04-28 21:22:22 +0530 | [diff] [blame] | 539 | |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 540 | *** Keywords *** |
Hardik Windlass | 4ed5450 | 2021-05-14 07:34:15 +0000 | [diff] [blame] | 541 | Setup Soak |
| 542 | [Documentation] Pre-test Setup for Soak Job |
| 543 | ${olt_ids} Create List |
| 544 | FOR ${I} IN RANGE 0 ${num_olts} |
| 545 | ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn] |
| 546 | ${olt_device_id}= Get Device ID From SN ${olt_serial_number} |
| 547 | ${logical_id}= Get Logical Device ID From SN ${olt_serial_number} |
| 548 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 549 | ... ${olt_serial_number} |
| 550 | ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 551 | ... Get NNI Port in ONOS ${of_id} |
| 552 | Set Global Variable ${nni_port} |
| 553 | ${olt} Create Dictionary device_id ${olt_device_id} logical_id ${logical_id} |
| 554 | ... of_id ${of_id} sn ${olt_serial_number} |
| 555 | Append To List ${olt_ids} ${olt} |
| 556 | END |
| 557 | Set Global Variable ${olt_ids} |
| 558 | |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 559 | Setup Suite |
| 560 | [Documentation] Set up the test suite |
| 561 | Common Test Suite Setup |
Andrea Campanella | 15619c7 | 2020-04-30 09:48:04 +0200 | [diff] [blame] | 562 | #power_switch.robot needs it to support different vendor's power switch |
| 563 | ${switch_type}= Get Variable Value ${web_power_switch.type} |
| 564 | Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type} |
Hardik Windlass | 4ed5450 | 2021-05-14 07:34:15 +0000 | [diff] [blame] | 565 | # Run Pre-test Setup for Soak Job |
| 566 | # Note: As soak requirement, it expects that the devices under test are already created and enabled |
| 567 | Run Keyword If '${SOAK_TEST}'=='True' Setup Soak |
| 568 | |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 569 | |
| 570 | Clear All Devices Then Create New Device |
| 571 | [Documentation] Remove any devices from VOLTHA and ONOS |
| 572 | # Remove all devices from voltha and nos |
| 573 | Delete All Devices and Verify |
| 574 | # Execute normal test Setup Keyword |
| 575 | Setup |
| 576 | |