blob: 8d72f1fc64e30ea95e5fa2d12dc3022072192057 [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
Andy Bavierb6f57542019-03-11 14:41:03 -070026Library ${VOLTHA_DIR}/tests/atests/common/testCaseUtils.py
Kailash Khalasi16d95c12018-09-21 14:17:28 -070027Library ../../Framework/utils/utils.py
28Resource ../../Framework/utils/utils.robot
29Library ../../Framework/restApi.py
30Resource ../../Framework/Subscriber.robot
31Resource ../../Framework/ATTWorkFlowDriver.robot
Kailash Khalasibf1478b2018-10-17 11:58:58 -070032Resource ../../Framework/Kubernetes.robot
Kailash Khalasi16d95c12018-09-21 14:17:28 -070033Resource ../../Framework/ONU.robot
Kailashaca803e2019-03-05 15:04:31 -080034Resource ../../Framework/OLT.robot
Kailash Khalasi16d95c12018-09-21 14:17:28 -070035Resource ../../Framework/DHCP.robot
36Variables ../../Properties/RestApiProperties.py
37
38*** Variables ***
Andy Bavierb6f57542019-03-11 14:41:03 -070039${VOLTHA_DIR} ~/cord/incubator/voltha
Andy Bavier74d2e762019-04-29 15:29:03 -070040${WHITELIST_FILENAME} SIABWhitelist
Kailash665f0c12019-04-29 14:20:56 -070041${SUBSCRIBER_FILENAME} SIABSubscriber
42${OLT_DEVICE_FILENAME} SIABOLTDevice
43${WHITELIST_PATHFILE} ${CURDIR}/data/${WHITELIST_FILENAME}.json
44${SUBSCRIBER_PATHFILE} ${CURDIR}/data/${SUBSCRIBER_FILENAME}.json
45${VOLT_DEVICE_PATHFILE} ${CURDIR}/data/${OLT_DEVICE_FILENAME}.json
Andy Bavier224ac982019-05-03 14:41:43 -070046${export_kube_config} export KUBECONFIG=%{HOME}/.kube/config
Kailash Khalasibf1478b2018-10-17 11:58:58 -070047${kube_node_ip} localhost
48${dst_host_ip} 172.18.0.10
Kailash Khalasicf006cb2018-10-19 08:36:51 -070049${local_user} %{USER}
Kailashabb029d2019-02-15 17:17:11 -080050${local_pass} ${None}
Kailash Khalasi16d95c12018-09-21 14:17:28 -070051
52*** Test Cases ***
Kailash Khalasibf1478b2018-10-17 11:58:58 -070053ONU in Correct Location
54 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
55 ... Configure whitelist with correct ONU location
56 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasif56a4fb2018-10-23 12:38:16 -070057 [Setup] None
Andy Baviera09626a2019-05-22 14:13:39 -070058 [Tags] stable latest test1 multicast
Andy Bavierdf70bba2019-01-24 07:06:38 -070059 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -070060 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavierdf70bba2019-01-24 07:06:38 -070061 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -070062 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 -070063 ${subscriber_id}= Retrieve Subscriber ${c_tag}
64 CORD Put ${VOLT_SUBSCRIBER} {"status":"disabled"} ${subscriber_id}
Andy Bavier3075b9b2019-01-31 13:45:35 -070065 No Subscriber Service Chain
Andy Bavier81de8b72018-11-20 10:15:06 -070066 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 -070067 Restart RG Pod
Andy Bavierdf70bba2019-01-24 07:06:38 -070068 CORD Put ${VOLT_SUBSCRIBER} {"status":"awaiting-auth"} ${subscriber_id}
69 # ATTWD SI auth_state is already "APPROVED" here from previous auth... not sure if this matters
Kailash Khalasicf006cb2018-10-19 08:36:51 -070070 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavierdf70bba2019-01-24 07:06:38 -070071 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -070072 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 -070073
Kailash Khalasibf1478b2018-10-17 11:58:58 -070074ONU in Correct Location -> Remove ONU from Whitelist -> Add ONU to Whitelist
75 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
76 ... Configure whitelist with correct ONU location
77 ... Validate successful authentication/DHCP/E2E ping
78 ... Remove ONU from whitelist
79 ... Validate failed authentication/DHCP/E2E ping
80 ... Add ONU to whitelist
81 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -080082 [Tags] stable latest test2
Andy Bavier3075b9b2019-01-31 13:45:35 -070083 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -070084 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -070085 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -070086 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 -070087 Reset SIAB Environment
Kailash Khalasibf1478b2018-10-17 11:58:58 -070088 Remove Whitelist
Kailashb49e8452018-12-18 08:29:11 -080089 Wait Until Keyword Succeeds 120s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -070090 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 -070091 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailasha02472b2018-12-18 09:18:20 -080092 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -070093 No Subscriber Service Chain
Kailasha02472b2018-12-18 09:18:20 -080094 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 -070095 Reset SIAB Environment
Andy Bavier3075b9b2019-01-31 13:45:35 -070096 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -070097 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -070098 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -070099 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 -0700100
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700101ONU in Correct Location -> ONU in Wrong Location -> ONU in Correct Location
102 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
103 ... Configure whitelist with correct ONU location
104 ... Validate successful authentication/DHCP/E2E ping
105 ... Update whitelist with wrong ONU location
106 ... Validate failed authentication/DHCP/E2E ping
107 ... Update whitelist with correct ONU location
108 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -0800109 [Tags] stable latest test3
Andy Bavier3075b9b2019-01-31 13:45:35 -0700110 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700111 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700112 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700113 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 -0700114 Restart RG Pod
115 Update Whitelist with Wrong Location
Andy Bavier3075b9b2019-01-31 13:45:35 -0700116 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 -0700117 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700118 No Subscriber Service Chain
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700119 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
120 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 -0700121 Restart RG Pod
122 Update Whitelist with Correct Location
Andy Bavier3075b9b2019-01-31 13:45:35 -0700123 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700124 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700125 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700126 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 -0700127
128ONU in Correct Location -> Remove Subscriber -> Create Subscriber
129 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
130 ... Configure whitelist with correct ONU location
131 ... Validate successful authentication/DHCP/E2E ping
132 ... Remove subscriber model
133 ... Validate failed authentication/DHCP/E2E ping
134 ... Recreate subscriber model
135 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -0800136 [Tags] stable latest test4
Andy Bavier3075b9b2019-01-31 13:45:35 -0700137 Subscriber Ready to Authenticate
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700138 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700139 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700140 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 -0700141 Restart RG Pod
142 Remove Subscriber
Andy Bavier3075b9b2019-01-31 13:45:35 -0700143 No Subscriber Service Chain
Andy Bavier3d6ac1a2018-11-20 15:23:40 -0700144 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700145 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 -0700146 Restart RG Pod
147 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700148 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700149 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700150 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700151 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 -0700152
153ONU in Correct Location (Skip Subscriber Provisioning) -> Provision Subscriber
154 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
155 ... Configure whitelist with correct ONU location and skip provisioning subscriber
156 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
157 ... Provision subscriber
158 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -0800159 [Tags] stable latest test5
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700160 Remove Subscriber
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700161 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700162 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${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}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700164 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700165 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700166 Restart RG Pod
167 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700168 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700169 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700170 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700171 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 -0700172
173ONU in Correct Location (Skip Authentication)
174 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
175 ... Configure whitelist with correct ONU location and skip RG authentication
176 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700177 [Tags] stable latest test6
Andy Bavier3075b9b2019-01-31 13:45:35 -0700178 Subscriber Ready to Authenticate
179 No Subscriber Service Chain
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700180 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 -0700181
182ONU not in Whitelist
183 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
184 ... Skip whitelist configuration for ONU
185 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasi92061c12018-10-29 11:52:39 -0700186 [Tags] stable latest test7
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700187 [Setup] Simple Setup
Kailash Khalasi8b3523c2018-11-08 15:31:49 -0800188 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700189 Wait Until Keyword Succeeds 60s 2s Create Subscriber
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700190 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700191 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasi8b3523c2018-11-08 15:31:49 -0800192 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device} pre-provisioned
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700193 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700194 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 -0800195 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device} pre-provisioned
Andy Bavier3075b9b2019-01-31 13:45:35 -0700196 No Subscriber Service Chain
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700197 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 -0700198
199ONU not in Whitelist (Skip Subscriber Provisioning) -> Add ONU to Whitelist -> Provision Subscriber
200 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
201 ... Skip whitelist configuration for ONU and subscriber provisioning
202 ... Validate successful authentication but failed DHCP/E2E ping
203 ... Configure whitelist with correct ONU location
204 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
205 ... Provision subscriber
206 ... Validate successful authentication/DHCP/E2E ping
Kailash Khalasic7477512018-11-08 07:55:01 -0800207 [Tags] latest test8 stable
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700208 [Setup] Simple Setup
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700209 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700210 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 -0700211 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
212 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 -0700213 Restart RG Pod
214 Create Whitelist
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700215 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700216 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${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}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700218 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700219 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 -0700220 Restart RG Pod
221 Create Subscriber
Kailash Khalasif76cad92018-10-19 12:33:21 -0700222 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status pre-provisioned ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700223 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700224 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700225 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 -0700226
227ONU in Wrong Location
228 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
229 ... Configure whitelist with wrong ONU location
230 ... Validate failed authentication/DHCP/E2E ping
Kailash Khalasic7477512018-11-08 07:55:01 -0800231 [Tags] latest test9 stable
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700232 Update Whitelist with Wrong Location
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700233 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700234 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 -0700235 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700236 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700237 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 -0700238 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700239 No Subscriber Service Chain
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700240 Validate DHCP and Ping False False eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700241
242ONU in Wrong Location (Skip Subscriber Provisioning) -> ONU in Correct Location -> Provision Subscriber
243 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
244 ... Configure whitelist with wrong ONU location and skip subscriber provisioning
245 ... Validate failed authentication/DHCP/E2E ping
246 ... Configure whitelist with correct ONU location
247 ... Validate successful authentication (expected with the ONF pod setup) but failed DHCP/E2E ping
248 ... Provision subscriber
249 ... Validate successful authentication/DHCP/E2E ping
Kailashb49e8452018-12-18 08:29:11 -0800250 [Tags] stable latest test10
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700251 [Setup] Simple Setup
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700252 Wait Until Keyword Succeeds 60s 2s Create Whitelist
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700253 Update Whitelist with Wrong Location
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700254 Wait Until Keyword Succeeds 60s 15s Validate ONU States UNKNOWN DISABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700255 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 -0700256 Validate Authentication False eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700257 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700258 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 -0700259 Restart RG Pod
260 Update Whitelist with Correct Location
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700261 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700262 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
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}
Kailash4b39ecf2018-12-18 08:35:34 -0800264 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device}
Kailasha02472b2018-12-18 09:18:20 -0800265 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 -0700266 Restart RG Pod
267 Create Subscriber
Andy Bavierdf70bba2019-01-24 07:06:38 -0700268 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device} pre-provisioned
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700269 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700270 Subscriber Service Chain Created
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700271 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 -0700272
Andy Baviera09626a2019-05-22 14:13:39 -0700273Multicast Join Fails -> Authenticate, run DHCP -> Multicast Join Succeeds
274 [Documentation] Validates Multicast Connectivity and object states for the given scenario:
275 ... (Assumes multicast server upstream of BNG)
276 ... (Assumes pimd server running on BNG)
277 ... Configure whitelist with correct ONU location
278 ... Run multicast client on RG
279 ... Validate that no multicast traffic flowing yet
280 ... Validate successful authentication/DHCP/E2E ping
281 ... Run multicast client on RG
282 ... Validate that multicast traffic is flowing E2E
283 [Tags] latest test11 multicast
284 Subscriber Ready to Authenticate
285 Validate Multicast False eth0 ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
286 Validate Authentication True eth0 wpa_supplicant.conf ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
287 Subscriber Service Chain Created
288 Validate DHCP and Ping True True eth0 ${s_tag} ${c_tag} ${dst_host_ip} ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
289 Validate Multicast True eth0 ${kube_node_ip} ${local_user} ${local_pass} K8S ${RG_CONTAINER}
290
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700291*** Keywords ***
292Setup
293 ${auth} = Create List ${XOS_USER} ${XOS_PASSWD}
294 ${HEADERS} Create Dictionary Content-Type=application/json
295 Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS}
296 ${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE}
297 ${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE}
298 ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700299 Set Suite Variable ${AttWhiteListList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700300 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
301 ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700302 ${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number
303 Log ${onu_device}
304 Set Global Variable ${onu_device}
305 ${onu_location}= Get From Dictionary ${AttWhiteListDict} pon_port_id
306 Set Global Variable ${onu_location}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700307 ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700308 Set Global Variable ${SubscriberList}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700309 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
310 ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag
311 ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag
312 ${VoltDeviceList}= utils.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
Kailash Khalasi4e1ce762018-12-18 20:29:29 -0800313 ${VoltDeviceDict}= utils.setFieldValueInDict ${VoltDeviceList[0]} volt_service_id ${volt_service_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700314 Set Global Variable ${VoltDeviceList}
Kailash Khalasi4e1ce762018-12-18 20:29:29 -0800315 Set Global Variable ${VoltDeviceDict}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700316 Set Suite Variable ${s_tag}
317 Set Suite Variable ${c_tag}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700318 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700319 Set Suite Variable ${whitelist_id}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700320 ${att_si_id}= Retrieve ATT Service Instance ID ${onu_device}
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700321 Set Suite Variable ${att_si_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700322 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
323 Set Suite Variable ${RG_CONTAINER}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700324 ## Validate ATT Workflow SI
Kailash Khalasif76cad92018-10-19 12:33:21 -0700325 Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700326 @{container_list}= Create List
Kailash Khalasidd9136a2018-10-18 11:16:18 -0700327 Append To List ${container_list} att-workflow-att-workflow-driver
Kailash Khalasie59ba702018-12-18 19:36:03 -0800328 Append To List ${container_list} seba-services-fabric-crossconnect
329 Append To List ${container_list} seba-services-rcord
330 Append To List ${container_list} seba-services-volt
Kailash Khalasi30704022018-10-18 09:13:26 -0700331 Append To List ${container_list} xos-core
332 Append To List ${container_list} vcore
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700333 Set Suite Variable ${container_list}
Kailashabb029d2019-02-15 17:17:11 -0800334 Setup SSH Keys to Localhost
Kailash Khalasicf006cb2018-10-19 08:36:51 -0700335 ${datetime}= Get Current Datetime On Kubernetes Node localhost ${local_user} ${local_pass}
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700336 Set Suite Variable ${datetime}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700337
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700338Teardown
339 Setup Test
340 Delete All Sessions
341
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700342Setup Test
Kailash6e02a072019-04-04 09:33:43 -0700343 ${datetime}= Run date +"%Y-%m-%dT%H:%M:%S.%NZ"
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700344 Set Suite Variable ${datetime}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700345 Wait Until Keyword Succeeds 60s 2s Create Subscriber
Andy Bavierdf70bba2019-01-24 07:06:38 -0700346 Wait Until Keyword Succeeds 60s 2s Create Whitelist
347 Subscriber Ready to Authenticate
348
349Subscriber Ready to Authenticate
350 Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700351 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 -0700352 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
Andy Bavierdf70bba2019-01-24 07:06:38 -0700353
354Subscriber Service Chain Created
Andy Bavier3075b9b2019-01-31 13:45:35 -0700355 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 -0700356 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
357 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
358 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} True
Kailash66b9a8d2019-02-07 10:18:55 -0800359 Wait Until Keyword Succeeds 60s 2s Validate XConnect in ONOS True
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700360
Andy Bavier3075b9b2019-01-31 13:45:35 -0700361No Subscriber Service Chain
362 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
363 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
Kailash66b9a8d2019-02-07 10:18:55 -0800364 Wait Until Keyword Succeeds 60s 2s Validate XConnect in ONOS False
Andy Bavier3075b9b2019-01-31 13:45:35 -0700365
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700366Simple Setup
Kailash6e02a072019-04-04 09:33:43 -0700367 ${datetime}= Run date +"%Y-%m-%dT%H:%M:%S.%NZ"
Kailash Khalasia2e6aa82018-10-23 14:56:02 -0700368 Set Suite Variable ${datetime}
369 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
370 Set Suite Variable ${RG_CONTAINER}
371
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700372Test Cleanup
373 [Documentation] Restore back to initial state per each test
Kailashaca803e2019-03-05 15:04:31 -0800374 Get VOLTHA Status
375 Get ONOS Status
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700376 Log Kubernetes Containers Logs Since Time ${datetime} ${container_list}
Kailash Khalasif56a4fb2018-10-23 12:38:16 -0700377 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
Andy Bavierdf70bba2019-01-24 07:06:38 -0700378 Wait Until Keyword Succeeds 30s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
379 Wait Until Keyword Succeeds 30s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Andy Bavier3075b9b2019-01-31 13:45:35 -0700380 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
381 Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} False
382 Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${s_tag} False
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700383 Restart RG Pod
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700384
Kailash Khalasi0e515fe2018-10-02 12:13:47 -0700385Restart RG Pod
386 Run kubectl -n voltha delete pod ${RG_CONTAINER}
387 ${RG_CONTAINER}= Wait Until Keyword Succeeds 60s 1s Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
388 Set Suite Variable ${RG_CONTAINER}
389 Run kubectl wait -n voltha pod/${RG_CONTAINER} --for condition=Ready --timeout=180s
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700390
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700391Create Whitelist
392 ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
393 ${resp}= CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
394 ${whitelist_id}= Get Json Value ${resp.content} /id
395 Set Global Variable ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700396
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700397Remove Whitelist
398 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
399 CORD Delete ${ATT_WHITELIST} ${whitelist_id}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700400
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700401Create Subscriber
402 ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
403 CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict}
Kailash Khalasi16d95c12018-09-21 14:17:28 -0700404
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700405Remove Subscriber
406 ${subscriber_id}= Retrieve Subscriber ${c_tag}
407 CORD Delete ${VOLT_SUBSCRIBER} ${subscriber_id}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700408
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700409Create VOLT
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700410 CORD Post ${VOLT_DEVICE} ${VoltDeviceDict}
Kailash Khalasib5975cf2018-10-01 12:57:44 -0700411
Kailash Khalasibf1478b2018-10-17 11:58:58 -0700412Update Whitelist with Wrong Location
413 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
414 CORD Put ${ATT_WHITELIST} {"pon_port_id": 55 } ${whitelist_id}
415
416Update Whitelist with Correct Location
417 ${whitelist_id}= Retrieve Whitelist Entry ${onu_device}
Kailash Khalasi92061c12018-10-29 11:52:39 -0700418 CORD Put ${ATT_WHITELIST} {"pon_port_id": ${onu_location} } ${whitelist_id}
Kailash821de7a2018-11-02 11:32:49 -0700419
420Reset SIAB Environment
421 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
422 Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
Andy Bavierdf70bba2019-01-24 07:06:38 -0700423 Wait Until Keyword Succeeds 30s 2s Validate ONU States UNKNOWN DISABLED ${onu_device}
424 Wait Until Keyword Succeeds 30s 2s Validate ATT Workflow Driver SI DISABLED AWAITING ${onu_device}
Kailash821de7a2018-11-02 11:32:49 -0700425 Restart RG Pod
Kailash821de7a2018-11-02 11:32:49 -0700426 Wait Until Keyword Succeeds 60s 2s Create Subscriber
Andy Bavierdf70bba2019-01-24 07:06:38 -0700427 Wait Until Keyword Succeeds 60s 2s Create Whitelist
Andy Bavier3075b9b2019-01-31 13:45:35 -0700428 Subscriber Ready to Authenticate
Kailash821de7a2018-11-02 11:32:49 -0700429 ${RG_CONTAINER}= Run kubectl -n voltha get pod|grep "^rg-"|cut -d' ' -f1
430 Set Suite Variable ${RG_CONTAINER}
Kailashfe18d612019-02-04 17:04:42 -0800431
Kailash66b9a8d2019-02-07 10:18:55 -0800432Validate XConnect in ONOS
433 [Arguments] ${exists}=True
434 ${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
435 Run Keyword If '${exists}' == 'True' Should Be Equal As Integers ${rc} 0
Kailashabb029d2019-02-15 17:17:11 -0800436 ... ELSE Should Be Equal As Integers ${rc} 1
437
438Setup SSH Keys to Localhost
439 Run yes y 2>/dev/null | ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
440 Run cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
441 Run chmod og-wx ~/.ssh/authorized_keys