blob: 2bd7ca79c233a60cc673c25e2b8403a407142f7a [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}
Kailashabb029d2019-02-15 17:17:11 -080044${local_pass} ${None}
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}
Kailashabb029d2019-02-15 17:17:11 -0800310 Setup SSH Keys to Localhost
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700311 ${datetime}= Get Current Datetime On Kubernetes Node localhost ${local_user} ${local_pass}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700312 Set Suite Variable ${datetime}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700313
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700314Teardown
315 Setup Test
316 Delete All Sessions
317
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700318Setup Test
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700319 ${datetime}= Get Current Datetime On Kubernetes Node ${kube_node_ip} ${local_user} ${local_pass}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700320 Set Suite Variable ${datetime}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700321 Wait Until Keyword Succeeds 60s 2s Create Subscriber
Andy Bavierdf70bba2019-01-24 07:06:38 -0700322 Wait Until Keyword Succeeds 60s 2s Create Whitelist
323 Subscriber Ready to Authenticate
324
325Subscriber Ready to Authenticate
326 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700327 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 -0700328 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Andy Bavierdf70bba2019-01-24 07:06:38 -0700329
330Subscriber Service Chain Created
Andy Bavier3075b9b2019-01-31 13:45:35 -0700331 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 -0700332 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
333 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
334 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash66b9a8d2019-02-07 10:18:55 -0800335 Wait Until Keyword Succeeds 60s 2s Validate XConnect in ONOS True
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700336
Andy Bavier3075b9b2019-01-31 13:45:35 -0700337No Subscriber Service Chain
338 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
339 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
Kailash66b9a8d2019-02-07 10:18:55 -0800340 Wait Until Keyword Succeeds 60s 2s Validate XConnect in ONOS False
Andy Bavier3075b9b2019-01-31 13:45:35 -0700341
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700342Simple Setup
343 ${datetime}= Get Current Datetime On Kubernetes Node ${kube_node_ip} ${local_user} ${local_pass}
344 Set Suite Variable ${datetime}
345 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
346 Set Suite Variable ${RG_CONTAINER}
347
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700348Test Cleanup
349 [Documentation] Restore back to initial state per each test
350 Log Kubernetes Containers Logs Since Time ${datetime} ${container_list}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700351 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
Andy Bavierdf70bba2019-01-24 07:06:38 -0700352 Wait Until Keyword Succeeds 30s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
353 Wait Until Keyword Succeeds 30s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700354 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
355 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
356 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700357 Restart RG Pod
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700358
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700359Restart RG Pod
360 Run kubectl -n voltha delete pod ${RG_CONTAINER}
361 ${RG_CONTAINER}= Wait Until Keyword Succeeds 60s 1s Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
362 Set Suite Variable ${RG_CONTAINER}
363 Run kubectl wait -n voltha pod/${RG_CONTAINER} --for condition=Ready --timeout=180s
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700364
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700365Create Whitelist
366 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
367 ${resp}= CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
368 ${whitelist_id}= Get Json Value ${resp.content} /id
369 Set Global Variable ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700370
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700371Remove Whitelist
372 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
373 CORD Delete ${ATT_WHITELIST} ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700374
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700375Create Subscriber
376 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
377 CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700378
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700379Remove Subscriber
380 ${subscriber_id}= Retrieve Subscriber ${c_tag}
381 CORD Delete ${VOLT_SUBSCRIBER} ${subscriber_id}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700382
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700383Create VOLT
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700384 CORD Post ${VOLT_DEVICE} ${VoltDeviceDict}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700385
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700386Update Whitelist with Wrong Location
387 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
388 CORD Put ${ATT_WHITELIST} {"pon_port_id": 55 } ${whitelist_id}
389
390Update Whitelist with Correct Location
391 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
Kailash Khalasi92061c12018-10-29 11:52:39 -0700392 CORD Put ${ATT_WHITELIST} {"pon_port_id": ${onu_location} } ${whitelist_id}
Kailash821de7a2018-11-02 11:32:49 -0700393
394Reset SIAB Environment
395 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
396 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
Andy Bavierdf70bba2019-01-24 07:06:38 -0700397 Wait Until Keyword Succeeds 30s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
398 Wait Until Keyword Succeeds 30s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash821de7a2018-11-02 11:32:49 -0700399 Restart RG Pod
Kailash821de7a2018-11-02 11:32:49 -0700400 Wait Until Keyword Succeeds 60s 2s Create Subscriber
Andy Bavierdf70bba2019-01-24 07:06:38 -0700401 Wait Until Keyword Succeeds 60s 2s Create Whitelist
Andy Bavier3075b9b2019-01-31 13:45:35 -0700402 Subscriber Ready to Authenticate
Kailash821de7a2018-11-02 11:32:49 -0700403 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
404 Set Suite Variable ${RG_CONTAINER}
Kailashfe18d612019-02-04 17:04:42 -0800405
Kailash66b9a8d2019-02-07 10:18:55 -0800406Validate XConnect in ONOS
407 [Arguments] ${exists}=True
408 ${rc}= Run And Return RC http -a karaf:karaf GET http://127.0.0.1:30120/onos/segmentrouting/xconnect|jq -r '.xconnects[].vlanId'|grep 222
409 Run Keyword If '${exists}' == 'True' Should Be Equal As Integers ${rc} 0
Kailashabb029d2019-02-15 17:17:11 -0800410 ... ELSE Should Be Equal As Integers ${rc} 1
411
412Setup SSH Keys to Localhost
413 Run yes y 2>/dev/null | ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
414 Run cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
415 Run chmod og-wx ~/.ssh/authorized_keys