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 |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 17 | Suite Setup Common Test Suite Setup |
| 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 |
| 44 | # For below variable value, using deployment name as using grep for |
| 45 | # parsing radius pod name, we can also use full radius pod name |
| 46 | ${RESTART_POD_NAME} radius |
| 47 | ${timeout} 60s |
| 48 | ${of_id} 0 |
| 49 | ${logical_id} 0 |
Suchitra Vemuri | 109feb1 | 2020-01-23 16:25:02 -0800 | [diff] [blame] | 50 | ${has_dataplane} True |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 51 | ${teardown_device} False |
| 52 | ${scripts} ../../scripts |
| 53 | |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 54 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 55 | ${container_log_dir} ${None} |
| 56 | |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 57 | *** Test Cases *** |
Suchitra Vemuri | 60be98b | 2020-02-19 16:41:21 -0800 | [diff] [blame] | 58 | Verify ONU after rebooting physically |
| 59 | [Documentation] Test the ONU functionality by physically turning on/off ONU. |
| 60 | ... Prerequisite : Subscriber are authenticated/DHCP/pingable state |
| 61 | ... Test case runs only on the PODs that are configured with PowerSwitch that |
| 62 | ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot) |
| 63 | ... VOL-2634 |
| 64 | [Tags] functional PowerSwitch |
| 65 | [Setup] Run Keywords Announce Message START TEST PowerSwitch |
| 66 | ... AND Start Logging PowerSwitch |
| 67 | [Teardown] Run Keywords Collect Logs |
| 68 | ... AND Stop Logging PowerSwitch |
| 69 | ... AND Announce Message END TEST PowerSwitch |
| 70 | # Add OLT device |
| 71 | setup |
| 72 | # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable |
| 73 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 74 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 75 | Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password} |
| 76 | FOR ${I} IN RANGE 0 ${num_onus} |
| 77 | ${src}= Set Variable ${hosts.src[${I}]} |
| 78 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 79 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 80 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 81 | Disable Switch Outlet ${src['power_switch_port']} |
| 82 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 83 | ... Wait Until Keyword Succeeds 60s 2s |
| 84 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 85 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 86 | |
| 87 | Enable Switch Outlet ${src['power_switch_port']} |
| 88 | # Check ONU port is Enabled in ONOS |
| 89 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
| 90 | ... Verify ONU Port Is Enabled ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 91 | # Verify EAPOL flows are added for the ONU port |
| 92 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 93 | ... Verify Eapol Flows Added For ONU ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 94 | # Verify ONU state in voltha |
| 95 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 96 | ... ENABLED ACTIVE REACHABLE |
| 97 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 98 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 99 | ... ENABLED ACTIVE REACHABLE ${src['onu']} |
| 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 | a7dae32 | 2020-02-19 22:38:18 -0800 | [diff] [blame] | 106 | # Deleting OLT run tests independently (as this test doesn't not run on each POD) |
| 107 | Run Keyword If ${has_dataplane} Delete Device and Verify |
| 108 | |
| 109 | Verify restart openolt-adapter container after VOLTHA is operational |
| 110 | [Documentation] Restart openolt-adapter container after VOLTHA is operational. |
| 111 | ... Prerequisite : ONUs are authenticated and pingable. |
| 112 | [Tags] functional VOL-1958 RestartPods released |
| 113 | [Setup] Run Keywords Announce Message START TEST RestartPods |
| 114 | ... AND Start Logging RestartPods |
| 115 | [Teardown] Run Keywords Collect Logs |
| 116 | ... AND Stop Logging RestartPods |
| 117 | ... AND Announce Message END TEST RestartPods |
| 118 | # Add OLT device |
| 119 | setup |
| 120 | # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable |
| 121 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 122 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 123 | ${waitforRestart} Set Variable 120s |
| 124 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 125 | Log ${podStatusOutput} |
| 126 | ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 127 | ${podName} Set Variable adapter-open-olt |
| 128 | Restart Pod ${NAMESPACE} ${podName} |
| 129 | Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ${podName} ${NAMESPACE} |
| 130 | ... Running |
| 131 | Repeat Sanity Test |
| 132 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 133 | Log ${podStatusOutput} |
| 134 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 135 | Should Be Equal As Strings ${countAfterRestart} ${countBforRestart} |
| 136 | Log to console Pod ${podName} restarted and sanity checks passed successfully |
Suchitra Vemuri | 60be98b | 2020-02-19 16:41:21 -0800 | [diff] [blame] | 137 | |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 138 | Verify restart ofagent container after VOLTHA is operational |
| 139 | [Documentation] Restart ofagent container after VOLTHA is operational. |
| 140 | ... Please note this test case should be run before the restart of other containers. |
| 141 | ... Prerequisite : ONUs are authenticated and pingable. |
Suchitra Vemuri | cd2f64f | 2020-02-18 18:30:27 -0800 | [diff] [blame] | 142 | [Tags] functional VOL-2409 ofagentRestart |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 143 | [Setup] Run Keywords Announce Message START TEST ofagentRestart |
| 144 | ... AND Start Logging ofagentRestart |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 145 | [Teardown] Run Keywords Collect Logs |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 146 | ... AND Stop Logging ofagentRestart |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 147 | ... AND Announce Message END TEST ofagentRestart |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 148 | ${waitforRestart} Set Variable 120s |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 149 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 150 | Log ${podStatusOutput} |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 151 | ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 152 | Restart Pod ${NAMESPACE} ofagent |
| 153 | Sleep 60s |
| 154 | Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE} |
| 155 | ... Running |
| 156 | Repeat Sanity Test |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 157 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 158 | Log ${podStatusOutput} |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 159 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 160 | Should Be Equal As Strings ${countAfterRestart} ${countBforRestart} |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 161 | |
Gayathri.Selvan | c0b3702 | 2020-02-06 05:17:00 +0000 | [diff] [blame] | 162 | Check ONU adapter crash not forcing authentication again |
| 163 | [Documentation] After ONU adapter restart, checks wpa log for 'authentication started' |
| 164 | ... message count to make sure auth not started again and validates EAP status and ping. |
| 165 | ... Assuming that test1 or sanity was executed where all the ONUs are authenticated/DHCP/pingable |
| 166 | [Tags] functional ONUAdaptCrash notready |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 167 | [Setup] Run Keywords Announce Message START TEST ONUAdaptCrash |
| 168 | ... AND Start Logging ONUAdaptCrash |
| 169 | [Teardown] Run Keywords Collect Logs |
| 170 | ... AND Stop Logging ONUAdaptCrash |
| 171 | ... AND Announce Message END TEST ONUAdaptCrash |
Gayathri.Selvan | c0b3702 | 2020-02-06 05:17:00 +0000 | [diff] [blame] | 172 | @{before_list}= Create List |
| 173 | @{after_list}= Create List |
| 174 | FOR ${I} IN RANGE 0 ${num_onus} |
| 175 | ${src}= Set Variable ${hosts.src[${I}]} |
| 176 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 177 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 178 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 179 | ... ${of_id} |
| 180 | ${before}= Run Keyword If ${has_dataplane} Check Remote File Contents For WPA Logs |
| 181 | ... True /tmp/wpa.log authentication started ${src['ip']} ${src['user']} ${src['pass']} |
| 182 | ... ${src['container_type']} ${src['container_name']} |
| 183 | Append To List ${before_list} ${before} |
| 184 | END |
| 185 | Wait Until Keyword Succeeds ${timeout} 15s Restart Pod ${NAMESPACE} adapter-open-onu |
| 186 | Wait Until Keyword Succeeds ${timeout} 2s Validate Pod Status ${podName} ${NAMESPACE} |
| 187 | ... Running |
| 188 | FOR ${I} IN RANGE 0 ${num_onus} |
| 189 | ${src}= Set Variable ${hosts.src[${I}]} |
| 190 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 191 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 192 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 193 | ... ${of_id} |
| 194 | ${after}= Run Keyword If ${has_dataplane} Check Remote File Contents For WPA Logs |
| 195 | ... True /tmp/wpa.log authentication started ${src['ip']} ${src['user']} ${src['pass']} |
| 196 | ... ${src['container_type']} ${src['container_name']} |
| 197 | Append To List ${after_list} ${after} |
| 198 | ${output}= Run Keyword If ${has_dataplane} Login And Run Command On Remote System |
| 199 | ... wpa_cli status | grep SUCCESS ${src['ip']} ${src['user']} ${src['pass']} |
| 200 | ... ${src['container_type']} ${src['container_name']} |
| 201 | Run Keyword If ${has_dataplane} Should Contain ${output} SUCCESS |
| 202 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 203 | ... Wait Until Keyword Succeeds 60s 2s Check Ping |
| 204 | ... True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']} ${src['user']} |
| 205 | ... ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 206 | END |
| 207 | Lists Should Be Equal ${after_list} ${before_list} |
| 208 | Log ${after_list} |
| 209 | Log ${before_list} |
| 210 | Run Keyword and Ignore Error Collect Logs |
| 211 | |
Gayathri.Selvan | f68ea4b | 2020-02-03 07:36:39 +0000 | [diff] [blame] | 212 | ONU Reboot |
| 213 | [Documentation] Reboot ONU and verify that ONU comes up properly |
| 214 | [Tags] VOL-1957 RebootONU notready |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 215 | [Setup] Run Keywords Announce Message START TEST RebootONU |
| 216 | ... AND Start Logging RebootONU |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 217 | [Teardown] Run Keywords Collect Logs |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 218 | ... AND Stop Logging RebootONU |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 219 | ... AND Announce Message END TEST RebootONU |
Gayathri.Selvan | f68ea4b | 2020-02-03 07:36:39 +0000 | [diff] [blame] | 220 | FOR ${I} IN RANGE 0 ${num_onus} |
| 221 | ${src}= Set Variable ${hosts.src[${I}]} |
| 222 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 223 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
Suchitra Vemuri | cd2f64f | 2020-02-18 18:30:27 -0800 | [diff] [blame] | 224 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 225 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
Gayathri.Selvan | f68ea4b | 2020-02-03 07:36:39 +0000 | [diff] [blame] | 226 | Reboot ONU ${onu_device_id} ${src} ${dst} |
| 227 | 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] | 228 | # Check ONU port is Enabled in ONOS |
| 229 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
| 230 | ... Verify ONU Port Is Enabled ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 231 | # Verify EAPOL flows are added for the ONU port |
| 232 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 233 | ... Verify Eapol Flows Added For ONU ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 234 | # Verify ONU state in voltha |
| 235 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 236 | ... ENABLED ACTIVE REACHABLE |
| 237 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 238 | # Verify pings are successful after reboot on the current ONU |
| 239 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 240 | ... Wait Until Keyword Succeeds 60s 2s |
| 241 | ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 242 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Gayathri.Selvan | f68ea4b | 2020-02-03 07:36:39 +0000 | [diff] [blame] | 243 | END |
Suchitra Vemuri | cd2f64f | 2020-02-18 18:30:27 -0800 | [diff] [blame] | 244 | #Run Keyword If ${has_dataplane} Clean Up Linux |
| 245 | #Check after reboot that ONUs are active, authenticated/DHCP/pingable |
| 246 | #Perform Sanity Test |