Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 1 | # Copyright 2017 - present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | # FIXME Can we use the same test against BBSim and Hardware? |
| 15 | |
| 16 | *** Settings *** |
| 17 | Documentation Test various end-to-end scenarios |
| 18 | Suite Setup Setup Suite |
| 19 | Test Setup Setup |
| 20 | Test Teardown Teardown |
| 21 | Suite Teardown Teardown Suite |
| 22 | Library Collections |
| 23 | Library String |
| 24 | Library OperatingSystem |
| 25 | Library XML |
| 26 | Library RequestsLibrary |
| 27 | Library ../../libraries/DependencyLibrary.py |
| 28 | Resource ../../libraries/onos.robot |
| 29 | Resource ../../libraries/voltctl.robot |
| 30 | Resource ../../libraries/voltha.robot |
| 31 | Resource ../../libraries/utils.robot |
| 32 | Resource ../../libraries/k8s.robot |
| 33 | Resource ../../variables/variables.robot |
Andrea Campanella | 15619c7 | 2020-04-30 09:48:04 +0200 | [diff] [blame] | 34 | Resource ../../libraries/power_switch.robot |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 35 | |
| 36 | *** Variables *** |
| 37 | ${POD_NAME} flex-ocp-cord |
| 38 | ${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 39 | ${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs |
| 40 | #${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 41 | ${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml |
| 42 | ${HELM_CHARTS_DIR} ~/helm-charts |
| 43 | ${VOLTHA_POD_NUM} 8 |
| 44 | ${NAMESPACE} voltha |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 45 | ${INFRA_NAMESPACE} default |
Matteo Scandolo | a4e5952 | 2021-08-31 14:56:24 -0700 | [diff] [blame] | 46 | ${STACK_NAME} voltha |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 47 | # For below variable value, using deployment name as using grep for |
| 48 | # parsing radius pod name, we can also use full radius pod name |
| 49 | ${RESTART_POD_NAME} radius |
| 50 | ${timeout} 60s |
| 51 | ${of_id} 0 |
| 52 | ${logical_id} 0 |
| 53 | ${has_dataplane} True |
| 54 | ${teardown_device} False |
| 55 | ${scripts} ../../scripts |
| 56 | |
| 57 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 58 | ${container_log_dir} ${None} |
| 59 | |
Hardik Windlass | 4353133 | 2021-05-19 07:07:03 +0000 | [diff] [blame] | 60 | # logging flag to enable Collect Logs, can be passed via the command line too |
| 61 | # example: -v logging:False |
| 62 | ${logging} True |
| 63 | |
Hardik Windlass | 4ed5450 | 2021-05-14 07:34:15 +0000 | [diff] [blame] | 64 | # Flag specific to Soak Jobs |
| 65 | ${SOAK_TEST} False |
| 66 | |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 67 | *** Test Cases *** |
| 68 | Verify ONU after Rebooting Physically for DT |
| 69 | [Documentation] Test the ONU functionality by physically turning on/off ONU. |
| 70 | ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed) |
| 71 | ... Test case runs only on the PODs that are configured with PowerSwitch that |
| 72 | ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot) |
| 73 | [Tags] functionalDt PowerSwitchOnuRebootDt VOL-2819 PowerSwitch |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 74 | [Setup] Start Logging RebootOnu_PowerSwitch_Dt |
Hardik Windlass | 4353133 | 2021-05-19 07:07:03 +0000 | [diff] [blame] | 75 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 76 | ... AND Delete All Devices and Verify |
Girish Gowdra | f244d5b | 2021-09-01 17:16:16 -0700 | [diff] [blame] | 77 | ... AND Run Keyword If ${logging} Collect Logs |
| 78 | ... AND Stop Logging RebootOnu_PowerSwitch_Dt |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 79 | # Add OLT device |
| 80 | Setup |
| 81 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 82 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 83 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 84 | Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password} |
Hardik Windlass | 2eb4718 | 2020-05-19 20:24:12 +0530 | [diff] [blame] | 85 | Run Keyword If ${has_dataplane} Clean Up Linux |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 86 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 87 | ${src}= Set Variable ${hosts.src[${I}]} |
| 88 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 89 | ${of_id}= Get ofID From OLT List ${src['olt']} |
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 | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 92 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 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 |
| 97 | ... Wait Until Keyword Succeeds 60s 2s |
| 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']} |
Hardik Windlass | 40ccffb | 2020-05-11 14:12:07 +0530 | [diff] [blame] | 110 | # Waiting extra time for the ONU to come up |
| 111 | Sleep 60s |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 112 | # Check ONU port is Enabled in ONOS |
| 113 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
Hardik Windlass | 3901567 | 2021-07-05 05:48:08 +0000 | [diff] [blame] | 114 | ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Hardik Windlass | 7c801e6 | 2020-05-04 19:33:21 +0530 | [diff] [blame] | 115 | Run Keyword And Continue On Failure 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 |
Suchitra Vemuri | cdc32d8 | 2020-07-17 12:24:46 -0700 | [diff] [blame] | 119 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 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 |
| 123 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 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 |
| 150 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 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 |
| 165 | ... Wait Until Keyword Succeeds 60s 2s |
| 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} |
| 178 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s |
| 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 |
| 185 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 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 |
| 198 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 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 |
| 209 | Wait Until Keyword Succeeds ${timeout} 2s 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 |
| 228 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 229 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 230 | Log ${podStatusOutput} |
| 231 | ${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 |
| 239 | Wait Until Keyword Succeeds ${timeout} 2s 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_device_id}= Get Device ID From SN ${src['onu']} |
| 262 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 263 | ... ${of_id} |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 264 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s |
| 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 | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 272 | # Scale up the open OLT adapter deployment and make sure both it and the ofagent deployment are back |
Andrea Campanella | 3dcce27 | 2021-01-15 16:04:47 +0100 | [diff] [blame] | 273 | Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 274 | Wait Until Keyword Succeeds ${timeout} 2s |
Andrea Campanella | 3dcce27 | 2021-01-15 16:04:47 +0100 | [diff] [blame] | 275 | ... Check Expected Available Deployment Replicas By Pod Label ${NAMESPACE} app ${OLT_ADAPTER_APP_LABEL} 1 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 276 | |
| 277 | # Ensure the device is available in ONOS, this represents system connectivity being restored |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 278 | FOR ${I} IN RANGE 0 ${olt_count} |
| 279 | ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn |
| 280 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 281 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 282 | ... ${olt_serial_number} |
| 283 | Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS |
| 284 | ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id} |
| 285 | END |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 286 | |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 287 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 288 | ${src}= Set Variable ${hosts.src[${I}]} |
| 289 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 290 | ${of_id}= Get ofID From OLT List ${src['olt']} |
TorstenThieme | dda3765 | 2021-11-11 16:22:05 +0000 | [diff] [blame] | 291 | ${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] | 292 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 293 | ... ${of_id} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 294 | # 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] | 295 | 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] | 296 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 297 | # Verify subscriber access flows are added for the ONU port |
| 298 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 299 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 300 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 301 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 302 | ... ENABLED ACTIVE REACHABLE |
| 303 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 304 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 305 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 306 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 307 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 308 | ... ${dst['container_name']} |
| 309 | END |
| 310 | |
| 311 | Verify restart ofagent container after subscriber is provisioned for DT |
| 312 | [Documentation] Restart ofagent container after VOLTHA is operational. |
| 313 | ... Prerequisite : ONUs are authenticated and pingable. |
Hardik Windlass | 4ed5450 | 2021-05-14 07:34:15 +0000 | [diff] [blame] | 314 | [Tags] functionalDt ofagentRestart-Dt soak |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 315 | [Setup] Start Logging ofagentRestart-Dt |
Hardik Windlass | 4353133 | 2021-05-19 07:07:03 +0000 | [diff] [blame] | 316 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 317 | ... AND Stop Logging ofagentRestart-Dt |
Matteo Scandolo | a4e5952 | 2021-08-31 14:56:24 -0700 | [diff] [blame] | 318 | ... AND Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 1 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 319 | # set timeout value |
| 320 | ${waitforRestart} Set Variable 120s |
| 321 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 322 | Log ${podStatusOutput} |
| 323 | ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 324 | ${podName} Set Variable ofagent |
Hardik Windlass | 79b40ff | 2020-06-11 22:55:47 +0530 | [diff] [blame] | 325 | 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] | 326 | Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE} |
| 327 | ... app ${podName} Running |
Hardik Windlass | 5e214b2 | 2021-02-26 10:37:14 +0000 | [diff] [blame] | 328 | 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] | 329 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 330 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 331 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 332 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 333 | Log ${podStatusOutput} |
| 334 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 335 | Should Be Equal As Strings ${countAfterRestart} ${countBforRestart} |
| 336 | # Scale Down the Of-Agent Deployment |
Matteo Scandolo | a4e5952 | 2021-08-31 14:56:24 -0700 | [diff] [blame] | 337 | Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 0 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 338 | Sleep 30s |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 339 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 340 | ${src}= Set Variable ${hosts.src[${I}]} |
| 341 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 342 | ${of_id}= Get ofID From OLT List ${src['olt']} |
TorstenThieme | dda3765 | 2021-11-11 16:22:05 +0000 | [diff] [blame] | 343 | ${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] | 344 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 345 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 346 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 347 | # Verify ONU state in voltha |
Suchitra Vemuri | cdc32d8 | 2020-07-17 12:24:46 -0700 | [diff] [blame] | 348 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s Validate Device |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 349 | ... ENABLED ACTIVE REACHABLE |
| 350 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 351 | # Check ONU port is Disabled in ONOS |
| 352 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
Hardik Windlass | 3901567 | 2021-07-05 05:48:08 +0000 | [diff] [blame] | 353 | ... Verify UNI Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 354 | # Verify subscriber access flows are added for the ONU port |
| 355 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 356 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 357 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
| 358 | # Verify Ping |
| 359 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Check Ping True |
| 360 | ... ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']} |
| 361 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 362 | END |
| 363 | # Scale Up the Of-Agent Deployment |
Matteo Scandolo | a4e5952 | 2021-08-31 14:56:24 -0700 | [diff] [blame] | 364 | Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 1 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 365 | Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE} |
| 366 | ... Running |
| 367 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 368 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 369 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 370 | Log to console Pod ${podName} restarted and sanity checks passed successfully |
| 371 | |
| 372 | Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart for DT |
| 373 | [Documentation] Deploys an device instance and waits for it to authenticate. After |
| 374 | ... authentication is successful the rw-core deployment is scaled to 0 instances to |
| 375 | ... simulate a POD crash. The test then scales the rw-core back to a single instance |
| 376 | ... and configures ONOS for access. The test succeeds if the device is able to |
| 377 | ... complete the DHCP sequence. |
Hardik Windlass | 4353133 | 2021-05-19 07:07:03 +0000 | [diff] [blame] | 378 | [Tags] functionalDt rwcore-restart-Dt |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 379 | [Setup] Run Keywords Start Logging RwCoreFailAndRestart-Dt |
| 380 | ... AND Clear All Devices Then Create New Device |
Hardik Windlass | 4353133 | 2021-05-19 07:07:03 +0000 | [diff] [blame] | 381 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 382 | ... AND Stop Logging RwCoreFailAndRestart-Dt |
| 383 | #... AND Delete Device and Verify |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 384 | Run Keyword If ${has_dataplane} Clean Up Linux |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 385 | FOR ${I} IN RANGE 0 ${olt_count} |
| 386 | ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn |
| 387 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 388 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 389 | ... ${olt_serial_number} |
TorstenThieme | dda3765 | 2021-11-11 16:22:05 +0000 | [diff] [blame] | 390 | ${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] | 391 | END |
| 392 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 393 | ${src}= Set Variable ${hosts.src[${I}]} |
| 394 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 395 | ${of_id}= Get ofID From OLT List ${src['olt']} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 396 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 397 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 398 | ... ${of_id} |
| 399 | # Bring up the device and verify it authenticates |
Suchitra Vemuri | cdc32d8 | 2020-07-17 12:24:46 -0700 | [diff] [blame] | 400 | Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE |
Hardik Windlass | 8b44649 | 2021-06-10 06:25:23 +0000 | [diff] [blame] | 401 | ... ${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] | 402 | END |
| 403 | |
| 404 | # 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] | 405 | Scale K8s Deployment voltha voltha-voltha-rw-core 0 |
| 406 | 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] | 407 | # Ensure the ofagent POD goes "not-ready" as expected |
| 408 | Wait Until keyword Succeeds ${timeout} 2s |
Hardik Windlass | 79b40ff | 2020-06-11 22:55:47 +0530 | [diff] [blame] | 409 | ... Check Expected Available Deployment Replicas voltha voltha-voltha-ofagent 0 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 410 | # 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] | 411 | Scale K8s Deployment 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-rw-core 1 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 414 | Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | 79b40ff | 2020-06-11 22:55:47 +0530 | [diff] [blame] | 415 | ... Check Expected Available Deployment Replicas voltha voltha-voltha-ofagent 1 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 416 | # For some reason scaling down and up the POD behind a service causes the port forward to stop working, |
| 417 | # so restart the port forwarding for the API service |
David Bainbridge | 07321ff | 2020-06-12 13:55:42 -0700 | [diff] [blame] | 418 | Restart VOLTHA Port Forward voltha-api |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 419 | # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this |
| 420 | # represents system connectivity being restored |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 421 | FOR ${I} IN RANGE 0 ${olt_count} |
| 422 | ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn |
| 423 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 424 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 425 | ... ${olt_serial_number} |
Girish Gowdra | e4de3b3 | 2021-03-23 22:20:00 -0700 | [diff] [blame] | 426 | Wait Until Keyword Succeeds 120s 2s Device Is Available In ONOS |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 427 | ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id} |
| 428 | END |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 429 | |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 430 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Andy Bavier | 5209462 | 2020-05-12 15:54:24 -0700 | [diff] [blame] | 431 | ${src}= Set Variable ${hosts.src[${I}]} |
| 432 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 433 | ${of_id}= Get ofID From OLT List ${src['olt']} |
TorstenThieme | dda3765 | 2021-11-11 16:22:05 +0000 | [diff] [blame] | 434 | ${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] | 435 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 436 | ... ${of_id} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 437 | # 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] | 438 | 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] | 439 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 440 | # Verify subscriber access flows are added for the ONU port |
| 441 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 442 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 443 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
| 444 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 445 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 446 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 447 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 448 | ... ${dst['container_name']} |
| 449 | END |
| 450 | |
Hema | df00368 | 2020-04-28 21:22:22 +0530 | [diff] [blame] | 451 | Verify OLT Soft Reboot for DT |
| 452 | [Documentation] Test soft reboot of the OLT using voltctl command |
Hardik Windlass | 20a503d | 2021-06-21 11:58:08 +0000 | [diff] [blame] | 453 | [Tags] VOL-2818 OLTSoftRebootDt functionalDt |
Hema | df00368 | 2020-04-28 21:22:22 +0530 | [diff] [blame] | 454 | [Setup] Start Logging OLTSoftRebootDt |
Hardik Windlass | 20a503d | 2021-06-21 11:58:08 +0000 | [diff] [blame] | 455 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
Hema | df00368 | 2020-04-28 21:22:22 +0530 | [diff] [blame] | 456 | ... AND Stop Logging OLTSoftRebootDt |
Hardik Windlass | 20a503d | 2021-06-21 11:58:08 +0000 | [diff] [blame] | 457 | FOR ${I} IN RANGE 0 ${olt_count} |
| 458 | ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn |
| 459 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 460 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s |
| 461 | ... Validate OLT Device ENABLED ACTIVE |
| 462 | ... REACHABLE ${olt_serial_number} |
| 463 | # Reboot the OLT using "voltctl device reboot" command |
| 464 | Reboot Device ${olt_device_id} |
| 465 | # Wait for the OLT to actually go down |
| 466 | Wait Until Keyword Succeeds 360s 5s Validate OLT Device ENABLED UNKNOWN UNREACHABLE |
| 467 | ... ${olt_serial_number} |
| 468 | END |
Hema | df00368 | 2020-04-28 21:22:22 +0530 | [diff] [blame] | 469 | #Verify that ping fails |
Hardik Windlass | 20a503d | 2021-06-21 11:58:08 +0000 | [diff] [blame] | 470 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Hema | df00368 | 2020-04-28 21:22:22 +0530 | [diff] [blame] | 471 | ${src}= Set Variable ${hosts.src[${I}]} |
| 472 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 473 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 474 | ... Wait Until Keyword Succeeds 60s 2s |
| 475 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 476 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 477 | END |
Hardik Windlass | 20a503d | 2021-06-21 11:58:08 +0000 | [diff] [blame] | 478 | # Check OLT states |
| 479 | FOR ${I} IN RANGE 0 ${olt_count} |
| 480 | ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn |
| 481 | ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship |
| 482 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 483 | # Wait for the OLT to come back up |
| 484 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s |
| 485 | ... Check Remote System Reachability True ${olt_ssh_ip} |
| 486 | # Check OLT states |
| 487 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s |
| 488 | ... Validate OLT Device ENABLED ACTIVE |
| 489 | ... REACHABLE ${olt_serial_number} |
| 490 | END |
Hema | df00368 | 2020-04-28 21:22:22 +0530 | [diff] [blame] | 491 | # Waiting extra time for the ONUs to come up |
| 492 | Sleep 60s |
Hardik Windlass | 20a503d | 2021-06-21 11:58:08 +0000 | [diff] [blame] | 493 | #Check after reboot that ONUs are active, DHCP/pingable |
Hema | df00368 | 2020-04-28 21:22:22 +0530 | [diff] [blame] | 494 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 495 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 496 | |
Hema | 8c1a032 | 2020-05-26 16:02:32 +0530 | [diff] [blame] | 497 | Verify ONU Soft Reboot for DT |
| 498 | [Documentation] Test soft reboot of the ONU using voltctl command |
| 499 | [Tags] VOL-2820 ONUSoftRebootDt notready |
| 500 | [Setup] Start Logging ONUSoftRebootDt |
| 501 | #... AND Setup |
| 502 | [Teardown] Run Keywords Collect Logs |
| 503 | ... AND Stop Logging ONUSoftRebootDt |
| 504 | #... AND Delete Device and Verify |
Hema | 8c1a032 | 2020-05-26 16:02:32 +0530 | [diff] [blame] | 505 | #Reboot the ONU and verify that ping fails |
| 506 | FOR ${I} IN RANGE 0 ${num_onus} |
| 507 | ${src}= Set Variable ${hosts.src[${I}]} |
| 508 | ${dst}= Set Variable ${hosts.dst[${I}]} |
TorstenThieme | dda3765 | 2021-11-11 16:22:05 +0000 | [diff] [blame] | 509 | ${of_id}= Get ofID From OLT List ${src['olt']} |
| 510 | ${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] | 511 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 512 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 513 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 514 | Reboot Device ${onu_device_id} |
| 515 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 516 | ... Wait Until Keyword Succeeds 60s 2s |
| 517 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 518 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 519 | Verify ping is succesful except for given device ${num_onus} ${onu_device_id} |
| 520 | # Remove Subscriber Access (To replicate DT workflow) |
TorstenThieme | 4e2168e | 2021-06-22 14:01:47 +0000 | [diff] [blame] | 521 | 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] | 522 | ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port} |
| 523 | # Delete ONU Device (To replicate DT workflow) |
| 524 | Delete Device ${onu_device_id} |
| 525 | Sleep 40s |
| 526 | # Check ONU port is Enabled in ONOS |
| 527 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
Hardik Windlass | 3901567 | 2021-07-05 05:48:08 +0000 | [diff] [blame] | 528 | ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Hema | 8c1a032 | 2020-05-26 16:02:32 +0530 | [diff] [blame] | 529 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2 |
TorstenThieme | 4e2168e | 2021-06-22 14:01:47 +0000 | [diff] [blame] | 530 | ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Hema | 8c1a032 | 2020-05-26 16:02:32 +0530 | [diff] [blame] | 531 | ... volt-add-subscriber-access ${of_id} ${onu_port} |
| 532 | # Verify ONU state in voltha |
Suchitra Vemuri | cdc32d8 | 2020-07-17 12:24:46 -0700 | [diff] [blame] | 533 | 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] | 534 | ... ENABLED ACTIVE REACHABLE |
| 535 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 536 | # Verify subscriber access flows are added for the ONU port |
| 537 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 538 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 539 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
| 540 | #Run Keyword If ${has_dataplane} Clean Up Linux |
| 541 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 542 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 543 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 544 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 545 | ... ${dst['container_name']} |
Hema | 8c1a032 | 2020-05-26 16:02:32 +0530 | [diff] [blame] | 546 | END |
| 547 | # Verify ONOS Flows |
| 548 | # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream) |
| 549 | ${onos_flows_count}= Evaluate 4 * ${num_onus} |
| 550 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 551 | ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 552 | ... ${of_id} ${onos_flows_count} |
| 553 | # Verify VOLTHA Flows |
| 554 | # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP |
| 555 | ${olt_flows}= Evaluate 2 * ${num_onus} + 1 |
| 556 | # Number of per ONU Flows equals 2 (one each for downstream and upstream) |
| 557 | ${onu_flows}= Set Variable 2 |
| 558 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows} |
| 559 | ${List_ONU_Serial} Create List |
| 560 | Set Suite Variable ${List_ONU_Serial} |
| 561 | Build ONU SN List ${List_ONU_Serial} |
| 562 | Log ${List_ONU_Serial} |
| 563 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows |
| 564 | ... ${List_ONU_Serial} ${onu_flows} |
Hema | df00368 | 2020-04-28 21:22:22 +0530 | [diff] [blame] | 565 | |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 566 | Verify restart openonu-adapter container for DT |
Hardik Windlass | d19af86 | 2021-08-12 11:40:20 +0000 | [diff] [blame] | 567 | [Documentation] Restart openonu-adapter container after VOLTHA is operational. |
| 568 | ... Run the ping continuously in background during container restart, |
| 569 | ... and verify that there should be no affect on the dataplane. |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 570 | ... Also, verify that the voltha control plane functionality is not affected. |
| 571 | [Tags] functionalDt RestartOpenOnuPingDt |
Hardik Windlass | d19af86 | 2021-08-12 11:40:20 +0000 | [diff] [blame] | 572 | [Setup] Start Logging RestartOpenOnuPingDt |
| 573 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 574 | ... AND Stop Logging RestartOpenOnuPingDt |
| 575 | Clear All Devices Then Create New Device |
| 576 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 577 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 578 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 579 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 580 | ${src}= Set Variable ${hosts.src[${I}]} |
| 581 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 582 | ${ping_output_file}= Set Variable /tmp/${src['onu']}_ping |
| 583 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 584 | ... Wait Until Keyword Succeeds 60s 2s |
| 585 | ... Run Ping In Background ${ping_output_file} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 586 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 587 | END |
| 588 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 589 | Log ${podStatusOutput} |
| 590 | ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 591 | ${podName} Set Variable adapter-open-onu |
| 592 | Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName} |
| 593 | Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE} |
| 594 | ... app ${podName} Running |
| 595 | # Wait for 1 min after openonu adapter is restarted |
| 596 | Sleep 60s |
| 597 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 598 | Log ${podStatusOutput} |
| 599 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 600 | Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart} |
| 601 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 602 | ${src}= Set Variable ${hosts.src[${I}]} |
| 603 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Hardik Windlass | d19af86 | 2021-08-12 11:40:20 +0000 | [diff] [blame] | 604 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 605 | ... Wait Until Keyword Succeeds 60s 2s |
| 606 | ... Stop Ping Running In Background ${src['ip']} ${src['user']} ${src['pass']} |
| 607 | ... ${src['container_type']} ${src['container_name']} |
Hardik Windlass | 6763ba5 | 2021-08-17 03:14:23 +0000 | [diff] [blame] | 608 | END |
| 609 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 610 | ${src}= Set Variable ${hosts.src[${I}]} |
| 611 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 612 | ${ping_output_file}= Set Variable /tmp/${src['onu']}_ping |
Hardik Windlass | d19af86 | 2021-08-12 11:40:20 +0000 | [diff] [blame] | 613 | ${ping_output}= Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 614 | ... Wait Until Keyword Succeeds 60s 2s |
| 615 | ... Retrieve Remote File Contents ${ping_output_file} ${src['ip']} ${src['user']} ${src['pass']} |
| 616 | ... ${src['container_type']} ${src['container_name']} |
| 617 | Check Ping Result True ${ping_output} |
| 618 | END |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 619 | # Verify Control Plane Functionality by Deleting and Re-adding the Subscriber |
| 620 | Verify Control Plane After Pod Restart DT |
Hardik Windlass | d19af86 | 2021-08-12 11:40:20 +0000 | [diff] [blame] | 621 | |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 622 | Verify restart openolt-adapter container for DT |
Hardik Windlass | a04efa5 | 2021-08-13 08:17:24 +0000 | [diff] [blame] | 623 | [Documentation] Restart openolt-adapter container after VOLTHA is operational. |
| 624 | ... Run the ping continuously in background during container restart, |
| 625 | ... and verify that there should be no affect on the dataplane. |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 626 | ... Also, verify that the voltha control plane functionality is not affected. |
| 627 | [Tags] functionalDt RestartOpenOltPingDt |
Hardik Windlass | a04efa5 | 2021-08-13 08:17:24 +0000 | [diff] [blame] | 628 | [Setup] Start Logging RestartOpenOltPingDt |
| 629 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 630 | ... AND Stop Logging RestartOpenOltPingDt |
| 631 | Clear All Devices Then Create New Device |
| 632 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 633 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 634 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 635 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 636 | ${src}= Set Variable ${hosts.src[${I}]} |
| 637 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 638 | ${ping_output_file}= Set Variable /tmp/${src['onu']}_ping |
| 639 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 640 | ... Wait Until Keyword Succeeds 60s 2s |
| 641 | ... Run Ping In Background ${ping_output_file} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 642 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 643 | END |
| 644 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 645 | Log ${podStatusOutput} |
| 646 | ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 647 | ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL} |
| 648 | Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName} |
| 649 | Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE} |
| 650 | ... app ${podName} Running |
| 651 | # Wait for 1 min after openolt adapter is restarted |
| 652 | Sleep 60s |
| 653 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 654 | Log ${podStatusOutput} |
| 655 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 656 | Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart} |
| 657 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 658 | ${src}= Set Variable ${hosts.src[${I}]} |
| 659 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Hardik Windlass | a04efa5 | 2021-08-13 08:17:24 +0000 | [diff] [blame] | 660 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 661 | ... Wait Until Keyword Succeeds 60s 2s |
| 662 | ... Stop Ping Running In Background ${src['ip']} ${src['user']} ${src['pass']} |
| 663 | ... ${src['container_type']} ${src['container_name']} |
Hardik Windlass | 6763ba5 | 2021-08-17 03:14:23 +0000 | [diff] [blame] | 664 | END |
| 665 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 666 | ${src}= Set Variable ${hosts.src[${I}]} |
| 667 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 668 | ${ping_output_file}= Set Variable /tmp/${src['onu']}_ping |
Hardik Windlass | a04efa5 | 2021-08-13 08:17:24 +0000 | [diff] [blame] | 669 | ${ping_output}= Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 670 | ... Wait Until Keyword Succeeds 60s 2s |
| 671 | ... Retrieve Remote File Contents ${ping_output_file} ${src['ip']} ${src['user']} ${src['pass']} |
| 672 | ... ${src['container_type']} ${src['container_name']} |
| 673 | Check Ping Result True ${ping_output} |
| 674 | END |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 675 | # Verify Control Plane Functionality by Deleting and Re-adding the Subscriber |
| 676 | Verify Control Plane After Pod Restart DT |
| 677 | |
| 678 | Verify restart rw-core container for DT |
| 679 | [Documentation] Restart rw-core container after VOLTHA is operational. |
| 680 | ... Run the ping continuously in background during container restart, |
| 681 | ... and verify that there should be no affect on the dataplane. |
| 682 | ... Also, verify that the voltha control plane functionality is not affected. |
| 683 | [Tags] functionalDt RestartRwCorePingDt |
| 684 | [Setup] Start Logging RestartRwCorePingDt |
| 685 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 686 | ... AND Stop Logging RestartRwCorePingDt |
| 687 | Clear All Devices Then Create New Device |
| 688 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 689 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 690 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 691 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 692 | ${src}= Set Variable ${hosts.src[${I}]} |
| 693 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 694 | ${ping_output_file}= Set Variable /tmp/${src['onu']}_ping |
| 695 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 696 | ... Wait Until Keyword Succeeds 60s 2s |
| 697 | ... Run Ping In Background ${ping_output_file} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 698 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 699 | END |
| 700 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 701 | Log ${podStatusOutput} |
| 702 | ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 703 | ${podName} Set Variable rw-core |
| 704 | Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName} |
| 705 | Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE} |
| 706 | ... app ${podName} Running |
| 707 | # Wait for 1 min after rw-core is restarted |
| 708 | Sleep 60s |
| 709 | # For some reason scaling down and up the POD behind a service causes the port forward to stop working, |
| 710 | # so restart the port forwarding for the API service |
| 711 | Restart VOLTHA Port Forward voltha-api |
| 712 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 713 | Log ${podStatusOutput} |
| 714 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 715 | Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart} |
| 716 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 717 | ${src}= Set Variable ${hosts.src[${I}]} |
| 718 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 719 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 720 | ... Wait Until Keyword Succeeds 60s 2s |
| 721 | ... Stop Ping Running In Background ${src['ip']} ${src['user']} ${src['pass']} |
| 722 | ... ${src['container_type']} ${src['container_name']} |
| 723 | END |
| 724 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 725 | ${src}= Set Variable ${hosts.src[${I}]} |
| 726 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 727 | ${ping_output_file}= Set Variable /tmp/${src['onu']}_ping |
| 728 | ${ping_output}= Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 729 | ... Wait Until Keyword Succeeds 60s 2s |
| 730 | ... Retrieve Remote File Contents ${ping_output_file} ${src['ip']} ${src['user']} ${src['pass']} |
| 731 | ... ${src['container_type']} ${src['container_name']} |
| 732 | Check Ping Result True ${ping_output} |
| 733 | END |
| 734 | # Verify Control Plane Functionality by Deleting and Re-adding the Subscriber |
| 735 | Verify Control Plane After Pod Restart DT |
Hardik Windlass | a04efa5 | 2021-08-13 08:17:24 +0000 | [diff] [blame] | 736 | |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 737 | *** Keywords *** |
| 738 | Setup Suite |
| 739 | [Documentation] Set up the test suite |
| 740 | Common Test Suite Setup |
Andrea Campanella | 15619c7 | 2020-04-30 09:48:04 +0200 | [diff] [blame] | 741 | #power_switch.robot needs it to support different vendor's power switch |
| 742 | ${switch_type}= Get Variable Value ${web_power_switch.type} |
| 743 | Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type} |
Hardik Windlass | 4ed5450 | 2021-05-14 07:34:15 +0000 | [diff] [blame] | 744 | # Run Pre-test Setup for Soak Job |
| 745 | # Note: As soak requirement, it expects that the devices under test are already created and enabled |
| 746 | Run Keyword If '${SOAK_TEST}'=='True' Setup Soak |
| 747 | |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 748 | |
| 749 | Clear All Devices Then Create New Device |
| 750 | [Documentation] Remove any devices from VOLTHA and ONOS |
| 751 | # Remove all devices from voltha and nos |
| 752 | Delete All Devices and Verify |
| 753 | # Execute normal test Setup Keyword |
| 754 | Setup |
| 755 | |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 756 | Verify Control Plane After Pod Restart DT |
| 757 | [Documentation] Verifies the control plane functionality after the voltha pod restart |
| 758 | ... by deleting and re-adding the subscriber |
| 759 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 760 | ${src}= Set Variable ${hosts.src[${I}]} |
| 761 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 762 | ${of_id}= Get ofID From OLT List ${src['olt']} |
TorstenThieme | dda3765 | 2021-11-11 16:22:05 +0000 | [diff] [blame] | 763 | ${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] | 764 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 765 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 766 | ... ${of_id} |
| 767 | # Remove Subscriber Access |
| 768 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} |
| 769 | ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port} |
| 770 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 771 | ... Wait Until Keyword Succeeds 60s 2s |
| 772 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 773 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 774 | # Disable and Re-Enable the ONU (To replicate DT current workflow) |
| 775 | # TODO: Delete and Auto-Discovery Add of ONU (not yet supported) |
| 776 | Disable Device ${onu_device_id} |
| 777 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 778 | ... Validate Device DISABLED UNKNOWN |
| 779 | ... REACHABLE ${src['onu']} |
| 780 | Enable Device ${onu_device_id} |
| 781 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s |
| 782 | ... Validate Device ENABLED ACTIVE |
| 783 | ... REACHABLE ${src['onu']} |
| 784 | # Add Subscriber Access |
| 785 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} |
| 786 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 787 | # Verify subscriber access flows are added for the ONU port |
| 788 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 789 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 790 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
| 791 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s |
| 792 | ... Validate Device ENABLED ACTIVE |
| 793 | ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 794 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 795 | ... Wait Until Keyword Succeeds 60s 2s |
| 796 | ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 797 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 798 | END |