blob: 5ce1fff9e6d297f2f50f8c7983050ed294eb142a [file] [log] [blame]
Kailash Khalasi16d95c12018-09-21 14:17:28 -07001# 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 ***
16Documentation Test various E2E conditions for seba-in-a-box
17Suite Setup Setup
Kailash Khalasif56a4fb2018-10-23 12:38:16 -070018Suite Teardown Teardown
Kailash Khalasibf1478b2018-10-17 11:58:58 -070019Test Setup Setup Test
20Test Teardown Test Cleanup
Kailash Khalasi16d95c12018-09-21 14:17:28 -070021Library Collections
22Library String
23Library OperatingSystem
24Library XML
25Library RequestsLibrary
Andy Bavierb6f57542019-03-11 14:41:03 -070026Library ${VOLTHA_DIR}/tests/atests/common/testCaseUtils.py
Kailash Khalasi16d95c12018-09-21 14:17:28 -070027Library ../../Framework/utils/utils.py
28Resource ../../Framework/utils/utils.robot
29Library ../../Framework/restApi.py
30Resource ../../Framework/Subscriber.robot
31Resource ../../Framework/ATTWorkFlowDriver.robot
Kailash Khalasibf1478b2018-10-17 11:58:58 -070032Resource ../../Framework/Kubernetes.robot
Kailash Khalasi16d95c12018-09-21 14:17:28 -070033Resource ../../Framework/ONU.robot
Kailashaca803e2019-03-05 15:04:31 -080034Resource ../../Framework/OLT.robot
Kailash Khalasi16d95c12018-09-21 14:17:28 -070035Resource ../../Framework/DHCP.robot
36Variables ../../Properties/RestApiProperties.py
37
38*** Variables ***
Andy Bavierb6f57542019-03-11 14:41:03 -070039${VOLTHA_DIR} ~/cord/incubator/voltha
Kailash Khalasibf1478b2018-10-17 11:58:58 -070040${WHITELIST_PATHFILE} ${CURDIR}/data/SIABWhitelist.json
41${SUBSCRIBER_PATHFILE} ${CURDIR}/data/SIABSubscriber.json
Kailash Khalasi16d95c12018-09-21 14:17:28 -070042${VOLT_DEVICE_PATHFILE} ${CURDIR}/data/SIABOLTDevice.json
Kailash Khalasicf006cb2018-10-19 08:36:51 -070043${export_kube_config} export KUBECONFIG=/home/%{USER}/.kube/config
Kailash Khalasibf1478b2018-10-17 11:58:58 -070044${kube_node_ip} localhost
45${dst_host_ip} 172.18.0.10
Kailash Khalasicf006cb2018-10-19 08:36:51 -070046${local_user} %{USER}
Kailashabb029d2019-02-15 17:17:11 -080047${local_pass} ${None}
Kailash Khalasi16d95c12018-09-21 14:17:28 -070048
49*** Test Cases ***
Kailash Khalasibf1478b2018-10-17 11:58:58 -070050ONU in Correct Location
51 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
52 ... Configure whitelist with correct ONU location
53 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasif56a4fb2018-10-23 12:38:16 -070054 [Setup] None
Kailash Khalasi92061c12018-10-29 11:52:39 -070055 [Tags] stable latest test1
Andy Bavierdf70bba2019-01-24 07:06:38 -070056 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -070057 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavierdf70bba2019-01-24 07:06:38 -070058 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -070059 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasi16d95c12018-09-21 14:17:28 -070060 ${subscriber_id}= Retrieve Subscriber ${c_tag}
61 CORD Put ${VOLT_SUBSCRIBER} {"status":"disabled"} ${subscriber_id}
Andy Bavier3075b9b2019-01-31 13:45:35 -070062 No Subscriber Service Chain
Andy Bavier81de8b72018-11-20 10:15:06 -070063 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -070064 Restart RG Pod
Andy Bavierdf70bba2019-01-24 07:06:38 -070065 CORD Put ${VOLT_SUBSCRIBER} {"status":"awaiting-auth"} ${subscriber_id}
66 # ATTWD SI auth_state is already "APPROVED" here from previous auth... not sure if this matters
Kailash Khalasicf006cb2018-10-19 08:36:51 -070067 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavierdf70bba2019-01-24 07:06:38 -070068 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -070069 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasi16d95c12018-09-21 14:17:28 -070070
Kailash Khalasibf1478b2018-10-17 11:58:58 -070071ONU in Correct Location -> Remove ONU from Whitelist -> Add ONU to Whitelist
72 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
73 ... Configure whitelist with correct ONU location
74 ... Validate successful authentication/DHCP/E2E ping
75 ... Remove ONU from whitelist
76 ... Validate failed authentication/DHCP/E2E ping
77 ... Add ONU to whitelist
78 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -080079 [Tags] stable latest test2
Andy Bavier3075b9b2019-01-31 13:45:35 -070080 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -070081 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -070082 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -070083 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash821de7a2018-11-02 11:32:49 -070084 Reset SIAB Environment
Kailash Khalasibf1478b2018-10-17 11:58:58 -070085 Remove Whitelist
Kailashb49e8452018-12-18 08:29:11 -080086 Wait Until Keyword Succeeds 120s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -070087 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device} ONU not found in whitelist
Kailash Khalasibf1478b2018-10-17 11:58:58 -070088 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailasha02472b2018-12-18 09:18:20 -080089 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -070090 No Subscriber Service Chain
Kailasha02472b2018-12-18 09:18:20 -080091 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash821de7a2018-11-02 11:32:49 -070092 Reset SIAB Environment
Andy Bavier3075b9b2019-01-31 13:45:35 -070093 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -070094 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -070095 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -070096 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasi16d95c12018-09-21 14:17:28 -070097
Kailash Khalasibf1478b2018-10-17 11:58:58 -070098ONU in Correct Location -> ONU in Wrong Location -> ONU in Correct Location
99 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
100 ... Configure whitelist with correct ONU location
101 ... Validate successful authentication/DHCP/E2E ping
102 ... Update whitelist with wrong ONU location
103 ... Validate failed authentication/DHCP/E2E ping
104 ... Update whitelist with correct ONU location
105 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -0800106 [Tags] stable latest test3
Andy Bavier3075b9b2019-01-31 13:45:35 -0700107 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700108 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700109 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700110 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700111 Restart RG Pod
112 Update Whitelist with Wrong Location
Andy Bavier3075b9b2019-01-31 13:45:35 -0700113 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device} ONU activated in wrong location
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700114 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700115 No Subscriber Service Chain
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700116 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
117 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700118 Restart RG Pod
119 Update Whitelist with Correct Location
Andy Bavier3075b9b2019-01-31 13:45:35 -0700120 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700121 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700122 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700123 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700124
125ONU in Correct Location -> Remove Subscriber -> Create Subscriber
126 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
127 ... Configure whitelist with correct ONU location
128 ... Validate successful authentication/DHCP/E2E ping
129 ... Remove subscriber model
130 ... Validate failed authentication/DHCP/E2E ping
131 ... Recreate subscriber model
132 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -0800133 [Tags] stable latest test4
Andy Bavier3075b9b2019-01-31 13:45:35 -0700134 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700135 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700136 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700137 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700138 Restart RG Pod
139 Remove Subscriber
Andy Bavier3075b9b2019-01-31 13:45:35 -0700140 No Subscriber Service Chain
Andy Bavier3d6ac1a2018-11-20 15:23:40 -0700141 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700142 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700143 Restart RG Pod
144 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700145 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700146 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700147 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700148 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700149
150ONU in Correct Location (Skip Subscriber Provisioning) -> Provision Subscriber
151 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
152 ... Configure whitelist with correct ONU location and skip provisioning subscriber
153 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
154 ... Provision subscriber
155 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -0800156 [Tags] stable latest test5
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700157 Remove Subscriber
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700158 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700159 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700160 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700161 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700162 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700163 Restart RG Pod
164 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700165 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700166 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700167 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700168 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700169
170ONU in Correct Location (Skip Authentication)
171 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
172 ... Configure whitelist with correct ONU location and skip RG authentication
173 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700174 [Tags] stable latest test6
Andy Bavier3075b9b2019-01-31 13:45:35 -0700175 Subscriber Ready to Authenticate
176 No Subscriber Service Chain
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700177 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700178
179ONU not in Whitelist
180 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
181 ... Skip whitelist configuration for ONU
182 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700183 [Tags] stable latest test7
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700184 [Setup] Simple Setup
Kailash Khalasi8b3523c2018-11-08 15:31:49 -0800185 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700186 Wait Until Keyword Succeeds 60s 2s Create Subscriber
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700187 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700188 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasi8b3523c2018-11-08 15:31:49 -0800189 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device} pre-provisioned
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700190 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700191 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device} ONU not found in whitelist
Kailash Khalasi8b3523c2018-11-08 15:31:49 -0800192 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device} pre-provisioned
Andy Bavier3075b9b2019-01-31 13:45:35 -0700193 No Subscriber Service Chain
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700194 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700195
196ONU not in Whitelist (Skip Subscriber Provisioning) -> Add ONU to Whitelist -> Provision Subscriber
197 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
198 ... Skip whitelist configuration for ONU and subscriber provisioning
199 ... Validate successful authentication but failed DHCP/E2E ping
200 ... Configure whitelist with correct ONU location
201 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
202 ... Provision subscriber
203 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasic7477512018-11-08 07:55:01 -0800204 [Tags] latest test8 stable
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700205 [Setup] Simple Setup
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700206 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700207 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device} ONU not found in whitelist
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700208 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
209 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700210 Restart RG Pod
211 Create Whitelist
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700212 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700213 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700214 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700215 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700216 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700217 Restart RG Pod
218 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700219 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700220 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700221 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700222 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700223
224ONU in Wrong Location
225 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
226 ... Configure whitelist with wrong ONU location
227 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasic7477512018-11-08 07:55:01 -0800228 [Tags] latest test9 stable
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700229 Update Whitelist with Wrong Location
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700230 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700231 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device} ONU activated in wrong location
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700232 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700233 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700234 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device} ONU activated in wrong location
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700235 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700236 No Subscriber Service Chain
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700237 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700238
239ONU in Wrong Location (Skip Subscriber Provisioning) -> ONU in Correct Location -> Provision Subscriber
240 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
241 ... Configure whitelist with wrong ONU location and skip subscriber provisioning
242 ... Validate failed authentication/DHCP/E2E ping
243 ... Configure whitelist with correct ONU location
244 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
245 ... Provision subscriber
246 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -0800247 [Tags] stable latest test10
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700248 [Setup] Simple Setup
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700249 Wait Until Keyword Succeeds 60s 2s Create Whitelist
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700250 Update Whitelist with Wrong Location
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700251 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700252 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device} ONU activated in wrong location
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700253 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700254 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700255 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700256 Restart RG Pod
257 Update Whitelist with Correct Location
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700258 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700259 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700260 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash4b39ecf2018-12-18 08:35:34 -0800261 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailasha02472b2018-12-18 09:18:20 -0800262 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700263 Restart RG Pod
264 Create Subscriber
Andy Bavierdf70bba2019-01-24 07:06:38 -0700265 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device} pre-provisioned
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700266 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700267 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700268 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700269
270*** Keywords ***
271Setup
272 ${auth} = Create List ${XOS_USER} ${XOS_PASSWD}
273 ${HEADERS} Create Dictionary Content-Type=application/json
274 Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS}
275 ${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE}
276 ${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE}
277 ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700278 Set Suite Variable ${AttWhiteListList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700279 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
280 ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700281 ${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number
282 Log ${onu_device}
283 Set Global Variable ${onu_device}
284 ${onu_location}= Get From Dictionary ${AttWhiteListDict} pon_port_id
285 Set Global Variable ${onu_location}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700286 ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700287 Set Global Variable ${SubscriberList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700288 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
289 ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag
290 ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag
291 ${VoltDeviceList}= utils.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
Kailash Khalasi4e1ce762018-12-18 20:29:29 -0800292 ${VoltDeviceDict}= utils.setFieldValueInDict ${VoltDeviceList[0]} volt_service_id ${volt_service_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700293 Set Global Variable ${VoltDeviceList}
Kailash Khalasi4e1ce762018-12-18 20:29:29 -0800294 Set Global Variable ${VoltDeviceDict}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700295 Set Suite Variable ${s_tag}
296 Set Suite Variable ${c_tag}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700297 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700298 Set Suite Variable ${whitelist_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700299 ${att_si_id}= Retrieve ATT Service Instance ID ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700300 Set Suite Variable ${att_si_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700301 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
302 Set Suite Variable ${RG_CONTAINER}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700303 ## Validate ATT Workflow SI
Kailash Khalasif76cad92018-10-19 12:33:21 -0700304 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700305 @{container_list}= Create List
Kailash Khalasidd9136a2018-10-18 11:16:18 -0700306 Append To List ${container_list} att-workflow-att-workflow-driver
Kailash Khalasie59ba702018-12-18 19:36:03 -0800307 Append To List ${container_list} seba-services-fabric-crossconnect
308 Append To List ${container_list} seba-services-rcord
309 Append To List ${container_list} seba-services-volt
Kailash Khalasi30704022018-10-18 09:13:26 -0700310 Append To List ${container_list} xos-core
311 Append To List ${container_list} vcore
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700312 Set Suite Variable ${container_list}
Kailashabb029d2019-02-15 17:17:11 -0800313 Setup SSH Keys to Localhost
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700314 ${datetime}= Get Current Datetime On Kubernetes Node localhost ${local_user} ${local_pass}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700315 Set Suite Variable ${datetime}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700316
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700317Teardown
318 Setup Test
319 Delete All Sessions
320
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700321Setup Test
Kailash6e02a072019-04-04 09:33:43 -0700322 ${datetime}= Run date +"%Y-%m-%dT%H:%M:%S.%NZ"
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700323 Set Suite Variable ${datetime}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700324 Wait Until Keyword Succeeds 60s 2s Create Subscriber
Andy Bavierdf70bba2019-01-24 07:06:38 -0700325 Wait Until Keyword Succeeds 60s 2s Create Whitelist
326 Subscriber Ready to Authenticate
327
328Subscriber Ready to Authenticate
329 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700330 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device} ONU has been validated - Awaiting Authentication
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700331 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Andy Bavierdf70bba2019-01-24 07:06:38 -0700332
333Subscriber Service Chain Created
Andy Bavier3075b9b2019-01-31 13:45:35 -0700334 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device} ONU has been validated - Authentication succeeded
Andy Bavierdf70bba2019-01-24 07:06:38 -0700335 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
336 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
337 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash66b9a8d2019-02-07 10:18:55 -0800338 Wait Until Keyword Succeeds 60s 2s Validate XConnect in ONOS True
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700339
Andy Bavier3075b9b2019-01-31 13:45:35 -0700340No Subscriber Service Chain
341 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
342 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
Kailash66b9a8d2019-02-07 10:18:55 -0800343 Wait Until Keyword Succeeds 60s 2s Validate XConnect in ONOS False
Andy Bavier3075b9b2019-01-31 13:45:35 -0700344
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700345Simple Setup
Kailash6e02a072019-04-04 09:33:43 -0700346 ${datetime}= Run date +"%Y-%m-%dT%H:%M:%S.%NZ"
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700347 Set Suite Variable ${datetime}
348 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
349 Set Suite Variable ${RG_CONTAINER}
350
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700351Test Cleanup
352 [Documentation] Restore back to initial state per each test
Kailashaca803e2019-03-05 15:04:31 -0800353 Get VOLTHA Status
354 Get ONOS Status
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700355 Log Kubernetes Containers Logs Since Time ${datetime} ${container_list}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700356 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
Andy Bavierdf70bba2019-01-24 07:06:38 -0700357 Wait Until Keyword Succeeds 30s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
358 Wait Until Keyword Succeeds 30s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700359 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
360 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
361 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700362 Restart RG Pod
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700363
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700364Restart RG Pod
365 Run kubectl -n voltha delete pod ${RG_CONTAINER}
366 ${RG_CONTAINER}= Wait Until Keyword Succeeds 60s 1s Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
367 Set Suite Variable ${RG_CONTAINER}
368 Run kubectl wait -n voltha pod/${RG_CONTAINER} --for condition=Ready --timeout=180s
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700369
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700370Create Whitelist
371 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
372 ${resp}= CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
373 ${whitelist_id}= Get Json Value ${resp.content} /id
374 Set Global Variable ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700375
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700376Remove Whitelist
377 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
378 CORD Delete ${ATT_WHITELIST} ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700379
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700380Create Subscriber
381 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
382 CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700383
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700384Remove Subscriber
385 ${subscriber_id}= Retrieve Subscriber ${c_tag}
386 CORD Delete ${VOLT_SUBSCRIBER} ${subscriber_id}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700387
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700388Create VOLT
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700389 CORD Post ${VOLT_DEVICE} ${VoltDeviceDict}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700390
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700391Update Whitelist with Wrong Location
392 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
393 CORD Put ${ATT_WHITELIST} {"pon_port_id": 55 } ${whitelist_id}
394
395Update Whitelist with Correct Location
396 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
Kailash Khalasi92061c12018-10-29 11:52:39 -0700397 CORD Put ${ATT_WHITELIST} {"pon_port_id": ${onu_location} } ${whitelist_id}
Kailash821de7a2018-11-02 11:32:49 -0700398
399Reset SIAB Environment
400 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
401 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
Andy Bavierdf70bba2019-01-24 07:06:38 -0700402 Wait Until Keyword Succeeds 30s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
403 Wait Until Keyword Succeeds 30s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash821de7a2018-11-02 11:32:49 -0700404 Restart RG Pod
Kailash821de7a2018-11-02 11:32:49 -0700405 Wait Until Keyword Succeeds 60s 2s Create Subscriber
Andy Bavierdf70bba2019-01-24 07:06:38 -0700406 Wait Until Keyword Succeeds 60s 2s Create Whitelist
Andy Bavier3075b9b2019-01-31 13:45:35 -0700407 Subscriber Ready to Authenticate
Kailash821de7a2018-11-02 11:32:49 -0700408 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
409 Set Suite Variable ${RG_CONTAINER}
Kailashfe18d612019-02-04 17:04:42 -0800410
Kailash66b9a8d2019-02-07 10:18:55 -0800411Validate XConnect in ONOS
412 [Arguments] ${exists}=True
413 ${rc}= Run And Return RC http -a karaf:karaf GET http://127.0.0.1:30120/onos/segmentrouting/xconnect|jq -r '.xconnects[].vlanId'|grep 222
414 Run Keyword If '${exists}' == 'True' Should Be Equal As Integers ${rc} 0
Kailashabb029d2019-02-15 17:17:11 -0800415 ... ELSE Should Be Equal As Integers ${rc} 1
416
417Setup SSH Keys to Localhost
418 Run yes y 2>/dev/null | ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
419 Run cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
420 Run chmod og-wx ~/.ssh/authorized_keys