blob: 4bb6d18f19f798eba3103117a7827f0b984b4302 [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 Khalasibf1478b2018-10-17 11:58:58 -070018Suite Teardown Delete All Sessions
19Test Setup Setup Test
20Test Teardown Test Cleanup
Kailash Khalasi16d95c12018-09-21 14:17:28 -070021Library Collections
22Library String
23Library OperatingSystem
24Library XML
25Library RequestsLibrary
26Library ../../Framework/utils/utils.py
27Resource ../../Framework/utils/utils.robot
28Library ../../Framework/restApi.py
29Resource ../../Framework/Subscriber.robot
30Resource ../../Framework/ATTWorkFlowDriver.robot
Kailash Khalasibf1478b2018-10-17 11:58:58 -070031Resource ../../Framework/Kubernetes.robot
Kailash Khalasi16d95c12018-09-21 14:17:28 -070032Resource ../../Framework/ONU.robot
33Resource ../../Framework/DHCP.robot
34Variables ../../Properties/RestApiProperties.py
35
36*** Variables ***
Kailash Khalasibf1478b2018-10-17 11:58:58 -070037${WHITELIST_PATHFILE} ${CURDIR}/data/SIABWhitelist.json
38${SUBSCRIBER_PATHFILE} ${CURDIR}/data/SIABSubscriber.json
Kailash Khalasi16d95c12018-09-21 14:17:28 -070039${VOLT_DEVICE_PATHFILE} ${CURDIR}/data/SIABOLTDevice.json
Kailash Khalasibf1478b2018-10-17 11:58:58 -070040${export_kube_config} export KUBECONFIG=/home/cord/.kube/config
41${kube_node_ip} localhost
42${dst_host_ip} 172.18.0.10
Kailash Khalasi16d95c12018-09-21 14:17:28 -070043
44*** Test Cases ***
Kailash Khalasibf1478b2018-10-17 11:58:58 -070045ONU in Correct Location
46 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
47 ... Configure whitelist with correct ONU location
48 ... Validate successful authentication/DHCP/E2E ping
49 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
50 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
51 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
52 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
53 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
54 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
55 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
Kailash Khalasi16d95c12018-09-21 14:17:28 -070056 ${subscriber_id}= Retrieve Subscriber ${c_tag}
57 CORD Put ${VOLT_SUBSCRIBER} {"status":"disabled"} ${subscriber_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -070058 Validate DHCP and Ping True False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
59 Restart RG Pod
Kailash Khalasi16d95c12018-09-21 14:17:28 -070060 CORD Put ${VOLT_SUBSCRIBER} {"status":"enabled"} ${subscriber_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -070061 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
62 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
Kailash Khalasi16d95c12018-09-21 14:17:28 -070063
Kailash Khalasibf1478b2018-10-17 11:58:58 -070064ONU in Correct Location -> Remove ONU from Whitelist -> Add ONU to Whitelist
65 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
66 ... Configure whitelist with correct ONU location
67 ... Validate successful authentication/DHCP/E2E ping
68 ... Remove ONU from whitelist
69 ... Validate failed authentication/DHCP/E2E ping
70 ... Add ONU to whitelist
71 ... Validate successful authentication/DHCP/E2E ping
72 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
73 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
74 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
75 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
76 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
77 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
78 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
79 Restart RG Pod
80 Remove Whitelist
81 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
82 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
83 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
84 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
85 Restart RG Pod
86 Create Whitelist
87 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
88 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
89 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
90 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
91 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
92 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
Kailash Khalasi16d95c12018-09-21 14:17:28 -070093
Kailash Khalasibf1478b2018-10-17 11:58:58 -070094ONU in Correct Location -> ONU in Wrong Location -> ONU in Correct Location
95 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
96 ... Configure whitelist with correct ONU location
97 ... Validate successful authentication/DHCP/E2E ping
98 ... Update whitelist with wrong ONU location
99 ... Validate failed authentication/DHCP/E2E ping
100 ... Update whitelist with correct ONU location
101 ... Validate successful authentication/DHCP/E2E ping
102 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
103 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
104 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
105 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
106 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
107 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
108 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
109 Restart RG Pod
110 Update Whitelist with Wrong Location
111 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
112 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
113 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
114 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
115 Restart RG Pod
116 Update Whitelist with Correct Location
117 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
118 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
119 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
120 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
121 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
122 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
123
124ONU in Correct Location -> Remove Subscriber -> Create Subscriber
125 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
126 ... Configure whitelist with correct ONU location
127 ... Validate successful authentication/DHCP/E2E ping
128 ... Remove subscriber model
129 ... Validate failed authentication/DHCP/E2E ping
130 ... Recreate subscriber model
131 ... Validate successful authentication/DHCP/E2E ping
132 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
133 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
134 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
135 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
136 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
137 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
138 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
139 Restart RG Pod
140 Remove Subscriber
141 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
142 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
143 Restart RG Pod
144 Create Subscriber
145 Wait Until Keyword Succeeds 90s 2s Validate Subscriber Status awaiting-auth ${onu_device}
146 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
147 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
148 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
149 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
150
151ONU in Correct Location (Skip Subscriber Provisioning) -> Provision Subscriber
152 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
153 ... Configure whitelist with correct ONU location and skip provisioning subscriber
154 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
155 ... Provision subscriber
156 ... Validate successful authentication/DHCP/E2E ping
157 Remove Subscriber
158 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
159 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
160 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
161 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
162 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
163 Restart RG Pod
164 Create Subscriber
165 Wait Until Keyword Succeeds 90s 2s Validate Subscriber Status awaiting-auth ${onu_device}
166 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
167 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
168 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
169 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
170
171ONU in Correct Location (Skip Authentication)
172 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
173 ... Configure whitelist with correct ONU location and skip RG authentication
174 ... Validate failed authentication/DHCP/E2E ping
175 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
176 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
177 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
178 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
179
180ONU not in Whitelist
181 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
182 ... Skip whitelist configuration for ONU
183 ... Validate failed authentication/DHCP/E2E ping
184 Remove Whitelist
185 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
186 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
187 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
188 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
189 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
190 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
191 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
192
193ONU not in Whitelist (Skip Subscriber Provisioning) -> Add ONU to Whitelist -> Provision Subscriber
194 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
195 ... Skip whitelist configuration for ONU and subscriber provisioning
196 ... Validate successful authentication but failed DHCP/E2E ping
197 ... Configure whitelist with correct ONU location
198 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
199 ... Provision subscriber
200 ... Validate successful authentication/DHCP/E2E ping
201 Remove Whitelist
202 Remove Subscriber
203 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
204 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
205 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
206 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
207 Restart RG Pod
208 Create Whitelist
209 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
210 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
211 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
212 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
213 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
214 Restart RG Pod
215 Create Subscriber
216 Wait Until Keyword Succeeds 90s 2s Validate Subscriber Status awaiting-auth ${onu_device}
217 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
218 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
219 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
220 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
221
222ONU in Wrong Location
223 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
224 ... Configure whitelist with wrong ONU location
225 ... Validate failed authentication/DHCP/E2E ping
226 Update Whitelist with Wrong Location
227 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
228 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
229 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
230 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
231 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
232 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
233 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
234
235ONU in Wrong Location (Skip Subscriber Provisioning) -> ONU in Correct Location -> Provision Subscriber
236 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
237 ... Configure whitelist with wrong ONU location and skip subscriber provisioning
238 ... Validate failed authentication/DHCP/E2E ping
239 ... Configure whitelist with correct ONU location
240 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
241 ... Provision subscriber
242 ... Validate successful authentication/DHCP/E2E ping
243 Update Whitelist with Wrong Location
244 Remove Subscriber
245 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
246 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
247 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
248 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
249 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
250 Restart RG Pod
251 Update Whitelist with Correct Location
252 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
253 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasi3098b2f2018-10-18 10:23:56 -0700254 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700255 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
256 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
257 Restart RG Pod
258 Create Subscriber
259 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
260 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
261 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
262 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
263 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} cord cord K8S ${RG_CONTAINER}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700264
265*** Keywords ***
266Setup
267 ${auth} = Create List ${XOS_USER} ${XOS_PASSWD}
268 ${HEADERS} Create Dictionary Content-Type=application/json
269 Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS}
270 ${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE}
271 ${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE}
272 ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700273 Set Suite Variable ${AttWhiteListList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700274 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
275 ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700276 ${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number
277 Log ${onu_device}
278 Set Global Variable ${onu_device}
279 ${onu_location}= Get From Dictionary ${AttWhiteListDict} pon_port_id
280 Set Global Variable ${onu_location}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700281 ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700282 Set Global Variable ${SubscriberList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700283 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
284 ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag
285 ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag
286 ${VoltDeviceList}= utils.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700287 Set Global Variable ${VoltDeviceList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700288 Set Suite Variable ${s_tag}
289 Set Suite Variable ${c_tag}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700290 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700291 Set Suite Variable ${whitelist_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700292 ${att_si_id}= Retrieve ATT Service Instance ID ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700293 Set Suite Variable ${att_si_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700294 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
295 Set Suite Variable ${RG_CONTAINER}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700296 ## Validate ATT Workflow SI
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700297 Wait Until Keyword Succeeds 90s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
298 @{container_list}= Create List
Kailash Khalasidd9136a2018-10-18 11:16:18 -0700299 Append To List ${container_list} att-workflow-att-workflow-driver
Kailash Khalasi30704022018-10-18 09:13:26 -0700300 Append To List ${container_list} xos-core
301 Append To List ${container_list} vcore
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700302 Set Suite Variable ${container_list}
303 ${datetime}= Get Current Datetime On Kubernetes Node localhost cord cord
304 Set Suite Variable ${datetime}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700305
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700306Setup Test
307 ${datetime}= Get Current Datetime On Kubernetes Node ${kube_node_ip} cord cord
308 Set Suite Variable ${datetime}
309 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
310 Set Suite Variable ${RG_CONTAINER}
311
312Test Cleanup
313 [Documentation] Restore back to initial state per each test
314 Log Kubernetes Containers Logs Since Time ${datetime} ${container_list}
315 Restart RG Pod
316 ${status} ${whitelist_id}= Run Keyword And Ignore Error Retrieve Whitelist Entry ${onu_device}
317 Run Keyword And Ignore Error CORD Put ${ATT_WHITELIST} {"pon_port_id": 1 } ${whitelist_id}
318 Run Keyword And Ignore Error CORD Put ${ATT_SERVICEINSTANCES} {"authentication_state": "AWAITING"} ${att_si_id}
319 Run Keyword And Ignore Error CORD Put ${ATT_SERVICEINSTANCES} {"onu_state": "ENABLED"} ${att_si_id}
320 Run Keyword And Ignore Error Create Whitelist
321 Run Keyword And Ignore Error Create Subscriber
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700322
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700323Restart RG Pod
324 Run kubectl -n voltha delete pod ${RG_CONTAINER}
325 ${RG_CONTAINER}= Wait Until Keyword Succeeds 60s 1s Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
326 Set Suite Variable ${RG_CONTAINER}
327 Run kubectl wait -n voltha pod/${RG_CONTAINER} --for condition=Ready --timeout=180s
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700328
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700329Create Whitelist
330 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
331 ${resp}= CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
332 ${whitelist_id}= Get Json Value ${resp.content} /id
333 Set Global Variable ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700334
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700335Remove Whitelist
336 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
337 CORD Delete ${ATT_WHITELIST} ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700338
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700339Create Subscriber
340 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
341 CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700342
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700343Remove Subscriber
344 ${subscriber_id}= Retrieve Subscriber ${c_tag}
345 CORD Delete ${VOLT_SUBSCRIBER} ${subscriber_id}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700346
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700347Create VOLT
348 ${VoltDeviceDict}= utils.listToDict ${VoltDeviceList} 0
349 CORD Post ${VOLT_DEVICE} ${VoltDeviceDict}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700350
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700351Update Whitelist with Wrong Location
352 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
353 CORD Put ${ATT_WHITELIST} {"pon_port_id": 55 } ${whitelist_id}
354
355Update Whitelist with Correct Location
356 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
357 CORD Put ${ATT_WHITELIST} {"pon_port_id": ${onu_location} } ${whitelist_id}
358