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