blob: e3e5115dcced061d563389d637df9153e734f90a [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
Zack Williams821c5022020-01-15 15:11:46 -070026Library CORDRobot
27Library ImportResource resources=CORDRobot
Kailash Khalasi16d95c12018-09-21 14:17:28 -070028Variables ../../Properties/RestApiProperties.py
29
30*** Variables ***
Andy Bavierb6f57542019-03-11 14:41:03 -070031${VOLTHA_DIR} ~/cord/incubator/voltha
Andy Bavier74d2e762019-04-29 15:29:03 -070032${WHITELIST_FILENAME} SIABWhitelist
Kailash665f0c12019-04-29 14:20:56 -070033${SUBSCRIBER_FILENAME} SIABSubscriber
34${OLT_DEVICE_FILENAME} SIABOLTDevice
35${WHITELIST_PATHFILE} ${CURDIR}/data/${WHITELIST_FILENAME}.json
36${SUBSCRIBER_PATHFILE} ${CURDIR}/data/${SUBSCRIBER_FILENAME}.json
37${VOLT_DEVICE_PATHFILE} ${CURDIR}/data/${OLT_DEVICE_FILENAME}.json
Andy Bavier224ac982019-05-03 14:41:43 -070038${export_kube_config} export KUBECONFIG=%{HOME}/.kube/config
Andy Bavier38102202019-09-19 14:13:27 -070039${kube_node_ip} 127.0.0.1
Kailash Khalasibf1478b2018-10-17 11:58:58 -070040${dst_host_ip} 172.18.0.10
Kailash Khalasicf006cb2018-10-19 08:36:51 -070041${local_user} %{USER}
Kailashabb029d2019-02-15 17:17:11 -080042${local_pass} ${None}
Kailash Khalasi16d95c12018-09-21 14:17:28 -070043
44*** Test Cases ***
Kailash Khalasibf1478b2018-10-17 11:58:58 -070045ONU in Correct Location
46 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
47 ... Configure whitelist with correct ONU location
48 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasif56a4fb2018-10-23 12:38:16 -070049 [Setup] None
Andy Baviera09626a2019-05-22 14:13:39 -070050 [Tags] stable latest test1 multicast
Andy Bavierdf70bba2019-01-24 07:06:38 -070051 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -070052 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavierdf70bba2019-01-24 07:06:38 -070053 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -070054 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 -070055 ${subscriber_id}= Retrieve Subscriber ${c_tag}
56 CORD Put ${VOLT_SUBSCRIBER} {"status":"disabled"} ${subscriber_id}
Andy Bavier3075b9b2019-01-31 13:45:35 -070057 No Subscriber Service Chain
Andy Bavier81de8b72018-11-20 10:15:06 -070058 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 -070059 Restart RG Pod
Andy Bavierdf70bba2019-01-24 07:06:38 -070060 CORD Put ${VOLT_SUBSCRIBER} {"status":"awaiting-auth"} ${subscriber_id}
61 # ATTWD SI auth_state is already "APPROVED" here from previous auth... not sure if this matters
Kailash Khalasicf006cb2018-10-19 08:36:51 -070062 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavierdf70bba2019-01-24 07:06:38 -070063 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -070064 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 -070065
Kailash Khalasibf1478b2018-10-17 11:58:58 -070066ONU in Correct Location -> Remove ONU from Whitelist -> Add ONU to Whitelist
67 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
68 ... Configure whitelist with correct ONU location
69 ... Validate successful authentication/DHCP/E2E ping
70 ... Remove ONU from whitelist
71 ... Validate failed authentication/DHCP/E2E ping
72 ... Add ONU to whitelist
73 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -080074 [Tags] stable latest test2
Andy Bavier3075b9b2019-01-31 13:45:35 -070075 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -070076 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -070077 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -070078 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 -070079 Reset SIAB Environment
Kailash Khalasibf1478b2018-10-17 11:58:58 -070080 Remove Whitelist
Kailashb49e8452018-12-18 08:29:11 -080081 Wait Until Keyword Succeeds 120s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -070082 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 -070083 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailasha02472b2018-12-18 09:18:20 -080084 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -070085 No Subscriber Service Chain
Kailasha02472b2018-12-18 09:18:20 -080086 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 -070087 Reset SIAB Environment
Andy Bavier3075b9b2019-01-31 13:45:35 -070088 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -070089 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -070090 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -070091 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 -070092
Kailash Khalasibf1478b2018-10-17 11:58:58 -070093ONU in Correct Location -> ONU in Wrong Location -> ONU in Correct Location
94 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
95 ... Configure whitelist with correct ONU location
96 ... Validate successful authentication/DHCP/E2E ping
97 ... Update whitelist with wrong ONU location
98 ... Validate failed authentication/DHCP/E2E ping
99 ... Update whitelist with correct ONU location
100 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -0800101 [Tags] stable latest test3
Andy Bavier3075b9b2019-01-31 13:45:35 -0700102 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700103 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700104 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700105 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700106 Restart RG Pod
107 Update Whitelist with Wrong Location
Andy Bavier3075b9b2019-01-31 13:45:35 -0700108 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 -0700109 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700110 No Subscriber Service Chain
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700111 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
112 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 -0700113 Restart RG Pod
114 Update Whitelist with Correct Location
Andy Bavier3075b9b2019-01-31 13:45:35 -0700115 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700116 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700117 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700118 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 -0700119
120ONU in Correct Location -> Remove Subscriber -> Create Subscriber
121 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
122 ... Configure whitelist with correct ONU location
123 ... Validate successful authentication/DHCP/E2E ping
124 ... Remove subscriber model
125 ... Validate failed authentication/DHCP/E2E ping
126 ... Recreate subscriber model
127 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -0800128 [Tags] stable latest test4
Andy Bavier3075b9b2019-01-31 13:45:35 -0700129 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700130 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700131 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700132 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 -0700133 Restart RG Pod
134 Remove Subscriber
Andy Bavier3075b9b2019-01-31 13:45:35 -0700135 No Subscriber Service Chain
Andy Bavier3d6ac1a2018-11-20 15:23:40 -0700136 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700137 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 -0700138 Restart RG Pod
139 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700140 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700141 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700142 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700143 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 -0700144
145ONU in Correct Location (Skip Subscriber Provisioning) -> Provision Subscriber
146 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
147 ... Configure whitelist with correct ONU location and skip provisioning subscriber
148 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
149 ... Provision subscriber
150 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -0800151 [Tags] stable latest test5
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700152 Remove Subscriber
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700153 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700154 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
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}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700157 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 -0700158 Restart RG Pod
159 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700160 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700161 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700162 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700163 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 -0700164
165ONU in Correct Location (Skip Authentication)
166 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
167 ... Configure whitelist with correct ONU location and skip RG authentication
168 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700169 [Tags] stable latest test6
Andy Bavier3075b9b2019-01-31 13:45:35 -0700170 Subscriber Ready to Authenticate
171 No Subscriber Service Chain
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700172 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 -0700173
174ONU not in Whitelist
175 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
176 ... Skip whitelist configuration for ONU
177 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700178 [Tags] stable latest test7
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700179 [Setup] Simple Setup
Kailash Khalasi8b3523c2018-11-08 15:31:49 -0800180 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700181 Wait Until Keyword Succeeds 60s 2s Create Subscriber
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700182 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700183 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasi8b3523c2018-11-08 15:31:49 -0800184 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device} pre-provisioned
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700185 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700186 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 -0800187 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device} pre-provisioned
Andy Bavier3075b9b2019-01-31 13:45:35 -0700188 No Subscriber Service Chain
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700189 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 -0700190
191ONU not in Whitelist (Skip Subscriber Provisioning) -> Add ONU to Whitelist -> Provision Subscriber
192 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
193 ... Skip whitelist configuration for ONU and subscriber provisioning
194 ... Validate successful authentication but failed DHCP/E2E ping
195 ... Configure whitelist with correct ONU location
196 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
197 ... Provision subscriber
198 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasic7477512018-11-08 07:55:01 -0800199 [Tags] latest test8 stable
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700200 [Setup] Simple Setup
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700201 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700202 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 -0700203 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
204 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 -0700205 Restart RG Pod
206 Create Whitelist
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700207 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700208 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700209 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700210 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700211 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 -0700212 Restart RG Pod
213 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700214 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700215 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700216 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700217 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 -0700218
219ONU in Wrong Location
220 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
221 ... Configure whitelist with wrong ONU location
222 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasic7477512018-11-08 07:55:01 -0800223 [Tags] latest test9 stable
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700224 Update Whitelist with Wrong Location
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700225 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700226 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 -0700227 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700228 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700229 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 -0700230 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700231 No Subscriber Service Chain
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700232 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 -0700233
234ONU in Wrong Location (Skip Subscriber Provisioning) -> ONU in Correct Location -> Provision Subscriber
235 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
236 ... Configure whitelist with wrong ONU location and skip subscriber provisioning
237 ... Validate failed authentication/DHCP/E2E ping
238 ... Configure whitelist with correct ONU location
239 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
240 ... Provision subscriber
241 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -0800242 [Tags] stable latest test10
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700243 [Setup] Simple Setup
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700244 Wait Until Keyword Succeeds 60s 2s Create Whitelist
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700245 Update Whitelist with Wrong Location
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700246 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700247 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 -0700248 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700249 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700250 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700251 Restart RG Pod
252 Update Whitelist with Correct Location
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700253 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700254 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700255 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash4b39ecf2018-12-18 08:35:34 -0800256 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailasha02472b2018-12-18 09:18:20 -0800257 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 -0700258 Restart RG Pod
259 Create Subscriber
Andy Bavierdf70bba2019-01-24 07:06:38 -0700260 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device} pre-provisioned
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700261 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700262 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700263 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 -0700264
Andy Baviera09626a2019-05-22 14:13:39 -0700265Multicast Join Fails -> Authenticate, run DHCP -> Multicast Join Succeeds
266 [Documentation] Validates Multicast Connectivity and object states for the given scenario:
267 ... (Assumes multicast server upstream of BNG)
268 ... (Assumes pimd server running on BNG)
269 ... Configure whitelist with correct ONU location
270 ... Run multicast client on RG
271 ... Validate that no multicast traffic flowing yet
272 ... Validate successful authentication/DHCP/E2E ping
273 ... Run multicast client on RG
274 ... Validate that multicast traffic is flowing E2E
275 [Tags] latest test11 multicast
276 Subscriber Ready to Authenticate
277 Validate Multicast False eth0 ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
278 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
279 Subscriber Service Chain Created
280 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
281 Validate Multicast True eth0 ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
282
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700283*** Keywords ***
284Setup
285 ${auth} = Create List ${XOS_USER} ${XOS_PASSWD}
286 ${HEADERS} Create Dictionary Content-Type=application/json
287 Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS}
288 ${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE}
289 ${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE}
Zack Williams821c5022020-01-15 15:11:46 -0700290 ${AttWhiteListList}= CORDRobot.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700291 Set Suite Variable ${AttWhiteListList}
Zack Williams821c5022020-01-15 15:11:46 -0700292 ${AttWhiteListDict}= CORDRobot.listToDict ${AttWhiteListList} 0
293 ${AttWhiteListDict}= CORDRobot.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700294 ${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number
295 Log ${onu_device}
296 Set Global Variable ${onu_device}
297 ${onu_location}= Get From Dictionary ${AttWhiteListDict} pon_port_id
298 Set Global Variable ${onu_location}
Zack Williams821c5022020-01-15 15:11:46 -0700299 ${SubscriberList}= CORDRobot.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700300 Set Global Variable ${SubscriberList}
Zack Williams821c5022020-01-15 15:11:46 -0700301 ${SubscriberDict}= CORDRobot.listToDict ${SubscriberList} 0
302 ${s_tag}= CORDRobot.getFieldValueFromDict ${SubscriberDict} s_tag
303 ${c_tag}= CORDRobot.getFieldValueFromDict ${SubscriberDict} c_tag
304 ${VoltDeviceList}= CORDRobot.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
305 ${VoltDeviceDict}= CORDRobot.setFieldValueInDict ${VoltDeviceList[0]} volt_service_id ${volt_service_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700306 Set Global Variable ${VoltDeviceList}
Kailash Khalasi4e1ce762018-12-18 20:29:29 -0800307 Set Global Variable ${VoltDeviceDict}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700308 Set Suite Variable ${s_tag}
309 Set Suite Variable ${c_tag}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700310 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700311 Set Suite Variable ${whitelist_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700312 ${att_si_id}= Retrieve ATT Service Instance ID ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700313 Set Suite Variable ${att_si_id}
Andy Bavier8d74e8a2019-05-28 15:36:53 -0700314 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg[0-]"|cut -d' ' -f1
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700315 Set Suite Variable ${RG_CONTAINER}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700316 ## Validate ATT Workflow SI
Kailash Khalasif76cad92018-10-19 12:33:21 -0700317 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700318 @{container_list}= Create List
Kailash Khalasidd9136a2018-10-18 11:16:18 -0700319 Append To List ${container_list} att-workflow-att-workflow-driver
Kailash Khalasie59ba702018-12-18 19:36:03 -0800320 Append To List ${container_list} seba-services-fabric-crossconnect
321 Append To List ${container_list} seba-services-rcord
322 Append To List ${container_list} seba-services-volt
Kailash Khalasi30704022018-10-18 09:13:26 -0700323 Append To List ${container_list} xos-core
324 Append To List ${container_list} vcore
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700325 Set Suite Variable ${container_list}
Kailashabb029d2019-02-15 17:17:11 -0800326 Setup SSH Keys to Localhost
Andy Bavier38102202019-09-19 14:13:27 -0700327 ${datetime}= Get Current Datetime On Kubernetes Node ${kube_node_ip} ${local_user} ${local_pass}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700328 Set Suite Variable ${datetime}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700329
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700330Teardown
331 Setup Test
332 Delete All Sessions
333
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700334Setup Test
Kailash6e02a072019-04-04 09:33:43 -0700335 ${datetime}= Run date +"%Y-%m-%dT%H:%M:%S.%NZ"
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700336 Set Suite Variable ${datetime}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700337 Wait Until Keyword Succeeds 60s 2s Create Subscriber
Andy Bavierdf70bba2019-01-24 07:06:38 -0700338 Wait Until Keyword Succeeds 60s 2s Create Whitelist
339 Subscriber Ready to Authenticate
340
341Subscriber Ready to Authenticate
342 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700343 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 -0700344 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Andy Bavierdf70bba2019-01-24 07:06:38 -0700345
346Subscriber Service Chain Created
Andy Bavier3075b9b2019-01-31 13:45:35 -0700347 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 -0700348 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
349 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
350 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash66b9a8d2019-02-07 10:18:55 -0800351 Wait Until Keyword Succeeds 60s 2s Validate XConnect in ONOS True
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700352
Andy Bavier3075b9b2019-01-31 13:45:35 -0700353No Subscriber Service Chain
354 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
355 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
Kailash66b9a8d2019-02-07 10:18:55 -0800356 Wait Until Keyword Succeeds 60s 2s Validate XConnect in ONOS False
Andy Bavier3075b9b2019-01-31 13:45:35 -0700357
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700358Simple Setup
Kailash6e02a072019-04-04 09:33:43 -0700359 ${datetime}= Run date +"%Y-%m-%dT%H:%M:%S.%NZ"
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700360 Set Suite Variable ${datetime}
Andy Bavier8d74e8a2019-05-28 15:36:53 -0700361 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg[0-]"|cut -d' ' -f1
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700362 Set Suite Variable ${RG_CONTAINER}
363
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700364Test Cleanup
365 [Documentation] Restore back to initial state per each test
Kailashaca803e2019-03-05 15:04:31 -0800366 Get VOLTHA Status
Andy Bavier38102202019-09-19 14:13:27 -0700367 Get ONOS Status ${kube_node_ip}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700368 Log Kubernetes Containers Logs Since Time ${datetime} ${container_list}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700369 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
Andy Bavierdf70bba2019-01-24 07:06:38 -0700370 Wait Until Keyword Succeeds 30s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
371 Wait Until Keyword Succeeds 30s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700372 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
373 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
374 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
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}
Andy Bavier8d74e8a2019-05-28 15:36:53 -0700379 ${RG_CONTAINER}= Wait Until Keyword Succeeds 60s 1s Run kubectl -n voltha get pod|grep "^rg[0-]"|cut -d' ' -f1
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700380 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
Zack Williams821c5022020-01-15 15:11:46 -0700384 ${AttWhiteListDict}= CORDRobot.listToDict ${AttWhiteListList} 0
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700385 ${resp}= CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
Zack Williams821c5022020-01-15 15:11:46 -0700386 ${id}= Get From Dictionary ${resp.json()} id
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700387 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
Zack Williams821c5022020-01-15 15:11:46 -0700394 ${SubscriberDict}= CORDRobot.listToDict ${SubscriberList} 0
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700395 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
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700402 CORD Post ${VOLT_DEVICE} ${VoltDeviceDict}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700403
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700404Update Whitelist with Wrong Location
405 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
406 CORD Put ${ATT_WHITELIST} {"pon_port_id": 55 } ${whitelist_id}
407
408Update Whitelist with Correct Location
409 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
Kailash Khalasi92061c12018-10-29 11:52:39 -0700410 CORD Put ${ATT_WHITELIST} {"pon_port_id": ${onu_location} } ${whitelist_id}
Kailash821de7a2018-11-02 11:32:49 -0700411
412Reset SIAB Environment
413 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
414 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
Andy Bavierdf70bba2019-01-24 07:06:38 -0700415 Wait Until Keyword Succeeds 30s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
416 Wait Until Keyword Succeeds 30s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash821de7a2018-11-02 11:32:49 -0700417 Restart RG Pod
Kailash821de7a2018-11-02 11:32:49 -0700418 Wait Until Keyword Succeeds 60s 2s Create Subscriber
Andy Bavierdf70bba2019-01-24 07:06:38 -0700419 Wait Until Keyword Succeeds 60s 2s Create Whitelist
Andy Bavier3075b9b2019-01-31 13:45:35 -0700420 Subscriber Ready to Authenticate
Andy Bavier8d74e8a2019-05-28 15:36:53 -0700421 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg[0-]"|cut -d' ' -f1
Kailash821de7a2018-11-02 11:32:49 -0700422 Set Suite Variable ${RG_CONTAINER}
Kailashfe18d612019-02-04 17:04:42 -0800423
Kailash66b9a8d2019-02-07 10:18:55 -0800424Validate XConnect in ONOS
425 [Arguments] ${exists}=True
426 ${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
427 Run Keyword If '${exists}' == 'True' Should Be Equal As Integers ${rc} 0
Kailashabb029d2019-02-15 17:17:11 -0800428 ... ELSE Should Be Equal As Integers ${rc} 1
429
430Setup SSH Keys to Localhost
431 Run yes y 2>/dev/null | ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
432 Run cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
433 Run chmod og-wx ~/.ssh/authorized_keys