Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -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 | |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 15 | *** Settings *** |
Suchitra Vemuri | 32fc2f2 | 2018-09-10 12:06:01 -0700 | [diff] [blame] | 16 | Documentation Test successful ping from end-end |
Kailash Khalasi | f3e0a9f | 2018-09-18 13:43:42 -0700 | [diff] [blame] | 17 | Suite Setup Setup |
Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -0700 | [diff] [blame] | 18 | Suite Teardown Teardown |
Kailash Khalasi | f3e0a9f | 2018-09-18 13:43:42 -0700 | [diff] [blame] | 19 | Test Setup Create Models |
| 20 | Test Teardown Clean Test Environment |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 21 | Library Collections |
| 22 | Library String |
| 23 | Library OperatingSystem |
| 24 | Library XML |
| 25 | Library RequestsLibrary |
Suchitra Vemuri | 32fc2f2 | 2018-09-10 12:06:01 -0700 | [diff] [blame] | 26 | Library ../../Framework/utils/utils.py |
Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -0700 | [diff] [blame] | 27 | Resource ../../Framework/utils/utils.robot |
Suchitra Vemuri | 32fc2f2 | 2018-09-10 12:06:01 -0700 | [diff] [blame] | 28 | Library ../../Framework/restApi.py |
Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -0700 | [diff] [blame] | 29 | Resource ../../Framework/Subscriber.robot |
| 30 | Resource ../../Framework/ATTWorkFlowDriver.robot |
| 31 | Resource ../../Framework/ONU.robot |
| 32 | Resource ../../Framework/DHCP.robot |
| 33 | Variables ../../Properties/RestApiProperties.py |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 34 | |
| 35 | *** Variables *** |
Kailash Khalasi | 30a6a39 | 2018-09-10 14:32:39 -0700 | [diff] [blame] | 36 | ${WHITELIST_PATHFILE} ${CURDIR}/data/ATTWhiteList.json |
| 37 | ${SUBSCRIBER_PATHFILE} ${CURDIR}/data/ATTSubscriber.json |
Kailash Khalasi | f3e0a9f | 2018-09-18 13:43:42 -0700 | [diff] [blame] | 38 | ${VOLT_DEVICE_PATHFILE} ${CURDIR}/../data/RealOLTDevice.json |
Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -0700 | [diff] [blame] | 39 | ${src_ip} X.X.X.X |
| 40 | ${src_gateway} X.X.X.X |
| 41 | ${src_user} user |
| 42 | ${src_pass} pass |
| 43 | ${src_iface} eth0 |
| 44 | ${dst_ip} X.X.X.X |
| 45 | ${dst_dp_iface} eth0 |
| 46 | ${dst_dp_ip} X.X.X.X |
| 47 | ${dst_user} user |
| 48 | ${dst_pass} pass |
| 49 | ${dst_gateway} X.X.X.X |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 50 | |
Kailash Khalasi | a0810ce | 2018-09-10 13:03:27 -0700 | [diff] [blame] | 51 | *** Test Cases *** |
Kailash Khalasi | f3e0a9f | 2018-09-18 13:43:42 -0700 | [diff] [blame] | 52 | ONU in Correct Location + Successful Auth Request |
| 53 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 54 | ... Discovery of ONU Device after whitelist has been configured |
| 55 | ... Sending of a successful 802.1x auth request |
| 56 | ... Configuration of the destination servers interface and start dhcpd |
| 57 | ... Configuration of source server interface and execute dhclient on interface |
| 58 | ... Validate successful pings from src to dst |
| 59 | [Setup] None |
Kailash Khalasi | a0810ce | 2018-09-10 13:03:27 -0700 | [diff] [blame] | 60 | Wait Until Keyword Succeeds 60s 2s Validate ONU States ACTIVE ENABLED |
You Wang | fa6d8cf | 2018-09-18 16:54:30 -0700 | [diff] [blame] | 61 | Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING |
| 62 | Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth |
Kailash Khalasi | a0810ce | 2018-09-10 13:03:27 -0700 | [diff] [blame] | 63 | Send EAPOL Message ${src_ip} ${src_user} ${src_pass} ${src_iface} wpa_supplicant.conf |
You Wang | fa6d8cf | 2018-09-18 16:54:30 -0700 | [diff] [blame] | 64 | Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED |
| 65 | Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled |
Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -0700 | [diff] [blame] | 66 | Add Double Vlan Interface on Host ${dst_ip} ${dst_user} ${dst_pass} ${dst_dp_iface} ${s_tag} ${c_tag} |
| 67 | Add IP Address on Interface on Host ${dst_ip} ${dst_user} ${dst_pass} ${dst_dp_ip}/24 ${dst_dp_iface}.${stag}.${c_tag} |
| 68 | Add Route to Remote Host ${dst_ip} ${dst_user} ${dst_pass} ${dst_dp_ip} ${src_gateway} ${dst_dp_iface}.${stag}.${c_tag} |
Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -0700 | [diff] [blame] | 69 | Start DHCP Server on Remote Host ${dst_ip} ${dst_user} ${dst_pass} ${dst_dp_iface}.${stag}.${ctag} |
Kailash Khalasi | a0810ce | 2018-09-10 13:03:27 -0700 | [diff] [blame] | 70 | Send Dhclient Request ${src_ip} ${src_user} ${src_pass} ${src_iface} |
Kailash Khalasi | 422d1ab | 2018-09-18 09:54:26 -0700 | [diff] [blame] | 71 | Wait Until Keyword Succeeds 60s 5s Test Ping PASS ${src_ip} ${src_user} ${src_pass} ${dst_dp_ip} ${src_iface} |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 72 | |
| 73 | *** Keywords *** |
Kailash Khalasi | f3e0a9f | 2018-09-18 13:43:42 -0700 | [diff] [blame] | 74 | Setup |
| 75 | ${auth} = Create List ${XOS_USER} ${XOS_PASSWD} |
| 76 | ${HEADERS} Create Dictionary Content-Type=application/json |
| 77 | Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS} |
| 78 | ${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE} |
| 79 | ${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE} |
Kailash Khalasi | 30a6a39 | 2018-09-10 14:32:39 -0700 | [diff] [blame] | 80 | ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo |
| 81 | Set Suite Variable ${alist} ${AttWhiteListList} |
| 82 | ${AttWhiteListList} = Get Variable Value ${alist} |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 83 | ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0 |
Kailash Khalasi | f3e0a9f | 2018-09-18 13:43:42 -0700 | [diff] [blame] | 84 | ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id} |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 85 | ${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number |
| 86 | Log ${onu_device} |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 87 | Set Global Variable ${onu_device} |
Kailash Khalasi | 30a6a39 | 2018-09-10 14:32:39 -0700 | [diff] [blame] | 88 | ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo |
| 89 | Set Global Variable ${slist} ${SubscriberList} |
Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -0700 | [diff] [blame] | 90 | ${SubscriberList} = Get Variable Value ${slist} |
| 91 | ${SubscriberDict}= utils.listToDict ${SubscriberList} 0 |
| 92 | ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag |
| 93 | ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag |
Kailash Khalasi | f3e0a9f | 2018-09-18 13:43:42 -0700 | [diff] [blame] | 94 | ${VoltDeviceList}= utils.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo |
| 95 | Set Global Variable ${vlist} ${VoltDeviceList} |
Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -0700 | [diff] [blame] | 96 | Set Suite Variable ${s_tag} |
| 97 | Set Suite Variable ${c_tag} |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 98 | |
Suchitra Vemuri | 32fc2f2 | 2018-09-10 12:06:01 -0700 | [diff] [blame] | 99 | Teardown |
Kailash Khalasi | f3e0a9f | 2018-09-18 13:43:42 -0700 | [diff] [blame] | 100 | [Documentation] Performs any additional cleanup required |
| 101 | Log Suite Teardown cleanup |
| 102 | Delete All Sessions |
| 103 | |
| 104 | Create Models |
| 105 | [Documentation] Re-create Subscriber, whitelist, and olt-device models to test |
| 106 | Log Re-creating objects |
| 107 | #create attwhitelist |
| 108 | ${AttWhiteListList} = Get Variable Value ${alist} |
| 109 | ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0 |
| 110 | CORD Post ${ATT_WHITELIST} ${AttWhiteListDict} |
| 111 | #create subscriber |
| 112 | ${SubscriberList} = Get Variable Value ${slist} |
| 113 | ${SubscriberDict}= utils.listToDict ${SubscriberList} 0 |
| 114 | Wait Until Keyword Succeeds 120s 15s CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict} |
| 115 | #create olt device |
| 116 | ${VoltDeviceList} = Get Variable Value ${vlist} |
| 117 | ${VoltDeviceDict}= utils.listToDict ${VoltDeviceList} 0 |
| 118 | CORD Post ${VOLT_DEVICE} ${VoltDeviceDict} |
| 119 | |
| 120 | Clean Test Environment |
| 121 | [Documentation] Delete xos objects, kills processes and cleans up interfaces on src+dst servers |
Kailash Khalasi | 052cbb1 | 2018-09-13 16:50:13 -0700 | [diff] [blame] | 122 | Run Keyword And Ignore Error Kill Linux Process ${src_ip} ${src_user} ${src_pass} [w]pa_supplicant |
| 123 | Run Keyword And Ignore Error Kill Linux Process ${src_ip} ${src_user} ${src_pass} [d]hclient |
Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -0700 | [diff] [blame] | 124 | Run Keyword And Ignore Error Kill Linux Process ${dst_ip} ${dst_user} ${dst_pass} [d]hcpd |
Kailash Khalasi | 052cbb1 | 2018-09-13 16:50:13 -0700 | [diff] [blame] | 125 | Delete IP Addresses from Interface on Remote Host ${src_ip} ${src_user} ${src_pass} ${src_iface} |
Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -0700 | [diff] [blame] | 126 | Delete Interface on Remote Host ${dst_ip} ${dst_user} ${dst_pass} ${dst_dp_iface}.${stag} |
Kailash Khalasi | adc4b4d | 2018-09-19 10:23:55 -0700 | [diff] [blame] | 127 | Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER} |
| 128 | Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_DEVICE} |
| 129 | Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST} |
Kailash Khalasi | a0810ce | 2018-09-10 13:03:27 -0700 | [diff] [blame] | 130 | |
| 131 | Validate ONU States |
| 132 | [Arguments] ${expected_op_status} ${expected_admin_status} |
| 133 | ${operational_status} ${admin_status} ONU Status Check ${onu_device} |
| 134 | Should Be Equal ${operational_status} ${expected_op_status} |
| 135 | Should Be Equal ${admin_status} ${expected_admin_status} |
| 136 | |
| 137 | Validate ATT Workflow Driver SI |
| 138 | [Arguments] ${expected_status} ${expected_auth_status} |
You Wang | fa6d8cf | 2018-09-18 16:54:30 -0700 | [diff] [blame] | 139 | ${onu_state} ${authentication_status} Service Instance Status Check ${onu_device} |
| 140 | Should Be Equal ${onu_state} ${expected_status} |
Kailash Khalasi | a0810ce | 2018-09-10 13:03:27 -0700 | [diff] [blame] | 141 | Should Be Equal ${authentication_status} ${expected_auth_status} |
| 142 | |
| 143 | Validate Subscriber Status |
| 144 | [Arguments] ${exepected_status} |
| 145 | ${status} Subscriber Status Check ${onu_device} |
You Wang | fa6d8cf | 2018-09-18 16:54:30 -0700 | [diff] [blame] | 146 | Should Be Equal ${status} ${exepected_status} |