blob: 8031bee1179ad407cc19d0a24e1ee2f6281a6829 [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 Khalasi92061c12018-10-29 11:52:39 -070052 [Tags] stable latest test1
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 Khalasic456d152018-10-26 11:02:06 -070059 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
Kailash Khalasif56a4fb2018-10-23 12:38:16 -070060 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 Khalasi92061c12018-10-29 11:52:39 -070078 [Tags] latest test2
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}
Kailash821de7a2018-11-02 11:32:49 -070088 Reset SIAB Environment
Kailash Khalasibf1478b2018-10-17 11:58:58 -070089 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}
Kailash821de7a2018-11-02 11:32:49 -070096 Reset SIAB Environment
Kailash Khalasibf1478b2018-10-17 11:58:58 -070097 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
98 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -070099 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700100 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
101 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700102 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
103 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700104 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 -0700105
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700106ONU in Correct Location -> ONU in Wrong Location -> ONU in Correct Location
107 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
108 ... Configure whitelist with correct ONU location
109 ... Validate successful authentication/DHCP/E2E ping
110 ... Update whitelist with wrong ONU location
111 ... Validate failed authentication/DHCP/E2E ping
112 ... Update whitelist with correct ONU location
113 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700114 [Tags] latest test3
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700115 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700116 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED 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 True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700119 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
120 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700121 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
122 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700123 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 -0700124 Restart RG Pod
125 Update Whitelist with Wrong Location
126 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
127 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700128 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
129 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700130 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
131 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 -0700132 Restart RG Pod
133 Update Whitelist with Correct Location
134 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
135 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700136 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700137 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
138 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700139 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
140 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
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
143ONU in Correct Location -> Remove Subscriber -> Create Subscriber
144 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
145 ... Configure whitelist with correct ONU location
146 ... Validate successful authentication/DHCP/E2E ping
147 ... Remove subscriber model
148 ... Validate failed authentication/DHCP/E2E ping
149 ... Recreate subscriber model
150 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700151 [Tags] latest test4
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700152 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700153 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
154 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700155 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700156 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
157 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700158 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
159 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700160 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 -0700161 Restart RG Pod
162 Remove Subscriber
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700163 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
164 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 -0700165 Restart RG Pod
166 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700167 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700168 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700169 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
170 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700171 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
172 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700173 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 -0700174
175ONU in Correct Location (Skip Subscriber Provisioning) -> Provision Subscriber
176 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
177 ... Configure whitelist with correct ONU location and skip provisioning subscriber
178 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
179 ... Provision subscriber
180 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700181 [Tags] latest test5
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700182 Remove Subscriber
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700183 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700184 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700185 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700186 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700187 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 -0700188 Restart RG Pod
189 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700190 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700191 Validate Authentication True 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 ENABLED APPROVED ${onu_device}
193 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700194 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
195 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700196 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 -0700197
198ONU in Correct Location (Skip Authentication)
199 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
200 ... Configure whitelist with correct ONU location and skip RG authentication
201 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700202 [Tags] stable latest test6
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700203 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700204 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
205 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700206 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
207 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700208 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 -0700209
210ONU not in Whitelist
211 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
212 ... Skip whitelist configuration for ONU
213 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700214 [Tags] stable latest test7
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700215 [Setup] Simple Setup
216 Wait Until Keyword Succeeds 60s 2s Create Subscriber
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700217 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700218 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
219 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700220 Validate Authentication False 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 DISABLED AWAITING ${onu_device}
222 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700223 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
224 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700225 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 -0700226
227ONU not in Whitelist (Skip Subscriber Provisioning) -> Add ONU to Whitelist -> Provision Subscriber
228 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
229 ... Skip whitelist configuration for ONU and subscriber provisioning
230 ... Validate successful authentication but failed DHCP/E2E ping
231 ... Configure whitelist with correct ONU location
232 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
233 ... Provision subscriber
234 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700235 [Tags] latest test8
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700236 [Setup] Simple Setup
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700237 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700238 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700239 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
240 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 -0700241 Restart RG Pod
242 Create Whitelist
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700243 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700244 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700245 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700246 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700247 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 -0700248 Restart RG Pod
249 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700250 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700251 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700252 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
253 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700254 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
255 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700256 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 -0700257
258ONU in Wrong Location
259 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
260 ... Configure whitelist with wrong ONU location
261 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700262 [Tags] latest test9
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700263 Update Whitelist with Wrong Location
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700264 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700265 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
266 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700267 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
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 Khalasif56a4fb2018-10-23 12:38:16 -0700270 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
271 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700272 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 -0700273
274ONU in Wrong Location (Skip Subscriber Provisioning) -> ONU in Correct Location -> Provision Subscriber
275 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
276 ... Configure whitelist with wrong ONU location and skip subscriber provisioning
277 ... Validate failed authentication/DHCP/E2E ping
278 ... Configure whitelist with correct ONU location
279 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
280 ... Provision subscriber
281 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700282 [Tags] latest test10
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700283 [Setup] Simple Setup
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700284 Wait Until Keyword Succeeds 60s 2s Create Whitelist
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700285 Update Whitelist with Wrong Location
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700286 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700287 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700288 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700289 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700290 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 -0700291 Restart RG Pod
292 Update Whitelist with Correct Location
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700293 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700294 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700295 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700296 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700297 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 -0700298 Restart RG Pod
299 Create Subscriber
300 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700301 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700302 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
303 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700304 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
305 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700306 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 -0700307
308*** Keywords ***
309Setup
310 ${auth} = Create List ${XOS_USER} ${XOS_PASSWD}
311 ${HEADERS} Create Dictionary Content-Type=application/json
312 Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS}
313 ${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE}
314 ${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE}
315 ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700316 Set Suite Variable ${AttWhiteListList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700317 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
318 ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700319 ${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number
320 Log ${onu_device}
321 Set Global Variable ${onu_device}
322 ${onu_location}= Get From Dictionary ${AttWhiteListDict} pon_port_id
323 Set Global Variable ${onu_location}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700324 ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700325 Set Global Variable ${SubscriberList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700326 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
327 ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag
328 ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag
329 ${VoltDeviceList}= utils.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700330 Set Global Variable ${VoltDeviceList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700331 Set Suite Variable ${s_tag}
332 Set Suite Variable ${c_tag}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700333 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700334 Set Suite Variable ${whitelist_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700335 ${att_si_id}= Retrieve ATT Service Instance ID ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700336 Set Suite Variable ${att_si_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700337 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
338 Set Suite Variable ${RG_CONTAINER}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700339 ## Validate ATT Workflow SI
Kailash Khalasif76cad92018-10-19 12:33:21 -0700340 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700341 @{container_list}= Create List
Kailash Khalasidd9136a2018-10-18 11:16:18 -0700342 Append To List ${container_list} att-workflow-att-workflow-driver
Kailash Khalasi30704022018-10-18 09:13:26 -0700343 Append To List ${container_list} xos-core
344 Append To List ${container_list} vcore
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700345 Set Suite Variable ${container_list}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700346 ${datetime}= Get Current Datetime On Kubernetes Node localhost ${local_user} ${local_pass}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700347 Set Suite Variable ${datetime}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700348
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700349Teardown
350 Setup Test
351 Delete All Sessions
352
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700353Setup Test
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700354 ${datetime}= Get Current Datetime On Kubernetes Node ${kube_node_ip} ${local_user} ${local_pass}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700355 Set Suite Variable ${datetime}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700356 Wait Until Keyword Succeeds 60s 2s Create Whitelist
357 Wait Until Keyword Succeeds 60s 2s Create Subscriber
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700358 Wait Until Keyword Succeeds 120s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
359 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
360 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700361 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
362 Set Suite Variable ${RG_CONTAINER}
363
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700364Simple Setup
365 ${datetime}= Get Current Datetime On Kubernetes Node ${kube_node_ip} ${local_user} ${local_pass}
366 Set Suite Variable ${datetime}
367 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
368 Set Suite Variable ${RG_CONTAINER}
369
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700370Test Cleanup
371 [Documentation] Restore back to initial state per each test
372 Log Kubernetes Containers Logs Since Time ${datetime} ${container_list}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700373 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700374 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700375 Restart RG Pod
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700376
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700377Restart RG Pod
378 Run kubectl -n voltha delete pod ${RG_CONTAINER}
379 ${RG_CONTAINER}= Wait Until Keyword Succeeds 60s 1s Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
380 Set Suite Variable ${RG_CONTAINER}
381 Run kubectl wait -n voltha pod/${RG_CONTAINER} --for condition=Ready --timeout=180s
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700382
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700383Create Whitelist
384 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
385 ${resp}= CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
386 ${whitelist_id}= Get Json Value ${resp.content} /id
387 Set Global Variable ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700388
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700389Remove Whitelist
390 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
391 CORD Delete ${ATT_WHITELIST} ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700392
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700393Create Subscriber
394 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
395 CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700396
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700397Remove Subscriber
398 ${subscriber_id}= Retrieve Subscriber ${c_tag}
399 CORD Delete ${VOLT_SUBSCRIBER} ${subscriber_id}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700400
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700401Create VOLT
402 ${VoltDeviceDict}= utils.listToDict ${VoltDeviceList} 0
403 CORD Post ${VOLT_DEVICE} ${VoltDeviceDict}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700404
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700405Update Whitelist with Wrong Location
406 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
407 CORD Put ${ATT_WHITELIST} {"pon_port_id": 55 } ${whitelist_id}
408
409Update Whitelist with Correct Location
410 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
Kailash Khalasi92061c12018-10-29 11:52:39 -0700411 CORD Put ${ATT_WHITELIST} {"pon_port_id": ${onu_location} } ${whitelist_id}
Kailash821de7a2018-11-02 11:32:49 -0700412
413Reset SIAB Environment
414 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
415 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
416 Restart RG Pod
417 Wait Until Keyword Succeeds 60s 2s Create Whitelist
418 Wait Until Keyword Succeeds 60s 2s Create Subscriber
419 Reset ONU
420 Wait Until Keyword Succeeds 120s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
421 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
422 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
423 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
424 Set Suite Variable ${RG_CONTAINER}
425
426Reset ONU
427 CORD Put /xosapi/v1/volt/onudevices {"admin_state": "DISABLED" } 1
428 Sleep 10
429 CORD Put /xosapi/v1/volt/onudevices {"admin_state": "ENABLED" } 1