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