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 |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 17 | Suite Setup Read InputFile |
Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -0700 | [diff] [blame] | 18 | Suite Teardown Teardown |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 19 | Library Collections |
| 20 | Library String |
| 21 | Library OperatingSystem |
| 22 | Library XML |
| 23 | Library RequestsLibrary |
Suchitra Vemuri | 32fc2f2 | 2018-09-10 12:06:01 -0700 | [diff] [blame] | 24 | Library ../../Framework/utils/utils.py |
Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -0700 | [diff] [blame] | 25 | Resource ../../Framework/utils/utils.robot |
Suchitra Vemuri | 32fc2f2 | 2018-09-10 12:06:01 -0700 | [diff] [blame] | 26 | Library ../../Framework/restApi.py |
Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -0700 | [diff] [blame] | 27 | Resource ../../Framework/Subscriber.robot |
| 28 | Resource ../../Framework/ATTWorkFlowDriver.robot |
| 29 | Resource ../../Framework/ONU.robot |
| 30 | Resource ../../Framework/DHCP.robot |
| 31 | Variables ../../Properties/RestApiProperties.py |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 32 | |
| 33 | *** Variables *** |
Kailash Khalasi | 30a6a39 | 2018-09-10 14:32:39 -0700 | [diff] [blame] | 34 | ${WHITELIST_PATHFILE} ${CURDIR}/data/ATTWhiteList.json |
| 35 | ${SUBSCRIBER_PATHFILE} ${CURDIR}/data/ATTSubscriber.json |
Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -0700 | [diff] [blame] | 36 | ${src_ip} X.X.X.X |
| 37 | ${src_gateway} X.X.X.X |
| 38 | ${src_user} user |
| 39 | ${src_pass} pass |
| 40 | ${src_iface} eth0 |
| 41 | ${dst_ip} X.X.X.X |
| 42 | ${dst_dp_iface} eth0 |
| 43 | ${dst_dp_ip} X.X.X.X |
| 44 | ${dst_user} user |
| 45 | ${dst_pass} pass |
| 46 | ${dst_gateway} X.X.X.X |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 47 | |
Kailash Khalasi | a0810ce | 2018-09-10 13:03:27 -0700 | [diff] [blame] | 48 | *** Test Cases *** |
Suchitra Vemuri | 32fc2f2 | 2018-09-10 12:06:01 -0700 | [diff] [blame] | 49 | Validate ONU States |
| 50 | [Documentation] Validate status field in ONU List |
Kailash Khalasi | a0810ce | 2018-09-10 13:03:27 -0700 | [diff] [blame] | 51 | Wait Until Keyword Succeeds 60s 2s Validate ONU States ACTIVE ENABLED |
Suchitra Vemuri | 32fc2f2 | 2018-09-10 12:06:01 -0700 | [diff] [blame] | 52 | |
| 53 | Validate states in ATT WorkFlowDriver Service Instances |
| 54 | [Documentation] Validates necessary states for entries in workflow driver service instance list |
Kailash Khalasi | a0810ce | 2018-09-10 13:03:27 -0700 | [diff] [blame] | 55 | Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI valid AWAITING |
Suchitra Vemuri | 32fc2f2 | 2018-09-10 12:06:01 -0700 | [diff] [blame] | 56 | |
| 57 | Validate Subscriber State |
| 58 | [Documentation] Validate subscriber status in the rcordsubscriber list |
Kailash Khalasi | a0810ce | 2018-09-10 13:03:27 -0700 | [diff] [blame] | 59 | Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status AWAITING-AUTH |
Suchitra Vemuri | 32fc2f2 | 2018-09-10 12:06:01 -0700 | [diff] [blame] | 60 | |
Kailash Khalasi | a0810ce | 2018-09-10 13:03:27 -0700 | [diff] [blame] | 61 | Send Subscriber Authentication |
| 62 | [Documentation] Sends a successful 802.1x EAPOL message from the subscriber |
| 63 | Send EAPOL Message ${src_ip} ${src_user} ${src_pass} ${src_iface} wpa_supplicant.conf |
Suchitra Vemuri | 32fc2f2 | 2018-09-10 12:06:01 -0700 | [diff] [blame] | 64 | |
| 65 | Validate states in ATT WorkFlowDriver instances after subscriber authentication |
| 66 | [Documentation] Validate proper states on the service instances after authentication |
Kailash Khalasi | a0810ce | 2018-09-10 13:03:27 -0700 | [diff] [blame] | 67 | Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI valid APPROVED |
Suchitra Vemuri | 32fc2f2 | 2018-09-10 12:06:01 -0700 | [diff] [blame] | 68 | |
| 69 | Re-Validate Subscriber State |
| 70 | [Documentation] Validate subscriber status in the rcordsubscriber list |
Kailash Khalasi | a0810ce | 2018-09-10 13:03:27 -0700 | [diff] [blame] | 71 | Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status ENABLED |
| 72 | |
Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -0700 | [diff] [blame] | 73 | Configure QinQ Interface on Dest Server |
| 74 | [Documentation] Configure a QinQ (802.11q) interface to pass double tagged traffic from RG |
| 75 | Add Double Vlan Interface on Host ${dst_ip} ${dst_user} ${dst_pass} ${dst_dp_iface} ${s_tag} ${c_tag} |
| 76 | Add IP Address on Interface on Host ${dst_ip} ${dst_user} ${dst_pass} ${dst_dp_ip}/24 ${dst_dp_iface}.${stag}.${c_tag} |
| 77 | Add Route to Remote Host ${dst_ip} ${dst_user} ${dst_pass} ${dst_dp_ip} ${src_gateway} ${dst_dp_iface}.${stag}.${c_tag} |
| 78 | |
| 79 | Start DHCP Server on QinQ Interface |
| 80 | [Documentation] Start dhcpd on the previously configured interface on the destination server |
| 81 | Start DHCP Server on Remote Host ${dst_ip} ${dst_user} ${dst_pass} ${dst_dp_iface}.${stag}.${ctag} |
| 82 | |
Kailash Khalasi | a0810ce | 2018-09-10 13:03:27 -0700 | [diff] [blame] | 83 | Execute Dhclient on RG |
| 84 | [Documentation] Run dhclient on the dataplane interface on the RG |
| 85 | Send Dhclient Request ${src_ip} ${src_user} ${src_pass} ${src_iface} |
| 86 | |
| 87 | Test E2E Connectivity |
| 88 | [Documentation] Test pings after subscriber has been authenticated + enabled |
Kailash Khalasi | 422d1ab | 2018-09-18 09:54:26 -0700 | [diff] [blame^] | 89 | 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] | 90 | |
| 91 | *** Keywords *** |
| 92 | Read InputFile |
Kailash Khalasi | 30a6a39 | 2018-09-10 14:32:39 -0700 | [diff] [blame] | 93 | ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo |
| 94 | Set Suite Variable ${alist} ${AttWhiteListList} |
| 95 | ${AttWhiteListList} = Get Variable Value ${alist} |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 96 | ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0 |
| 97 | ${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number |
| 98 | Log ${onu_device} |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 99 | Set Global Variable ${onu_device} |
Kailash Khalasi | 30a6a39 | 2018-09-10 14:32:39 -0700 | [diff] [blame] | 100 | ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo |
| 101 | Set Global Variable ${slist} ${SubscriberList} |
Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -0700 | [diff] [blame] | 102 | ${SubscriberList} = Get Variable Value ${slist} |
| 103 | ${SubscriberDict}= utils.listToDict ${SubscriberList} 0 |
| 104 | ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag |
| 105 | ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag |
| 106 | Set Suite Variable ${s_tag} |
| 107 | Set Suite Variable ${c_tag} |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 108 | |
Suchitra Vemuri | 32fc2f2 | 2018-09-10 12:06:01 -0700 | [diff] [blame] | 109 | Teardown |
Kailash Khalasi | c8dfd0d | 2018-09-11 09:54:43 -0700 | [diff] [blame] | 110 | [Documentation] Delete xos objects and kill process on src host |
Kailash Khalasi | 052cbb1 | 2018-09-13 16:50:13 -0700 | [diff] [blame] | 111 | Run Keyword And Ignore Error Kill Linux Process ${src_ip} ${src_user} ${src_pass} [w]pa_supplicant |
| 112 | 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] | 113 | 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] | 114 | 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] | 115 | Delete Interface on Remote Host ${dst_ip} ${dst_user} ${dst_pass} ${dst_dp_iface}.${stag} |
| 116 | #Clean Up Objects ${VOLT_SUBSCRIBER} |
| 117 | #Clean Up Objects ${VOLT_DEVICE} |
| 118 | #Clean Up Objects ${ATT_WHITELIST} |
Kailash Khalasi | a0810ce | 2018-09-10 13:03:27 -0700 | [diff] [blame] | 119 | |
| 120 | Validate ONU States |
| 121 | [Arguments] ${expected_op_status} ${expected_admin_status} |
| 122 | ${operational_status} ${admin_status} ONU Status Check ${onu_device} |
| 123 | Should Be Equal ${operational_status} ${expected_op_status} |
| 124 | Should Be Equal ${admin_status} ${expected_admin_status} |
| 125 | |
| 126 | Validate ATT Workflow Driver SI |
| 127 | [Arguments] ${expected_status} ${expected_auth_status} |
| 128 | ${status} ${authentication_status} Service Instance Status Check ${onu_device} |
| 129 | Should Be Equal ${status} ${expected_status} |
| 130 | Should Be Equal ${authentication_status} ${expected_auth_status} |
| 131 | |
| 132 | Validate Subscriber Status |
| 133 | [Arguments] ${exepected_status} |
| 134 | ${status} Subscriber Status Check ${onu_device} |
Kailash Khalasi | 6dab16e | 2018-09-17 20:24:08 -0700 | [diff] [blame] | 135 | Should Be Equal ${status} ${exepected_status} |