David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame^] | 1 | # Copyright 2017 - present Open Networking Foundation |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 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 | |
Matteo Scandolo | 1294aeb | 2019-09-24 16:20:32 -0700 | [diff] [blame] | 15 | # FIXME Can we use the same test against BBSim and Hardware? |
| 16 | |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 17 | *** Settings *** |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 18 | Documentation Test various end-to-end scenarios |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 19 | Suite Setup Setup Suite |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 20 | Test Setup Setup |
| 21 | Test Teardown Teardown |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 22 | Suite Teardown Teardown Suite |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 23 | Library Collections |
| 24 | Library String |
| 25 | Library OperatingSystem |
| 26 | Library XML |
| 27 | Library RequestsLibrary |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 28 | Library ../../libraries/DependencyLibrary.py |
Suchitra Vemuri | b8ed2d5 | 2019-09-30 13:22:51 -0700 | [diff] [blame] | 29 | Resource ../../libraries/onos.robot |
| 30 | Resource ../../libraries/voltctl.robot |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame^] | 31 | Resource ../../libraries/voltha.robot |
Suchitra Vemuri | b8ed2d5 | 2019-09-30 13:22:51 -0700 | [diff] [blame] | 32 | Resource ../../libraries/utils.robot |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 33 | Resource ../../libraries/k8s.robot |
Suchitra Vemuri | b8ed2d5 | 2019-09-30 13:22:51 -0700 | [diff] [blame] | 34 | Resource ../../variables/variables.robot |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 35 | |
| 36 | *** Variables *** |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 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 |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 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 |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 48 | ${timeout} 60s |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 49 | ${of_id} 0 |
| 50 | ${logical_id} 0 |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 51 | ${has_dataplane} True |
| 52 | ${external_libs} True |
| 53 | ${teardown_device} False |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame^] | 54 | ${scripts} ../../scripts |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 55 | |
| 56 | *** Test Cases *** |
| 57 | Sanity E2E Test for OLT/ONU on POD |
| 58 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 59 | ... Validate successful authentication/DHCP/E2E ping for the tech profile that is used |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 60 | [Tags] sanity test1 |
Suchitra Vemuri | 6db8941 | 2019-11-14 14:52:54 -0800 | [diff] [blame] | 61 | [Teardown] NONE |
Suchitra Vemuri | b89b9ac | 2019-12-11 21:53:11 -0800 | [diff] [blame] | 62 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
Suchitra Vemuri | 582574b | 2019-12-10 21:11:54 -0800 | [diff] [blame] | 63 | Run Keyword and Ignore Error Collect Logs |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 64 | |
Suchitra Vemuri | 6db8941 | 2019-11-14 14:52:54 -0800 | [diff] [blame] | 65 | Test Disable and Enable ONU |
| 66 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 67 | ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable |
| 68 | ... Perform disable on the ONUs and validate that the pings do not succeed |
| 69 | ... Perform enable on the ONUs and validate that the pings are successful |
Suchitra Vemuri | 582574b | 2019-12-10 21:11:54 -0800 | [diff] [blame] | 70 | [Tags] functional DisableEnableONU |
Suchitra Vemuri | 6db8941 | 2019-11-14 14:52:54 -0800 | [diff] [blame] | 71 | [Setup] None |
suraj gour | 7f6d5fe | 2019-11-29 10:56:35 +0000 | [diff] [blame] | 72 | [Teardown] None |
Suchitra Vemuri | 6db8941 | 2019-11-14 14:52:54 -0800 | [diff] [blame] | 73 | |
| 74 | FOR ${I} IN RANGE 0 ${num_onus} |
| 75 | ${src}= Set Variable ${hosts.src[${I}]} |
| 76 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 77 | |
| 78 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 79 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 80 | ... ${of_id} |
| 81 | Disable Device ${onu_device_id} |
| 82 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s Check Ping False ${dst['dp_iface_ip_qinq']} |
| 83 | ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 84 | Enable Device ${onu_device_id} |
| 85 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 86 | ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 87 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s Check Ping True ${dst['dp_iface_ip_qinq']} |
| 88 | ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Suchitra Vemuri | 582574b | 2019-12-10 21:11:54 -0800 | [diff] [blame] | 89 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 90 | Run Keyword and Ignore Error Collect Logs |
Suchitra Vemuri | 6db8941 | 2019-11-14 14:52:54 -0800 | [diff] [blame] | 91 | END |
Suchitra Vemuri | 582574b | 2019-12-10 21:11:54 -0800 | [diff] [blame] | 92 | Run Keyword and Ignore Error Collect Logs |
Suchitra Vemuri | 6db8941 | 2019-11-14 14:52:54 -0800 | [diff] [blame] | 93 | |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 94 | Check OLT/ONU Authentication After Radius Pod Restart |
suraj gour | 7f6d5fe | 2019-11-29 10:56:35 +0000 | [diff] [blame] | 95 | [Documentation] After radius restart, triggers reassociation, checks status and |
| 96 | ... authentication, validates dhcp and ping. Note : wpa reassociate works only when |
| 97 | ... wpa supplicant is running in background hence it is recommended to remove |
| 98 | ... teardown from previous test or uncomment 'Teardown None'. |
| 99 | ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable |
Suchitra Vemuri | 582574b | 2019-12-10 21:11:54 -0800 | [diff] [blame] | 100 | [Tags] functional RadiusRestart |
Suchitra Vemuri | 6db8941 | 2019-11-14 14:52:54 -0800 | [diff] [blame] | 101 | [Setup] NONE |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 102 | Wait Until Keyword Succeeds ${timeout} 15s Restart Pod ${NAMESPACE} ${RESTART_POD_NAME} |
| 103 | |
| 104 | FOR ${I} IN RANGE 0 ${num_onus} |
| 105 | ${src}= Set Variable ${hosts.src[${I}]} |
| 106 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 107 | |
| 108 | |
| 109 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 110 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 111 | ... ${of_id} |
| 112 | Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip} |
| 113 | ... ${ONOS_SSH_PORT} ${onu_port} |
suraj gour | 7f6d5fe | 2019-11-29 10:56:35 +0000 | [diff] [blame] | 114 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication After Reassociate |
| 115 | ... True ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 116 | ... ${src['container_type']} ${src['container_name']} |
| 117 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip} |
| 118 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 119 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 120 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 121 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 122 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 123 | ... ${dst['container_name']} |
| 124 | Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure |
| 125 | ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
Suchitra Vemuri | 582574b | 2019-12-10 21:11:54 -0800 | [diff] [blame] | 126 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 127 | Run Keyword and Ignore Error Collect Logs |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 128 | END |
Suchitra Vemuri | 582574b | 2019-12-10 21:11:54 -0800 | [diff] [blame] | 129 | Run Keyword and Ignore Error Collect Logs |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 130 | |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame^] | 131 | Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart |
| 132 | [Documentation] Deploys an device instance and waits for it to authenticate. After |
| 133 | ... authentication is successful the rw-core deployment is scaled to 0 instances to |
| 134 | ... simulate a POD crash. The test then scales the rw-core back to a single instance |
| 135 | ... and configures ONOS for access. The test succeeds if the device is able to |
| 136 | ... complete the DHCP sequence. |
| 137 | [Tags] bbsim rwcore-restart |
| 138 | [Setup] Clear All Devices Then Create New Device |
| 139 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number} |
| 140 | Set Global Variable ${of_id} |
| 141 | |
| 142 | FOR ${I} IN RANGE 0 ${num_onus} |
| 143 | ${src}= Set Variable ${hosts.src[${I}]} |
| 144 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 145 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 146 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 147 | ... ${of_id} |
| 148 | |
| 149 | # Bring up the device and verify it authenticates |
| 150 | Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE |
| 151 | ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed |
| 152 | Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip} |
| 153 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 154 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True |
| 155 | ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']} |
| 156 | ... ${src['container_type']} ${src['container_name']} |
| 157 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip} |
| 158 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 159 | |
| 160 | # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1 |
| 161 | Scale K8s Deployment voltha voltha-rw-core 0 |
| 162 | Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-rw-core |
| 163 | # Ensure the ofagent POD goes "not-ready" as expected |
| 164 | Wait Until keyword Succeeds ${timeout} 2s Check Expected Available Deployment Replicas voltha voltha-ofagent 0 |
| 165 | # Scale up the core deployment and make sure both it and the ofagent deployment are back |
| 166 | Scale K8s Deployment voltha voltha-rw-core 1 |
| 167 | Wait Until Keyword Succeeds ${timeout} 2s Check Expected Available Deployment Replicas voltha voltha-rw-core 1 |
| 168 | Wait Until Keyword Succeeds ${timeout} 2s Check Expected Available Deployment Replicas voltha voltha-ofagent 1 |
| 169 | |
| 170 | # For some reason scaling down and up the POD behind a service causes the port forward to stop working, |
| 171 | # so restart the port forwarding for the API service |
| 172 | Restart VOLTHA Port Foward voltha-api-minimal |
| 173 | |
| 174 | # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this |
| 175 | # represents system connectivity being restored |
| 176 | Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS |
| 177 | ... http://karaf:karaf@${k8s_node_ip}:${ONOS_REST_PORT} ${of_id} |
| 178 | |
| 179 | # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly |
| 180 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip} |
| 181 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 182 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 183 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 184 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 185 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 186 | ... ${dst['container_name']} |
| 187 | Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure |
| 188 | ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 189 | END |
| 190 | |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 191 | *** Keywords *** |
| 192 | Setup Suite |
Andy Bavier | 88cd9f6 | 2019-11-26 16:22:33 -0700 | [diff] [blame] | 193 | [Documentation] Set up the test suite |
| 194 | Common Test Suite Setup |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 195 | |
| 196 | Setup |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 197 | [Documentation] Pre-test Setup |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 198 | #test for empty device list |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame^] | 199 | Test Empty Device List |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 200 | #create/preprovision device |
Suchitra Vemuri | c59eb27 | 2019-09-18 17:59:33 -0700 | [diff] [blame] | 201 | ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT} |
| 202 | Set Suite Variable ${olt_device_id} |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 203 | #validate olt states |
| 204 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN |
| 205 | ... ${EMPTY} ${olt_device_id} |
Suchitra Vemuri | c59eb27 | 2019-09-18 17:59:33 -0700 | [diff] [blame] | 206 | Enable Device ${olt_device_id} |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 207 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE |
| 208 | ... ${olt_serial_number} |
Suchitra Vemuri | 00d147d | 2019-09-13 13:07:32 -0700 | [diff] [blame] | 209 | ${logical_id}= Get Logical Device ID From SN ${olt_serial_number} |
| 210 | Set Suite Variable ${logical_id} |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 211 | |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame^] | 212 | Delete All Devices and Verify |
| 213 | [Documentation] Remove any devices from VOLTHA and ONOS |
| 214 | |
| 215 | # Clear devices from VOLTHA |
| 216 | Disable Devices In Voltha Root=true |
| 217 | Wait Until Keyword Succeeds ${timeout} 2s Test Devices Disabled In Voltha Root=true |
| 218 | Delete Devices In Voltha Root=true |
| 219 | Wait Until Keyword Succeeds ${timeout} 2s Test Empty Device List |
| 220 | |
| 221 | # Clear devices from ONOS |
| 222 | Remove All Devices From ONOS |
| 223 | ... http://karaf:karaf@${k8s_node_ip}:${ONOS_REST_PORT} |
| 224 | |
| 225 | Clear All Devices Then Create New Device |
| 226 | [Documentation] Remove any devices from VOLTHA and ONOS |
| 227 | |
| 228 | # Remove all devices from voltha and nos |
| 229 | Delete All Devices and Verify |
| 230 | |
| 231 | # Execute normal test Setup Keyword |
| 232 | Setup |
| 233 | |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 234 | Teardown |
| 235 | [Documentation] kills processes and cleans up interfaces on src+dst servers |
Suchitra Vemuri | 582574b | 2019-12-10 21:11:54 -0800 | [diff] [blame] | 236 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 237 | Run Keyword If ${external_libs} Log Kubernetes Containers Logs Since Time ${datetime} ${container_list} |
| 238 | |
| 239 | Collect Logs |
| 240 | [Documentation] Collect Logs from voltha and onos cli for various commands |
Suchitra Vemuri | 1a970a6 | 2019-11-26 12:52:16 -0800 | [diff] [blame] | 241 | Run Keyword and Ignore Error Get Device List from Voltha |
| 242 | Run Keyword and Ignore Error Get Device Output from Voltha ${olt_device_id} |
| 243 | Run Keyword and Ignore Error Get Logical Device Output from Voltha ${logical_id} |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 244 | Run Keyword If ${external_libs} Get ONOS Status ${k8s_node_ip} |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 245 | |
| 246 | Teardown Suite |
| 247 | [Documentation] Clean up device if desired |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame^] | 248 | Run Keyword If ${teardown_device} Delete All Devices and Verify |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 249 | |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 250 | Clean Up Linux |
| 251 | [Documentation] Kill processes and clean up interfaces on src+dst servers |
Suchitra Vemuri | 8a9c378 | 2019-10-23 12:43:01 -0700 | [diff] [blame] | 252 | FOR ${I} IN RANGE 0 ${num_onus} |
| 253 | ${src}= Set Variable ${hosts.src[${I}]} |
| 254 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 255 | Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']} |
| 256 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 257 | Run Keyword And Ignore Error Kill Linux Process [d]hclient ${src['ip']} |
| 258 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 259 | Run Keyword If '${dst['ip']}' != '${None}' Run Keyword And Ignore Error |
| 260 | ... Kill Linux Process [d]hcpd ${dst['ip']} ${dst['user']} |
| 261 | ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']} |
| 262 | Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']} |
| 263 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 264 | Run Keyword If '${dst['ip']}' != '${None}' Delete Interface on Remote Host |
| 265 | ... ${dst['dp_iface_name']}.${src['s_tag']} ${dst['ip']} ${dst['user']} ${dst['pass']} |
| 266 | ... ${dst['container_type']} ${dst['container_name']} |
| 267 | END |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 268 | |
| 269 | Delete Device and Verify |
| 270 | [Documentation] Disable -> Delete devices via voltctl and verify its removed |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 271 | ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id} |
| 272 | Should Be Equal As Integers ${rc} 0 |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 273 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE |
| 274 | ... ${olt_serial_number} |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 275 | ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device delete ${olt_device_id} |
| 276 | Should Be Equal As Integers ${rc} 0 |
| 277 | Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed ${olt_device_id} |
Suchitra Vemuri | b89b9ac | 2019-12-11 21:53:11 -0800 | [diff] [blame] | 278 | |
| 279 | Perform Sanity Test |
| 280 | [Documentation] This keyword performs Sanity Test Procedure |
| 281 | ... Sanity test performs authentication, dhcp and pings for all the ONUs given for the POD |
| 282 | ... This keyword can be used to call in any other tests where sanity check is required |
| 283 | ... and avoids duplication of code. |
| 284 | |
| 285 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number} |
| 286 | Set Global Variable ${of_id} |
| 287 | |
| 288 | FOR ${I} IN RANGE 0 ${num_onus} |
| 289 | ${src}= Set Variable ${hosts.src[${I}]} |
| 290 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 291 | |
| 292 | Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE |
| 293 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 294 | |
| 295 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 296 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 297 | ... ${of_id} |
| 298 | Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip} |
| 299 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 300 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True |
| 301 | ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']} |
| 302 | ... ${src['container_type']} ${src['container_name']} |
| 303 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip} |
| 304 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 305 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip} |
| 306 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 307 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 308 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 309 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 310 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 311 | ... ${dst['container_name']} |
| 312 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 313 | ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 314 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 315 | Run Keyword and Ignore Error Collect Logs |
| 316 | END |