Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 1 | #Copyright 2017-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | *** Settings *** |
DEBASISH MOHAPATRO | 8d8b8db | 2020-02-07 13:04:14 +0530 | [diff] [blame] | 16 | Documentation Test suite that engages a larger number of ONU at the same which makes it a more realistic test |
| 17 | ... It is addaptable to either BBSim or Real H/W using a configuration file |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 18 | Suite Setup Setup Suite |
| 19 | Suite Teardown Teardown Suite |
| 20 | Library Collections |
| 21 | Library String |
| 22 | Library OperatingSystem |
| 23 | Library XML |
| 24 | Library RequestsLibrary |
| 25 | Library ../../libraries/DependencyLibrary.py |
| 26 | Resource ../../libraries/onos.robot |
| 27 | Resource ../../libraries/voltctl.robot |
| 28 | Resource ../../libraries/utils.robot |
| 29 | Resource ../../libraries/k8s.robot |
| 30 | Resource ../../variables/variables.robot |
| 31 | |
| 32 | *** Variables *** |
DEBASISH MOHAPATRO | 8d8b8db | 2020-02-07 13:04:14 +0530 | [diff] [blame] | 33 | ${timeout} 60s |
Andy Bavier | e118e05 | 2020-03-06 12:49:24 -0700 | [diff] [blame] | 34 | ${long_timeout} 420 |
DEBASISH MOHAPATRO | 8d8b8db | 2020-02-07 13:04:14 +0530 | [diff] [blame] | 35 | ${of_id} 0 |
| 36 | ${logical_id} 0 |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 37 | ${has_dataplane} True |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 38 | ${teardown_device} False |
| 39 | |
| 40 | *** Test Cases *** |
| 41 | Activate Devices OLT/ONU |
| 42 | [Documentation] Validate deployment -> Empty Device List |
| 43 | ... create and enable device -> Preprovision and Enable |
| 44 | ... re-validate deployment -> Active OLT |
| 45 | [Tags] active |
| 46 | #test for empty device list |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 47 | Test Empty Device List |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 48 | #create/preprovision device |
| 49 | ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT} |
| 50 | Set Global Variable ${olt_device_id} |
| 51 | #validate olt states |
DEBASISH MOHAPATRO | 8d8b8db | 2020-02-07 13:04:14 +0530 | [diff] [blame] | 52 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN |
Andy Bavier | e118e05 | 2020-03-06 12:49:24 -0700 | [diff] [blame] | 53 | ... ${olt_device_id} |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 54 | #enable device |
| 55 | Enable Device ${olt_device_id} |
| 56 | #validate olt states |
Andy Bavier | e118e05 | 2020-03-06 12:49:24 -0700 | [diff] [blame] | 57 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE |
DEBASISH MOHAPATRO | 8d8b8db | 2020-02-07 13:04:14 +0530 | [diff] [blame] | 58 | ... ${olt_device_id} |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 59 | |
| 60 | ONU Discovery |
| 61 | [Documentation] Discover lists of ONUS, their Serial Numbers and device id |
| 62 | [Tags] active |
| 63 | #build onu sn list |
| 64 | ${List_ONU_Serial} Create List |
| 65 | Set Suite Variable ${List_ONU_Serial} |
| 66 | Build ONU SN List ${List_ONU_Serial} |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 67 | #validate onu states |
DEBASISH MOHAPATRO | 8d8b8db | 2020-02-07 13:04:14 +0530 | [diff] [blame] | 68 | Wait Until Keyword Succeeds ${long_timeout} 20s Validate ONU Devices ENABLED ACTIVE REACHABLE |
| 69 | ... ${List_ONU_Serial} |
| 70 | |
| 71 | Verify AAA-Users Authentication |
| 72 | [Documentation] Authenticating all AAA-users in onos |
| 73 | [Tags] VOL-1823 active |
| 74 | #build onu sn list |
| 75 | ${List_ONU_Serial} Create List |
| 76 | Set Suite Variable ${List_ONU_Serial} |
| 77 | Build ONU SN List ${List_ONU_Serial} |
Andy Bavier | e118e05 | 2020-03-06 12:49:24 -0700 | [diff] [blame] | 78 | Wait Until Keyword Succeeds ${long_timeout} 60s Verify Number of AAA-Users ${ONOS_SSH_IP} |
| 79 | ... ${ONOS_SSH_PORT} 16 |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 80 | |
| 81 | Validate Device's Ports and Flows |
| 82 | [Documentation] Verify Ports and Flows listed for OLT and ONUs |
DEBASISH MOHAPATRO | 8d8b8db | 2020-02-07 13:04:14 +0530 | [diff] [blame] | 83 | ... For OLT we validate the port types and numbers and for flows we simply verify that their numbers > 0 |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 84 | ... For each ONU, we validate the port types and numbers for each and for flows. |
| 85 | ... For flows they should be == 0 at this stage |
| 86 | [Tags] active |
| 87 | #validate olt port types |
| 88 | Validate OLT Port Types PON_OLT ETHERNET_NNI |
| 89 | #validate olt flows |
Andy Bavier | ac7e597 | 2019-11-14 15:35:48 -0700 | [diff] [blame] | 90 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 91 | #validate onu port types |
| 92 | Validate ONU Port Types ${List_ONU_Serial} PON_ONU ETHERNET_UNI |
| 93 | #validate onu flows |
DEBASISH MOHAPATRO | 8d8b8db | 2020-02-07 13:04:14 +0530 | [diff] [blame] | 94 | Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows ${List_ONU_Serial} ${num_onu_flows} |
| 95 | |
| 96 | Verify Total Number Of Eapol Flows |
| 97 | [Documentation] Verify Flows listed for ONUs |
| 98 | ... For 16 ONUs we validate the number of flows to be 16 eapol flows |
| 99 | [Tags] VOL-1823 active |
| 100 | #verify eapol flows added |
Andy Bavier | e118e05 | 2020-03-06 12:49:24 -0700 | [diff] [blame] | 101 | Wait Until Keyword Succeeds ${long_timeout} 5s Verify Eapol Flows Added ${ONOS_SSH_IP} |
| 102 | ... ${ONOS_SSH_PORT} 16 |
DEBASISH MOHAPATRO | 8d8b8db | 2020-02-07 13:04:14 +0530 | [diff] [blame] | 103 | |
| 104 | Allocate DHCP To All ONU Devices |
| 105 | [Documentation] DHCP Allocation for all ONUs |
| 106 | [Tags] VOL-1824 active |
| 107 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number} |
| 108 | Set Global Variable ${of_id} |
| 109 | FOR ${I} IN RANGE 0 ${num_onus} |
| 110 | ${src}= Set Variable ${hosts.src[${I}]} |
| 111 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Andy Bavier | e118e05 | 2020-03-06 12:49:24 -0700 | [diff] [blame] | 112 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 113 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 114 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
DEBASISH MOHAPATRO | 8d8b8db | 2020-02-07 13:04:14 +0530 | [diff] [blame] | 115 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2 |
Andy Bavier | e118e05 | 2020-03-06 12:49:24 -0700 | [diff] [blame] | 116 | ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 117 | ... volt-add-subscriber-access ${of_id} ${onu_port} |
DEBASISH MOHAPATRO | 8d8b8db | 2020-02-07 13:04:14 +0530 | [diff] [blame] | 118 | END |
| 119 | |
| 120 | Validate Total Number Of DHCP Allocations |
| 121 | [Documentation] Verify dhcp allocation for multiple ONU user |
| 122 | [Tags] VOL-1824 active |
| 123 | #validate total number of DHCP allocations |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 124 | Wait Until Keyword Succeeds ${long_timeout} 20s Validate DHCP Allocations ${ONOS_SSH_IP} |
Andy Bavier | e118e05 | 2020-03-06 12:49:24 -0700 | [diff] [blame] | 125 | ... ${ONOS_SSH_PORT} 16 |
DEBASISH MOHAPATRO | 8d8b8db | 2020-02-07 13:04:14 +0530 | [diff] [blame] | 126 | #validate DHCP allocation for each port |
| 127 | FOR ${I} IN RANGE 0 ${num_onus} |
| 128 | ${src}= Set Variable ${hosts.src[${I}]} |
| 129 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 130 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
Andy Bavier | e118e05 | 2020-03-06 12:49:24 -0700 | [diff] [blame] | 131 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 132 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 133 | Wait Until Keyword Succeeds ${long_timeout} 20s Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} |
| 134 | ... ${ONOS_SSH_PORT} ${onu_port} |
DEBASISH MOHAPATRO | 8d8b8db | 2020-02-07 13:04:14 +0530 | [diff] [blame] | 135 | END |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 136 | |
| 137 | Validate Logical Device |
| 138 | [Documentation] Verify that logical device exists and then verify its ports and flows |
| 139 | [Tags] active |
| 140 | #Verify logical device exists |
| 141 | ${logical_device_id}= Validate Logical Device |
| 142 | #Verify logical device ports |
| 143 | Validate Logical Device Ports ${logical_device_id} |
| 144 | #Verify logical device flows |
| 145 | Validate Logical Device Flows ${logical_device_id} |
| 146 | |
| 147 | Validate Peer Devices |
| 148 | [Documentation] Verify that peer lists matches up between that of ${olt_device_id} |
| 149 | ... and individual ONU device ids |
| 150 | [Tags] active |
| 151 | #Retrieve peer list from OLT |
| 152 | ${olt_peer_list}= Create List |
| 153 | Retrieve Peer List From OLT ${olt_peer_list} |
| 154 | Log ${olt_peer_list} |
| 155 | #Validate OLT peer id list |
| 156 | Validate OLT Peer Id List ${olt_peer_list} |
| 157 | #Validate ONU peer ids |
| 158 | Validate ONU Peer Id ${olt_device_id} ${List_ONU_Serial} |
| 159 | |
| 160 | *** Keywords *** |
| 161 | Setup Suite |
Andy Bavier | 88cd9f6 | 2019-11-26 16:22:33 -0700 | [diff] [blame] | 162 | [Documentation] Set up the test suite |
| 163 | Common Test Suite Setup |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 164 | |
| 165 | Teardown Suite |
| 166 | [Documentation] Clean up devices if desired |
| 167 | ... kills processes and cleans up interfaces on src+dst servers |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 168 | Get ONOS Status ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 169 | Run Keyword If ${has_dataplane} Clean Up Linux |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 170 | Run Keyword If ${teardown_device} Delete Device and Verify |
David Bainbridge | f81cd64 | 2019-11-20 00:14:47 +0000 | [diff] [blame] | 171 | Run Keyword If ${teardown_device} Test Empty Device List |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 172 | Run Keyword If ${teardown_device} Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 173 | ... device-remove ${of_id} |
| 174 | |
| 175 | Clean Up Linux |
| 176 | [Documentation] Kill processes and clean up interfaces on src+dst servers |
| 177 | FOR ${I} IN RANGE 0 ${num_onus} |
| 178 | ${src}= Set Variable ${hosts.src[${I}]} |
| 179 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 180 | Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']} |
| 181 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 182 | Run Keyword And Ignore Error Kill Linux Process [d]hclient ${src['ip']} |
| 183 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 184 | Run Keyword If '${dst['ip']}' != '${None}' Run Keyword And Ignore Error |
| 185 | ... Kill Linux Process [d]hcpd ${dst['ip']} ${dst['user']} |
| 186 | ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']} |
| 187 | Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']} |
| 188 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 189 | Run Keyword If '${dst['ip']}' != '${None}' Delete Interface on Remote Host |
| 190 | ... ${dst['dp_iface_name']}.${src['s_tag']} ${dst['ip']} ${dst['user']} ${dst['pass']} |
| 191 | ... ${dst['container_type']} ${dst['container_name']} |
| 192 | END |
| 193 | |
| 194 | Delete Device and Verify |
| 195 | [Documentation] Disable -> Delete devices via voltctl and verify its removed |
DEBASISH MOHAPATRO | 8d8b8db | 2020-02-07 13:04:14 +0530 | [diff] [blame] | 196 | ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id} |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 197 | Should Be Equal As Integers ${rc} 0 |
DEBASISH MOHAPATRO | 8d8b8db | 2020-02-07 13:04:14 +0530 | [diff] [blame] | 198 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE |
| 199 | ... ${olt_serial_number} |
| 200 | ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device delete ${olt_device_id} |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 201 | Should Be Equal As Integers ${rc} 0 |
DEBASISH MOHAPATRO | 8d8b8db | 2020-02-07 13:04:14 +0530 | [diff] [blame] | 202 | Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed ${olt_device_id} |