blob: fc0f15ea44ef2360d8e81aa64d763e33d379f3eb [file] [log] [blame]
Kailash Khalasi16d95c12018-09-21 14:17:28 -07001# Copyright 2017-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15*** Settings ***
16Documentation Test various E2E conditions for seba-in-a-box
17Suite Setup Setup
Kailash Khalasibf1478b2018-10-17 11:58:58 -070018Suite Teardown Delete All Sessions
19Test Setup Setup Test
20Test Teardown Test Cleanup
Kailash Khalasi16d95c12018-09-21 14:17:28 -070021Library Collections
22Library String
23Library OperatingSystem
24Library XML
25Library RequestsLibrary
26Library ../../Framework/utils/utils.py
27Resource ../../Framework/utils/utils.robot
28Library ../../Framework/restApi.py
29Resource ../../Framework/Subscriber.robot
30Resource ../../Framework/ATTWorkFlowDriver.robot
Kailash Khalasibf1478b2018-10-17 11:58:58 -070031Resource ../../Framework/Kubernetes.robot
Kailash Khalasi16d95c12018-09-21 14:17:28 -070032Resource ../../Framework/ONU.robot
33Resource ../../Framework/DHCP.robot
34Variables ../../Properties/RestApiProperties.py
35
36*** Variables ***
Kailash Khalasibf1478b2018-10-17 11:58:58 -070037${WHITELIST_PATHFILE} ${CURDIR}/data/SIABWhitelist.json
38${SUBSCRIBER_PATHFILE} ${CURDIR}/data/SIABSubscriber.json
Kailash Khalasi16d95c12018-09-21 14:17:28 -070039${VOLT_DEVICE_PATHFILE} ${CURDIR}/data/SIABOLTDevice.json
Kailash Khalasicf006cb2018-10-19 08:36:51 -070040${export_kube_config} export KUBECONFIG=/home/%{USER}/.kube/config
Kailash Khalasibf1478b2018-10-17 11:58:58 -070041${kube_node_ip} localhost
42${dst_host_ip} 172.18.0.10
Kailash Khalasicf006cb2018-10-19 08:36:51 -070043${local_user} %{USER}
44${local_pass} %{USER}
Kailash Khalasi16d95c12018-09-21 14:17:28 -070045
46*** Test Cases ***
Kailash Khalasibf1478b2018-10-17 11:58:58 -070047ONU in Correct Location
48 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
49 ... Configure whitelist with correct ONU location
50 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -070051 [Tags] stable latest
Kailash Khalasibf1478b2018-10-17 11:58:58 -070052 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
53 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
54 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070055 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -070056 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
57 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070058 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasi16d95c12018-09-21 14:17:28 -070059 ${subscriber_id}= Retrieve Subscriber ${c_tag}
60 CORD Put ${VOLT_SUBSCRIBER} {"status":"disabled"} ${subscriber_id}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070061 Validate DHCP and Ping True False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -070062 Restart RG Pod
Kailash Khalasi16d95c12018-09-21 14:17:28 -070063 CORD Put ${VOLT_SUBSCRIBER} {"status":"enabled"} ${subscriber_id}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070064 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
65 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasi16d95c12018-09-21 14:17:28 -070066
Kailash Khalasibf1478b2018-10-17 11:58:58 -070067ONU in Correct Location -> Remove ONU from Whitelist -> Add ONU to Whitelist
68 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
69 ... Configure whitelist with correct ONU location
70 ... Validate successful authentication/DHCP/E2E ping
71 ... Remove ONU from whitelist
72 ... Validate failed authentication/DHCP/E2E ping
73 ... Add ONU to whitelist
74 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -070075 [Tags] latest
Kailash Khalasibf1478b2018-10-17 11:58:58 -070076 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
77 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
78 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070079 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -070080 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
81 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070082 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -070083 Restart RG Pod
84 Remove Whitelist
85 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
86 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070087 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
88 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -070089 Restart RG Pod
90 Create Whitelist
91 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
92 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070093 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -070094 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
95 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070096 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasi16d95c12018-09-21 14:17:28 -070097
Kailash Khalasibf1478b2018-10-17 11:58:58 -070098ONU in Correct Location -> ONU in Wrong Location -> ONU in Correct Location
99 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
100 ... Configure whitelist with correct ONU location
101 ... Validate successful authentication/DHCP/E2E ping
102 ... Update whitelist with wrong ONU location
103 ... Validate failed authentication/DHCP/E2E ping
104 ... Update whitelist with correct ONU location
105 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -0700106 [Tags] latest
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700107 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
108 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
109 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700110 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700111 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
112 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700113 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700114 Restart RG Pod
115 Update Whitelist with Wrong Location
116 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
117 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700118 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
119 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700120 Restart RG Pod
121 Update Whitelist with Correct Location
122 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
123 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700124 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700125 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
126 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700127 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700128
129ONU in Correct Location -> Remove Subscriber -> Create Subscriber
130 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
131 ... Configure whitelist with correct ONU location
132 ... Validate successful authentication/DHCP/E2E ping
133 ... Remove subscriber model
134 ... Validate failed authentication/DHCP/E2E ping
135 ... Recreate subscriber model
136 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -0700137 [Tags] latest
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700138 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
139 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
140 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700141 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700142 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
143 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700144 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700145 Restart RG Pod
146 Remove Subscriber
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700147 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
148 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700149 Restart RG Pod
150 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700151 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700152 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700153 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
154 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700155 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700156
157ONU in Correct Location (Skip Subscriber Provisioning) -> Provision Subscriber
158 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
159 ... Configure whitelist with correct ONU location and skip provisioning subscriber
160 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
161 ... Provision subscriber
162 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -0700163 [Tags] latest
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700164 Remove Subscriber
165 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
166 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700167 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700168 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700169 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700170 Restart RG Pod
171 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700172 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700173 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700174 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
175 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700176 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700177
178ONU in Correct Location (Skip Authentication)
179 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
180 ... Configure whitelist with correct ONU location and skip RG authentication
181 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -0700182 [Tags] stable latest
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700183 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
184 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
185 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasi4ce3fe22018-10-22 14:36:27 -0700186 Validate DHCP and Ping True False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700187
188ONU not in Whitelist
189 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
190 ... Skip whitelist configuration for ONU
191 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -0700192 [Tags] stable latest
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700193 Remove Whitelist
194 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
195 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
196 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700197 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700198 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}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700200 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700201
202ONU not in Whitelist (Skip Subscriber Provisioning) -> Add ONU to Whitelist -> Provision Subscriber
203 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
204 ... Skip whitelist configuration for ONU and subscriber provisioning
205 ... Validate successful authentication but failed DHCP/E2E ping
206 ... Configure whitelist with correct ONU location
207 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
208 ... Provision subscriber
209 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -0700210 [Tags] latest
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700211 Remove Whitelist
212 Remove Subscriber
213 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
214 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700215 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
216 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700217 Restart RG Pod
218 Create Whitelist
219 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
220 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700221 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700222 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700223 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700224 Restart RG Pod
225 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700226 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700227 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700228 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
229 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700230 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700231
232ONU in Wrong Location
233 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
234 ... Configure whitelist with wrong ONU location
235 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -0700236 [Tags] latest
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700237 Update Whitelist with Wrong Location
238 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
239 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
240 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700241 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700242 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
243 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700244 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700245
246ONU in Wrong Location (Skip Subscriber Provisioning) -> ONU in Correct Location -> Provision Subscriber
247 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
248 ... Configure whitelist with wrong ONU location and skip subscriber provisioning
249 ... Validate failed authentication/DHCP/E2E ping
250 ... Configure whitelist with correct ONU location
251 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
252 ... Provision subscriber
253 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -0700254 [Tags] latest
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700255 Update Whitelist with Wrong Location
256 Remove Subscriber
257 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
258 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700259 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700260 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700261 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700262 Restart RG Pod
263 Update Whitelist with Correct Location
264 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
265 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700266 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700267 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700268 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700269 Restart RG Pod
270 Create Subscriber
271 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700272 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700273 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
274 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700275 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700276
277*** Keywords ***
278Setup
279 ${auth} = Create List ${XOS_USER} ${XOS_PASSWD}
280 ${HEADERS} Create Dictionary Content-Type=application/json
281 Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS}
282 ${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE}
283 ${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE}
284 ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700285 Set Suite Variable ${AttWhiteListList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700286 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
287 ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700288 ${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number
289 Log ${onu_device}
290 Set Global Variable ${onu_device}
291 ${onu_location}= Get From Dictionary ${AttWhiteListDict} pon_port_id
292 Set Global Variable ${onu_location}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700293 ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700294 Set Global Variable ${SubscriberList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700295 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
296 ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag
297 ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag
298 ${VoltDeviceList}= utils.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700299 Set Global Variable ${VoltDeviceList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700300 Set Suite Variable ${s_tag}
301 Set Suite Variable ${c_tag}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700302 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700303 Set Suite Variable ${whitelist_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700304 ${att_si_id}= Retrieve ATT Service Instance ID ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700305 Set Suite Variable ${att_si_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700306 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
307 Set Suite Variable ${RG_CONTAINER}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700308 ## Validate ATT Workflow SI
Kailash Khalasif76cad92018-10-19 12:33:21 -0700309 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700310 @{container_list}= Create List
Kailash Khalasidd9136a2018-10-18 11:16:18 -0700311 Append To List ${container_list} att-workflow-att-workflow-driver
Kailash Khalasi30704022018-10-18 09:13:26 -0700312 Append To List ${container_list} xos-core
313 Append To List ${container_list} vcore
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700314 Set Suite Variable ${container_list}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700315 ${datetime}= Get Current Datetime On Kubernetes Node localhost ${local_user} ${local_pass}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700316 Set Suite Variable ${datetime}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700317
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700318Setup Test
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700319 ${datetime}= Get Current Datetime On Kubernetes Node ${kube_node_ip} ${local_user} ${local_pass}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700320 Set Suite Variable ${datetime}
321 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
322 Set Suite Variable ${RG_CONTAINER}
323
324Test Cleanup
325 [Documentation] Restore back to initial state per each test
326 Log Kubernetes Containers Logs Since Time ${datetime} ${container_list}
327 Restart RG Pod
328 ${status} ${whitelist_id}= Run Keyword And Ignore Error Retrieve Whitelist Entry ${onu_device}
329 Run Keyword And Ignore Error CORD Put ${ATT_WHITELIST} {"pon_port_id": 1 } ${whitelist_id}
330 Run Keyword And Ignore Error CORD Put ${ATT_SERVICEINSTANCES} {"authentication_state": "AWAITING"} ${att_si_id}
331 Run Keyword And Ignore Error CORD Put ${ATT_SERVICEINSTANCES} {"onu_state": "ENABLED"} ${att_si_id}
332 Run Keyword And Ignore Error Create Whitelist
333 Run Keyword And Ignore Error Create Subscriber
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700334
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700335Restart RG Pod
336 Run kubectl -n voltha delete pod ${RG_CONTAINER}
337 ${RG_CONTAINER}= Wait Until Keyword Succeeds 60s 1s Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
338 Set Suite Variable ${RG_CONTAINER}
339 Run kubectl wait -n voltha pod/${RG_CONTAINER} --for condition=Ready --timeout=180s
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700340
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700341Create Whitelist
342 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
343 ${resp}= CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
344 ${whitelist_id}= Get Json Value ${resp.content} /id
345 Set Global Variable ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700346
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700347Remove Whitelist
348 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
349 CORD Delete ${ATT_WHITELIST} ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700350
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700351Create Subscriber
352 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
353 CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700354
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700355Remove Subscriber
356 ${subscriber_id}= Retrieve Subscriber ${c_tag}
357 CORD Delete ${VOLT_SUBSCRIBER} ${subscriber_id}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700358
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700359Create VOLT
360 ${VoltDeviceDict}= utils.listToDict ${VoltDeviceList} 0
361 CORD Post ${VOLT_DEVICE} ${VoltDeviceDict}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700362
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700363Update Whitelist with Wrong Location
364 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
365 CORD Put ${ATT_WHITELIST} {"pon_port_id": 55 } ${whitelist_id}
366
367Update Whitelist with Correct Location
368 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
369 CORD Put ${ATT_WHITELIST} {"pon_port_id": ${onu_location} } ${whitelist_id}
370