Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [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. |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 14 | |
| 15 | *** Settings *** |
HungWei Chiu | 87edb1f | 2020-01-28 00:10:58 +0000 | [diff] [blame] | 16 | Documentation Test various failure scenarios |
HungWei Chiu | 1408fb9 | 2020-03-03 19:43:30 -0500 | [diff] [blame] | 17 | Suite Setup Setup Suite |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 18 | Test Setup Setup |
| 19 | Test Teardown Teardown |
| 20 | #Suite Teardown Teardown Suite |
| 21 | Library Collections |
| 22 | Library String |
| 23 | Library OperatingSystem |
| 24 | Library XML |
| 25 | Library RequestsLibrary |
| 26 | Library ../../libraries/DependencyLibrary.py |
| 27 | Resource ../../libraries/onos.robot |
| 28 | Resource ../../libraries/voltctl.robot |
| 29 | Resource ../../libraries/voltha.robot |
| 30 | Resource ../../libraries/utils.robot |
| 31 | Resource ../../libraries/k8s.robot |
| 32 | Resource ../../variables/variables.robot |
HungWei Chiu | 87edb1f | 2020-01-28 00:10:58 +0000 | [diff] [blame] | 33 | Resource ../../libraries/power_switch.robot |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 34 | |
| 35 | *** Variables *** |
| 36 | ${POD_NAME} flex-ocp-cord |
| 37 | ${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 38 | ${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs |
| 39 | #${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 40 | ${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml |
| 41 | ${HELM_CHARTS_DIR} ~/helm-charts |
| 42 | ${VOLTHA_POD_NUM} 8 |
| 43 | ${NAMESPACE} voltha |
Suchitra Vemuri | ca1c5d3 | 2020-04-09 18:45:29 -0700 | [diff] [blame] | 44 | ${DEFAULTSPACE} default |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 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 |
Suchitra Vemuri | 109feb1 | 2020-01-23 16:25:02 -0800 | [diff] [blame] | 51 | ${has_dataplane} True |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 52 | ${teardown_device} False |
| 53 | ${scripts} ../../scripts |
| 54 | |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 55 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 56 | ${container_log_dir} ${None} |
| 57 | |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 58 | *** Test Cases *** |
Suchitra Vemuri | 60be98b | 2020-02-19 16:41:21 -0800 | [diff] [blame] | 59 | Verify ONU after rebooting physically |
| 60 | [Documentation] Test the ONU functionality by physically turning on/off ONU. |
| 61 | ... Prerequisite : Subscriber are authenticated/DHCP/pingable state |
| 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 | ... VOL-2634 |
| 65 | [Tags] functional PowerSwitch |
Suchitra Vemuri | 9a6dd6d | 2020-02-28 17:46:26 -0800 | [diff] [blame] | 66 | [Setup] Run Keywords Announce Message START TEST ONUreboot_PowerSwitch |
| 67 | ... AND Start Logging ONUreboot_PowerSwitch |
Suchitra Vemuri | 60be98b | 2020-02-19 16:41:21 -0800 | [diff] [blame] | 68 | [Teardown] Run Keywords Collect Logs |
Suchitra Vemuri | 9a6dd6d | 2020-02-28 17:46:26 -0800 | [diff] [blame] | 69 | ... AND Stop Logging ONUreboot_PowerSwitch |
| 70 | ... AND Announce Message END TEST ONUreboot_PowerSwitch |
Suchitra Vemuri | 0656bc2 | 2020-03-21 19:07:49 -0700 | [diff] [blame] | 71 | ... AND Delete Device and Verify |
Suchitra Vemuri | 60be98b | 2020-02-19 16:41:21 -0800 | [diff] [blame] | 72 | # Add OLT device |
| 73 | setup |
| 74 | # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable |
| 75 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 76 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 77 | Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password} |
| 78 | FOR ${I} IN RANGE 0 ${num_onus} |
| 79 | ${src}= Set Variable ${hosts.src[${I}]} |
| 80 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 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} |
| 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']} |
| 88 | |
| 89 | Enable Switch Outlet ${src['power_switch_port']} |
| 90 | # Check ONU port is Enabled in ONOS |
| 91 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 92 | ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
Suchitra Vemuri | 60be98b | 2020-02-19 16:41:21 -0800 | [diff] [blame] | 93 | # Verify EAPOL flows are added for the ONU port |
| 94 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 95 | ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
Suchitra Vemuri | 60be98b | 2020-02-19 16:41:21 -0800 | [diff] [blame] | 96 | # Verify ONU state in voltha |
| 97 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 98 | ... ENABLED ACTIVE REACHABLE |
| 99 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
Suchitra Vemuri | 60be98b | 2020-02-19 16:41:21 -0800 | [diff] [blame] | 100 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 101 | ... Wait Until Keyword Succeeds 60s 2s |
| 102 | ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 103 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 104 | Run Keyword And Ignore Error Collect Logs |
| 105 | END |
Suchitra Vemuri | d709613 | 2020-02-21 14:50:47 -0800 | [diff] [blame] | 106 | # Deleting OLT after tests completes independently (as this test doesn't not run on each POD) |
Suchitra Vemuri | 0656bc2 | 2020-03-21 19:07:49 -0700 | [diff] [blame] | 107 | #Run Keyword If ${has_dataplane} Delete Device and Verify |
Suchitra Vemuri | a7dae32 | 2020-02-19 22:38:18 -0800 | [diff] [blame] | 108 | |
Suchitra Vemuri | 784e1ae | 2020-03-16 18:40:25 -0700 | [diff] [blame] | 109 | Verify OLT after rebooting physically |
| 110 | [Documentation] Test the physical reboot of the OLT |
| 111 | ... Prerequisite : Subscriber are authenticated/DHCP/pingable state |
| 112 | ... Test performs a physical reboot, performs "reboot" from the OLT CLI |
| 113 | ... VOL-1956 |
| 114 | [Tags] functional PhysicalOLTReboot |
| 115 | [Setup] Run Keywords Announce Message START TEST PhysicalOLTReboot |
| 116 | ... AND Start Logging PhysicalOLTReboot |
| 117 | [Teardown] Run Keywords Collect Logs |
| 118 | ... AND Stop Logging PhysicalOLTReboot |
| 119 | ... AND Announce Message END TEST PhysicalOLTReboot |
Suchitra Vemuri | b3a92e4 | 2020-03-21 16:49:57 -0700 | [diff] [blame] | 120 | ... AND Delete Device and Verify |
Suchitra Vemuri | 784e1ae | 2020-03-16 18:40:25 -0700 | [diff] [blame] | 121 | # Add OLT device |
| 122 | setup |
| 123 | # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable |
| 124 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 125 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 126 | # Reboot the OLT from the OLT CLI |
| 127 | Run Keyword If ${has_dataplane} Login And Run Command On Remote System |
| 128 | ... sudo reboot ${olt_ip} ${olt_user} ${olt_pass} prompt=# |
| 129 | Run Keyword And Ignore Error Collect Logs |
| 130 | FOR ${I} IN RANGE 0 ${num_onus} |
| 131 | ${src}= Set Variable ${hosts.src[${I}]} |
| 132 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 133 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 134 | ... Wait Until Keyword Succeeds 60s 2s |
| 135 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 136 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 137 | END |
| 138 | # Wait for the OLT to come back up |
| 139 | Wait Until Keyword Succeeds 120s 10s Check Remote System Reachability True ${olt_ip} |
Suchitra Vemuri | 64db965 | 2020-03-22 21:11:13 -0700 | [diff] [blame] | 140 | # Waiting extra time for the ONUs to come up |
| 141 | Sleep 60s |
Suchitra Vemuri | 784e1ae | 2020-03-16 18:40:25 -0700 | [diff] [blame] | 142 | Run Keyword And Ignore Error Collect Logs |
| 143 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 144 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 145 | # Deleting OLT after test completes |
Suchitra Vemuri | b3a92e4 | 2020-03-21 16:49:57 -0700 | [diff] [blame] | 146 | #Run Keyword If ${has_dataplane} Delete Device and Verify |
Suchitra Vemuri | 784e1ae | 2020-03-16 18:40:25 -0700 | [diff] [blame] | 147 | |
Suchitra Vemuri | 05180cb | 2020-03-26 13:13:27 -0700 | [diff] [blame] | 148 | Verify restart openolt-adapter container after subscriber provisioning |
Suchitra Vemuri | a7dae32 | 2020-02-19 22:38:18 -0800 | [diff] [blame] | 149 | [Documentation] Restart openolt-adapter container after VOLTHA is operational. |
| 150 | ... Prerequisite : ONUs are authenticated and pingable. |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 151 | [Tags] functional VOL-1958 Restart-OpenOlt released |
| 152 | [Setup] Run Keywords Announce Message START TEST Restart-OpenOlt |
| 153 | ... AND Start Logging Restart-OpenOlt |
Suchitra Vemuri | a7dae32 | 2020-02-19 22:38:18 -0800 | [diff] [blame] | 154 | [Teardown] Run Keywords Collect Logs |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 155 | ... AND Stop Logging Restart-OpenOlt |
| 156 | ... AND Announce Message END TEST Restart-OpenOlt |
Suchitra Vemuri | a7dae32 | 2020-02-19 22:38:18 -0800 | [diff] [blame] | 157 | # Add OLT device |
| 158 | setup |
| 159 | # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable |
| 160 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 161 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 162 | ${waitforRestart} Set Variable 120s |
| 163 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 164 | Log ${podStatusOutput} |
| 165 | ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 166 | ${podName} Set Variable adapter-open-olt |
| 167 | Restart Pod ${NAMESPACE} ${podName} |
| 168 | Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ${podName} ${NAMESPACE} |
| 169 | ... Running |
Suchitra Vemuri | 312bfe0 | 2020-03-16 16:11:34 -0700 | [diff] [blame] | 170 | # Wait for 1min after openolt adapter is restarted |
| 171 | Sleep 60s |
Suchitra Vemuri | a7dae32 | 2020-02-19 22:38:18 -0800 | [diff] [blame] | 172 | Repeat Sanity Test |
Suchitra Vemuri | d709613 | 2020-02-21 14:50:47 -0800 | [diff] [blame] | 173 | Run Keyword and Ignore Error Collect Logs |
Suchitra Vemuri | a7dae32 | 2020-02-19 22:38:18 -0800 | [diff] [blame] | 174 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 175 | Log ${podStatusOutput} |
| 176 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 177 | Should Be Equal As Strings ${countAfterRestart} ${countBforRestart} |
| 178 | Log to console Pod ${podName} restarted and sanity checks passed successfully |
Suchitra Vemuri | 60be98b | 2020-02-19 16:41:21 -0800 | [diff] [blame] | 179 | |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 180 | Check OLT/ONU Authentication After Radius Pod Restart |
| 181 | [Documentation] After radius restart, triggers reassociation, checks status and |
| 182 | ... authentication, validates dhcp and ping. Note : wpa reassociate works only when |
| 183 | ... wpa supplicant is running in background hence it is recommended to remove |
| 184 | ... teardown from previous test or uncomment 'Teardown None'. |
| 185 | ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable |
| 186 | [Tags] functional RadiusRestart released |
| 187 | [Setup] Run Keywords Announce Message START TEST RadiusRestart |
| 188 | ... AND Start Logging RadiusRestart |
| 189 | [Teardown] Run Keywords Collect Logs |
| 190 | ... AND Stop Logging RadiusRestart |
| 191 | ... AND Announce Message END TEST RadiusRestart |
| 192 | ${waitforRestart} Set Variable 120s |
Suchitra Vemuri | ca1c5d3 | 2020-04-09 18:45:29 -0700 | [diff] [blame] | 193 | Wait Until Keyword Succeeds ${timeout} 15s Restart Pod ${DEFAULTSPACE} ${RESTART_POD_NAME} |
| 194 | Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ${RESTART_POD_NAME} |
| 195 | ... ${DEFAULTSPACE} Running |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 196 | FOR ${I} IN RANGE 0 ${num_onus} |
| 197 | ${src}= Set Variable ${hosts.src[${I}]} |
| 198 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 199 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 200 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s |
| 201 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 202 | Wait Until Keyword Succeeds ${timeout} 2s |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 203 | ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 204 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 205 | ... Validate Authentication After Reassociate True ${src['dp_iface_name']} |
| 206 | ... ${src['ip']} ${src['user']} ${src['pass']} |
| 207 | ... ${src['container_type']} ${src['container_name']} |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 208 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP} |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 209 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 210 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 211 | ... Validate DHCP and Ping True True ${src['dp_iface_name']} |
| 212 | ... ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 213 | ... ${src['ip']} ${src['user']} ${src['pass']} |
| 214 | ... ${src['container_type']} ${src['container_name']} |
| 215 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} |
| 216 | ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']} |
| 217 | Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 218 | ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 219 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 220 | Run Keyword and Ignore Error Collect Logs |
| 221 | END |
| 222 | |
Suchitra Vemuri | 05180cb | 2020-03-26 13:13:27 -0700 | [diff] [blame] | 223 | Verify openolt adapter restart before subscriber provisioning |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 224 | [Documentation] Deploys an device instance and waits for it to authenticate. After |
| 225 | ... authentication is successful the rw-core deployment is scaled to 0 instances to |
| 226 | ... simulate a POD crash. The test then scales the rw-core back to a single instance |
| 227 | ... and configures ONOS for access. The test succeeds if the device is able to |
| 228 | ... complete the DHCP sequence. |
Hung-Wei Chiu | d357676 | 2020-03-25 18:06:26 -0700 | [diff] [blame] | 229 | [Tags] functional olt-adapter-restart |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 230 | [Setup] Run Keywords Announce Message START TEST OltAdapterRestart |
| 231 | ... AND Start Logging OltAdapterRestart |
Suchitra Vemuri | a0c086f | 2020-03-29 19:14:13 -0700 | [diff] [blame] | 232 | #... AND Clear All Devices Then Create New Device |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 233 | [Teardown] Run Keywords Collect Logs |
| 234 | ... AND Stop Logging OltAdapterRestart |
| 235 | ... AND Announce Message END TEST OltAdapterRestart |
Hung-Wei Chiu | d357676 | 2020-03-25 18:06:26 -0700 | [diff] [blame] | 236 | # Add OLT and perform sanity test |
Suchitra Vemuri | 59ad277 | 2020-03-26 22:27:27 -0700 | [diff] [blame] | 237 | #setup |
Suchitra Vemuri | 91537c8 | 2020-03-29 15:03:26 -0700 | [diff] [blame] | 238 | Run Keyword If ${has_dataplane} Clean Up Linux |
Suchitra Vemuri | 59ad277 | 2020-03-26 22:27:27 -0700 | [diff] [blame] | 239 | #Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 240 | Set Global Variable ${of_id} |
| 241 | |
| 242 | FOR ${I} IN RANGE 0 ${num_onus} |
| 243 | ${src}= Set Variable ${hosts.src[${I}]} |
| 244 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 245 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 246 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 247 | ... ${of_id} |
| 248 | |
| 249 | # Bring up the device and verify it authenticates |
| 250 | Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE |
| 251 | ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 252 | Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 253 | ... ${ONOS_SSH_PORT} ${onu_port} |
Andy Bavier | 84834d4 | 2020-02-25 13:49:50 -0700 | [diff] [blame] | 254 | ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=. |
| 255 | ... /tmp/wpa ${src['dp_iface_name']} log |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 256 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True |
| 257 | ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']} |
Andy Bavier | 84834d4 | 2020-02-25 13:49:50 -0700 | [diff] [blame] | 258 | ... ${src['container_type']} ${src['container_name']} ${wpa_log} |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 259 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP} |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 260 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 261 | END |
| 262 | # Scale down the open OLT adapter deployment to 0 PODs and once confirmed, scale it back to 1 |
| 263 | Scale K8s Deployment voltha adapter-open-olt 0 |
| 264 | Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha adapter-open-olt |
| 265 | # Scale up the open OLT adapter deployment and make sure both it and the ofagent deployment are back |
| 266 | Scale K8s Deployment voltha adapter-open-olt 1 |
| 267 | Wait Until Keyword Succeeds ${timeout} 2s |
| 268 | ... Check Expected Available Deployment Replicas voltha adapter-open-olt 1 |
| 269 | |
| 270 | # Ensure the device is available in ONOS, this represents system connectivity being restored |
| 271 | Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 272 | ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id} |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 273 | |
| 274 | FOR ${I} IN RANGE 0 ${num_onus} |
| 275 | # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 276 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP} |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 277 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 278 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 279 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 280 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 281 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 282 | ... ${dst['container_name']} |
| 283 | Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 284 | ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 285 | END |
| 286 | |
hwchiu | 14c0510 | 2020-03-27 00:44:30 +0000 | [diff] [blame] | 287 | Verify restart ofagent container after subscriber is provisioned |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 288 | [Documentation] Restart ofagent container after VOLTHA is operational. |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 289 | ... Prerequisite : ONUs are authenticated and pingable. |
Hardik Windlass | 8f2aadc | 2020-03-16 20:16:39 +0530 | [diff] [blame] | 290 | #TODO: remove "notready" tag once olt reboot and ofagent restart work items are done |
Hardik Windlass | 7a84666 | 2020-03-19 20:42:59 +0530 | [diff] [blame] | 291 | [Tags] functional VOL-2409 ofagentRestart |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 292 | [Setup] Run Keywords Announce Message START TEST ofagentRestart |
| 293 | ... AND Start Logging ofagentRestart |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 294 | [Teardown] Run Keywords Collect Logs |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 295 | ... AND Stop Logging ofagentRestart |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 296 | ... AND Announce Message END TEST ofagentRestart |
Hardik Windlass | 8f2aadc | 2020-03-16 20:16:39 +0530 | [diff] [blame] | 297 | ... AND Scale K8s Deployment ${NAMESPACE} voltha-ofagent 1 |
Suchitra Vemuri | ceb002a | 2020-03-25 13:36:21 -0700 | [diff] [blame] | 298 | # set timeout value |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 299 | ${waitforRestart} Set Variable 120s |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 300 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 301 | Log ${podStatusOutput} |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 302 | ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
Hardik Windlass | 8f2aadc | 2020-03-16 20:16:39 +0530 | [diff] [blame] | 303 | ${podName} Set Variable ofagent |
| 304 | Restart Pod ${NAMESPACE} ${podName} |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 305 | Sleep 60s |
| 306 | Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE} |
| 307 | ... Running |
Hardik Windlass | 8f2aadc | 2020-03-16 20:16:39 +0530 | [diff] [blame] | 308 | # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable |
| 309 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 310 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 311 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 312 | Log ${podStatusOutput} |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 313 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 314 | Should Be Equal As Strings ${countAfterRestart} ${countBforRestart} |
Hardik Windlass | 8f2aadc | 2020-03-16 20:16:39 +0530 | [diff] [blame] | 315 | # Scale Down the Of-Agent Deployment |
| 316 | Scale K8s Deployment ${NAMESPACE} voltha-ofagent 0 |
| 317 | Sleep 30s |
| 318 | FOR ${I} IN RANGE 0 ${num_onus} |
| 319 | ${src}= Set Variable ${hosts.src[${I}]} |
| 320 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 321 | Run Keyword and Ignore Error Collect Logs |
| 322 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 323 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 324 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 325 | # Verify ONU state in voltha |
| 326 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 327 | ... ENABLED ACTIVE REACHABLE |
| 328 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 329 | # Check ONU port is Disabled in ONOS |
| 330 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
| 331 | ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
| 332 | # Verify EAPOL flows are present for the ONU port |
| 333 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 334 | ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
| 335 | # Verify ONU in AAA-Users |
| 336 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2 |
| 337 | ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
| 338 | # Verify DHCP-Allocations |
| 339 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 340 | ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
| 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 |
| 349 | Scale K8s Deployment ${NAMESPACE} voltha-ofagent 1 |
| 350 | Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE} |
| 351 | ... Running |
| 352 | # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable |
| 353 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 354 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 355 | Log to console Pod ${podName} restarted and sanity checks passed successfully |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 356 | |
Gayathri.Selvan | c0b3702 | 2020-02-06 05:17:00 +0000 | [diff] [blame] | 357 | Check ONU adapter crash not forcing authentication again |
| 358 | [Documentation] After ONU adapter restart, checks wpa log for 'authentication started' |
| 359 | ... message count to make sure auth not started again and validates EAP status and ping. |
| 360 | ... Assuming that test1 or sanity was executed where all the ONUs are authenticated/DHCP/pingable |
hwchiu | 14c0510 | 2020-03-27 00:44:30 +0000 | [diff] [blame] | 361 | [Tags] functional ONUAdaptCrash |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 362 | [Setup] Run Keywords Announce Message START TEST ONUAdaptCrash |
| 363 | ... AND Start Logging ONUAdaptCrash |
| 364 | [Teardown] Run Keywords Collect Logs |
| 365 | ... AND Stop Logging ONUAdaptCrash |
| 366 | ... AND Announce Message END TEST ONUAdaptCrash |
hwchiu | 14c0510 | 2020-03-27 00:44:30 +0000 | [diff] [blame] | 367 | # Wait for adapter to resync |
| 368 | Sleep 60s |
| 369 | # Restart the onu |
| 370 | ${podName} Set Variable adapter-open-onu |
| 371 | Wait Until Keyword Succeeds ${timeout} 15s Restart Pod ${NAMESPACE} ${podName} |
| 372 | # Validate ONU Ports |
Gayathri.Selvan | c0b3702 | 2020-02-06 05:17:00 +0000 | [diff] [blame] | 373 | FOR ${I} IN RANGE 0 ${num_onus} |
| 374 | ${src}= Set Variable ${hosts.src[${I}]} |
| 375 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 376 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 377 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 378 | ... ${of_id} |
hwchiu | 14c0510 | 2020-03-27 00:44:30 +0000 | [diff] [blame] | 379 | Run Keyword And Continue On Failure Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 380 | ... ${onu_port} |
Gayathri.Selvan | c0b3702 | 2020-02-06 05:17:00 +0000 | [diff] [blame] | 381 | ${output}= Run Keyword If ${has_dataplane} Login And Run Command On Remote System |
| 382 | ... wpa_cli status | grep SUCCESS ${src['ip']} ${src['user']} ${src['pass']} |
| 383 | ... ${src['container_type']} ${src['container_name']} |
| 384 | Run Keyword If ${has_dataplane} Should Contain ${output} SUCCESS |
Gayathri.Selvan | c0b3702 | 2020-02-06 05:17:00 +0000 | [diff] [blame] | 385 | END |
hwchiu | 14c0510 | 2020-03-27 00:44:30 +0000 | [diff] [blame] | 386 | Wait Until Keyword Succeeds ${timeout} 2s Validate Pod Status ${podName} ${NAMESPACE} |
| 387 | ... Running |
| 388 | # Wait for adapter to resync |
| 389 | Sleep 60s |
| 390 | Clean Up Linux |
| 391 | # Perform all steps in Sanity Test except the subscriber addition |
| 392 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number} |
| 393 | Set Global Variable ${of_id} |
| 394 | FOR ${I} IN RANGE 0 ${num_onus} |
| 395 | ${src}= Set Variable ${hosts.src[${I}]} |
| 396 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 397 | Run Keyword and Ignore Error Collect Logs |
| 398 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 399 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 400 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 401 | # Check ONU port is Enabled in ONOS |
| 402 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
| 403 | ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
| 404 | # Verify EAPOL flows are added for the ONU port |
| 405 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 406 | ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
| 407 | # Verify ONU state in voltha |
| 408 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 409 | ... ENABLED ACTIVE REACHABLE |
| 410 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 411 | # Perform Authentication |
| 412 | ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=. |
| 413 | ... /tmp/wpa ${src['dp_iface_name']} log |
| 414 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True |
| 415 | ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']} |
| 416 | ... ${src['container_type']} ${src['container_name']} ${wpa_log} |
| 417 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2 |
| 418 | ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
| 419 | # Verify that no pending flows exist for the ONU port |
| 420 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 421 | ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
| 422 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 423 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 424 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 425 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 426 | ... ${dst['container_name']} |
| 427 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 428 | ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
| 429 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 430 | Run Keyword and Ignore Error Collect Logs |
| 431 | END |
| 432 | |
Gayathri.Selvan | c0b3702 | 2020-02-06 05:17:00 +0000 | [diff] [blame] | 433 | Run Keyword and Ignore Error Collect Logs |
| 434 | |
Suchitra Vemuri | ebf6532 | 2020-04-03 10:09:41 -0700 | [diff] [blame] | 435 | Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart |
| 436 | [Documentation] Deploys an device instance and waits for it to authenticate. After |
| 437 | ... authentication is successful the rw-core deployment is scaled to 0 instances to |
| 438 | ... simulate a POD crash. The test then scales the rw-core back to a single instance |
| 439 | ... and configures ONOS for access. The test succeeds if the device is able to |
| 440 | ... complete the DHCP sequence. |
| 441 | [Tags] functional rwcore-restart |
| 442 | [Setup] Run Keywords Announce Message START TEST RwCoreFailAndRestart |
| 443 | ... AND Start Logging RwCoreFailAndRestart |
| 444 | ... AND Clear All Devices Then Create New Device |
| 445 | [Teardown] Run Keywords Collect Logs |
| 446 | ... AND Stop Logging RwCoreFailAndRestart |
| 447 | ... AND Announce Message END TEST RwCoreFailAndRestart |
Suchitra Vemuri | 5d3383f | 2020-04-03 11:02:26 -0700 | [diff] [blame] | 448 | #... AND Delete Device and Verify |
Suchitra Vemuri | ebf6532 | 2020-04-03 10:09:41 -0700 | [diff] [blame] | 449 | Run Keyword and Ignore Error Collect Logs |
| 450 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 451 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number} |
| 452 | Set Global Variable ${of_id} |
| 453 | FOR ${I} IN RANGE 0 ${num_onus} |
| 454 | ${src}= Set Variable ${hosts.src[${I}]} |
| 455 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 456 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 457 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 458 | ... ${of_id} |
| 459 | # Bring up the device and verify it authenticates |
| 460 | Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE |
| 461 | ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed |
| 462 | Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} |
| 463 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 464 | ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=. |
| 465 | ... /tmp/wpa ${src['dp_iface_name']} log |
| 466 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True |
| 467 | ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']} |
| 468 | ... ${src['container_type']} ${src['container_name']} ${wpa_log} |
| 469 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP} |
| 470 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 471 | END |
| 472 | |
| 473 | # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1 |
| 474 | Scale K8s Deployment voltha voltha-rw-core 0 |
| 475 | Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-rw-core |
| 476 | # Ensure the ofagent POD goes "not-ready" as expected |
| 477 | Wait Until keyword Succeeds ${timeout} 2s |
| 478 | ... Check Expected Available Deployment Replicas voltha voltha-ofagent 0 |
| 479 | # Scale up the core deployment and make sure both it and the ofagent deployment are back |
| 480 | Scale K8s Deployment voltha voltha-rw-core 1 |
| 481 | Wait Until Keyword Succeeds ${timeout} 2s |
| 482 | ... Check Expected Available Deployment Replicas voltha voltha-rw-core 1 |
| 483 | Wait Until Keyword Succeeds ${timeout} 2s |
| 484 | ... Check Expected Available Deployment Replicas voltha voltha-ofagent 1 |
| 485 | # For some reason scaling down and up the POD behind a service causes the port forward to stop working, |
| 486 | # so restart the port forwarding for the API service |
| 487 | Restart VOLTHA Port Foward voltha-api-minimal |
| 488 | # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this |
| 489 | # represents system connectivity being restored |
| 490 | Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS |
| 491 | ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id} |
| 492 | |
| 493 | FOR ${I} IN RANGE 0 ${num_onus} |
| 494 | # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly |
| 495 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP} |
| 496 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 497 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 498 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 499 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 500 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 501 | ... ${dst['container_name']} |
| 502 | Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure |
| 503 | ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
| 504 | END |
| 505 | |
Gayathri.Selvan | f68ea4b | 2020-02-03 07:36:39 +0000 | [diff] [blame] | 506 | ONU Reboot |
| 507 | [Documentation] Reboot ONU and verify that ONU comes up properly |
| 508 | [Tags] VOL-1957 RebootONU notready |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 509 | [Setup] Run Keywords Announce Message START TEST RebootONU |
| 510 | ... AND Start Logging RebootONU |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 511 | [Teardown] Run Keywords Collect Logs |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 512 | ... AND Stop Logging RebootONU |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 513 | ... AND Announce Message END TEST RebootONU |
Gayathri.Selvan | f68ea4b | 2020-02-03 07:36:39 +0000 | [diff] [blame] | 514 | FOR ${I} IN RANGE 0 ${num_onus} |
| 515 | ${src}= Set Variable ${hosts.src[${I}]} |
| 516 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 517 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
Suchitra Vemuri | cd2f64f | 2020-02-18 18:30:27 -0800 | [diff] [blame] | 518 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 519 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
Gayathri.Selvan | f68ea4b | 2020-02-03 07:36:39 +0000 | [diff] [blame] | 520 | Reboot ONU ${onu_device_id} ${src} ${dst} |
| 521 | Verify ping is succesful except for given device ${num_onus} ${onu_device_id} |
Suchitra Vemuri | cd2f64f | 2020-02-18 18:30:27 -0800 | [diff] [blame] | 522 | # Check ONU port is Enabled in ONOS |
| 523 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 524 | ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
Suchitra Vemuri | cd2f64f | 2020-02-18 18:30:27 -0800 | [diff] [blame] | 525 | # Verify EAPOL flows are added for the ONU port |
| 526 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 527 | ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
Suchitra Vemuri | cd2f64f | 2020-02-18 18:30:27 -0800 | [diff] [blame] | 528 | # Verify ONU state in voltha |
| 529 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 530 | ... ENABLED ACTIVE REACHABLE |
| 531 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 532 | # Verify pings are successful after reboot on the current ONU |
| 533 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 534 | ... Wait Until Keyword Succeeds 60s 2s |
| 535 | ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 536 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Gayathri.Selvan | f68ea4b | 2020-02-03 07:36:39 +0000 | [diff] [blame] | 537 | END |
Suchitra Vemuri | cd2f64f | 2020-02-18 18:30:27 -0800 | [diff] [blame] | 538 | #Run Keyword If ${has_dataplane} Clean Up Linux |
| 539 | #Check after reboot that ONUs are active, authenticated/DHCP/pingable |
| 540 | #Perform Sanity Test |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 541 | |
| 542 | *** Keywords *** |
| 543 | Setup Suite |
| 544 | [Documentation] Set up the test suite |
| 545 | Common Test Suite Setup |
HungWei Chiu | 1408fb9 | 2020-03-03 19:43:30 -0500 | [diff] [blame] | 546 | #power_switch.robot needs it to support different vendor's power switch |
Hung-Wei Chiu | fcc6d8e | 2020-03-10 12:05:11 -0700 | [diff] [blame] | 547 | ${switch_type}= Get Variable Value ${web_power_switch.type} |
| 548 | Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type} |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 549 | |
| 550 | Clear All Devices Then Create New Device |
| 551 | [Documentation] Remove any devices from VOLTHA and ONOS |
| 552 | # Remove all devices from voltha and nos |
| 553 | Delete All Devices and Verify |
| 554 | # Execute normal test Setup Keyword |
| 555 | Setup |