Kailash | 9276492 | 2019-07-25 08:21:39 -0700 | [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 | |
| 16 | *** Settings *** |
| 17 | Documentation Creates bbsim olt/onu and validates activataion |
| 18 | ... Assumes voltha-go, go-based onu/olt adapters, and bbsim are installed |
| 19 | ... voltctl and kubectl should be configured prior to running these tests |
| 20 | Library OperatingSystem |
Kailash | 6f5acb6 | 2019-08-28 14:38:45 -0700 | [diff] [blame] | 21 | Resource ${CURDIR}/../../libraries/onos.robot |
| 22 | Resource ${CURDIR}/../../libraries/voltctl.robot |
Kailash | 9276492 | 2019-07-25 08:21:39 -0700 | [diff] [blame] | 23 | Resource ${CURDIR}/../../libraries/utils.robot |
| 24 | Resource ${CURDIR}/../../variables/variables.robot |
| 25 | Suite Setup Setup |
| 26 | Suite Teardown Teardown |
| 27 | |
| 28 | *** Variables *** |
Kailash | 0e2465c | 2019-08-05 09:56:02 -0700 | [diff] [blame] | 29 | ${server_ip} localhost |
| 30 | ${timeout} 90s |
| 31 | ${num_onus} 1 |
Kailash | 9276492 | 2019-07-25 08:21:39 -0700 | [diff] [blame] | 32 | |
| 33 | *** Test Cases *** |
| 34 | Activate Device BBSIM OLT/ONU |
| 35 | [Documentation] Validate deployment -> |
| 36 | ... create and enable bbsim device -> |
| 37 | ... re-validate deployment |
Kailash | 9b50efc | 2019-08-06 22:01:45 -0700 | [diff] [blame] | 38 | [Tags] sanity |
Kailash | 9276492 | 2019-07-25 08:21:39 -0700 | [diff] [blame] | 39 | #create/preprovision device |
Kailash | 6f5acb6 | 2019-08-28 14:38:45 -0700 | [diff] [blame] | 40 | ${olt_device_id}= Create Device ${BBSIM_IP} ${BBSIM_PORT} |
Kailash | ce30501 | 2019-08-05 13:15:52 -0700 | [diff] [blame] | 41 | Set Suite Variable ${olt_device_id} |
Kailash | 9276492 | 2019-07-25 08:21:39 -0700 | [diff] [blame] | 42 | #enable device |
Kailash | 6f5acb6 | 2019-08-28 14:38:45 -0700 | [diff] [blame] | 43 | Enable Device ${olt_device_id} |
Kailash | 9276492 | 2019-07-25 08:21:39 -0700 | [diff] [blame] | 44 | #validate olt states |
| 45 | Wait Until Keyword Succeeds 60s 5s Validate Device ${BBSIM_OLT_SN} ENABLED ACTIVE REACHABLE |
| 46 | #validate onu states |
Kailash | 6f5acb6 | 2019-08-28 14:38:45 -0700 | [diff] [blame] | 47 | Wait Until Keyword Succeeds 60s 5s Validate Device ${BBSIM_ONU_SN} ENABLED ACTIVE REACHABLE onu=True onu_reason=tech-profile-config-download-success |
Kailash | ce30501 | 2019-08-05 13:15:52 -0700 | [diff] [blame] | 48 | #get onu device id |
| 49 | ${onu_device_id}= Get Device ID From SN ${BBSIM_ONU_SN} |
| 50 | Set Suite Variable ${onu_device_id} |
Kailash | 9276492 | 2019-07-25 08:21:39 -0700 | [diff] [blame] | 51 | |
| 52 | Validate OLT Connected to ONOS |
| 53 | [Documentation] Verifies the BBSIM-OLT device is activated in onos |
Kailash | 9b50efc | 2019-08-06 22:01:45 -0700 | [diff] [blame] | 54 | [Tags] sanity |
Kailash | 6f5acb6 | 2019-08-28 14:38:45 -0700 | [diff] [blame] | 55 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device in ONOS ${BBSIM_OLT_SN} |
Kailash | 9276492 | 2019-07-25 08:21:39 -0700 | [diff] [blame] | 56 | |
| 57 | Check EAPOL Flows in ONOS |
| 58 | [Documentation] Validates eapol flows for the onu are pushed from voltha |
Kailash | 9b50efc | 2019-08-06 22:01:45 -0700 | [diff] [blame] | 59 | [Tags] sanity notready |
Kailash | ce30501 | 2019-08-05 13:15:52 -0700 | [diff] [blame] | 60 | Wait Until Keyword Succeeds ${timeout} 5s Verify Eapol Flows Added ${num_onus} |
Kailash | 9276492 | 2019-07-25 08:21:39 -0700 | [diff] [blame] | 61 | |
| 62 | Validate ONU Authenticated in ONOS |
| 63 | [Documentation] Validates onu is AUTHORIZED in ONOS as bbsim will attempt to authenticate |
Kailash | 9b50efc | 2019-08-06 22:01:45 -0700 | [diff] [blame] | 64 | [Tags] sanity |
Kailash | 2b963f0 | 2019-08-28 22:46:33 -0700 | [diff] [blame] | 65 | Wait Until Keyword Succeeds ${timeout} 1s Verify Number of AAA-Users ${server_ip} ${ONOS_SSH_PORT} ${num_onus} |
Kailash | 9b50efc | 2019-08-06 22:01:45 -0700 | [diff] [blame] | 66 | |
| 67 | Add Subscriber-Access in ONOS |
| 68 | [Documentation] Through the olt-app in ONOS, execute 'volt-add-subscriber-access' and validate IP Flows |
| 69 | [Tags] sanity |
| 70 | ## TODO: this works fine with 1 onu, but with multiple onus, we need to ensure this is executes |
| 71 | ... prior to to dhclient starting. possible start a process after first test case to just attempt |
| 72 | ... "volt-add-subscriber-access" to all onus periodically? |
Kailash | 6f5acb6 | 2019-08-28 14:38:45 -0700 | [diff] [blame] | 73 | ${output}= Execute ONOS Command ${server_ip} ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} 16 |
Kailash | 9b50efc | 2019-08-06 22:01:45 -0700 | [diff] [blame] | 74 | Log ${output} |
Kailash | 9276492 | 2019-07-25 08:21:39 -0700 | [diff] [blame] | 75 | |
| 76 | Validate DHCP Assignment in ONOS |
| 77 | [Documentation] After IP Flows are pushed to the device, BBSIM will start a dhclient for the ONU. |
Kailash | 9b50efc | 2019-08-06 22:01:45 -0700 | [diff] [blame] | 78 | [Tags] sanity |
Kailash | 2b963f0 | 2019-08-28 22:46:33 -0700 | [diff] [blame] | 79 | Wait Until Keyword Succeeds 120s 15s Validate DHCP Allocations ${server_ip} ${ONOS_SSH_PORT} ${num_onus} |
Kailash | ce30501 | 2019-08-05 13:15:52 -0700 | [diff] [blame] | 80 | |
| 81 | Delete Device and Verify |
| 82 | [Documentation] Disable -> Delete devices via voltctl and verify its removed |
Kailash | 9b50efc | 2019-08-06 22:01:45 -0700 | [diff] [blame] | 83 | [Tags] VOL-1705 |
Kailash | ce30501 | 2019-08-05 13:15:52 -0700 | [diff] [blame] | 84 | #disable/delete onu |
| 85 | ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${onu_device_id} |
| 86 | Should Be Equal As Integers ${rc} 0 |
Kailash | 1a871bf | 2019-08-05 14:20:02 -0700 | [diff] [blame] | 87 | Wait Until Keyword Succeeds 60s 5s Validate Device ${BBSIM_ONU_SN} DISABLED UNKNOWN REACHABLE |
Kailash | ce30501 | 2019-08-05 13:15:52 -0700 | [diff] [blame] | 88 | ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device delete ${onu_device_id} |
| 89 | Should Be Equal As Integers ${rc} 0 |
| 90 | Wait Until Keyword Succeeds 60s 5s Validate Device Removed ${onu_device_id} |
| 91 | #disable/delete olt |
| 92 | ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id} |
| 93 | Should Be Equal As Integers ${rc} 0 |
Kailash | 1a871bf | 2019-08-05 14:20:02 -0700 | [diff] [blame] | 94 | Wait Until Keyword Succeeds 60s 5s Validate Device ${BBSIM_OLT_SN} DISABLED UNKNOWN REACHABLE |
Kailash | ce30501 | 2019-08-05 13:15:52 -0700 | [diff] [blame] | 95 | ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device delete ${olt_device_id} |
| 96 | Should Be Equal As Integers ${rc} 0 |
| 97 | Wait Until Keyword Succeeds 60s 5s Validate Device Removed ${olt_device_id} |
Kailash | 9276492 | 2019-07-25 08:21:39 -0700 | [diff] [blame] | 98 | |
| 99 | *** Keywords *** |
| 100 | Setup |
Kailash | 528f7c0 | 2019-07-31 10:55:49 -0700 | [diff] [blame] | 101 | [Documentation] Setup environment |
Kailash | 0e2465c | 2019-08-05 09:56:02 -0700 | [diff] [blame] | 102 | Log Setting up |
| 103 | Set Global Variable ${KUBECTL_CONFIG} export KUBECONFIG=%{KUBECONFIG} |
| 104 | Set Global Variable ${VOLTCTL_CONFIG} export VOLTCONFIG=%{VOLTCONFIG} |
Kailash | 528f7c0 | 2019-07-31 10:55:49 -0700 | [diff] [blame] | 105 | Check CLI Tools Configured |
Kailash | 9276492 | 2019-07-25 08:21:39 -0700 | [diff] [blame] | 106 | ${onos_auth}= Create List karaf karaf |
| 107 | ${HEADERS} Create Dictionary Content-Type=application/json |
| 108 | Create Session ONOS http://${server_ip}:${ONOS_REST_PORT} auth=${ONOS_AUTH} |
Kailash | 9276492 | 2019-07-25 08:21:39 -0700 | [diff] [blame] | 109 | |
| 110 | Teardown |
| 111 | [Documentation] Delete all http sessions |
Kailash | 6f5acb6 | 2019-08-28 14:38:45 -0700 | [diff] [blame] | 112 | Delete All Sessions |