blob: aeb78dc6ce8d4f81a0d5f5715d30ce478758dc52 [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
Kailash Khalasi92061c12018-10-29 11:52:39 -070054 [Tags] test1
You Wang5be816a2018-10-11 16:45:31 -070055 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
56 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
57 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
58 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
59 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
60 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
61 Validate DHCP and Ping True True ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang0c2b3662018-10-01 16:56:17 -070062
You Wang9f7eb392018-10-09 17:49:34 -070063ONU in Correct Location -> Remove ONU from Whitelist -> Add ONU to Whitelist
You Wang0c2b3662018-10-01 16:56:17 -070064 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
You Wang9f7eb392018-10-09 17:49:34 -070065 ... Configure whitelist with correct ONU location
66 ... Validate successful authentication/DHCP/E2E ping
67 ... Remove ONU from whitelist
68 ... Validate failed authentication/DHCP/E2E ping
69 ... Add ONU to whitelist
70 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -070071 [Tags] test2
You Wang5be816a2018-10-11 16:45:31 -070072 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 ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
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 ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -070079 Clean Up Linux
80 Remove Whitelist
You Wanga4524992018-10-17 16:38:33 -070081 Wait Until Keyword Succeeds 60s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -070082 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
83 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
84 Validate Authentication False ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
85 Validate DHCP and Ping False False ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -070086 Clean Up Linux
87 Create Whitelist
You Wang5be816a2018-10-11 16:45:31 -070088 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
89 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
90 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
91 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
92 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
93 Validate DHCP and Ping True True ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -070094
95ONU in Correct Location -> ONU in Wrong Location -> ONU in Correct Location
96 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
97 ... Configure whitelist with correct ONU location
98 ... Validate successful authentication/DHCP/E2E ping
99 ... Update whitelist with wrong ONU location
100 ... Validate failed authentication/DHCP/E2E ping
101 ... Update whitelist with correct ONU location
102 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700103 [Tags] test3
You Wang5be816a2018-10-11 16:45:31 -0700104 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
105 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
106 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
107 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
108 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
109 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
110 Validate DHCP and Ping True True ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -0700111 Clean Up Linux
112 Update Whitelist with Wrong Location
You Wanga4524992018-10-17 16:38:33 -0700113 Wait Until Keyword Succeeds 60s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700114 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
115 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
116 Validate Authentication False ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
117 Validate DHCP and Ping False False ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -0700118 Clean Up Linux
119 Update Whitelist with Correct Location
You Wang5be816a2018-10-11 16:45:31 -0700120 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
121 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
122 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
123 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
124 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
125 Validate DHCP and Ping True True ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -0700126
127ONU in Correct Location -> Remove Subscriber -> Create Subscriber
128 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
129 ... Configure whitelist with correct ONU location
130 ... Validate successful authentication/DHCP/E2E ping
131 ... Remove subscriber model
You Wang070302c2018-10-17 15:42:24 -0700132 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
You Wang9f7eb392018-10-09 17:49:34 -0700133 ... Recreate subscriber model
134 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700135 [Tags] test4
You Wang5be816a2018-10-11 16:45:31 -0700136 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
137 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
138 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
139 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
140 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
141 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
142 Validate DHCP and Ping True True ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -0700143 Clean Up Linux
144 Remove Subscriber
You Wang070302c2018-10-17 15:42:24 -0700145 Sleep 10s
146 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
You Wang5be816a2018-10-11 16:45:31 -0700147 Validate DHCP and Ping False False ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -0700148 Clean Up Linux
149 Create Subscriber
You Wang070302c2018-10-17 15:42:24 -0700150 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700151 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
152 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
153 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
154 Validate DHCP and Ping True True ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -0700155
156ONU in Correct Location (Skip Subscriber Provisioning) -> Provision Subscriber
157 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
158 ... Configure whitelist with correct ONU location and skip provisioning subscriber
You Wang5be816a2018-10-11 16:45:31 -0700159 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
You Wang9f7eb392018-10-09 17:49:34 -0700160 ... Provision subscriber
161 ... Validate successful authentication/DHCP/E2E ping
162 [Setup] None
Kailash Khalasi92061c12018-10-29 11:52:39 -0700163 [Tags] test5
You Wang9f7eb392018-10-09 17:49:34 -0700164 Create Whitelist
165 Create VOLT
You Wang5be816a2018-10-11 16:45:31 -0700166 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
167 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
168 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
You Wang8fff6a02018-10-15 16:26:54 -0700169 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700170 Validate DHCP and Ping False False ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -0700171 Clean Up Linux
172 Create Subscriber
You Wanga4524992018-10-17 16:38:33 -0700173 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700174 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
175 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
176 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
177 Validate DHCP and Ping True True ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -0700178
179ONU in Correct Location (Skip Authentication)
180 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
181 ... Configure whitelist with correct ONU location and skip RG authentication
182 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700183 [Tags] test6
You Wang5be816a2018-10-11 16:45:31 -0700184 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
185 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
186 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
187 Validate DHCP and Ping False False ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang0c2b3662018-10-01 16:56:17 -0700188
You Wang9f7eb392018-10-09 17:49:34 -0700189ONU not in Whitelist
You Wang0c2b3662018-10-01 16:56:17 -0700190 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
You Wang9f7eb392018-10-09 17:49:34 -0700191 ... Skip whitelist configuration for ONU
192 ... Validate failed authentication/DHCP/E2E ping
You Wang0c2b3662018-10-01 16:56:17 -0700193 [Setup] None
Kailash Khalasi92061c12018-10-29 11:52:39 -0700194 [Tags] test7
You Wang9f7eb392018-10-09 17:49:34 -0700195 Create Subscriber
196 Create VOLT
You Wang5be816a2018-10-11 16:45:31 -0700197 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
198 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
199 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
200 Validate Authentication False ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
201 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
202 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
203 Validate DHCP and Ping False False ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
Suchitra Vemuriff825322018-09-07 14:00:04 -0700204
You Wang9f7eb392018-10-09 17:49:34 -0700205ONU not in Whitelist (Skip Subscriber Provisioning) -> Add ONU to Whitelist -> Provision Subscriber
206 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
207 ... Skip whitelist configuration for ONU and subscriber provisioning
You Wang5be816a2018-10-11 16:45:31 -0700208 ... Validate successful authentication but failed DHCP/E2E ping
You Wang9f7eb392018-10-09 17:49:34 -0700209 ... Configure whitelist with correct ONU location
You Wang5be816a2018-10-11 16:45:31 -0700210 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
You Wang9f7eb392018-10-09 17:49:34 -0700211 ... Provision subscriber
212 ... Validate successful authentication/DHCP/E2E ping
213 [Setup] None
Kailash Khalasi92061c12018-10-29 11:52:39 -0700214 [Tags] test8
You Wang9f7eb392018-10-09 17:49:34 -0700215 Create VOLT
You Wang5be816a2018-10-11 16:45:31 -0700216 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
217 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
218 Validate Authentication False ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
219 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
220 Validate DHCP and Ping False False ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -0700221 Clean Up Linux
222 Create Whitelist
You Wanga4524992018-10-17 16:38:33 -0700223 Wait Until Keyword Succeeds 60s 2s Validate ONU States ACTIVE ENABLED ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700224 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
225 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
You Wang8fff6a02018-10-15 16:26:54 -0700226 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700227 Validate DHCP and Ping False False ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -0700228 Clean Up Linux
229 Create Subscriber
You Wanga4524992018-10-17 16:38:33 -0700230 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700231 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
232 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
233 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
234 Validate DHCP and Ping True True ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -0700235
236ONU in Wrong Location
237 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
238 ... Configure whitelist with wrong ONU location
239 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700240 [Tags] test9
You Wang9f7eb392018-10-09 17:49:34 -0700241 Update Whitelist with Wrong Location
You Wang5be816a2018-10-11 16:45:31 -0700242 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
243 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
244 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
245 Validate Authentication False ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
246 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
247 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
248 Validate DHCP and Ping False False ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -0700249
You Wang5be816a2018-10-11 16:45:31 -0700250ONU in Wrong Location (Skip Subscriber Provisioning) -> ONU in Correct Location -> Provision Subscriber
You Wang9f7eb392018-10-09 17:49:34 -0700251 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
252 ... Configure whitelist with wrong ONU location and skip subscriber provisioning
253 ... Validate failed authentication/DHCP/E2E ping
254 ... Configure whitelist with correct ONU location
You Wang5be816a2018-10-11 16:45:31 -0700255 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
You Wang9f7eb392018-10-09 17:49:34 -0700256 ... Provision subscriber
257 ... Validate successful authentication/DHCP/E2E ping
258 [Setup] None
Kailash Khalasi92061c12018-10-29 11:52:39 -0700259 [Tags] test10
You Wang9f7eb392018-10-09 17:49:34 -0700260 Create VOLT
261 Create Whitelist
262 Update Whitelist with Wrong Location
You Wang5be816a2018-10-11 16:45:31 -0700263 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
264 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
265 Validate Authentication False ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
266 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
267 Validate DHCP and Ping False False ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -0700268 Clean Up Linux
269 Update Whitelist with Correct Location
You Wanga4524992018-10-17 16:38:33 -0700270 Wait Until Keyword Succeeds 60s 2s Validate ONU States ACTIVE ENABLED ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700271 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
272 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
You Wang8fff6a02018-10-15 16:26:54 -0700273 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700274 Validate DHCP and Ping False False ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -0700275 Clean Up Linux
276 Create Subscriber
You Wanga4524992018-10-17 16:38:33 -0700277 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700278 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
279 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
280 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
281 Validate DHCP and Ping True True ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} ${dst_dp_iface} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -0700282
Suchitra Vemuriff825322018-09-07 14:00:04 -0700283*** Keywords ***
You Wang9f7eb392018-10-09 17:49:34 -0700284Setup Suite
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700285 ${auth} = Create List ${XOS_USER} ${XOS_PASSWD}
286 ${HEADERS} Create Dictionary Content-Type=application/json
287 Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS}
288 ${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE}
289 ${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE}
Kailash Khalasi30a6a392018-09-10 14:32:39 -0700290 ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
You Wang9f7eb392018-10-09 17:49:34 -0700291 Set Suite Variable ${AttWhiteListList}
Suchitra Vemuriff825322018-09-07 14:00:04 -0700292 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700293 ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
Suchitra Vemuriff825322018-09-07 14:00:04 -0700294 ${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number
Suchitra Vemuriff825322018-09-07 14:00:04 -0700295 Set Global Variable ${onu_device}
You Wang9f7eb392018-10-09 17:49:34 -0700296 ${onu_location}= Get From Dictionary ${AttWhiteListDict} pon_port_id
297 Set Global Variable ${onu_location}
Kailash Khalasi30a6a392018-09-10 14:32:39 -0700298 ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
You Wang9f7eb392018-10-09 17:49:34 -0700299 Set Global Variable ${SubscriberList}
Kailash Khalasi6dab16e2018-09-17 20:24:08 -0700300 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
301 ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag
302 ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700303 ${VoltDeviceList}= utils.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
You Wang9f7eb392018-10-09 17:49:34 -0700304 Set Global Variable ${VoltDeviceList}
Kailash Khalasi6dab16e2018-09-17 20:24:08 -0700305 Set Suite Variable ${s_tag}
306 Set Suite Variable ${c_tag}
You Wang59ded6c2018-10-05 17:43:44 -0700307 Set Global Variable ${export_kubeconfig} export KUBECONFIG=${KUBERNETES_CONF}
308 # Read variables from yaml file
309 ${src_ip}= Evaluate ${hosts}.get("src").get("ip")
310 ${src_user}= Evaluate ${hosts}.get("src").get("user")
311 ${src_pass}= Evaluate ${hosts}.get("src").get("pass")
You Wang5be816a2018-10-11 16:45:31 -0700312 ${src_container_type}= Evaluate ${hosts}.get("src").get("container_type")
You Wang59ded6c2018-10-05 17:43:44 -0700313 ${src_container_name}= Evaluate ${hosts}.get("src").get("container_name")
314 ${src_iface}= Evaluate ${hosts}.get("src").get("dp_iface_name")
315 ${dst_ip}= Evaluate ${hosts}.get("dst").get("ip")
316 ${dst_user} = Evaluate ${hosts}.get("dst").get("user")
317 ${dst_pass}= Evaluate ${hosts}.get("dst").get("pass")
You Wang5be816a2018-10-11 16:45:31 -0700318 ${dst_container_type}= Evaluate ${hosts}.get("dst").get("container_type")
You Wang59ded6c2018-10-05 17:43:44 -0700319 ${dst_container_name}= Evaluate ${hosts}.get("dst").get("container_name")
320 ${dst_dp_iface}= Evaluate ${hosts}.get("dst").get("dp_iface_name")
321 ${dst_dp_ip}= Evaluate ${hosts}.get("dst").get("dp_iface_ip_qinq")
322 ${olt_ip}= Evaluate ${olts}[0].get("ip")
323 ${olt_user}= Evaluate ${olts}[0].get("user")
324 ${olt_pass}= Evaluate ${olts}[0].get("pass")
You Wang8fff6a02018-10-15 16:26:54 -0700325 ${k8s_node_ip}= Evaluate ${nodes}[0].get("ip")
326 ${k8s_node_user}= Evaluate ${nodes}[0].get("user")
327 ${k8s_node_pass}= Evaluate ${nodes}[0].get("pass")
You Wang59ded6c2018-10-05 17:43:44 -0700328 Set Suite Variable ${src_ip}
329 Set Suite Variable ${src_user}
330 Set Suite Variable ${src_pass}
You Wang5be816a2018-10-11 16:45:31 -0700331 Set Suite Variable ${src_container_type}
You Wang59ded6c2018-10-05 17:43:44 -0700332 Set Suite Variable ${src_container_name}
333 Set Suite Variable ${src_iface}
334 Set Suite Variable ${dst_ip}
335 Set Suite Variable ${dst_user}
336 Set Suite Variable ${dst_pass}
You Wang5be816a2018-10-11 16:45:31 -0700337 Set Suite Variable ${dst_container_type}
You Wang59ded6c2018-10-05 17:43:44 -0700338 Set Suite Variable ${dst_container_name}
339 Set Suite Variable ${dst_dp_iface}
340 Set Suite Variable ${dst_dp_ip}
341 Set Suite Variable ${olt_ip}
342 Set Suite Variable ${olt_user}
343 Set Suite Variable ${olt_pass}
You Wang8fff6a02018-10-15 16:26:54 -0700344 Set Suite Variable ${k8s_node_ip}
345 Set Suite Variable ${k8s_node_user}
346 Set Suite Variable ${k8s_node_pass}
347 @{container_list}= Create List
Kailash Khalasidd9136a2018-10-18 11:16:18 -0700348 Append To List ${container_list} att-workflow-att-workflow-driver
You Wangf573e402018-10-17 14:01:59 -0700349 Append To List ${container_list} onos
350 Append To List ${container_list} xos-core
351 Append To List ${container_list} vcore
You Wang8fff6a02018-10-15 16:26:54 -0700352 Set Suite Variable ${container_list}
353 ${datetime}= Get Current Datetime On Kubernetes Node ${k8s_node_ip} ${k8s_node_user} ${k8s_node_pass}
354 Set Suite Variable ${datetime}
Suchitra Vemuriff825322018-09-07 14:00:04 -0700355
You Wang9f7eb392018-10-09 17:49:34 -0700356Teardown Suite
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700357 [Documentation] Performs any additional cleanup required
358 Log Suite Teardown cleanup
359 Delete All Sessions
360
You Wang9f7eb392018-10-09 17:49:34 -0700361Setup Test
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700362 [Documentation] Re-create Subscriber, whitelist, and olt-device models to test
363 Log Re-creating objects
You Wang8fff6a02018-10-15 16:26:54 -0700364 ${datetime}= Get Current Datetime On Kubernetes Node ${k8s_node_ip} ${k8s_node_user} ${k8s_node_pass}
You Wang9f7eb392018-10-09 17:49:34 -0700365 Create Whitelist
366 Create Subscriber
367 Create VOLT
368
You Wang9f7eb392018-10-09 17:49:34 -0700369Teardown Test
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700370 [Documentation] Delete xos objects, kills processes and cleans up interfaces on src+dst servers
You Wang9f7eb392018-10-09 17:49:34 -0700371 Clean Up Linux
372 Clean Up XOS
You Wang8fff6a02018-10-15 16:26:54 -0700373 Log Kubernetes Containers Logs Since Time ${datetime} ${container_list}
You Wang9f7eb392018-10-09 17:49:34 -0700374
375Clean Up Linux
376 [Documentation] Kill processes and clean up interfaces on src+dst servers
You Wang5be816a2018-10-11 16:45:31 -0700377 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
378 Run Keyword And Ignore Error Kill Linux Process [d]hclient ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
379 Run Keyword If '${dst_ip}' != '${None}' Run Keyword And Ignore Error Kill Linux Process [d]hcpd ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
380 Delete IP Addresses from Interface on Remote Host ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
381 Run Keyword If '${dst_ip}' != '${None}' Delete Interface on Remote Host ${dst_dp_iface}.${s_tag} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
You Wang9f7eb392018-10-09 17:49:34 -0700382
383Clean Up XOS
384 [Documentation] Clean up all XOS objects and reinstall voltha after OLT reboots
You Wang88e1d852018-10-05 11:44:19 -0700385 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
386 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_DEVICE}
387 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
You Wang0c2b3662018-10-01 16:56:17 -0700388 Wait Until Keyword Succeeds 120s 10s Check Remote System Reachability False ${olt_ip}
389 Wait Until Keyword Succeeds 120s 10s Check Remote System Reachability True ${olt_ip}
390 Wait Until Keyword Succeeds 120s 10s Openolt is Up ${olt_ip} ${olt_user} ${olt_pass}
Kailash Khalasia0810ce2018-09-10 13:03:27 -0700391
You Wang5be816a2018-10-11 16:45:31 -0700392Create Whitelist
393 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
394 CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
395
You Wang9f7eb392018-10-09 17:49:34 -0700396Remove Whitelist
397 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
398 CORD Delete ${ATT_WHITELIST} ${whitelist_id}
399
400Update Whitelist with Wrong Location
401 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
402 CORD Put ${ATT_WHITELIST} {"pon_port_id": 55 } ${whitelist_id}
403
404Update Whitelist with Correct Location
405 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
406 CORD Put ${ATT_WHITELIST} {"pon_port_id": ${onu_location} } ${whitelist_id}
407
You Wang5be816a2018-10-11 16:45:31 -0700408Create Subscriber
409 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
410 Wait Until Keyword Succeeds 120s 15s CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict}
Kailash Khalasia0810ce2018-09-10 13:03:27 -0700411
You Wangf573e402018-10-17 14:01:59 -0700412Remove Subscriber
413 ${subscriber_id}= Retrieve Subscriber ${c_tag}
414 CORD Delete ${VOLT_SUBSCRIBER} ${subscriber_id}
415
You Wang5be816a2018-10-11 16:45:31 -0700416Create VOLT
417 ${VoltDeviceDict}= utils.listToDict ${VoltDeviceList} 0
418 CORD Post ${VOLT_DEVICE} ${VoltDeviceDict}