blob: be9531abe5bbb88804d61ad4f4cc79ebf00b8f90 [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
Andy Bavierdf70bba2019-01-24 07:06:38 -070053 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -070054 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavierdf70bba2019-01-24 07:06:38 -070055 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -070056 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 -070057 ${subscriber_id}= Retrieve Subscriber ${c_tag}
58 CORD Put ${VOLT_SUBSCRIBER} {"status":"disabled"} ${subscriber_id}
Andy Bavier3075b9b2019-01-31 13:45:35 -070059 No Subscriber Service Chain
Andy Bavier81de8b72018-11-20 10:15:06 -070060 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 -070061 Restart RG Pod
Andy Bavierdf70bba2019-01-24 07:06:38 -070062 CORD Put ${VOLT_SUBSCRIBER} {"status":"awaiting-auth"} ${subscriber_id}
63 # ATTWD SI auth_state is already "APPROVED" here from previous auth... not sure if this matters
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}
Andy Bavierdf70bba2019-01-24 07:06:38 -070065 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -070066 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 -070067
Kailash Khalasibf1478b2018-10-17 11:58:58 -070068ONU in Correct Location -> Remove ONU from Whitelist -> Add ONU to Whitelist
69 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
70 ... Configure whitelist with correct ONU location
71 ... Validate successful authentication/DHCP/E2E ping
72 ... Remove ONU from whitelist
73 ... Validate failed authentication/DHCP/E2E ping
74 ... Add ONU to whitelist
75 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -080076 [Tags] stable latest test2
Andy Bavier3075b9b2019-01-31 13:45:35 -070077 Subscriber Ready to Authenticate
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}
Andy Bavier3075b9b2019-01-31 13:45:35 -070079 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -070080 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 -070081 Reset SIAB Environment
Kailash Khalasibf1478b2018-10-17 11:58:58 -070082 Remove Whitelist
Kailashb49e8452018-12-18 08:29:11 -080083 Wait Until Keyword Succeeds 120s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -070084 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device} ONU not found in whitelist
Kailash Khalasibf1478b2018-10-17 11:58:58 -070085 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailasha02472b2018-12-18 09:18:20 -080086 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -070087 No Subscriber Service Chain
Kailasha02472b2018-12-18 09:18:20 -080088 Validate DHCP and Ping False 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 -070089 Reset SIAB Environment
Andy Bavier3075b9b2019-01-31 13:45:35 -070090 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -070091 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -070092 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -070093 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 -070094
Kailash Khalasibf1478b2018-10-17 11:58:58 -070095ONU in Correct Location -> ONU in Wrong Location -> ONU in Correct Location
96 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
97 ... Configure whitelist with correct ONU location
98 ... Validate successful authentication/DHCP/E2E ping
99 ... Update whitelist with wrong ONU location
100 ... Validate failed authentication/DHCP/E2E ping
101 ... Update whitelist with correct ONU location
102 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -0800103 [Tags] stable latest test3
Andy Bavier3075b9b2019-01-31 13:45:35 -0700104 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700105 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700106 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700107 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 -0700108 Restart RG Pod
109 Update Whitelist with Wrong Location
Andy Bavier3075b9b2019-01-31 13:45:35 -0700110 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device} ONU activated in wrong location
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700111 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700112 No Subscriber Service Chain
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700113 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
114 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 -0700115 Restart RG Pod
116 Update Whitelist with Correct Location
Andy Bavier3075b9b2019-01-31 13:45:35 -0700117 Subscriber Ready to Authenticate
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}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700119 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700120 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 -0700121
122ONU in Correct Location -> Remove Subscriber -> Create Subscriber
123 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
124 ... Configure whitelist with correct ONU location
125 ... Validate successful authentication/DHCP/E2E ping
126 ... Remove subscriber model
127 ... Validate failed authentication/DHCP/E2E ping
128 ... Recreate subscriber model
129 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -0800130 [Tags] stable latest test4
Andy Bavier3075b9b2019-01-31 13:45:35 -0700131 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700132 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700133 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700134 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 -0700135 Restart RG Pod
136 Remove Subscriber
Andy Bavier3075b9b2019-01-31 13:45:35 -0700137 No Subscriber Service Chain
Andy Bavier3d6ac1a2018-11-20 15:23:40 -0700138 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700139 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 -0700140 Restart RG Pod
141 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700142 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700143 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700144 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700145 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 -0700146
147ONU in Correct Location (Skip Subscriber Provisioning) -> Provision Subscriber
148 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
149 ... Configure whitelist with correct ONU location and skip provisioning subscriber
150 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
151 ... Provision subscriber
152 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -0800153 [Tags] stable latest test5
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700154 Remove Subscriber
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700155 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700156 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700157 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700158 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700159 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 -0700160 Restart RG Pod
161 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700162 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${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}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700164 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700165 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 -0700166
167ONU in Correct Location (Skip Authentication)
168 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
169 ... Configure whitelist with correct ONU location and skip RG authentication
170 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700171 [Tags] stable latest test6
Andy Bavier3075b9b2019-01-31 13:45:35 -0700172 Subscriber Ready to Authenticate
173 No Subscriber Service Chain
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700174 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 -0700175
176ONU not in Whitelist
177 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
178 ... Skip whitelist configuration for ONU
179 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700180 [Tags] stable latest test7
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700181 [Setup] Simple Setup
Kailash Khalasi8b3523c2018-11-08 15:31:49 -0800182 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700183 Wait Until Keyword Succeeds 60s 2s Create Subscriber
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700184 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700185 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasi8b3523c2018-11-08 15:31:49 -0800186 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device} pre-provisioned
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700187 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700188 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device} ONU not found in whitelist
Kailash Khalasi8b3523c2018-11-08 15:31:49 -0800189 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device} pre-provisioned
Andy Bavier3075b9b2019-01-31 13:45:35 -0700190 No Subscriber Service Chain
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700191 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 -0700192
193ONU not in Whitelist (Skip Subscriber Provisioning) -> Add ONU to Whitelist -> Provision Subscriber
194 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
195 ... Skip whitelist configuration for ONU and subscriber provisioning
196 ... Validate successful authentication but failed DHCP/E2E ping
197 ... Configure whitelist with correct ONU location
198 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
199 ... Provision subscriber
200 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasic7477512018-11-08 07:55:01 -0800201 [Tags] latest test8 stable
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700202 [Setup] Simple Setup
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700203 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700204 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device} ONU not found in whitelist
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700205 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
206 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 -0700207 Restart RG Pod
208 Create Whitelist
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700209 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700210 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700211 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700212 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700213 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 -0700214 Restart RG Pod
215 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700216 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700217 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700218 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700219 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 -0700220
221ONU in Wrong Location
222 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
223 ... Configure whitelist with wrong ONU location
224 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasic7477512018-11-08 07:55:01 -0800225 [Tags] latest test9 stable
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700226 Update Whitelist with Wrong Location
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700227 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700228 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device} ONU activated in wrong location
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700229 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700230 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700231 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device} ONU activated in wrong location
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700232 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700233 No Subscriber Service Chain
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700234 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 -0700235
236ONU in Wrong Location (Skip Subscriber Provisioning) -> ONU in Correct Location -> Provision Subscriber
237 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
238 ... Configure whitelist with wrong ONU location and skip subscriber provisioning
239 ... Validate failed authentication/DHCP/E2E ping
240 ... Configure whitelist with correct ONU location
241 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
242 ... Provision subscriber
243 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -0800244 [Tags] stable latest test10
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700245 [Setup] Simple Setup
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700246 Wait Until Keyword Succeeds 60s 2s Create Whitelist
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700247 Update Whitelist with Wrong Location
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700248 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700249 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device} ONU activated in wrong location
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
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700255 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700256 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}
Kailash4b39ecf2018-12-18 08:35:34 -0800258 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailasha02472b2018-12-18 09:18:20 -0800259 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
Andy Bavierdf70bba2019-01-24 07:06:38 -0700262 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device} pre-provisioned
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}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700264 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700265 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 -0700266
267*** Keywords ***
268Setup
269 ${auth} = Create List ${XOS_USER} ${XOS_PASSWD}
270 ${HEADERS} Create Dictionary Content-Type=application/json
271 Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS}
272 ${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE}
273 ${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE}
274 ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700275 Set Suite Variable ${AttWhiteListList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700276 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
277 ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700278 ${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number
279 Log ${onu_device}
280 Set Global Variable ${onu_device}
281 ${onu_location}= Get From Dictionary ${AttWhiteListDict} pon_port_id
282 Set Global Variable ${onu_location}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700283 ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700284 Set Global Variable ${SubscriberList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700285 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
286 ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag
287 ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag
288 ${VoltDeviceList}= utils.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
Kailash Khalasi4e1ce762018-12-18 20:29:29 -0800289 ${VoltDeviceDict}= utils.setFieldValueInDict ${VoltDeviceList[0]} volt_service_id ${volt_service_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700290 Set Global Variable ${VoltDeviceList}
Kailash Khalasi4e1ce762018-12-18 20:29:29 -0800291 Set Global Variable ${VoltDeviceDict}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700292 Set Suite Variable ${s_tag}
293 Set Suite Variable ${c_tag}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700294 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700295 Set Suite Variable ${whitelist_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700296 ${att_si_id}= Retrieve ATT Service Instance ID ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700297 Set Suite Variable ${att_si_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700298 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
299 Set Suite Variable ${RG_CONTAINER}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700300 ## Validate ATT Workflow SI
Kailash Khalasif76cad92018-10-19 12:33:21 -0700301 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700302 @{container_list}= Create List
Kailash Khalasidd9136a2018-10-18 11:16:18 -0700303 Append To List ${container_list} att-workflow-att-workflow-driver
Kailash Khalasie59ba702018-12-18 19:36:03 -0800304 Append To List ${container_list} seba-services-fabric-crossconnect
305 Append To List ${container_list} seba-services-rcord
306 Append To List ${container_list} seba-services-volt
Kailash Khalasi30704022018-10-18 09:13:26 -0700307 Append To List ${container_list} xos-core
308 Append To List ${container_list} vcore
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700309 Set Suite Variable ${container_list}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700310 ${datetime}= Get Current Datetime On Kubernetes Node localhost ${local_user} ${local_pass}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700311 Set Suite Variable ${datetime}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700312
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700313Teardown
314 Setup Test
315 Delete All Sessions
316
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700317Setup Test
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700318 ${datetime}= Get Current Datetime On Kubernetes Node ${kube_node_ip} ${local_user} ${local_pass}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700319 Set Suite Variable ${datetime}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700320 Wait Until Keyword Succeeds 60s 2s Create Subscriber
Andy Bavierdf70bba2019-01-24 07:06:38 -0700321 Wait Until Keyword Succeeds 60s 2s Create Whitelist
322 Subscriber Ready to Authenticate
323
324Subscriber Ready to Authenticate
325 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700326 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device} ONU has been validated - Awaiting Authentication
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700327 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Andy Bavierdf70bba2019-01-24 07:06:38 -0700328
329Subscriber Service Chain Created
Andy Bavier3075b9b2019-01-31 13:45:35 -0700330 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device} ONU has been validated - Authentication succeeded
Andy Bavierdf70bba2019-01-24 07:06:38 -0700331 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
332 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
333 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700334
Andy Bavier3075b9b2019-01-31 13:45:35 -0700335No Subscriber Service Chain
336 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
337 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
Kailashfe18d612019-02-04 17:04:42 -0800338 Wait Until Keyword Succeeds 60s 2s Validate XConnect Removed from ONOS
Andy Bavier3075b9b2019-01-31 13:45:35 -0700339
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700340Simple Setup
341 ${datetime}= Get Current Datetime On Kubernetes Node ${kube_node_ip} ${local_user} ${local_pass}
342 Set Suite Variable ${datetime}
343 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
344 Set Suite Variable ${RG_CONTAINER}
345
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700346Test Cleanup
347 [Documentation] Restore back to initial state per each test
348 Log Kubernetes Containers Logs Since Time ${datetime} ${container_list}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700349 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
Andy Bavierdf70bba2019-01-24 07:06:38 -0700350 Wait Until Keyword Succeeds 30s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
351 Wait Until Keyword Succeeds 30s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700352 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
353 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
354 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700355 Restart RG Pod
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700356
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700357Restart RG Pod
358 Run kubectl -n voltha delete pod ${RG_CONTAINER}
359 ${RG_CONTAINER}= Wait Until Keyword Succeeds 60s 1s Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
360 Set Suite Variable ${RG_CONTAINER}
361 Run kubectl wait -n voltha pod/${RG_CONTAINER} --for condition=Ready --timeout=180s
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700362
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700363Create Whitelist
364 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
365 ${resp}= CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
366 ${whitelist_id}= Get Json Value ${resp.content} /id
367 Set Global Variable ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700368
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700369Remove Whitelist
370 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
371 CORD Delete ${ATT_WHITELIST} ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700372
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700373Create Subscriber
374 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
375 CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700376
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700377Remove Subscriber
378 ${subscriber_id}= Retrieve Subscriber ${c_tag}
379 CORD Delete ${VOLT_SUBSCRIBER} ${subscriber_id}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700380
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700381Create VOLT
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700382 CORD Post ${VOLT_DEVICE} ${VoltDeviceDict}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700383
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700384Update Whitelist with Wrong Location
385 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
386 CORD Put ${ATT_WHITELIST} {"pon_port_id": 55 } ${whitelist_id}
387
388Update Whitelist with Correct Location
389 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
Kailash Khalasi92061c12018-10-29 11:52:39 -0700390 CORD Put ${ATT_WHITELIST} {"pon_port_id": ${onu_location} } ${whitelist_id}
Kailash821de7a2018-11-02 11:32:49 -0700391
392Reset SIAB Environment
393 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
394 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
Andy Bavierdf70bba2019-01-24 07:06:38 -0700395 Wait Until Keyword Succeeds 30s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
396 Wait Until Keyword Succeeds 30s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash821de7a2018-11-02 11:32:49 -0700397 Restart RG Pod
Kailash821de7a2018-11-02 11:32:49 -0700398 Wait Until Keyword Succeeds 60s 2s Create Subscriber
Andy Bavierdf70bba2019-01-24 07:06:38 -0700399 Wait Until Keyword Succeeds 60s 2s Create Whitelist
Andy Bavier3075b9b2019-01-31 13:45:35 -0700400 Subscriber Ready to Authenticate
Kailash821de7a2018-11-02 11:32:49 -0700401 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
402 Set Suite Variable ${RG_CONTAINER}
Kailashfe18d612019-02-04 17:04:42 -0800403
404Validate XConnect Removed from ONOS
405 ${output}= Run http -a karaf:karaf GET http://127.0.0.1:30120/onos/segmentrouting/xconnect
406 Should Contain ${output} {"xconnects":[]}