blob: e34646fc95797d149538f6c1fe0fd48392756cbe [file] [log] [blame]
Kailash Khalasi6dab16e2018-09-17 20:24:08 -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
Suchitra Vemuriff825322018-09-07 14:00:04 -070015*** Settings ***
You Wang59ded6c2018-10-05 17:43:44 -070016Documentation Test various end-to-end scenarios with ATT workflow
You Wang9f7eb392018-10-09 17:49:34 -070017Suite Setup Setup Suite
18Suite Teardown Teardown Suite
19Test Setup Setup Test
20Test Teardown Teardown Test
Suchitra Vemuriff825322018-09-07 14:00:04 -070021Library Collections
22Library String
23Library OperatingSystem
24Library XML
25Library RequestsLibrary
Suchitra Vemuri32fc2f22018-09-10 12:06:01 -070026Library ../../Framework/utils/utils.py
Kailash Khalasi6dab16e2018-09-17 20:24:08 -070027Resource ../../Framework/utils/utils.robot
Suchitra Vemuri32fc2f22018-09-10 12:06:01 -070028Library ../../Framework/restApi.py
Kailash Khalasi6dab16e2018-09-17 20:24:08 -070029Resource ../../Framework/Subscriber.robot
30Resource ../../Framework/ATTWorkFlowDriver.robot
You Wang0c2b3662018-10-01 16:56:17 -070031Resource ../../Framework/Kubernetes.robot
Kailash Khalasi6dab16e2018-09-17 20:24:08 -070032Resource ../../Framework/ONU.robot
You Wang0c2b3662018-10-01 16:56:17 -070033Resource ../../Framework/OLT.robot
Kailash Khalasi6dab16e2018-09-17 20:24:08 -070034Resource ../../Framework/DHCP.robot
35Variables ../../Properties/RestApiProperties.py
Suchitra Vemuriff825322018-09-07 14:00:04 -070036
37*** Variables ***
You Wang59ded6c2018-10-05 17:43:44 -070038${POD_NAME} flex-pod1-olt
39${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs
40${HELM_CHARTS_DIR} ~/helm-charts
41${WHITELIST_PATHFILE} ${CURDIR}/data/${POD_NAME}/ATTWhiteList.json
42${SUBSCRIBER_PATHFILE} ${CURDIR}/data/${POD_NAME}/ATTSubscriber.json
43${VOLT_DEVICE_PATHFILE} ${CURDIR}/data/${POD_NAME}/RealOLTDevice.json
44${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
45${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
46${VOLTHA_POD_NUM} 8
Suchitra Vemuriff825322018-09-07 14:00:04 -070047
Kailash Khalasia0810ce2018-09-10 13:03:27 -070048*** Test Cases ***
You Wang9f7eb392018-10-09 17:49:34 -070049ONU in Correct Location
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -070050 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
You Wang9f7eb392018-10-09 17:49:34 -070051 ... Configure whitelist with correct ONU location
52 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -070053 [Setup] None
You Wang88e1d852018-10-05 11:44:19 -070054 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED
You Wangfa6d8cf2018-09-18 16:54:30 -070055 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING
56 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
You Wang9f7eb392018-10-09 17:49:34 -070057 Validate Authentication True wpa_supplicant.conf
You Wangfa6d8cf2018-09-18 16:54:30 -070058 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED
59 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled
You Wang0c2b3662018-10-01 16:56:17 -070060 Validate DHCP and Ping True True
61
You Wang9f7eb392018-10-09 17:49:34 -070062ONU in Correct Location -> Remove ONU from Whitelist -> Add ONU to Whitelist
You Wang0c2b3662018-10-01 16:56:17 -070063 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
You Wang9f7eb392018-10-09 17:49:34 -070064 ... Configure whitelist with correct ONU location
65 ... Validate successful authentication/DHCP/E2E ping
66 ... Remove ONU from whitelist
67 ... Validate failed authentication/DHCP/E2E ping
68 ... Add ONU to whitelist
69 ... Validate successful authentication/DHCP/E2E ping
70 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED
71 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING
72 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
73 Validate Authentication True wpa_supplicant.conf
74 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED
75 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled
76 Validate DHCP and Ping True True
77 Clean Up Linux
78 Remove Whitelist
79 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING
80 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
81 Validate Authentication False wpa_supplicant.conf
82 Validate DHCP and Ping False False
83 Clean Up Linux
84 Create Whitelist
85 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING
86 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
87 Validate Authentication True wpa_supplicant.conf
88 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED
89 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled
90 Validate DHCP and Ping True True
91
92ONU in Correct Location -> ONU in Wrong Location -> ONU in Correct Location
93 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
94 ... Configure whitelist with correct ONU location
95 ... Validate successful authentication/DHCP/E2E ping
96 ... Update whitelist with wrong ONU location
97 ... Validate failed authentication/DHCP/E2E ping
98 ... Update whitelist with correct ONU location
99 ... Validate successful authentication/DHCP/E2E ping
100 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED
101 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING
102 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
103 Validate Authentication True wpa_supplicant.conf
104 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED
105 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled
106 Validate DHCP and Ping True True
107 Clean Up Linux
108 Update Whitelist with Wrong Location
109 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING
110 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
111 Validate Authentication False wpa_supplicant.conf
112 Validate DHCP and Ping False False
113 Clean Up Linux
114 Update Whitelist with Correct Location
115 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING
116 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
117 Validate Authentication True wpa_supplicant.conf
118 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED
119 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled
120 Validate DHCP and Ping True True
121
122ONU in Correct Location -> Remove Subscriber -> Create Subscriber
123 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
124 ... Configure whitelist with correct ONU location
125 ... Validate successful authentication/DHCP/E2E ping
126 ... Remove subscriber model
127 ... Validate failed authentication/DHCP/E2E ping
128 ... Recreate subscriber model
129 ... Validate successful authentication/DHCP/E2E ping
130 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED
131 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING
132 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
133 Validate Authentication True wpa_supplicant.conf
134 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED
135 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled
136 Validate DHCP and Ping True True
137 Clean Up Linux
138 Remove Subscriber
139 Validate Authentication False wpa_supplicant.conf
140 Validate DHCP and Ping False False
141 Clean Up Linux
142 Create Subscriber
143 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
144 Validate Authentication True wpa_supplicant.conf
145 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED
146 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled
147 Validate DHCP and Ping True True
148
149ONU in Correct Location (Skip Subscriber Provisioning) -> Provision Subscriber
150 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
151 ... Configure whitelist with correct ONU location and skip provisioning subscriber
152 ... Validate failed authentication/DHCP/E2E ping
153 ... Provision subscriber
154 ... Validate successful authentication/DHCP/E2E ping
155 [Setup] None
156 Create Whitelist
157 Create VOLT
158 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED
159 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING
160 Validate Authentication False wpa_supplicant.conf
161 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING
162 Validate DHCP and Ping False False
163 Clean Up Linux
164 Create Subscriber
165 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
166 Validate Authentication True wpa_supplicant.conf
167 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED
168 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled
169 Validate DHCP and Ping True True
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
You Wang88e1d852018-10-05 11:44:19 -0700175 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED
You Wang0c2b3662018-10-01 16:56:17 -0700176 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING
177 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
178 Validate DHCP and Ping False False
179
You Wang9f7eb392018-10-09 17:49:34 -0700180ONU not in Whitelist
You Wang0c2b3662018-10-01 16:56:17 -0700181 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
You Wang9f7eb392018-10-09 17:49:34 -0700182 ... Skip whitelist configuration for ONU
183 ... Validate failed authentication/DHCP/E2E ping
You Wang0c2b3662018-10-01 16:56:17 -0700184 [Setup] None
You Wang9f7eb392018-10-09 17:49:34 -0700185 Create Subscriber
186 Create VOLT
You Wang88e1d852018-10-05 11:44:19 -0700187 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED
You Wang0c2b3662018-10-01 16:56:17 -0700188 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING
189 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
You Wang9f7eb392018-10-09 17:49:34 -0700190 Validate Authentication False wpa_supplicant.conf
You Wang0c2b3662018-10-01 16:56:17 -0700191 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING
192 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
193 Validate DHCP and Ping False False
Suchitra Vemuriff825322018-09-07 14:00:04 -0700194
You Wang9f7eb392018-10-09 17:49:34 -0700195ONU not in Whitelist (Skip Subscriber Provisioning) -> Add ONU to Whitelist -> Provision Subscriber
196 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
197 ... Skip whitelist configuration for ONU and subscriber provisioning
198 ... Validate failed authentication/DHCP/E2E ping
199 ... Configure whitelist with correct ONU location
200 ... Validate failed authentication/DHCP/E2E ping
201 ... Provision subscriber
202 ... Validate successful authentication/DHCP/E2E ping
203 [Setup] None
204 Create VOLT
205 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED
206 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING
207 Validate Authentication False wpa_supplicant.conf
208 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING
209 Validate DHCP and Ping False False
210 Clean Up Linux
211 Create Whitelist
212 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED
213 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING
214 Validate Authentication False wpa_supplicant.conf
215 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING
216 Validate DHCP and Ping False False
217 Clean Up Linux
218 Create Subscriber
219 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
220 Validate Authentication True wpa_supplicant.conf
221 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED
222 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled
223 Validate DHCP and Ping True True
224
225ONU in Wrong Location
226 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
227 ... Configure whitelist with wrong ONU location
228 ... Validate failed authentication/DHCP/E2E ping
229 Update Whitelist with Wrong Location
230 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED
231 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING
232 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
233 Validate Authentication False wpa_supplicant.conf
234 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING
235 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
236 Validate DHCP and Ping False False
237
238ONU with Wrong Location (Skip Subscriber Provisioning) -> ONU with Correct Location -> Provision Subscriber
239 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
240 ... Configure whitelist with wrong ONU location and skip subscriber provisioning
241 ... Validate failed authentication/DHCP/E2E ping
242 ... Configure whitelist with correct ONU location
243 ... Validate failed authentication/DHCP/E2E ping
244 ... Provision subscriber
245 ... Validate successful authentication/DHCP/E2E ping
246 [Setup] None
247 [Tags] Debug
248 Create VOLT
249 Create Whitelist
250 Update Whitelist with Wrong Location
251 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED
252 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING
253 Validate Authentication False wpa_supplicant.conf
254 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING
255 Validate DHCP and Ping False False
256 Clean Up Linux
257 Update Whitelist with Correct Location
258 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED
259 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING
260 Validate Authentication False wpa_supplicant.conf
261 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING
262 Validate DHCP and Ping False False
263 Clean Up Linux
264 Create Subscriber
265 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
266 Validate Authentication True wpa_supplicant.conf
267 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED
268 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled
269 Validate DHCP and Ping True True
270
Suchitra Vemuriff825322018-09-07 14:00:04 -0700271*** Keywords ***
You Wang9f7eb392018-10-09 17:49:34 -0700272Setup Suite
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700273 ${auth} = Create List ${XOS_USER} ${XOS_PASSWD}
274 ${HEADERS} Create Dictionary Content-Type=application/json
275 Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS}
276 ${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE}
277 ${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE}
Kailash Khalasi30a6a392018-09-10 14:32:39 -0700278 ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
You Wang9f7eb392018-10-09 17:49:34 -0700279 Set Suite Variable ${AttWhiteListList}
Suchitra Vemuriff825322018-09-07 14:00:04 -0700280 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700281 ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
Suchitra Vemuriff825322018-09-07 14:00:04 -0700282 ${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number
Suchitra Vemuriff825322018-09-07 14:00:04 -0700283 Set Global Variable ${onu_device}
You Wang9f7eb392018-10-09 17:49:34 -0700284 ${onu_location}= Get From Dictionary ${AttWhiteListDict} pon_port_id
285 Set Global Variable ${onu_location}
Kailash Khalasi30a6a392018-09-10 14:32:39 -0700286 ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
You Wang9f7eb392018-10-09 17:49:34 -0700287 Set Global Variable ${SubscriberList}
Kailash Khalasi6dab16e2018-09-17 20:24:08 -0700288 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
289 ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag
290 ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700291 ${VoltDeviceList}= utils.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
You Wang9f7eb392018-10-09 17:49:34 -0700292 Set Global Variable ${VoltDeviceList}
Kailash Khalasi6dab16e2018-09-17 20:24:08 -0700293 Set Suite Variable ${s_tag}
294 Set Suite Variable ${c_tag}
You Wang59ded6c2018-10-05 17:43:44 -0700295 Set Global Variable ${export_kubeconfig} export KUBECONFIG=${KUBERNETES_CONF}
296 # Read variables from yaml file
297 ${src_ip}= Evaluate ${hosts}.get("src").get("ip")
298 ${src_user}= Evaluate ${hosts}.get("src").get("user")
299 ${src_pass}= Evaluate ${hosts}.get("src").get("pass")
300 ${src_container_name}= Evaluate ${hosts}.get("src").get("container_name")
301 ${src_iface}= Evaluate ${hosts}.get("src").get("dp_iface_name")
302 ${dst_ip}= Evaluate ${hosts}.get("dst").get("ip")
303 ${dst_user} = Evaluate ${hosts}.get("dst").get("user")
304 ${dst_pass}= Evaluate ${hosts}.get("dst").get("pass")
305 ${dst_container_name}= Evaluate ${hosts}.get("dst").get("container_name")
306 ${dst_dp_iface}= Evaluate ${hosts}.get("dst").get("dp_iface_name")
307 ${dst_dp_ip}= Evaluate ${hosts}.get("dst").get("dp_iface_ip_qinq")
308 ${olt_ip}= Evaluate ${olts}[0].get("ip")
309 ${olt_user}= Evaluate ${olts}[0].get("user")
310 ${olt_pass}= Evaluate ${olts}[0].get("pass")
311 Set Suite Variable ${src_ip}
312 Set Suite Variable ${src_user}
313 Set Suite Variable ${src_pass}
314 Set Suite Variable ${src_container_name}
315 Set Suite Variable ${src_iface}
316 Set Suite Variable ${dst_ip}
317 Set Suite Variable ${dst_user}
318 Set Suite Variable ${dst_pass}
319 Set Suite Variable ${dst_container_name}
320 Set Suite Variable ${dst_dp_iface}
321 Set Suite Variable ${dst_dp_ip}
322 Set Suite Variable ${olt_ip}
323 Set Suite Variable ${olt_user}
324 Set Suite Variable ${olt_pass}
Suchitra Vemuriff825322018-09-07 14:00:04 -0700325
You Wang9f7eb392018-10-09 17:49:34 -0700326Teardown Suite
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700327 [Documentation] Performs any additional cleanup required
328 Log Suite Teardown cleanup
329 Delete All Sessions
330
You Wang9f7eb392018-10-09 17:49:34 -0700331Setup Test
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700332 [Documentation] Re-create Subscriber, whitelist, and olt-device models to test
333 Log Re-creating objects
You Wang9f7eb392018-10-09 17:49:34 -0700334 Create Whitelist
335 Create Subscriber
336 Create VOLT
337
338Create Whitelist
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700339 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
340 CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
You Wang9f7eb392018-10-09 17:49:34 -0700341
342Create Subscriber
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700343 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
344 Wait Until Keyword Succeeds 120s 15s CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict}
You Wang9f7eb392018-10-09 17:49:34 -0700345
346Create VOLT
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700347 ${VoltDeviceDict}= utils.listToDict ${VoltDeviceList} 0
348 CORD Post ${VOLT_DEVICE} ${VoltDeviceDict}
349
You Wang9f7eb392018-10-09 17:49:34 -0700350Teardown Test
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700351 [Documentation] Delete xos objects, kills processes and cleans up interfaces on src+dst servers
You Wang9f7eb392018-10-09 17:49:34 -0700352 Clean Up Linux
353 Clean Up XOS
354
355Clean Up Linux
356 [Documentation] Kill processes and clean up interfaces on src+dst servers
You Wang59ded6c2018-10-05 17:43:44 -0700357 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src_ip} ${src_user} ${src_pass} ${src_container_name}
358 Run Keyword And Ignore Error Kill Linux Process [d]hclient ${src_ip} ${src_user} ${src_pass} ${src_container_name}
359 Run Keyword If '${dst_ip}' != '${None}' Run Keyword And Ignore Error Kill Linux Process [d]hcpd ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_name}
360 Delete IP Addresses from Interface on Remote Host ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_container_name}
361 Run Keyword If '${dst_ip}' != '${None}' Delete Interface on Remote Host ${dst_dp_iface}.${s_tag} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -0700362
363Clean Up XOS
364 [Documentation] Clean up all XOS objects and reinstall voltha after OLT reboots
You Wang88e1d852018-10-05 11:44:19 -0700365 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
366 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_DEVICE}
367 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
You Wang0c2b3662018-10-01 16:56:17 -0700368 Wait Until Keyword Succeeds 120s 10s Check Remote System Reachability False ${olt_ip}
369 Wait Until Keyword Succeeds 120s 10s Check Remote System Reachability True ${olt_ip}
370 Wait Until Keyword Succeeds 120s 10s Openolt is Up ${olt_ip} ${olt_user} ${olt_pass}
371 Wait Until Keyword Succeeds 300s 10s Reinstall Voltha
Kailash Khalasia0810ce2018-09-10 13:03:27 -0700372
You Wang9f7eb392018-10-09 17:49:34 -0700373Remove Whitelist
374 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
375 CORD Delete ${ATT_WHITELIST} ${whitelist_id}
376
377Update Whitelist with Wrong Location
378 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
379 CORD Put ${ATT_WHITELIST} {"pon_port_id": 55 } ${whitelist_id}
380
381Update Whitelist with Correct Location
382 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
383 CORD Put ${ATT_WHITELIST} {"pon_port_id": ${onu_location} } ${whitelist_id}
384
Kailash Khalasia0810ce2018-09-10 13:03:27 -0700385Validate ONU States
386 [Arguments] ${expected_op_status} ${expected_admin_status}
387 ${operational_status} ${admin_status} ONU Status Check ${onu_device}
388 Should Be Equal ${operational_status} ${expected_op_status}
389 Should Be Equal ${admin_status} ${expected_admin_status}
390
391Validate ATT Workflow Driver SI
392 [Arguments] ${expected_status} ${expected_auth_status}
You Wangfa6d8cf2018-09-18 16:54:30 -0700393 ${onu_state} ${authentication_status} Service Instance Status Check ${onu_device}
394 Should Be Equal ${onu_state} ${expected_status}
Kailash Khalasia0810ce2018-09-10 13:03:27 -0700395 Should Be Equal ${authentication_status} ${expected_auth_status}
396
397Validate Subscriber Status
398 [Arguments] ${exepected_status}
399 ${status} Subscriber Status Check ${onu_device}
You Wangfa6d8cf2018-09-18 16:54:30 -0700400 Should Be Equal ${status} ${exepected_status}
You Wang0c2b3662018-10-01 16:56:17 -0700401
You Wang9f7eb392018-10-09 17:49:34 -0700402Validate Authentication
403 [Arguments] ${auth_pass} ${conf_file}
404 [Documentation] Executes a particular auth request on the RG and verifies if it succeeds. auth_pass determines if authentication should pass
405 Send EAPOL Message ${src_iface} ${conf_file} ${src_ip} ${src_user} ${src_pass} ${src_container_name}
406 Run Keyword If '${auth_pass}' == 'True' Wait Until Keyword Succeeds 30s 2s Check Remote File Contents True /tmp/wpa.log authentication completed successfully ${src_ip} ${src_user} ${src_pass} ${src_container_name}
407 Run Keyword If '${auth_pass}' == 'False' Sleep 10s
408 Run Keyword If '${auth_pass}' == 'False' Check Remote File Contents False /tmp/wpa.log authentication completed successfully ${src_ip} ${src_user} ${src_pass} ${src_container_name}
409
You Wang0c2b3662018-10-01 16:56:17 -0700410Validate DHCP and Ping
You Wang88e1d852018-10-05 11:44:19 -0700411 [Arguments] ${dhcp_should_pass} ${ping_should_pass}
You Wang59ded6c2018-10-05 17:43:44 -0700412 Run Keyword If '${dst_ip}' != '${None}' Run Keywords
413 ... Add Double Vlan Interface on Host ${dst_dp_iface} ${s_tag} ${c_tag} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_name} AND
414 ... Add IP Address on Interface on Host ${dst_dp_ip}/24 ${dst_dp_iface}.${s_tag}.${c_tag} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_name} AND
415 ... Start DHCP Server on Remote Host ${dst_dp_iface}.${s_tag}.${c_tag} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_name}
416 Send Dhclient Request ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_container_name}
417 Run Keyword If '${dhcp_should_pass}' == 'True' Wait Until Keyword Succeeds 60s 5s Check IPv4 Address on DHCP Client True ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_container_name}
You Wang88e1d852018-10-05 11:44:19 -0700418 Run Keyword If '${dhcp_should_pass}' == 'False' Sleep 10s
You Wang59ded6c2018-10-05 17:43:44 -0700419 Run Keyword If '${dhcp_should_pass}' == 'False' Check IPv4 Address on DHCP Client False ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_container_name}
420 Run Keyword If '${ping_should_pass}' == 'True' Wait Until Keyword Succeeds 60s 5s Check Ping True ${dst_dp_ip} ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_container_name}
421 ... ELSE Wait Until Keyword Succeeds 60s 5s Check Ping False ${dst_dp_ip} ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_container_name}
You Wang0c2b3662018-10-01 16:56:17 -0700422
423Reinstall Voltha
You Wang88e1d852018-10-05 11:44:19 -0700424 Run ${export_kubeconfig}; helm delete --purge voltha
425 Wait Until Keyword Succeeds 60s 10s Helm Chart is Removed voltha
426 Wait Until Keyword Succeeds 120s 10s Kubernetes PODs in Namespace are Removed voltha
You Wang59ded6c2018-10-05 17:43:44 -0700427 Run ${export_kubeconfig}; cd ${HELM_CHARTS_DIR}; helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
428 Run ${export_kubeconfig}; cd ${HELM_CHARTS_DIR}; helm dep up voltha
429 Run ${export_kubeconfig}; helm install -n voltha -f ${KUBERNETES_YAML} --set etcd-operator.customResources.createEtcdClusterCRD=false ${HELM_CHARTS_DIR}/voltha
430 Run ${export_kubeconfig}; helm upgrade -f ${KUBERNETES_YAML} --set etcd-operator.customResources.createEtcdClusterCRD=true voltha ${HELM_CHARTS_DIR}/voltha
431 Wait Until Keyword Succeeds 60s 10s Kubernetes PODs in Namespace are Running voltha ${VOLTHA_POD_NUM}
You Wang0c2b3662018-10-01 16:56:17 -0700432 Sleep 10s