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