blob: da0a422904c7a8d1386d791ac2a0aa79d83010f2 [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 Wang5be816a2018-10-11 16:45:31 -070054 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
55 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
56 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
57 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
58 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
59 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
60 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 -070061
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
You Wang5be816a2018-10-11 16:45:31 -070070 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
71 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
72 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
73 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
74 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
75 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
76 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 -070077 Clean Up Linux
78 Remove Whitelist
You Wanga4524992018-10-17 16:38:33 -070079 Wait Until Keyword Succeeds 60s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -070080 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
81 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
82 Validate Authentication False ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
83 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 -070084 Clean Up Linux
85 Create Whitelist
You Wang5be816a2018-10-11 16:45:31 -070086 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
87 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
88 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
89 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
90 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
91 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 -070092
93ONU in Correct Location -> ONU in Wrong Location -> ONU in Correct Location
94 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
95 ... Configure whitelist with correct ONU location
96 ... Validate successful authentication/DHCP/E2E ping
97 ... Update whitelist with wrong ONU location
98 ... Validate failed authentication/DHCP/E2E ping
99 ... Update whitelist with correct ONU location
100 ... Validate successful authentication/DHCP/E2E ping
You Wang5be816a2018-10-11 16:45:31 -0700101 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
102 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
103 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
104 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
105 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
106 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
107 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 -0700108 Clean Up Linux
109 Update Whitelist with Wrong Location
You Wanga4524992018-10-17 16:38:33 -0700110 Wait Until Keyword Succeeds 60s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700111 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 ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
114 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 -0700115 Clean Up Linux
116 Update Whitelist with Correct Location
You Wang5be816a2018-10-11 16:45:31 -0700117 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 ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
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 ${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 -0700123
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
You Wang070302c2018-10-17 15:42:24 -0700129 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
You Wang9f7eb392018-10-09 17:49:34 -0700130 ... Recreate subscriber model
131 ... Validate successful authentication/DHCP/E2E ping
You Wang5be816a2018-10-11 16:45:31 -0700132 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 ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
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 ${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 -0700139 Clean Up Linux
140 Remove Subscriber
You Wang070302c2018-10-17 15:42:24 -0700141 Sleep 10s
142 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 -0700143 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 -0700144 Clean Up Linux
145 Create Subscriber
You Wang070302c2018-10-17 15:42:24 -0700146 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700147 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
148 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
149 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
150 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 -0700151
152ONU in Correct Location (Skip Subscriber Provisioning) -> Provision Subscriber
153 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
154 ... Configure whitelist with correct ONU location and skip provisioning subscriber
You Wang5be816a2018-10-11 16:45:31 -0700155 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
You Wang9f7eb392018-10-09 17:49:34 -0700156 ... Provision subscriber
157 ... Validate successful authentication/DHCP/E2E ping
158 [Setup] None
159 Create Whitelist
160 Create VOLT
You Wang5be816a2018-10-11 16:45:31 -0700161 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
162 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
163 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 -0700164 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700165 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 -0700166 Clean Up Linux
167 Create Subscriber
You Wanga4524992018-10-17 16:38:33 -0700168 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700169 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
170 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
171 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
172 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 -0700173
174ONU in Correct Location (Skip Authentication)
175 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
176 ... Configure whitelist with correct ONU location and skip RG authentication
177 ... Validate failed authentication/DHCP/E2E ping
You Wang5be816a2018-10-11 16:45:31 -0700178 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
179 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
180 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
181 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 -0700182
You Wang9f7eb392018-10-09 17:49:34 -0700183ONU not in Whitelist
You Wang0c2b3662018-10-01 16:56:17 -0700184 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
You Wang9f7eb392018-10-09 17:49:34 -0700185 ... Skip whitelist configuration for ONU
186 ... Validate failed authentication/DHCP/E2E ping
You Wang0c2b3662018-10-01 16:56:17 -0700187 [Setup] None
You Wang9f7eb392018-10-09 17:49:34 -0700188 Create Subscriber
189 Create VOLT
You Wang5be816a2018-10-11 16:45:31 -0700190 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
191 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
192 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
193 Validate Authentication False ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
194 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
195 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
196 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 -0700197
You Wang9f7eb392018-10-09 17:49:34 -0700198ONU not in Whitelist (Skip Subscriber Provisioning) -> Add ONU to Whitelist -> Provision Subscriber
199 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
200 ... Skip whitelist configuration for ONU and subscriber provisioning
You Wang5be816a2018-10-11 16:45:31 -0700201 ... Validate successful authentication but failed DHCP/E2E ping
You Wang9f7eb392018-10-09 17:49:34 -0700202 ... Configure whitelist with correct ONU location
You Wang5be816a2018-10-11 16:45:31 -0700203 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
You Wang9f7eb392018-10-09 17:49:34 -0700204 ... Provision subscriber
205 ... Validate successful authentication/DHCP/E2E ping
206 [Setup] None
207 Create VOLT
You Wang5be816a2018-10-11 16:45:31 -0700208 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
209 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
210 Validate Authentication False ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
211 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
212 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 -0700213 Clean Up Linux
214 Create Whitelist
You Wanga4524992018-10-17 16:38:33 -0700215 Wait Until Keyword Succeeds 60s 2s Validate ONU States ACTIVE ENABLED ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700216 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
217 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 -0700218 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700219 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 -0700220 Clean Up Linux
221 Create Subscriber
You Wanga4524992018-10-17 16:38:33 -0700222 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700223 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
224 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
225 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
226 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 -0700227
228ONU in Wrong Location
229 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
230 ... Configure whitelist with wrong ONU location
231 ... Validate failed authentication/DHCP/E2E ping
232 Update Whitelist with Wrong Location
You Wang5be816a2018-10-11 16:45:31 -0700233 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
234 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
235 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
236 Validate Authentication False ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
237 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
238 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
239 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 -0700240
You Wang5be816a2018-10-11 16:45:31 -0700241ONU in Wrong Location (Skip Subscriber Provisioning) -> ONU in Correct Location -> Provision Subscriber
You Wang9f7eb392018-10-09 17:49:34 -0700242 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
243 ... Configure whitelist with wrong ONU location and skip subscriber provisioning
244 ... Validate failed authentication/DHCP/E2E ping
245 ... Configure whitelist with correct ONU location
You Wang5be816a2018-10-11 16:45:31 -0700246 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
You Wang9f7eb392018-10-09 17:49:34 -0700247 ... Provision subscriber
248 ... Validate successful authentication/DHCP/E2E ping
249 [Setup] None
You Wang9f7eb392018-10-09 17:49:34 -0700250 Create VOLT
251 Create Whitelist
252 Update Whitelist with Wrong Location
You Wang5be816a2018-10-11 16:45:31 -0700253 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
254 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
255 Validate Authentication False ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
256 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
257 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 -0700258 Clean Up Linux
259 Update Whitelist with Correct Location
You Wanga4524992018-10-17 16:38:33 -0700260 Wait Until Keyword Succeeds 60s 2s Validate ONU States ACTIVE ENABLED ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700261 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
262 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 -0700263 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700264 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 -0700265 Clean Up Linux
266 Create Subscriber
You Wanga4524992018-10-17 16:38:33 -0700267 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
You Wang5be816a2018-10-11 16:45:31 -0700268 Validate Authentication True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
269 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
270 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
271 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 -0700272
Suchitra Vemuriff825322018-09-07 14:00:04 -0700273*** Keywords ***
You Wang9f7eb392018-10-09 17:49:34 -0700274Setup Suite
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700275 ${auth} = Create List ${XOS_USER} ${XOS_PASSWD}
276 ${HEADERS} Create Dictionary Content-Type=application/json
277 Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS}
278 ${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE}
279 ${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE}
Kailash Khalasi30a6a392018-09-10 14:32:39 -0700280 ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
You Wang9f7eb392018-10-09 17:49:34 -0700281 Set Suite Variable ${AttWhiteListList}
Suchitra Vemuriff825322018-09-07 14:00:04 -0700282 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700283 ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
Suchitra Vemuriff825322018-09-07 14:00:04 -0700284 ${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number
Suchitra Vemuriff825322018-09-07 14:00:04 -0700285 Set Global Variable ${onu_device}
You Wang9f7eb392018-10-09 17:49:34 -0700286 ${onu_location}= Get From Dictionary ${AttWhiteListDict} pon_port_id
287 Set Global Variable ${onu_location}
Kailash Khalasi30a6a392018-09-10 14:32:39 -0700288 ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
You Wang9f7eb392018-10-09 17:49:34 -0700289 Set Global Variable ${SubscriberList}
Kailash Khalasi6dab16e2018-09-17 20:24:08 -0700290 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
291 ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag
292 ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700293 ${VoltDeviceList}= utils.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
You Wang9f7eb392018-10-09 17:49:34 -0700294 Set Global Variable ${VoltDeviceList}
Kailash Khalasi6dab16e2018-09-17 20:24:08 -0700295 Set Suite Variable ${s_tag}
296 Set Suite Variable ${c_tag}
You Wang59ded6c2018-10-05 17:43:44 -0700297 Set Global Variable ${export_kubeconfig} export KUBECONFIG=${KUBERNETES_CONF}
298 # Read variables from yaml file
299 ${src_ip}= Evaluate ${hosts}.get("src").get("ip")
300 ${src_user}= Evaluate ${hosts}.get("src").get("user")
301 ${src_pass}= Evaluate ${hosts}.get("src").get("pass")
You Wang5be816a2018-10-11 16:45:31 -0700302 ${src_container_type}= Evaluate ${hosts}.get("src").get("container_type")
You Wang59ded6c2018-10-05 17:43:44 -0700303 ${src_container_name}= Evaluate ${hosts}.get("src").get("container_name")
304 ${src_iface}= Evaluate ${hosts}.get("src").get("dp_iface_name")
305 ${dst_ip}= Evaluate ${hosts}.get("dst").get("ip")
306 ${dst_user} = Evaluate ${hosts}.get("dst").get("user")
307 ${dst_pass}= Evaluate ${hosts}.get("dst").get("pass")
You Wang5be816a2018-10-11 16:45:31 -0700308 ${dst_container_type}= Evaluate ${hosts}.get("dst").get("container_type")
You Wang59ded6c2018-10-05 17:43:44 -0700309 ${dst_container_name}= Evaluate ${hosts}.get("dst").get("container_name")
310 ${dst_dp_iface}= Evaluate ${hosts}.get("dst").get("dp_iface_name")
311 ${dst_dp_ip}= Evaluate ${hosts}.get("dst").get("dp_iface_ip_qinq")
312 ${olt_ip}= Evaluate ${olts}[0].get("ip")
313 ${olt_user}= Evaluate ${olts}[0].get("user")
314 ${olt_pass}= Evaluate ${olts}[0].get("pass")
You Wang8fff6a02018-10-15 16:26:54 -0700315 ${k8s_node_ip}= Evaluate ${nodes}[0].get("ip")
316 ${k8s_node_user}= Evaluate ${nodes}[0].get("user")
317 ${k8s_node_pass}= Evaluate ${nodes}[0].get("pass")
You Wang59ded6c2018-10-05 17:43:44 -0700318 Set Suite Variable ${src_ip}
319 Set Suite Variable ${src_user}
320 Set Suite Variable ${src_pass}
You Wang5be816a2018-10-11 16:45:31 -0700321 Set Suite Variable ${src_container_type}
You Wang59ded6c2018-10-05 17:43:44 -0700322 Set Suite Variable ${src_container_name}
323 Set Suite Variable ${src_iface}
324 Set Suite Variable ${dst_ip}
325 Set Suite Variable ${dst_user}
326 Set Suite Variable ${dst_pass}
You Wang5be816a2018-10-11 16:45:31 -0700327 Set Suite Variable ${dst_container_type}
You Wang59ded6c2018-10-05 17:43:44 -0700328 Set Suite Variable ${dst_container_name}
329 Set Suite Variable ${dst_dp_iface}
330 Set Suite Variable ${dst_dp_ip}
331 Set Suite Variable ${olt_ip}
332 Set Suite Variable ${olt_user}
333 Set Suite Variable ${olt_pass}
You Wang8fff6a02018-10-15 16:26:54 -0700334 Set Suite Variable ${k8s_node_ip}
335 Set Suite Variable ${k8s_node_user}
336 Set Suite Variable ${k8s_node_pass}
337 @{container_list}= Create List
Kailash Khalasidd9136a2018-10-18 11:16:18 -0700338 Append To List ${container_list} att-workflow-att-workflow-driver
You Wangf573e402018-10-17 14:01:59 -0700339 Append To List ${container_list} onos
340 Append To List ${container_list} xos-core
341 Append To List ${container_list} vcore
You Wang8fff6a02018-10-15 16:26:54 -0700342 Set Suite Variable ${container_list}
343 ${datetime}= Get Current Datetime On Kubernetes Node ${k8s_node_ip} ${k8s_node_user} ${k8s_node_pass}
344 Set Suite Variable ${datetime}
Suchitra Vemuriff825322018-09-07 14:00:04 -0700345
You Wang9f7eb392018-10-09 17:49:34 -0700346Teardown Suite
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700347 [Documentation] Performs any additional cleanup required
348 Log Suite Teardown cleanup
349 Delete All Sessions
350
You Wang9f7eb392018-10-09 17:49:34 -0700351Setup Test
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700352 [Documentation] Re-create Subscriber, whitelist, and olt-device models to test
353 Log Re-creating objects
You Wang8fff6a02018-10-15 16:26:54 -0700354 ${datetime}= Get Current Datetime On Kubernetes Node ${k8s_node_ip} ${k8s_node_user} ${k8s_node_pass}
You Wang9f7eb392018-10-09 17:49:34 -0700355 Create Whitelist
356 Create Subscriber
357 Create VOLT
358
You Wang9f7eb392018-10-09 17:49:34 -0700359Teardown Test
Kailash Khalasif3e0a9f2018-09-18 13:43:42 -0700360 [Documentation] Delete xos objects, kills processes and cleans up interfaces on src+dst servers
You Wang9f7eb392018-10-09 17:49:34 -0700361 Clean Up Linux
362 Clean Up XOS
You Wang8fff6a02018-10-15 16:26:54 -0700363 Log Kubernetes Containers Logs Since Time ${datetime} ${container_list}
You Wang9f7eb392018-10-09 17:49:34 -0700364
365Clean Up Linux
366 [Documentation] Kill processes and clean up interfaces on src+dst servers
You Wang5be816a2018-10-11 16:45:31 -0700367 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
368 Run Keyword And Ignore Error Kill Linux Process [d]hclient ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
369 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}
370 Delete IP Addresses from Interface on Remote Host ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
371 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 -0700372
373Clean Up XOS
374 [Documentation] Clean up all XOS objects and reinstall voltha after OLT reboots
You Wang88e1d852018-10-05 11:44:19 -0700375 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
376 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_DEVICE}
377 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
You Wang0c2b3662018-10-01 16:56:17 -0700378 Wait Until Keyword Succeeds 120s 10s Check Remote System Reachability False ${olt_ip}
379 Wait Until Keyword Succeeds 120s 10s Check Remote System Reachability True ${olt_ip}
380 Wait Until Keyword Succeeds 120s 10s Openolt is Up ${olt_ip} ${olt_user} ${olt_pass}
Kailash Khalasia0810ce2018-09-10 13:03:27 -0700381
You Wang5be816a2018-10-11 16:45:31 -0700382Create Whitelist
383 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
384 CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
385
You Wang9f7eb392018-10-09 17:49:34 -0700386Remove Whitelist
387 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
388 CORD Delete ${ATT_WHITELIST} ${whitelist_id}
389
390Update Whitelist with Wrong Location
391 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
392 CORD Put ${ATT_WHITELIST} {"pon_port_id": 55 } ${whitelist_id}
393
394Update Whitelist with Correct Location
395 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
396 CORD Put ${ATT_WHITELIST} {"pon_port_id": ${onu_location} } ${whitelist_id}
397
You Wang5be816a2018-10-11 16:45:31 -0700398Create Subscriber
399 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
400 Wait Until Keyword Succeeds 120s 15s CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict}
Kailash Khalasia0810ce2018-09-10 13:03:27 -0700401
You Wangf573e402018-10-17 14:01:59 -0700402Remove Subscriber
403 ${subscriber_id}= Retrieve Subscriber ${c_tag}
404 CORD Delete ${VOLT_SUBSCRIBER} ${subscriber_id}
405
You Wang5be816a2018-10-11 16:45:31 -0700406Create VOLT
407 ${VoltDeviceDict}= utils.listToDict ${VoltDeviceList} 0
408 CORD Post ${VOLT_DEVICE} ${VoltDeviceDict}