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 |
| 68 | ... AND Delete Device and Verify |
| 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 |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 76 | FOR ${I} IN RANGE 0 ${num_onus} |
| 77 | ${src}= Set Variable ${hosts.src[${I}]} |
| 78 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Hardik Windlass | 0560f80 | 2020-05-06 23:06:53 +0530 | [diff] [blame] | 79 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 80 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 81 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
Hardik Windlass | 7c801e6 | 2020-05-04 19:33:21 +0530 | [diff] [blame] | 82 | # Disable Power Switch |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 83 | Disable Switch Outlet ${src['power_switch_port']} |
| 84 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 85 | ... Wait Until Keyword Succeeds 60s 2s |
| 86 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 87 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Hardik Windlass | 7c801e6 | 2020-05-04 19:33:21 +0530 | [diff] [blame] | 88 | # Remove Subscriber Access (To replicate DT workflow) |
| 89 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP} |
| 90 | ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port} |
| 91 | # Delete ONU Device (To replicate DT workflow) |
| 92 | Delete Device ${onu_device_id} |
| 93 | Sleep 5s |
| 94 | # Enable Power Switch |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 95 | Enable Switch Outlet ${src['power_switch_port']} |
Hardik Windlass | 40ccffb | 2020-05-11 14:12:07 +0530 | [diff] [blame] | 96 | # Waiting extra time for the ONU to come up |
| 97 | Sleep 60s |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 98 | # Check ONU port is Enabled in ONOS |
| 99 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
| 100 | ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
Hardik Windlass | 7c801e6 | 2020-05-04 19:33:21 +0530 | [diff] [blame] | 101 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2 |
| 102 | ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 103 | ... volt-add-subscriber-access ${of_id} ${onu_port} |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 104 | # Verify ONU state in voltha |
| 105 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 106 | ... ENABLED ACTIVE REACHABLE |
Hardik Windlass | 7c801e6 | 2020-05-04 19:33:21 +0530 | [diff] [blame] | 107 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 108 | # Verify subscriber access flows are added for the ONU port |
| 109 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 110 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 111 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
Hardik Windlass | 2eb4718 | 2020-05-19 20:24:12 +0530 | [diff] [blame] | 112 | #Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 7c801e6 | 2020-05-04 19:33:21 +0530 | [diff] [blame] | 113 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 114 | ... 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] | 115 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Hardik Windlass | 7c801e6 | 2020-05-04 19:33:21 +0530 | [diff] [blame] | 116 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 117 | ... ${dst['container_name']} |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 118 | Run Keyword And Ignore Error Collect Logs |
| 119 | END |
| 120 | # Verify ONOS Flows |
| 121 | # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream) |
| 122 | ${onos_flows_count}= Evaluate 4 * ${num_onus} |
| 123 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 124 | ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 125 | ... ${of_id} ${onos_flows_count} |
| 126 | # Verify VOLTHA Flows |
| 127 | # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP |
| 128 | ${olt_flows}= Evaluate 2 * ${num_onus} + 1 |
| 129 | # Number of per ONU Flows equals 2 (one each for downstream and upstream) |
| 130 | ${onu_flows}= Set Variable 2 |
| 131 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows} |
| 132 | ${List_ONU_Serial} Create List |
| 133 | Set Suite Variable ${List_ONU_Serial} |
| 134 | Build ONU SN List ${List_ONU_Serial} |
| 135 | Log ${List_ONU_Serial} |
| 136 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows |
| 137 | ... ${List_ONU_Serial} ${onu_flows} |
| 138 | |
| 139 | Verify OLT after Rebooting Physically for DT |
| 140 | [Documentation] Test the physical reboot of the OLT |
| 141 | ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed) |
| 142 | ... Test performs a physical reboot, performs "reboot" from the OLT CLI |
| 143 | [Tags] functionalDt PhysicalOltRebootDt VOL-2817 |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 144 | [Setup] Start Logging RebootOlt_Physical_Dt |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 145 | [Teardown] Run Keywords Collect Logs |
| 146 | ... AND Stop Logging RebootOlt_Physical_Dt |
| 147 | ... AND Delete Device and Verify |
| 148 | # Add OLT device |
| 149 | Setup |
| 150 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 151 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 152 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 153 | # Reboot the OLT from the OLT CLI |
| 154 | Run Keyword If ${has_dataplane} Login And Run Command On Remote System |
| 155 | ... sudo reboot ${olt_ip} ${olt_user} ${olt_pass} prompt=# |
| 156 | Run Keyword And Ignore Error Collect Logs |
| 157 | FOR ${I} IN RANGE 0 ${num_onus} |
| 158 | ${src}= Set Variable ${hosts.src[${I}]} |
| 159 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 160 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 161 | ... Wait Until Keyword Succeeds 60s 2s |
| 162 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 163 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 164 | END |
| 165 | # Wait for the OLT to come back up |
| 166 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s |
| 167 | ... Check Remote System Reachability True ${olt_ip} |
| 168 | # Waiting extra time for the ONUs to come up |
| 169 | Sleep 60s |
| 170 | Run Keyword And Ignore Error Collect Logs |
| 171 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 172 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 173 | |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 174 | Verify restart openolt-adapter container after subscriber provisioning for DT |
| 175 | [Documentation] Restart openolt-adapter container after VOLTHA is operational. |
| 176 | ... Prerequisite : ONUs are authenticated and pingable. |
| 177 | [Tags] functionalDt Restart-OpenOlt-Dt |
| 178 | [Setup] Start Logging Restart-OpenOlt-Dt |
| 179 | [Teardown] Run Keywords Collect Logs |
| 180 | ... AND Stop Logging Restart-OpenOlt-Dt |
| 181 | # Add OLT device |
| 182 | setup |
| 183 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 184 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 185 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 186 | ${waitforRestart} Set Variable 120s |
| 187 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 188 | Log ${podStatusOutput} |
| 189 | ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 190 | ${podName} Set Variable adapter-open-olt |
| 191 | Restart Pod ${NAMESPACE} ${podName} |
| 192 | Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ${podName} ${NAMESPACE} |
| 193 | ... Running |
| 194 | # Wait for 1min after openolt adapter is restarted |
| 195 | Sleep 60s |
| 196 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 197 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 198 | Run Keyword and Ignore Error Collect Logs |
| 199 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 200 | Log ${podStatusOutput} |
| 201 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 202 | Should Be Equal As Strings ${countAfterRestart} ${countBforRestart} |
| 203 | Log to console Pod ${podName} restarted and sanity checks passed successfully |
| 204 | |
| 205 | Verify openolt adapter restart before subscriber provisioning for DT |
| 206 | [Documentation] Deploys an device instance and waits for it to authenticate. After |
| 207 | ... authentication is successful the rw-core deployment is scaled to 0 instances to |
| 208 | ... simulate a POD crash. The test then scales the rw-core back to a single instance |
| 209 | ... and configures ONOS for access. The test succeeds if the device is able to |
| 210 | ... complete the DHCP sequence. |
| 211 | [Tags] functionalDt olt-adapter-restart-Dt |
| 212 | [Setup] Start Logging OltAdapterRestart-Dt |
| 213 | #... AND Clear All Devices Then Create New Device |
| 214 | [Teardown] Run Keywords Collect Logs |
| 215 | ... AND Stop Logging OltAdapterRestart-Dt |
| 216 | # Add OLT and perform sanity test |
| 217 | #setup |
| 218 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 219 | #Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 220 | Set Global Variable ${of_id} |
| 221 | |
| 222 | FOR ${I} IN RANGE 0 ${num_onus} |
| 223 | ${src}= Set Variable ${hosts.src[${I}]} |
| 224 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 225 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 226 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 227 | ... ${of_id} |
| 228 | # Bring up the device and verify it authenticates |
| 229 | Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE |
| 230 | ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed |
| 231 | END |
| 232 | # Scale down the open OLT adapter deployment to 0 PODs and once confirmed, scale it back to 1 |
| 233 | Scale K8s Deployment voltha adapter-open-olt 0 |
| 234 | Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha adapter-open-olt |
| 235 | # Scale up the open OLT adapter deployment and make sure both it and the ofagent deployment are back |
| 236 | Scale K8s Deployment voltha adapter-open-olt 1 |
| 237 | Wait Until Keyword Succeeds ${timeout} 2s |
| 238 | ... Check Expected Available Deployment Replicas voltha adapter-open-olt 1 |
| 239 | |
| 240 | # Ensure the device is available in ONOS, this represents system connectivity being restored |
| 241 | Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS |
| 242 | ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id} |
| 243 | |
| 244 | FOR ${I} IN RANGE 0 ${num_onus} |
| 245 | # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly |
| 246 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP} |
| 247 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 248 | # Verify subscriber access flows are added for the ONU port |
| 249 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 250 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 251 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
| 252 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 253 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 254 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 255 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 256 | ... ${dst['container_name']} |
| 257 | END |
| 258 | |
| 259 | Verify restart ofagent container after subscriber is provisioned for DT |
| 260 | [Documentation] Restart ofagent container after VOLTHA is operational. |
| 261 | ... Prerequisite : ONUs are authenticated and pingable. |
| 262 | [Tags] functionalDt ofagentRestart-Dt |
| 263 | [Setup] Start Logging ofagentRestart-Dt |
| 264 | [Teardown] Run Keywords Collect Logs |
| 265 | ... AND Stop Logging ofagentRestart-Dt |
| 266 | ... AND Scale K8s Deployment ${NAMESPACE} voltha-ofagent 1 |
| 267 | # set timeout value |
| 268 | ${waitforRestart} Set Variable 120s |
| 269 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 270 | Log ${podStatusOutput} |
| 271 | ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 272 | ${podName} Set Variable ofagent |
| 273 | Restart Pod ${NAMESPACE} ${podName} |
| 274 | Sleep 60s |
| 275 | Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE} |
| 276 | ... Running |
| 277 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 278 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 279 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 280 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 281 | Log ${podStatusOutput} |
| 282 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 283 | Should Be Equal As Strings ${countAfterRestart} ${countBforRestart} |
| 284 | # Scale Down the Of-Agent Deployment |
| 285 | Scale K8s Deployment ${NAMESPACE} voltha-ofagent 0 |
| 286 | Sleep 30s |
| 287 | FOR ${I} IN RANGE 0 ${num_onus} |
| 288 | ${src}= Set Variable ${hosts.src[${I}]} |
| 289 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 290 | Run Keyword and Ignore Error Collect Logs |
| 291 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 292 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 293 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 294 | # Verify ONU state in voltha |
| 295 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 296 | ... ENABLED ACTIVE REACHABLE |
| 297 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 298 | # Check ONU port is Disabled in ONOS |
| 299 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
| 300 | ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
| 301 | # Verify subscriber access flows are added for the ONU port |
| 302 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 303 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 304 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
| 305 | # Verify Ping |
| 306 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Check Ping True |
| 307 | ... ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']} |
| 308 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 309 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 310 | Run Keyword and Ignore Error Collect Logs |
| 311 | END |
| 312 | # Scale Up the Of-Agent Deployment |
| 313 | Scale K8s Deployment ${NAMESPACE} voltha-ofagent 1 |
| 314 | Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE} |
| 315 | ... Running |
| 316 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 317 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 318 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 319 | Log to console Pod ${podName} restarted and sanity checks passed successfully |
| 320 | |
| 321 | Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart for DT |
| 322 | [Documentation] Deploys an device instance and waits for it to authenticate. After |
| 323 | ... authentication is successful the rw-core deployment is scaled to 0 instances to |
| 324 | ... simulate a POD crash. The test then scales the rw-core back to a single instance |
| 325 | ... and configures ONOS for access. The test succeeds if the device is able to |
| 326 | ... complete the DHCP sequence. |
| 327 | [Tags] functionalDt rwcore-restart-Dt |
| 328 | [Setup] Run Keywords Start Logging RwCoreFailAndRestart-Dt |
| 329 | ... AND Clear All Devices Then Create New Device |
| 330 | [Teardown] Run Keywords Collect Logs |
| 331 | ... AND Stop Logging RwCoreFailAndRestart-Dt |
| 332 | #... AND Delete Device and Verify |
| 333 | Run Keyword and Ignore Error Collect Logs |
| 334 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 335 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number} |
| 336 | Set Global Variable ${of_id} |
| 337 | ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 338 | ... Get NNI Port in ONOS ${of_id} |
| 339 | Set Global Variable ${nni_port} |
| 340 | FOR ${I} IN RANGE 0 ${num_onus} |
| 341 | ${src}= Set Variable ${hosts.src[${I}]} |
| 342 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 343 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 344 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 345 | ... ${of_id} |
| 346 | # Bring up the device and verify it authenticates |
| 347 | Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE |
| 348 | ... ${onu_device_id} onu=True onu_reason=initial-mib-downloaded |
| 349 | END |
| 350 | |
| 351 | # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1 |
| 352 | Scale K8s Deployment voltha voltha-rw-core 0 |
| 353 | Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-rw-core |
| 354 | # Ensure the ofagent POD goes "not-ready" as expected |
| 355 | Wait Until keyword Succeeds ${timeout} 2s |
| 356 | ... Check Expected Available Deployment Replicas voltha voltha-ofagent 0 |
| 357 | # Scale up the core deployment and make sure both it and the ofagent deployment are back |
| 358 | Scale K8s Deployment voltha voltha-rw-core 1 |
| 359 | Wait Until Keyword Succeeds ${timeout} 2s |
| 360 | ... Check Expected Available Deployment Replicas voltha voltha-rw-core 1 |
| 361 | Wait Until Keyword Succeeds ${timeout} 2s |
| 362 | ... Check Expected Available Deployment Replicas voltha voltha-ofagent 1 |
| 363 | # For some reason scaling down and up the POD behind a service causes the port forward to stop working, |
| 364 | # so restart the port forwarding for the API service |
| 365 | Restart VOLTHA Port Foward voltha-api-minimal |
| 366 | # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this |
| 367 | # represents system connectivity being restored |
| 368 | Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS |
| 369 | ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id} |
| 370 | |
| 371 | FOR ${I} IN RANGE 0 ${num_onus} |
Andy Bavier | 5209462 | 2020-05-12 15:54:24 -0700 | [diff] [blame] | 372 | ${src}= Set Variable ${hosts.src[${I}]} |
| 373 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 374 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 375 | ... ${of_id} |
Hardik Windlass | 9df139e | 2020-04-24 14:54:54 +0530 | [diff] [blame] | 376 | # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly |
| 377 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP} |
| 378 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 379 | # Verify subscriber access flows are added for the ONU port |
| 380 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 381 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 382 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
| 383 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 384 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 385 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 386 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 387 | ... ${dst['container_name']} |
| 388 | END |
| 389 | |
Hema | df00368 | 2020-04-28 21:22:22 +0530 | [diff] [blame] | 390 | Verify OLT Soft Reboot for DT |
| 391 | [Documentation] Test soft reboot of the OLT using voltctl command |
| 392 | [Tags] VOL-2818 OLTSoftRebootDt notready |
| 393 | [Setup] Start Logging OLTSoftRebootDt |
| 394 | #... AND Setup |
| 395 | [Teardown] Run Keywords Collect Logs |
| 396 | ... AND Stop Logging OLTSoftRebootDt |
| 397 | #... AND Delete Device and Verify |
| 398 | ## Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 399 | #Run Keyword If ${has_dataplane} Clean Up Linux |
| 400 | #Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 401 | # Reboot the OLT using "voltctl device reboot" command |
| 402 | Reboot Device ${olt_device_id} |
| 403 | Run Keyword And Ignore Error Collect Logs |
| 404 | #Verify that ping fails |
| 405 | FOR ${I} IN RANGE 0 ${num_onus} |
| 406 | ${src}= Set Variable ${hosts.src[${I}]} |
| 407 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 408 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 409 | ... Wait Until Keyword Succeeds 60s 2s |
| 410 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 411 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 412 | END |
| 413 | # Wait for the OLT to come back up |
| 414 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s |
| 415 | ... Check Remote System Reachability True ${olt_ip} |
| 416 | # Waiting extra time for the ONUs to come up |
| 417 | Sleep 60s |
| 418 | # Check OLT states |
| 419 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE |
| 420 | ... ${olt_serial_number} |
| 421 | Run Keyword And Ignore Error Collect Logs |
| 422 | #Check after reboot that ONUs are active, DHCP and pingable |
| 423 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 424 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 425 | |
| 426 | |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 427 | *** Keywords *** |
| 428 | Setup Suite |
| 429 | [Documentation] Set up the test suite |
| 430 | Common Test Suite Setup |
Andrea Campanella | 15619c7 | 2020-04-30 09:48:04 +0200 | [diff] [blame] | 431 | #power_switch.robot needs it to support different vendor's power switch |
| 432 | ${switch_type}= Get Variable Value ${web_power_switch.type} |
| 433 | Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type} |
Hardik Windlass | b9bdd50 | 2020-04-17 14:46:21 +0530 | [diff] [blame] | 434 | |
| 435 | Clear All Devices Then Create New Device |
| 436 | [Documentation] Remove any devices from VOLTHA and ONOS |
| 437 | # Remove all devices from voltha and nos |
| 438 | Delete All Devices and Verify |
| 439 | # Execute normal test Setup Keyword |
| 440 | Setup |
| 441 | |