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. |
Matteo Scandolo | 1294aeb | 2019-09-24 16:20:32 -0700 | [diff] [blame] | 14 | # FIXME Can we use the same test against BBSim and Hardware? |
| 15 | |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 16 | *** Settings *** |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 17 | Documentation Test various end-to-end scenarios |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 18 | Suite Setup Setup Suite |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 19 | Test Setup Setup |
| 20 | Test Teardown Teardown |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 21 | Suite Teardown Teardown Suite |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 22 | Library Collections |
| 23 | Library String |
| 24 | Library OperatingSystem |
| 25 | Library XML |
| 26 | Library RequestsLibrary |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 27 | Library ../../libraries/DependencyLibrary.py |
Suchitra Vemuri | b8ed2d5 | 2019-09-30 13:22:51 -0700 | [diff] [blame] | 28 | Resource ../../libraries/onos.robot |
| 29 | Resource ../../libraries/voltctl.robot |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 30 | Resource ../../libraries/voltha.robot |
Suchitra Vemuri | b8ed2d5 | 2019-09-30 13:22:51 -0700 | [diff] [blame] | 31 | Resource ../../libraries/utils.robot |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 32 | Resource ../../libraries/k8s.robot |
Suchitra Vemuri | b8ed2d5 | 2019-09-30 13:22:51 -0700 | [diff] [blame] | 33 | Resource ../../variables/variables.robot |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 34 | |
| 35 | *** Variables *** |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 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 |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 43 | ${NAMESPACE} voltha |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 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 |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 46 | ${RESTART_POD_NAME} radius |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 47 | ${timeout} 60s |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 48 | ${of_id} 0 |
| 49 | ${logical_id} 0 |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 50 | ${has_dataplane} True |
| 51 | ${external_libs} True |
| 52 | ${teardown_device} False |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 53 | ${scripts} ../../scripts |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 54 | |
| 55 | *** Test Cases *** |
| 56 | Sanity E2E Test for OLT/ONU on POD |
| 57 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 58 | ... 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] | 59 | [Tags] sanity test1 |
Suchitra Vemuri | 6db8941 | 2019-11-14 14:52:54 -0800 | [diff] [blame] | 60 | [Teardown] NONE |
Suchitra Vemuri | c5295a3 | 2019-12-15 20:32:04 -0800 | [diff] [blame] | 61 | Run Keyword If ${has_dataplane} Clean Up Linux |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [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 | 04245f7 | 2020-01-08 16:43:24 -0800 | [diff] [blame] | 70 | [Tags] functional DisableEnableONU released |
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 | FOR ${I} IN RANGE 0 ${num_onus} |
| 74 | ${src}= Set Variable ${hosts.src[${I}]} |
| 75 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Suchitra Vemuri | 6db8941 | 2019-11-14 14:52:54 -0800 | [diff] [blame] | 76 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 77 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 78 | ... ${of_id} |
| 79 | Disable Device ${onu_device_id} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 80 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s |
| 81 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 82 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Suchitra Vemuri | 6db8941 | 2019-11-14 14:52:54 -0800 | [diff] [blame] | 83 | Enable Device ${onu_device_id} |
| 84 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 85 | ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 86 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s |
| 87 | ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 88 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 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 |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 92 | Run Keyword and Ignore Error Collect Logs |
Suchitra Vemuri | 6db8941 | 2019-11-14 14:52:54 -0800 | [diff] [blame] | 93 | |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 94 | Test Subscriber Delete and Add |
| 95 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 96 | ... Assuming that all the ONUs are authenticated/DHCP/pingable |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 97 | ... Delete a subscriber and validate that the pings do not succeed |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 98 | ... Re-add the subscriber and validate that the pings are successful |
Suchitra Vemuri | 04245f7 | 2020-01-08 16:43:24 -0800 | [diff] [blame] | 99 | [Tags] functional SubAddDelete released |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 100 | [Setup] None |
| 101 | [Teardown] None |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 102 | FOR ${I} IN RANGE 0 ${num_onus} |
| 103 | ${src}= Set Variable ${hosts.src[${I}]} |
| 104 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 105 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 106 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 107 | ... ${of_id} |
| 108 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip} |
| 109 | ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port} |
| 110 | Sleep 10s |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 111 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s |
| 112 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 113 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 114 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip} |
| 115 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 116 | Sleep 10s |
| 117 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 118 | ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 119 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s |
| 120 | ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 121 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 122 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 123 | Run Keyword and Ignore Error Collect Logs |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 124 | END |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 125 | Run Keyword and Ignore Error Collect Logs |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 126 | |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 127 | Check OLT/ONU Authentication After Radius Pod Restart |
suraj gour | 7f6d5fe | 2019-11-29 10:56:35 +0000 | [diff] [blame] | 128 | [Documentation] After radius restart, triggers reassociation, checks status and |
| 129 | ... authentication, validates dhcp and ping. Note : wpa reassociate works only when |
| 130 | ... wpa supplicant is running in background hence it is recommended to remove |
| 131 | ... teardown from previous test or uncomment 'Teardown None'. |
| 132 | ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable |
Suchitra Vemuri | 04245f7 | 2020-01-08 16:43:24 -0800 | [diff] [blame] | 133 | [Tags] functional RadiusRestart released |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 134 | [Setup] None |
| 135 | [Teardown] None |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 136 | Wait Until Keyword Succeeds ${timeout} 15s Restart Pod ${NAMESPACE} ${RESTART_POD_NAME} |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 137 | FOR ${I} IN RANGE 0 ${num_onus} |
| 138 | ${src}= Set Variable ${hosts.src[${I}]} |
| 139 | ${dst}= Set Variable ${hosts.dst[${I}]} |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 140 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 141 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s |
| 142 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 143 | Wait Until Keyword Succeeds ${timeout} 2s |
| 144 | ... Verify Eapol Flows Added For ONU ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 145 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 146 | ... Validate Authentication After Reassociate True ${src['dp_iface_name']} |
| 147 | ... ${src['ip']} ${src['user']} ${src['pass']} |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 148 | ... ${src['container_type']} ${src['container_name']} |
| 149 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 150 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 151 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 152 | ... Validate DHCP and Ping True True ${src['dp_iface_name']} |
| 153 | ... ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 154 | ... ${src['ip']} ${src['user']} ${src['pass']} |
| 155 | ... ${src['container_type']} ${src['container_name']} |
| 156 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} |
| 157 | ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']} |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 158 | Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure |
| 159 | ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 160 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 161 | Run Keyword and Ignore Error Collect Logs |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 162 | END |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 163 | Run Keyword and Ignore Error Collect Logs |
suraj gour | d64356b | 2019-11-07 13:26:20 +0000 | [diff] [blame] | 164 | |
suraj gour | d5cfdbb | 2019-12-13 12:44:55 +0000 | [diff] [blame] | 165 | Check DHCP attempt fails when subscriber is not added |
| 166 | [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and |
| 167 | ... when again added subscriber access, DHCP attempt, ping succeeds |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 168 | ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable |
Suchitra Vemuri | 04245f7 | 2020-01-08 16:43:24 -0800 | [diff] [blame] | 169 | [Tags] functional SubsRemoveDHCP released |
suraj gour | d5cfdbb | 2019-12-13 12:44:55 +0000 | [diff] [blame] | 170 | [Setup] None |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 171 | [Teardown] None |
suraj gour | d5cfdbb | 2019-12-13 12:44:55 +0000 | [diff] [blame] | 172 | FOR ${I} IN RANGE 0 ${num_onus} |
| 173 | ${src}= Set Variable ${hosts.src[${I}]} |
| 174 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 175 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
suraj gour | d5cfdbb | 2019-12-13 12:44:55 +0000 | [diff] [blame] | 176 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 177 | ... ${of_id} |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 178 | Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']} |
| 179 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 180 | Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']} |
| 181 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
suraj gour | d5cfdbb | 2019-12-13 12:44:55 +0000 | [diff] [blame] | 182 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip} |
| 183 | ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 184 | Sleep 5s |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 185 | Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']} |
| 186 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 187 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s |
| 188 | ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']} |
| 189 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 190 | Run Keyword And Ignore Error Login And Run Command On Remote System |
| 191 | ... ifconfig | grep -A 10 ens ${src['ip']} |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 192 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
suraj gour | d5cfdbb | 2019-12-13 12:44:55 +0000 | [diff] [blame] | 193 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False |
| 194 | ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 195 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 196 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 197 | ... ${dst['container_name']} |
| 198 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip} |
| 199 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 200 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 201 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 202 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 203 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 204 | ... ${dst['container_name']} |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 205 | Run Keyword and Ignore Error Collect Logs |
| 206 | END |
| 207 | Run Keyword and Ignore Error Collect Logs |
| 208 | |
suraj gour | 1ecfae9 | 2019-12-20 15:11:40 +0000 | [diff] [blame] | 209 | Check ONU adapter crash not forcing authentication again |
| 210 | [Documentation] After ONU adapter restart, checks wpa log for 'authentication started' |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 211 | ... message count to make sure auth not started again and validates EAP status and ping. |
suraj gour | 1ecfae9 | 2019-12-20 15:11:40 +0000 | [diff] [blame] | 212 | ... Assuming that test1 or sanity was executed where all the ONUs are authenticated/DHCP/pingable |
Suchitra Vemuri | 04245f7 | 2020-01-08 16:43:24 -0800 | [diff] [blame] | 213 | [Tags] functional ONUAdaptCrash notready |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 214 | [Setup] None |
| 215 | [Teardown] None |
suraj gour | 1ecfae9 | 2019-12-20 15:11:40 +0000 | [diff] [blame] | 216 | @{before_list}= Create List |
| 217 | @{after_list}= Create List |
| 218 | FOR ${I} IN RANGE 0 ${num_onus} |
| 219 | ${src}= Set Variable ${hosts.src[${I}]} |
| 220 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 221 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 222 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 223 | ... ${of_id} |
| 224 | ${before}= Run Keyword If ${has_dataplane} Check Remote File Contents For WPA Logs |
| 225 | ... True /tmp/wpa.log authentication started ${src['ip']} ${src['user']} ${src['pass']} |
| 226 | ... ${src['container_type']} ${src['container_name']} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 227 | Append To List ${before_list} ${before} |
suraj gour | 1ecfae9 | 2019-12-20 15:11:40 +0000 | [diff] [blame] | 228 | END |
| 229 | Wait Until Keyword Succeeds ${timeout} 15s Restart Pod ${NAMESPACE} adapter-open-onu |
| 230 | Wait Until Keyword Succeeds ${timeout} 2s Validate Pod Status ${podName} ${NAMESPACE} |
| 231 | ... Running |
| 232 | FOR ${I} IN RANGE 0 ${num_onus} |
| 233 | ${src}= Set Variable ${hosts.src[${I}]} |
| 234 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 235 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 236 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 237 | ... ${of_id} |
| 238 | ${after}= Run Keyword If ${has_dataplane} Check Remote File Contents For WPA Logs |
| 239 | ... True /tmp/wpa.log authentication started ${src['ip']} ${src['user']} ${src['pass']} |
| 240 | ... ${src['container_type']} ${src['container_name']} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 241 | Append To List ${after_list} ${after} |
| 242 | ${output}= Run Keyword If ${has_dataplane} Login And Run Command On Remote System |
| 243 | ... wpa_cli status | grep SUCCESS ${src['ip']} ${src['user']} ${src['pass']} |
| 244 | ... ${src['container_type']} ${src['container_name']} |
| 245 | Should Contain ${output} SUCCESS |
| 246 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 247 | ... Wait Until Keyword Succeeds 60s 2s Check Ping |
suraj gour | 1ecfae9 | 2019-12-20 15:11:40 +0000 | [diff] [blame] | 248 | ... True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']} ${src['user']} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 249 | ... ${src['pass']} ${src['container_type']} ${src['container_name']} |
suraj gour | 1ecfae9 | 2019-12-20 15:11:40 +0000 | [diff] [blame] | 250 | END |
| 251 | Lists Should Be Equal ${after_list} ${before_list} |
| 252 | Log ${after_list} |
| 253 | Log ${before_list} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 254 | Run Keyword and Ignore Error Collect Logs |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 255 | |
| 256 | Test Disable and Enable ONU scenario for ATT workflow |
| 257 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 258 | ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable |
| 259 | ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 260 | ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and |
| 261 | ... validate that the pings are successful |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 262 | ... VOL-2284 |
Suchitra Vemuri | 04245f7 | 2020-01-08 16:43:24 -0800 | [diff] [blame] | 263 | [Tags] functional ATT_DisableEnableONU |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 264 | [Setup] None |
| 265 | #[Teardown] None |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 266 | FOR ${I} IN RANGE 0 ${num_onus} |
| 267 | ${src}= Set Variable ${hosts.src[${I}]} |
| 268 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 269 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 270 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 271 | ... ${of_id} |
| 272 | Disable Device ${onu_device_id} |
Suchitra Vemuri | 04245f7 | 2020-01-08 16:43:24 -0800 | [diff] [blame] | 273 | Sleep 5s |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 274 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip} |
| 275 | ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 276 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 277 | ... Wait Until Keyword Succeeds 60s 2s Check Ping |
| 278 | ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 279 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 280 | ... ELSE sleep 60s |
| 281 | Enable Device ${onu_device_id} |
| 282 | Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip} |
| 283 | ... ${ONOS_SSH_PORT} ${onu_port} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 284 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 285 | ... Validate Authentication After Reassociate True |
| 286 | ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 287 | ... ${src['container_type']} ${src['container_name']} |
| 288 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 289 | ... ${ONOS_SSH_PORT} ${onu_port} |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 290 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip} |
| 291 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 292 | Sleep 10s |
| 293 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
Andy Bavier | 08ae585 | 2019-12-19 09:12:42 -0700 | [diff] [blame] | 294 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 295 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 296 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 297 | ... ${dst['container_name']} |
| 298 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 299 | ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
Suchitra Vemuri | 5994cd1 | 2019-12-17 22:20:55 -0800 | [diff] [blame] | 300 | Run Keyword and Ignore Error Collect Logs |
suraj gour | d5cfdbb | 2019-12-13 12:44:55 +0000 | [diff] [blame] | 301 | END |
| 302 | Run Keyword and Ignore Error Collect Logs |
| 303 | |
Gayathri.Selvan | 4939896 | 2020-01-13 07:19:12 +0000 | [diff] [blame] | 304 | Verify restart any container after VOLTHA is operational |
| 305 | [Documentation] Restart any container after VOLTHA is operational. |
| 306 | ... Prerequisite : ONUs are authenticated and pingable. |
Suchitra Vemuri | d1e2b71 | 2020-01-13 23:06:22 -0800 | [diff] [blame] | 307 | [Tags] functional VOL-1958 RestartPods |
Gayathri.Selvan | 4939896 | 2020-01-13 07:19:12 +0000 | [diff] [blame] | 308 | [Setup] NONE |
| 309 | [Teardown] NONE |
| 310 | ${waitforRestart} Set Variable 120s |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 311 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
Gayathri.Selvan | 4939896 | 2020-01-13 07:19:12 +0000 | [diff] [blame] | 312 | Log ${podStatusOutput} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 313 | ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
Gayathri.Selvan | 4939896 | 2020-01-13 07:19:12 +0000 | [diff] [blame] | 314 | ${podName} Set Variable adapter-open-olt |
| 315 | Restart Pod ${NAMESPACE} ${podName} |
| 316 | Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ${podName} ${NAMESPACE} |
| 317 | ... Running |
| 318 | Repeat Sanity Test |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 319 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
Gayathri.Selvan | 4939896 | 2020-01-13 07:19:12 +0000 | [diff] [blame] | 320 | Log ${podStatusOutput} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 321 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
Gayathri.Selvan | 4939896 | 2020-01-13 07:19:12 +0000 | [diff] [blame] | 322 | Should Be Equal As Strings ${countAfterRestart} ${countBforRestart} |
| 323 | Log to console Pod ${podName} restarted and sanity checks passed successfully |
| 324 | |
Suchitra Vemuri | 937cd39 | 2020-01-12 17:10:42 -0800 | [diff] [blame] | 325 | Delete OLT, ReAdd OLT and Perform Sanity Test |
| 326 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 327 | ... Disable and Delete the OLT |
| 328 | ... Create/Enable the same OLT again |
| 329 | ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT |
| 330 | [Tags] functional DeleteOLT |
| 331 | [Setup] None |
| 332 | [Teardown] NONE |
| 333 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 334 | Run Keyword If ${has_dataplane} Delete Device and Verify |
| 335 | Run Keyword and Ignore Error Collect Logs |
| 336 | # Recreate the OLT |
| 337 | Run Keyword If ${has_dataplane} Setup |
| 338 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 339 | Run Keyword and Ignore Error Collect Logs |
| 340 | |
Hema | e6d223d | 2019-12-30 19:21:26 +0530 | [diff] [blame] | 341 | Adding the same OLT after enabling the device |
| 342 | [Documentation] Create OLT, enable it, Create the same OLT again and Check for the Error message |
| 343 | [Tags] VOL-2406 AddEnableOLT_AddTheSameOLTAgain notready |
| 344 | [Setup] Delete Device and Verify |
| 345 | [Teardown] None |
| 346 | Run Keyword If ${has_dataplane} Sleep 180s |
| 347 | #create/preprovision device |
| 348 | ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT} |
| 349 | Set Suite Variable ${olt_device_id} |
| 350 | #validate olt states |
| 351 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN |
| 352 | ... ${EMPTY} ${olt_device_id} |
| 353 | #Enable the created OLT device |
| 354 | Enable Device ${olt_device_id} |
| 355 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE |
| 356 | ... ${olt_serial_number} |
| 357 | #Create the same OLT again |
| 358 | ${rc} ${output}= Run and Return Rc and Output |
| 359 | ... ${VOLTCTL_CONFIG}; voltctl device create -t openolt -H ${olt_ip}:${OLT_PORT} |
| 360 | Should Not Be Equal As Integers ${rc} 0 |
| 361 | Log ${output} |
| 362 | Should Contain '${output}' 'ERROR: UNKNOWN: Device is already pre-provisioned' |
| 363 | Log "This OLT is added already and enabled" |
| 364 | |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 365 | Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart |
| 366 | [Documentation] Deploys an device instance and waits for it to authenticate. After |
| 367 | ... authentication is successful the rw-core deployment is scaled to 0 instances to |
| 368 | ... simulate a POD crash. The test then scales the rw-core back to a single instance |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 369 | ... and configures ONOS for access. The test succeeds if the device is able to |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 370 | ... complete the DHCP sequence. |
| 371 | [Tags] bbsim rwcore-restart |
| 372 | [Setup] Clear All Devices Then Create New Device |
| 373 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number} |
| 374 | Set Global Variable ${of_id} |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 375 | FOR ${I} IN RANGE 0 ${num_onus} |
| 376 | ${src}= Set Variable ${hosts.src[${I}]} |
| 377 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 378 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 379 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 380 | ... ${of_id} |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 381 | # Bring up the device and verify it authenticates |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 382 | Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 383 | ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed |
| 384 | Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip} |
| 385 | ... ${ONOS_SSH_PORT} ${onu_port} |
| 386 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True |
| 387 | ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']} |
| 388 | ... ${src['container_type']} ${src['container_name']} |
| 389 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 390 | ... ${ONOS_SSH_PORT} ${onu_port} |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 391 | # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1 |
| 392 | Scale K8s Deployment voltha voltha-rw-core 0 |
| 393 | Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-rw-core |
| 394 | # Ensure the ofagent POD goes "not-ready" as expected |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 395 | Wait Until keyword Succeeds ${timeout} 2s |
| 396 | ... Check Expected Available Deployment Replicas voltha voltha-ofagent 0 |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 397 | # Scale up the core deployment and make sure both it and the ofagent deployment are back |
| 398 | Scale K8s Deployment voltha voltha-rw-core 1 |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 399 | Wait Until Keyword Succeeds ${timeout} 2s |
| 400 | ... Check Expected Available Deployment Replicas voltha voltha-rw-core 1 |
| 401 | Wait Until Keyword Succeeds ${timeout} 2s |
| 402 | ... Check Expected Available Deployment Replicas voltha voltha-ofagent 1 |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 403 | # For some reason scaling down and up the POD behind a service causes the port forward to stop working, |
| 404 | # so restart the port forwarding for the API service |
| 405 | Restart VOLTHA Port Foward voltha-api-minimal |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 406 | # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this |
| 407 | # represents system connectivity being restored |
| 408 | Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS |
| 409 | ... http://karaf:karaf@${k8s_node_ip}:${ONOS_REST_PORT} ${of_id} |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 410 | # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly |
| 411 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip} |
| 412 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 413 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 414 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 415 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 416 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 417 | ... ${dst['container_name']} |
| 418 | Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure |
| 419 | ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 420 | END |
| 421 | |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 422 | *** Keywords *** |
| 423 | Setup Suite |
Andy Bavier | 88cd9f6 | 2019-11-26 16:22:33 -0700 | [diff] [blame] | 424 | [Documentation] Set up the test suite |
| 425 | Common Test Suite Setup |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 426 | |
| 427 | Setup |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 428 | [Documentation] Pre-test Setup |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 429 | #test for empty device list |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 430 | Test Empty Device List |
Suchitra Vemuri | 937cd39 | 2020-01-12 17:10:42 -0800 | [diff] [blame] | 431 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s Openolt is Up |
| 432 | ... ${olt_ip} ${olt_user} ${olt_pass} |
| 433 | Sleep 60s |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 434 | #create/preprovision device |
Suchitra Vemuri | c59eb27 | 2019-09-18 17:59:33 -0700 | [diff] [blame] | 435 | ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT} |
| 436 | Set Suite Variable ${olt_device_id} |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 437 | #validate olt states |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 438 | Wait Until Keyword Succeeds ${timeout} 5s |
| 439 | ... Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN ${EMPTY} ${olt_device_id} |
Suchitra Vemuri | c59eb27 | 2019-09-18 17:59:33 -0700 | [diff] [blame] | 440 | Enable Device ${olt_device_id} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 441 | Wait Until Keyword Succeeds ${timeout} 5s |
| 442 | ... Validate OLT Device ENABLED ACTIVE REACHABLE ${olt_serial_number} |
Suchitra Vemuri | 00d147d | 2019-09-13 13:07:32 -0700 | [diff] [blame] | 443 | ${logical_id}= Get Logical Device ID From SN ${olt_serial_number} |
| 444 | Set Suite Variable ${logical_id} |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 445 | |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 446 | Delete All Devices and Verify |
| 447 | [Documentation] Remove any devices from VOLTHA and ONOS |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 448 | # Clear devices from VOLTHA |
| 449 | Disable Devices In Voltha Root=true |
| 450 | Wait Until Keyword Succeeds ${timeout} 2s Test Devices Disabled In Voltha Root=true |
| 451 | Delete Devices In Voltha Root=true |
| 452 | Wait Until Keyword Succeeds ${timeout} 2s Test Empty Device List |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 453 | # Clear devices from ONOS |
| 454 | Remove All Devices From ONOS |
| 455 | ... http://karaf:karaf@${k8s_node_ip}:${ONOS_REST_PORT} |
| 456 | |
| 457 | Clear All Devices Then Create New Device |
| 458 | [Documentation] Remove any devices from VOLTHA and ONOS |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 459 | # Remove all devices from voltha and nos |
| 460 | Delete All Devices and Verify |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 461 | # Execute normal test Setup Keyword |
| 462 | Setup |
| 463 | |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 464 | Teardown |
| 465 | [Documentation] kills processes and cleans up interfaces on src+dst servers |
Suchitra Vemuri | 582574b | 2019-12-10 21:11:54 -0800 | [diff] [blame] | 466 | Run Keyword If ${has_dataplane} Clean Up Linux |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 467 | Run Keyword If ${external_libs} Log Kubernetes Containers |
| 468 | ... Logs Since Time ${datetime} ${container_list} |
Suchitra Vemuri | 582574b | 2019-12-10 21:11:54 -0800 | [diff] [blame] | 469 | |
| 470 | Collect Logs |
| 471 | [Documentation] Collect Logs from voltha and onos cli for various commands |
Suchitra Vemuri | 1a970a6 | 2019-11-26 12:52:16 -0800 | [diff] [blame] | 472 | Run Keyword and Ignore Error Get Device List from Voltha |
| 473 | Run Keyword and Ignore Error Get Device Output from Voltha ${olt_device_id} |
| 474 | 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] | 475 | Run Keyword If ${external_libs} Get ONOS Status ${k8s_node_ip} |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 476 | |
| 477 | Teardown Suite |
| 478 | [Documentation] Clean up device if desired |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 479 | Run Keyword If ${teardown_device} Delete All Devices and Verify |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 480 | |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 481 | Clean Up Linux |
| 482 | [Documentation] Kill processes and clean up interfaces on src+dst servers |
Suchitra Vemuri | 8a9c378 | 2019-10-23 12:43:01 -0700 | [diff] [blame] | 483 | FOR ${I} IN RANGE 0 ${num_onus} |
| 484 | ${src}= Set Variable ${hosts.src[${I}]} |
| 485 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 486 | Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']} |
| 487 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 488 | Run Keyword And Ignore Error Kill Linux Process [d]hclient ${src['ip']} |
| 489 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 490 | Run Keyword If '${dst['ip']}' != '${None}' Run Keyword And Ignore Error |
| 491 | ... Kill Linux Process [d]hcpd ${dst['ip']} ${dst['user']} |
| 492 | ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']} |
| 493 | Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']} |
| 494 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 495 | Run Keyword If '${dst['ip']}' != '${None}' Delete Interface on Remote Host |
| 496 | ... ${dst['dp_iface_name']}.${src['s_tag']} ${dst['ip']} ${dst['user']} ${dst['pass']} |
| 497 | ... ${dst['container_type']} ${dst['container_name']} |
| 498 | END |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 499 | |
| 500 | Delete Device and Verify |
| 501 | [Documentation] Disable -> Delete devices via voltctl and verify its removed |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 502 | ${rc} ${output}= Run and Return Rc and Output |
| 503 | ... ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id} |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 504 | Should Be Equal As Integers ${rc} 0 |
Suchitra Vemuri | 937cd39 | 2020-01-12 17:10:42 -0800 | [diff] [blame] | 505 | Sleep 5s |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 506 | Wait Until Keyword Succeeds ${timeout} 5s |
| 507 | ... Validate OLT Device DISABLED UNKNOWN REACHABLE ${olt_serial_number} |
| 508 | ${rc} ${output}= Run and Return Rc and Output |
| 509 | ... ${VOLTCTL_CONFIG}; voltctl device delete ${olt_device_id} |
Andy Bavier | ba9866b | 2019-10-11 07:11:53 -0700 | [diff] [blame] | 510 | Should Be Equal As Integers ${rc} 0 |
| 511 | Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed ${olt_device_id} |
Suchitra Vemuri | b89b9ac | 2019-12-11 21:53:11 -0800 | [diff] [blame] | 512 | |
| 513 | Perform Sanity Test |
| 514 | [Documentation] This keyword performs Sanity Test Procedure |
| 515 | ... Sanity test performs authentication, dhcp and pings for all the ONUs given for the POD |
| 516 | ... This keyword can be used to call in any other tests where sanity check is required |
| 517 | ... and avoids duplication of code. |
Suchitra Vemuri | b89b9ac | 2019-12-11 21:53:11 -0800 | [diff] [blame] | 518 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number} |
| 519 | Set Global Variable ${of_id} |
Suchitra Vemuri | b89b9ac | 2019-12-11 21:53:11 -0800 | [diff] [blame] | 520 | FOR ${I} IN RANGE 0 ${num_onus} |
| 521 | ${src}= Set Variable ${hosts.src[${I}]} |
| 522 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Suchitra Vemuri | 50aa980 | 2019-12-20 14:25:46 -0800 | [diff] [blame] | 523 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 524 | ... ENABLED ACTIVE REACHABLE |
Suchitra Vemuri | b89b9ac | 2019-12-11 21:53:11 -0800 | [diff] [blame] | 525 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
Suchitra Vemuri | b89b9ac | 2019-12-11 21:53:11 -0800 | [diff] [blame] | 526 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 527 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 528 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 529 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 530 | ... Verify Eapol Flows Added For ONU ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 531 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True |
Suchitra Vemuri | b89b9ac | 2019-12-11 21:53:11 -0800 | [diff] [blame] | 532 | ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']} |
| 533 | ... ${src['container_type']} ${src['container_name']} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 534 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2 |
| 535 | ... Verify ONU in AAA-Users ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 536 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2 |
| 537 | ... Execute ONOS CLI Command ${k8s_node_ip} ${ONOS_SSH_PORT} |
| 538 | ... volt-add-subscriber-access ${of_id} ${onu_port} |
Suchitra Vemuri | b89b9ac | 2019-12-11 21:53:11 -0800 | [diff] [blame] | 539 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 540 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 541 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 542 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 543 | ... ${dst['container_name']} |
| 544 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 545 | ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 546 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 547 | Run Keyword and Ignore Error Collect Logs |
Suchitra Vemuri | b89b9ac | 2019-12-11 21:53:11 -0800 | [diff] [blame] | 548 | END |
Gayathri.Selvan | 4939896 | 2020-01-13 07:19:12 +0000 | [diff] [blame] | 549 | |
| 550 | Repeat Sanity Test |
| 551 | [Documentation] This keyword performs Sanity Test Procedure |
| 552 | ... Sanity test performs authentication, dhcp and pings for all the ONUs given for the POD |
| 553 | ... This keyword can be used to call in any other tests where sanity check is required |
| 554 | ... with wpa reassociation |
| 555 | |
| 556 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number} |
| 557 | Set Global Variable ${of_id} |
| 558 | |
| 559 | FOR ${I} IN RANGE 0 ${num_onus} |
| 560 | ${src}= Set Variable ${hosts.src[${I}]} |
| 561 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 562 | |
| 563 | |
| 564 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 565 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s |
| 566 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 567 | Wait Until Keyword Succeeds ${timeout} 2s |
| 568 | ... Verify Eapol Flows Added For ONU ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 569 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 570 | ... Validate Authentication After Reassociate |
Gayathri.Selvan | 4939896 | 2020-01-13 07:19:12 +0000 | [diff] [blame] | 571 | ... True ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} |
| 572 | ... ${src['container_type']} ${src['container_name']} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 573 | Wait Until Keyword Succeeds ${timeout} 2s |
| 574 | ... Verify ONU in AAA-Users ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 575 | Wait Until Keyword Succeeds ${timeout} 2s |
| 576 | ... Execute ONOS CLI Command ${k8s_node_ip} ${ONOS_SSH_PORT} |
| 577 | ... volt-add-subscriber-access ${of_id} ${onu_port} |
| 578 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 579 | ... Validate DHCP and Ping True True |
| 580 | ... ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
Gayathri.Selvan | 4939896 | 2020-01-13 07:19:12 +0000 | [diff] [blame] | 581 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 582 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 583 | ... ${dst['container_name']} |
| 584 | Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure |
| 585 | ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port} |
| 586 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 587 | Run Keyword and Ignore Error Collect Logs |
| 588 | END |
| 589 | |