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