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 | c5295a3 | 2019-12-15 20:32:04 -0800 | [diff] [blame] | 62 | Run Keyword If ${has_dataplane} Clean Up Linux |
Suchitra Vemuri | b89b9ac | 2019-12-11 21:53:11 -0800 | [diff] [blame] | 63 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
Suchitra Vemuri | 582574b | 2019-12-10 21:11:54 -0800 | [diff] [blame] | 64 | Run Keyword and Ignore Error Collect Logs |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 65 | |
Suchitra Vemuri | 6db8941 | 2019-11-14 14:52:54 -0800 | [diff] [blame] | 66 | Test Disable and Enable ONU |
| 67 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 68 | ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable |
| 69 | ... Perform disable on the ONUs and validate that the pings do not succeed |
| 70 | ... Perform enable on the ONUs and validate that the pings are successful |
Suchitra Vemuri | 582574b | 2019-12-10 21:11:54 -0800 | [diff] [blame] | 71 | [Tags] functional DisableEnableONU |
Suchitra Vemuri | 6db8941 | 2019-11-14 14:52:54 -0800 | [diff] [blame] | 72 | [Setup] None |
suraj gour | 7f6d5fe | 2019-11-29 10:56:35 +0000 | [diff] [blame] | 73 | [Teardown] None |
Suchitra Vemuri | 6db8941 | 2019-11-14 14:52:54 -0800 | [diff] [blame] | 74 | |
| 75 | FOR ${I} IN RANGE 0 ${num_onus} |
| 76 | ${src}= Set Variable ${hosts.src[${I}]} |
| 77 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 78 | |
| 79 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 80 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 81 | ... ${of_id} |
| 82 | Disable Device ${onu_device_id} |
| 83 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s Check Ping False ${dst['dp_iface_ip_qinq']} |
| 84 | ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 85 | Enable Device ${onu_device_id} |
| 86 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 87 | ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 88 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s Check Ping True ${dst['dp_iface_ip_qinq']} |
| 89 | ... ${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] | 90 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 91 | Run Keyword and Ignore Error Collect Logs |
Suchitra Vemuri | 6db8941 | 2019-11-14 14:52:54 -0800 | [diff] [blame] | 92 | END |
Suchitra Vemuri | 582574b | 2019-12-10 21:11:54 -0800 | [diff] [blame] | 93 | Run Keyword and Ignore Error Collect Logs |
Suchitra Vemuri | 6db8941 | 2019-11-14 14:52:54 -0800 | [diff] [blame] | 94 | |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 95 | Check OLT/ONU Authentication After Radius Pod Restart |
suraj gour | 7f6d5fe | 2019-11-29 10:56:35 +0000 | [diff] [blame] | 96 | [Documentation] After radius restart, triggers reassociation, checks status and |
| 97 | ... authentication, validates dhcp and ping. Note : wpa reassociate works only when |
| 98 | ... wpa supplicant is running in background hence it is recommended to remove |
| 99 | ... teardown from previous test or uncomment 'Teardown None'. |
| 100 | ... 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] | 101 | [Tags] functional RadiusRestart |
suraj gour | d5cfdbb | 2019-12-13 12:44:55 +0000 | [diff] [blame] | 102 | [Setup] None |
Suchitra Vemuri | bb00d9d | 2019-12-16 15:38:38 -0800 | [diff] [blame] | 103 | [Teardown] None |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 104 | Wait Until Keyword Succeeds ${timeout} 15s Restart Pod ${NAMESPACE} ${RESTART_POD_NAME} |
| 105 | |
| 106 | FOR ${I} IN RANGE 0 ${num_onus} |
| 107 | ${src}= Set Variable ${hosts.src[${I}]} |
| 108 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 109 | |
| 110 | |
| 111 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 112 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 113 | ... ${of_id} |
| 114 | Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip} |
| 115 | ... ${ONOS_SSH_PORT} ${onu_port} |
suraj gour | 7f6d5fe | 2019-11-29 10:56:35 +0000 | [diff] [blame] | 116 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication After Reassociate |
| 117 | ... True ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 118 | ... ${src['container_type']} ${src['container_name']} |
| 119 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip} |
| 120 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 121 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 122 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 123 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 124 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 125 | ... ${dst['container_name']} |
| 126 | Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure |
| 127 | ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
Suchitra Vemuri | 582574b | 2019-12-10 21:11:54 -0800 | [diff] [blame] | 128 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 129 | Run Keyword and Ignore Error Collect Logs |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 130 | END |
Suchitra Vemuri | 582574b | 2019-12-10 21:11:54 -0800 | [diff] [blame] | 131 | Run Keyword and Ignore Error Collect Logs |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 132 | |
suraj gour | d5cfdbb | 2019-12-13 12:44:55 +0000 | [diff] [blame] | 133 | Check DHCP attempt fails when subscriber is not added |
| 134 | [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and |
| 135 | ... when again added subscriber access, DHCP attempt, ping succeeds |
| 136 | ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable |
Suchitra Vemuri | bb00d9d | 2019-12-16 15:38:38 -0800 | [diff] [blame] | 137 | [Tags] functional SubsRemoveDHCP |
suraj gour | d5cfdbb | 2019-12-13 12:44:55 +0000 | [diff] [blame] | 138 | [Setup] None |
| 139 | #[Teardown] None |
| 140 | |
| 141 | FOR ${I} IN RANGE 0 ${num_onus} |
| 142 | ${src}= Set Variable ${hosts.src[${I}]} |
| 143 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 144 | |
| 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 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip} |
| 149 | ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port} |
| 150 | # For releasing IP, also deleting lease file. Hence passing path where DHCP Client program writes the lease |
| 151 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s |
| 152 | ... Send Dhclient Request To Release Assigned IP ${src['dp_iface_name']} ${src['ip']} |
| 153 | ... ${src['user']} /var/lib/dhcp ${src['pass']} ${src['container_type']} ${src['container_name']} |
suraj gour | 19ee3a8 | 2019-12-16 09:43:14 +0000 | [diff] [blame] | 154 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s |
| 155 | ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']} |
| 156 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
suraj gour | d5cfdbb | 2019-12-13 12:44:55 +0000 | [diff] [blame] | 157 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False |
| 158 | ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 159 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 160 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 161 | ... ${dst['container_name']} |
| 162 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip} |
| 163 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 164 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 165 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 166 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 167 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 168 | ... ${dst['container_name']} |
| 169 | END |
| 170 | Run Keyword and Ignore Error Collect Logs |
| 171 | |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 172 | Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart |
| 173 | [Documentation] Deploys an device instance and waits for it to authenticate. After |
| 174 | ... authentication is successful the rw-core deployment is scaled to 0 instances to |
| 175 | ... simulate a POD crash. The test then scales the rw-core back to a single instance |
| 176 | ... and configures ONOS for access. The test succeeds if the device is able to |
| 177 | ... complete the DHCP sequence. |
| 178 | [Tags] bbsim rwcore-restart |
| 179 | [Setup] Clear All Devices Then Create New Device |
| 180 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number} |
| 181 | Set Global Variable ${of_id} |
| 182 | |
| 183 | FOR ${I} IN RANGE 0 ${num_onus} |
| 184 | ${src}= Set Variable ${hosts.src[${I}]} |
| 185 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 186 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 187 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 188 | ... ${of_id} |
| 189 | |
| 190 | # Bring up the device and verify it authenticates |
| 191 | Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE |
| 192 | ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed |
| 193 | Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip} |
| 194 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 195 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True |
| 196 | ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']} |
| 197 | ... ${src['container_type']} ${src['container_name']} |
| 198 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip} |
| 199 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 200 | |
| 201 | # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1 |
| 202 | Scale K8s Deployment voltha voltha-rw-core 0 |
| 203 | Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-rw-core |
| 204 | # Ensure the ofagent POD goes "not-ready" as expected |
| 205 | Wait Until keyword Succeeds ${timeout} 2s Check Expected Available Deployment Replicas voltha voltha-ofagent 0 |
| 206 | # Scale up the core deployment and make sure both it and the ofagent deployment are back |
| 207 | Scale K8s Deployment voltha voltha-rw-core 1 |
| 208 | Wait Until Keyword Succeeds ${timeout} 2s Check Expected Available Deployment Replicas voltha voltha-rw-core 1 |
| 209 | Wait Until Keyword Succeeds ${timeout} 2s Check Expected Available Deployment Replicas voltha voltha-ofagent 1 |
| 210 | |
| 211 | # For some reason scaling down and up the POD behind a service causes the port forward to stop working, |
| 212 | # so restart the port forwarding for the API service |
| 213 | Restart VOLTHA Port Foward voltha-api-minimal |
| 214 | |
| 215 | # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this |
| 216 | # represents system connectivity being restored |
| 217 | Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS |
| 218 | ... http://karaf:karaf@${k8s_node_ip}:${ONOS_REST_PORT} ${of_id} |
| 219 | |
| 220 | # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly |
| 221 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip} |
| 222 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 223 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 224 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 225 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 226 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 227 | ... ${dst['container_name']} |
| 228 | Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure |
| 229 | ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 230 | END |
| 231 | |
Torsten Thieme | 4d5171f | 2019-12-06 00:53:44 +0000 | [diff] [blame^] | 232 | Test Disable and Enable ONU scenario for ATT workflow |
| 233 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 234 | ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable |
| 235 | ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed |
| 236 | ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and validate that the pings are successful |
| 237 | ... VOL-2284 |
| 238 | [Tags] functional test4 |
| 239 | [Setup] None |
| 240 | #[Teardown] None |
| 241 | |
| 242 | FOR ${I} IN RANGE 0 ${num_onus} |
| 243 | ${src}= Set Variable ${hosts.src[${I}]} |
| 244 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 245 | |
| 246 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 247 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 248 | ... ${of_id} |
| 249 | Disable Device ${onu_device_id} |
| 250 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip} |
| 251 | ... ${ONOS_SSH_PORT} volt-remove-subscriber ${of_id} ${onu_port} |
| 252 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s Check Ping False ${dst['dp_iface_ip_qinq']} |
| 253 | ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 254 | ... ELSE sleep 60s |
| 255 | Enable Device ${onu_device_id} |
| 256 | Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip} |
| 257 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 258 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication After Reassociate |
| 259 | ... True ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} |
| 260 | ... ${src['container_type']} ${src['container_name']} |
| 261 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip} |
| 262 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 263 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip} |
| 264 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 265 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 266 | ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 267 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s Check Ping True ${dst['dp_iface_ip_qinq']} |
| 268 | ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 269 | END |
| 270 | |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 271 | *** Keywords *** |
| 272 | Setup Suite |
Andy Bavier | 88cd9f6 | 2019-11-26 16:22:33 -0700 | [diff] [blame] | 273 | [Documentation] Set up the test suite |
| 274 | Common Test Suite Setup |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 275 | |
| 276 | Setup |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 277 | [Documentation] Pre-test Setup |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 278 | #test for empty device list |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 279 | Test Empty Device List |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 280 | #create/preprovision device |
Suchitra Vemuri | c59eb27 | 2019-09-18 17:59:33 -0700 | [diff] [blame] | 281 | ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT} |
| 282 | Set Suite Variable ${olt_device_id} |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 283 | #validate olt states |
| 284 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN |
| 285 | ... ${EMPTY} ${olt_device_id} |
Suchitra Vemuri | c59eb27 | 2019-09-18 17:59:33 -0700 | [diff] [blame] | 286 | Enable Device ${olt_device_id} |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 287 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE |
| 288 | ... ${olt_serial_number} |
Suchitra Vemuri | 00d147d | 2019-09-13 13:07:32 -0700 | [diff] [blame] | 289 | ${logical_id}= Get Logical Device ID From SN ${olt_serial_number} |
| 290 | Set Suite Variable ${logical_id} |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 291 | |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 292 | Delete All Devices and Verify |
| 293 | [Documentation] Remove any devices from VOLTHA and ONOS |
| 294 | |
| 295 | # Clear devices from VOLTHA |
| 296 | Disable Devices In Voltha Root=true |
| 297 | Wait Until Keyword Succeeds ${timeout} 2s Test Devices Disabled In Voltha Root=true |
| 298 | Delete Devices In Voltha Root=true |
| 299 | Wait Until Keyword Succeeds ${timeout} 2s Test Empty Device List |
| 300 | |
| 301 | # Clear devices from ONOS |
| 302 | Remove All Devices From ONOS |
| 303 | ... http://karaf:karaf@${k8s_node_ip}:${ONOS_REST_PORT} |
| 304 | |
| 305 | Clear All Devices Then Create New Device |
| 306 | [Documentation] Remove any devices from VOLTHA and ONOS |
| 307 | |
| 308 | # Remove all devices from voltha and nos |
| 309 | Delete All Devices and Verify |
| 310 | |
| 311 | # Execute normal test Setup Keyword |
| 312 | Setup |
| 313 | |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 314 | Teardown |
| 315 | [Documentation] kills processes and cleans up interfaces on src+dst servers |
Suchitra Vemuri | 582574b | 2019-12-10 21:11:54 -0800 | [diff] [blame] | 316 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 317 | Run Keyword If ${external_libs} Log Kubernetes Containers Logs Since Time ${datetime} ${container_list} |
| 318 | |
| 319 | Collect Logs |
| 320 | [Documentation] Collect Logs from voltha and onos cli for various commands |
Suchitra Vemuri | 1a970a6 | 2019-11-26 12:52:16 -0800 | [diff] [blame] | 321 | Run Keyword and Ignore Error Get Device List from Voltha |
| 322 | Run Keyword and Ignore Error Get Device Output from Voltha ${olt_device_id} |
| 323 | 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] | 324 | Run Keyword If ${external_libs} Get ONOS Status ${k8s_node_ip} |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 325 | |
| 326 | Teardown Suite |
| 327 | [Documentation] Clean up device if desired |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 328 | Run Keyword If ${teardown_device} Delete All Devices and Verify |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 329 | |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 330 | Clean Up Linux |
| 331 | [Documentation] Kill processes and clean up interfaces on src+dst servers |
Suchitra Vemuri | 8a9c378 | 2019-10-23 12:43:01 -0700 | [diff] [blame] | 332 | FOR ${I} IN RANGE 0 ${num_onus} |
| 333 | ${src}= Set Variable ${hosts.src[${I}]} |
| 334 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 335 | Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']} |
| 336 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 337 | Run Keyword And Ignore Error Kill Linux Process [d]hclient ${src['ip']} |
| 338 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 339 | Run Keyword If '${dst['ip']}' != '${None}' Run Keyword And Ignore Error |
| 340 | ... Kill Linux Process [d]hcpd ${dst['ip']} ${dst['user']} |
| 341 | ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']} |
| 342 | Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']} |
| 343 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 344 | Run Keyword If '${dst['ip']}' != '${None}' Delete Interface on Remote Host |
| 345 | ... ${dst['dp_iface_name']}.${src['s_tag']} ${dst['ip']} ${dst['user']} ${dst['pass']} |
| 346 | ... ${dst['container_type']} ${dst['container_name']} |
| 347 | END |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 348 | |
| 349 | Delete Device and Verify |
| 350 | [Documentation] Disable -> Delete devices via voltctl and verify its removed |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 351 | ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id} |
| 352 | Should Be Equal As Integers ${rc} 0 |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 353 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE |
| 354 | ... ${olt_serial_number} |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 355 | ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device delete ${olt_device_id} |
| 356 | Should Be Equal As Integers ${rc} 0 |
| 357 | Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed ${olt_device_id} |
Suchitra Vemuri | b89b9ac | 2019-12-11 21:53:11 -0800 | [diff] [blame] | 358 | |
| 359 | Perform Sanity Test |
| 360 | [Documentation] This keyword performs Sanity Test Procedure |
| 361 | ... Sanity test performs authentication, dhcp and pings for all the ONUs given for the POD |
| 362 | ... This keyword can be used to call in any other tests where sanity check is required |
| 363 | ... and avoids duplication of code. |
| 364 | |
| 365 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number} |
| 366 | Set Global Variable ${of_id} |
| 367 | |
| 368 | FOR ${I} IN RANGE 0 ${num_onus} |
| 369 | ${src}= Set Variable ${hosts.src[${I}]} |
| 370 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 371 | |
| 372 | Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE |
| 373 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 374 | |
| 375 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 376 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 377 | ... ${of_id} |
| 378 | Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip} |
| 379 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 380 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True |
| 381 | ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']} |
| 382 | ... ${src['container_type']} ${src['container_name']} |
| 383 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip} |
| 384 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 385 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip} |
| 386 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 387 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 388 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 389 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 390 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 391 | ... ${dst['container_name']} |
| 392 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 393 | ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 394 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 395 | Run Keyword and Ignore Error Collect Logs |
| 396 | END |