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