blob: f1efc0895671564a79f01ff1682403057be524a9 [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 Khalasicf006cb2018-10-19 08:36:51 -070051 [Tags] test1
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
75 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
76 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
77 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070078 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -070079 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
80 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070081 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 -070082 Restart RG Pod
83 Remove Whitelist
84 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
85 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070086 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
87 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 -070088 Restart RG Pod
89 Create Whitelist
90 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
91 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070092 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -070093 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
94 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070095 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 -070096
Kailash Khalasibf1478b2018-10-17 11:58:58 -070097ONU in Correct Location -> ONU in Wrong Location -> ONU in Correct Location
98 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
99 ... Configure whitelist with correct ONU location
100 ... Validate successful authentication/DHCP/E2E ping
101 ... Update whitelist with wrong ONU location
102 ... Validate failed authentication/DHCP/E2E ping
103 ... Update whitelist with correct ONU location
104 ... Validate successful authentication/DHCP/E2E ping
105 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
106 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
107 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700108 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700109 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
110 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700111 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 -0700112 Restart RG Pod
113 Update Whitelist with Wrong Location
114 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}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700116 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
117 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 -0700118 Restart RG Pod
119 Update Whitelist with Correct Location
120 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}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700122 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700123 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}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700125 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 -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
132 ... Validate failed authentication/DHCP/E2E ping
133 ... Recreate subscriber model
134 ... Validate successful authentication/DHCP/E2E ping
135 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
136 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
137 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700138 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700139 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
140 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700141 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 -0700142 Restart RG Pod
143 Remove Subscriber
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700144 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
145 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 -0700146 Restart RG Pod
147 Create Subscriber
Kailash Khalasie3dd4852018-10-18 12:57:39 -0700148 Wait Until Keyword Succeeds 90s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700149 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700150 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
151 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700152 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 -0700153
154ONU in Correct Location (Skip Subscriber Provisioning) -> Provision Subscriber
155 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
156 ... Configure whitelist with correct ONU location and skip provisioning subscriber
157 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
158 ... Provision subscriber
159 ... Validate successful authentication/DHCP/E2E ping
160 Remove Subscriber
161 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}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700163 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700164 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700165 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 -0700166 Restart RG Pod
167 Create Subscriber
Kailash Khalasi423a90c2018-10-18 12:25:32 -0700168 Wait Until Keyword Succeeds 90s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700169 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700170 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}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700172 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 -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
178 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}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700181 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 -0700182
183ONU not in Whitelist
184 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
185 ... Skip whitelist configuration for ONU
186 ... Validate failed authentication/DHCP/E2E ping
187 Remove Whitelist
188 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
189 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
190 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700191 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700192 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
193 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700194 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 -0700195
196ONU not in Whitelist (Skip Subscriber Provisioning) -> Add ONU to Whitelist -> Provision Subscriber
197 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
198 ... Skip whitelist configuration for ONU and subscriber provisioning
199 ... Validate successful authentication but failed DHCP/E2E ping
200 ... Configure whitelist with correct ONU location
201 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
202 ... Provision subscriber
203 ... Validate successful authentication/DHCP/E2E ping
204 Remove Whitelist
205 Remove Subscriber
206 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
207 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700208 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
209 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 -0700210 Restart RG Pod
211 Create Whitelist
212 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
213 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700214 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700215 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700216 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 Subscriber
Kailash Khalasi423a90c2018-10-18 12:25:32 -0700219 Wait Until Keyword Succeeds 90s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700220 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700221 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
222 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700223 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 -0700224
225ONU in Wrong Location
226 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
227 ... Configure whitelist with wrong ONU location
228 ... Validate failed authentication/DHCP/E2E ping
229 Update Whitelist with Wrong Location
230 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
231 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
232 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700233 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700234 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}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700236 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 -0700237
238ONU in Wrong Location (Skip Subscriber Provisioning) -> ONU in Correct Location -> Provision Subscriber
239 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
240 ... Configure whitelist with wrong ONU location and skip subscriber provisioning
241 ... Validate failed authentication/DHCP/E2E ping
242 ... Configure whitelist with correct ONU location
243 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
244 ... Provision subscriber
245 ... Validate successful authentication/DHCP/E2E ping
246 Update Whitelist with Wrong Location
247 Remove Subscriber
248 Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
249 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700250 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700251 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700252 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 -0700253 Restart RG Pod
254 Update Whitelist with Correct Location
255 Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
256 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700257 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700258 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700259 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 -0700260 Restart RG Pod
261 Create Subscriber
262 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700263 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700264 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
265 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700266 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 -0700267
268*** Keywords ***
269Setup
270 ${auth} = Create List ${XOS_USER} ${XOS_PASSWD}
271 ${HEADERS} Create Dictionary Content-Type=application/json
272 Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS}
273 ${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE}
274 ${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE}
275 ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700276 Set Suite Variable ${AttWhiteListList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700277 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
278 ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700279 ${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number
280 Log ${onu_device}
281 Set Global Variable ${onu_device}
282 ${onu_location}= Get From Dictionary ${AttWhiteListDict} pon_port_id
283 Set Global Variable ${onu_location}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700284 ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700285 Set Global Variable ${SubscriberList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700286 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
287 ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag
288 ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag
289 ${VoltDeviceList}= utils.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700290 Set Global Variable ${VoltDeviceList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700291 Set Suite Variable ${s_tag}
292 Set Suite Variable ${c_tag}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700293 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700294 Set Suite Variable ${whitelist_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700295 ${att_si_id}= Retrieve ATT Service Instance ID ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700296 Set Suite Variable ${att_si_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700297 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
298 Set Suite Variable ${RG_CONTAINER}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700299 ## Validate ATT Workflow SI
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700300 Wait Until Keyword Succeeds 90s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
301 @{container_list}= Create List
Kailash Khalasidd9136a2018-10-18 11:16:18 -0700302 Append To List ${container_list} att-workflow-att-workflow-driver
Kailash Khalasi30704022018-10-18 09:13:26 -0700303 Append To List ${container_list} xos-core
304 Append To List ${container_list} vcore
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700305 Set Suite Variable ${container_list}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700306 ${datetime}= Get Current Datetime On Kubernetes Node localhost ${local_user} ${local_pass}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700307 Set Suite Variable ${datetime}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700308
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700309Setup Test
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700310 ${datetime}= Get Current Datetime On Kubernetes Node ${kube_node_ip} ${local_user} ${local_pass}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700311 Set Suite Variable ${datetime}
312 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
313 Set Suite Variable ${RG_CONTAINER}
314
315Test Cleanup
316 [Documentation] Restore back to initial state per each test
317 Log Kubernetes Containers Logs Since Time ${datetime} ${container_list}
318 Restart RG Pod
319 ${status} ${whitelist_id}= Run Keyword And Ignore Error Retrieve Whitelist Entry ${onu_device}
320 Run Keyword And Ignore Error CORD Put ${ATT_WHITELIST} {"pon_port_id": 1 } ${whitelist_id}
321 Run Keyword And Ignore Error CORD Put ${ATT_SERVICEINSTANCES} {"authentication_state": "AWAITING"} ${att_si_id}
322 Run Keyword And Ignore Error CORD Put ${ATT_SERVICEINSTANCES} {"onu_state": "ENABLED"} ${att_si_id}
323 Run Keyword And Ignore Error Create Whitelist
324 Run Keyword And Ignore Error Create Subscriber
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700325
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700326Restart RG Pod
327 Run kubectl -n voltha delete pod ${RG_CONTAINER}
328 ${RG_CONTAINER}= Wait Until Keyword Succeeds 60s 1s Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
329 Set Suite Variable ${RG_CONTAINER}
330 Run kubectl wait -n voltha pod/${RG_CONTAINER} --for condition=Ready --timeout=180s
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700331
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700332Create Whitelist
333 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
334 ${resp}= CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
335 ${whitelist_id}= Get Json Value ${resp.content} /id
336 Set Global Variable ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700337
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700338Remove Whitelist
339 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
340 CORD Delete ${ATT_WHITELIST} ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700341
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700342Create Subscriber
343 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
344 CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700345
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700346Remove Subscriber
347 ${subscriber_id}= Retrieve Subscriber ${c_tag}
348 CORD Delete ${VOLT_SUBSCRIBER} ${subscriber_id}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700349
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700350Create VOLT
351 ${VoltDeviceDict}= utils.listToDict ${VoltDeviceList} 0
352 CORD Post ${VOLT_DEVICE} ${VoltDeviceDict}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700353
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700354Update Whitelist with Wrong Location
355 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
356 CORD Put ${ATT_WHITELIST} {"pon_port_id": 55 } ${whitelist_id}
357
358Update Whitelist with Correct Location
359 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
360 CORD Put ${ATT_WHITELIST} {"pon_port_id": ${onu_location} } ${whitelist_id}
361