blob: e98cc0057df96ffcdd17f23eab41801673fe0b3d [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 Khalasif56a4fb2018-10-23 12:38:16 -070018Suite Teardown Teardown
Kailash Khalasibf1478b2018-10-17 11:58:58 -070019Test 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 Khalasif56a4fb2018-10-23 12:38:16 -070051 [Setup] None
Kailash Khalasif76cad92018-10-19 12:33:21 -070052 [Tags] stable latest
Kailash Khalasia2e6aa82018-10-23 14:56:02 -070053 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -070054 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
55 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070056 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -070057 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
58 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -070059 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} 1
60 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasicf006cb2018-10-19 08:36:51 -070061 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 -070062 ${subscriber_id}= Retrieve Subscriber ${c_tag}
63 CORD Put ${VOLT_SUBSCRIBER} {"status":"disabled"} ${subscriber_id}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070064 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 -070065 Restart RG Pod
Kailash Khalasi16d95c12018-09-21 14:17:28 -070066 CORD Put ${VOLT_SUBSCRIBER} {"status":"enabled"} ${subscriber_id}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070067 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
68 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 -070069
Kailash Khalasibf1478b2018-10-17 11:58:58 -070070ONU in Correct Location -> Remove ONU from Whitelist -> Add ONU to Whitelist
71 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
72 ... Configure whitelist with correct ONU location
73 ... Validate successful authentication/DHCP/E2E ping
74 ... Remove ONU from whitelist
75 ... Validate failed authentication/DHCP/E2E ping
76 ... Add ONU to whitelist
77 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -070078 [Tags] latest
Kailash Khalasia2e6aa82018-10-23 14:56:02 -070079 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -070080 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
81 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070082 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -070083 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
84 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -070085 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
86 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasicf006cb2018-10-19 08:36:51 -070087 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 -070088 Restart RG Pod
89 Remove Whitelist
90 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED 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 False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -070093 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
94 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
95 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 -070096 Restart RG Pod
97 Create Whitelist
98 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
99 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700100 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700101 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
102 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700103 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
104 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700105 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 -0700106
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700107ONU in Correct Location -> ONU in Wrong Location -> ONU in Correct Location
108 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
109 ... Configure whitelist with correct ONU location
110 ... Validate successful authentication/DHCP/E2E ping
111 ... Update whitelist with wrong ONU location
112 ... Validate failed authentication/DHCP/E2E ping
113 ... Update whitelist with correct ONU location
114 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -0700115 [Tags] latest
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700116 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -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}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700119 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700120 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}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700122 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
123 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700124 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 -0700125 Restart RG Pod
126 Update Whitelist with Wrong Location
127 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
128 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700129 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
130 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700131 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
132 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 -0700133 Restart RG Pod
134 Update Whitelist with Correct Location
135 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
136 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700137 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700138 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
139 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700140 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
141 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700142 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 -0700143
144ONU in Correct Location -> Remove Subscriber -> Create Subscriber
145 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
146 ... Configure whitelist with correct ONU location
147 ... Validate successful authentication/DHCP/E2E ping
148 ... Remove subscriber model
149 ... Validate failed authentication/DHCP/E2E ping
150 ... Recreate subscriber model
151 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -0700152 [Tags] latest
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700153 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700154 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
155 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700156 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700157 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
158 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700159 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
160 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700161 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 -0700162 Restart RG Pod
163 Remove Subscriber
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700164 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
165 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 Khalasif76cad92018-10-19 12:33:21 -0700168 Wait Until Keyword Succeeds 60s 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 Khalasif56a4fb2018-10-23 12:38:16 -0700172 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
173 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700174 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 -0700175
176ONU in Correct Location (Skip Subscriber Provisioning) -> Provision Subscriber
177 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
178 ... Configure whitelist with correct ONU location and skip provisioning subscriber
179 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
180 ... Provision subscriber
181 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -0700182 [Tags] latest
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700183 Remove Subscriber
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700184 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700185 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700186 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700187 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700188 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 -0700189 Restart RG Pod
190 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700191 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700192 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700193 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
194 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700195 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
196 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700197 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 -0700198
199ONU in Correct Location (Skip Authentication)
200 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
201 ... Configure whitelist with correct ONU location and skip RG authentication
202 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -0700203 [Tags] stable latest
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700204 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700205 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
206 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700207 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
208 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700209 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
211ONU not in Whitelist
212 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
213 ... Skip whitelist configuration for ONU
214 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -0700215 [Tags] stable latest
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700216 [Setup] Simple Setup
217 Wait Until Keyword Succeeds 60s 2s Create Subscriber
218 Wait Until Keyword Succeeds 60s 2s Create VOLT
219 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700220 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
221 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700222 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700223 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
224 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700225 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
226 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700227 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 -0700228
229ONU not in Whitelist (Skip Subscriber Provisioning) -> Add ONU to Whitelist -> Provision Subscriber
230 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
231 ... Skip whitelist configuration for ONU and subscriber provisioning
232 ... Validate successful authentication but failed DHCP/E2E ping
233 ... Configure whitelist with correct ONU location
234 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
235 ... Provision subscriber
236 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -0700237 [Tags] latest
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700238 [Setup] Simple Setup
239 Wait Until Keyword Succeeds 60s 2s Create VOLT
240 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700241 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700242 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
243 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 -0700244 Restart RG Pod
245 Create Whitelist
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700246 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700247 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700248 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700249 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700250 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 -0700251 Restart RG Pod
252 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700253 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700254 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700255 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
256 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700257 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
258 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700259 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 -0700260
261ONU in Wrong Location
262 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
263 ... Configure whitelist with wrong ONU location
264 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -0700265 [Tags] latest
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700266 Update Whitelist with Wrong Location
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700267 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700268 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
269 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700270 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700271 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
272 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700273 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
274 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700275 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 -0700276
277ONU in Wrong Location (Skip Subscriber Provisioning) -> ONU in Correct Location -> Provision Subscriber
278 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
279 ... Configure whitelist with wrong ONU location and skip subscriber provisioning
280 ... Validate failed authentication/DHCP/E2E ping
281 ... Configure whitelist with correct ONU location
282 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
283 ... Provision subscriber
284 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasif76cad92018-10-19 12:33:21 -0700285 [Tags] latest
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700286 [Setup] Simple Setup
287 Wait Until Keyword Succeeds 60s 2s Create VOLT
288 Wait Until Keyword Succeeds 60s 2s Create Whitelist
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700289 Update Whitelist with Wrong Location
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700290 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700291 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700292 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700293 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700294 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 -0700295 Restart RG Pod
296 Update Whitelist with Correct Location
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700297 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700298 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700299 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700300 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700301 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 -0700302 Restart RG Pod
303 Create Subscriber
304 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700305 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700306 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
307 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700308 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
309 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700310 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 -0700311
312*** Keywords ***
313Setup
314 ${auth} = Create List ${XOS_USER} ${XOS_PASSWD}
315 ${HEADERS} Create Dictionary Content-Type=application/json
316 Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS}
317 ${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE}
318 ${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE}
319 ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700320 Set Suite Variable ${AttWhiteListList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700321 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
322 ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700323 ${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number
324 Log ${onu_device}
325 Set Global Variable ${onu_device}
326 ${onu_location}= Get From Dictionary ${AttWhiteListDict} pon_port_id
327 Set Global Variable ${onu_location}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700328 ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700329 Set Global Variable ${SubscriberList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700330 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
331 ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag
332 ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag
333 ${VoltDeviceList}= utils.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700334 Set Global Variable ${VoltDeviceList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700335 Set Suite Variable ${s_tag}
336 Set Suite Variable ${c_tag}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700337 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700338 Set Suite Variable ${whitelist_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700339 ${att_si_id}= Retrieve ATT Service Instance ID ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700340 Set Suite Variable ${att_si_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700341 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
342 Set Suite Variable ${RG_CONTAINER}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700343 ## Validate ATT Workflow SI
Kailash Khalasif76cad92018-10-19 12:33:21 -0700344 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700345 @{container_list}= Create List
Kailash Khalasidd9136a2018-10-18 11:16:18 -0700346 Append To List ${container_list} att-workflow-att-workflow-driver
Kailash Khalasi30704022018-10-18 09:13:26 -0700347 Append To List ${container_list} xos-core
348 Append To List ${container_list} vcore
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700349 Set Suite Variable ${container_list}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700350 ${datetime}= Get Current Datetime On Kubernetes Node localhost ${local_user} ${local_pass}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700351 Set Suite Variable ${datetime}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700352
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700353Teardown
354 Setup Test
355 Delete All Sessions
356
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700357Setup Test
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700358 ${datetime}= Get Current Datetime On Kubernetes Node ${kube_node_ip} ${local_user} ${local_pass}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700359 Set Suite Variable ${datetime}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700360 Wait Until Keyword Succeeds 60s 2s Create Whitelist
361 Wait Until Keyword Succeeds 60s 2s Create Subscriber
362 Wait Until Keyword Succeeds 60s 2s Create VOLT
363 Wait Until Keyword Succeeds 120s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
364 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
365 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700366 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
367 Set Suite Variable ${RG_CONTAINER}
368
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700369Simple Setup
370 ${datetime}= Get Current Datetime On Kubernetes Node ${kube_node_ip} ${local_user} ${local_pass}
371 Set Suite Variable ${datetime}
372 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
373 Set Suite Variable ${RG_CONTAINER}
374
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700375Test Cleanup
376 [Documentation] Restore back to initial state per each test
377 Log Kubernetes Containers Logs Since Time ${datetime} ${container_list}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700378 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
379 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_DEVICE}
380 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700381 Restart RG Pod
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700382
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700383Restart RG Pod
384 Run kubectl -n voltha delete pod ${RG_CONTAINER}
385 ${RG_CONTAINER}= Wait Until Keyword Succeeds 60s 1s Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
386 Set Suite Variable ${RG_CONTAINER}
387 Run kubectl wait -n voltha pod/${RG_CONTAINER} --for condition=Ready --timeout=180s
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700388
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700389Create Whitelist
390 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
391 ${resp}= CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
392 ${whitelist_id}= Get Json Value ${resp.content} /id
393 Set Global Variable ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700394
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700395Remove Whitelist
396 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
397 CORD Delete ${ATT_WHITELIST} ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700398
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700399Create Subscriber
400 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
401 CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700402
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700403Remove Subscriber
404 ${subscriber_id}= Retrieve Subscriber ${c_tag}
405 CORD Delete ${VOLT_SUBSCRIBER} ${subscriber_id}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700406
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700407Create VOLT
408 ${VoltDeviceDict}= utils.listToDict ${VoltDeviceList} 0
409 CORD Post ${VOLT_DEVICE} ${VoltDeviceDict}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700410
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700411Update Whitelist with Wrong Location
412 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
413 CORD Put ${ATT_WHITELIST} {"pon_port_id": 55 } ${whitelist_id}
414
415Update Whitelist with Correct Location
416 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700417 CORD Put ${ATT_WHITELIST} {"pon_port_id": ${onu_location} } ${whitelist_id}