blob: b1d39e87444d9250f28bf640e933b6a2b77275f8 [file] [log] [blame]
David Bainbridgef81cd642019-11-20 00:14:47 +00001# Copyright 2017 - present Open Networking Foundation
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -07002#
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.
Matteo Scandolo1294aeb2019-09-24 16:20:32 -070014# FIXME Can we use the same test against BBSim and Hardware?
15
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070016*** Settings ***
Zack Williamsec53a1b2019-09-16 15:50:52 -070017Documentation Test various end-to-end scenarios
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070018Suite Setup Setup Suite
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070019Test Setup Setup
20Test Teardown Teardown
Andy Bavierba9866b2019-10-11 07:11:53 -070021Suite Teardown Teardown Suite
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070022Library Collections
23Library String
24Library OperatingSystem
25Library XML
26Library RequestsLibrary
Andy Bavierba9866b2019-10-11 07:11:53 -070027Library ../../libraries/DependencyLibrary.py
Suchitra Vemurib8ed2d52019-09-30 13:22:51 -070028Resource ../../libraries/onos.robot
29Resource ../../libraries/voltctl.robot
David Bainbridgef81cd642019-11-20 00:14:47 +000030Resource ../../libraries/voltha.robot
Suchitra Vemurib8ed2d52019-09-30 13:22:51 -070031Resource ../../libraries/utils.robot
Andy Bavierba9866b2019-10-11 07:11:53 -070032Resource ../../libraries/k8s.robot
Suchitra Vemurib8ed2d52019-09-30 13:22:51 -070033Resource ../../variables/variables.robot
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070034
35*** Variables ***
Zack Williamsec53a1b2019-09-16 15:50:52 -070036${POD_NAME} flex-ocp-cord
37${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
38${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs
39#${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
40${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
41${HELM_CHARTS_DIR} ~/helm-charts
42${VOLTHA_POD_NUM} 8
Zack Williamsa8fe75a2020-01-10 14:25:27 -070043${NAMESPACE} voltha
suraj gourd64356b2019-11-07 13:26:20 +000044# For below variable value, using deployment name as using grep for
45# parsing radius pod name, we can also use full radius pod name
Zack Williamsa8fe75a2020-01-10 14:25:27 -070046${RESTART_POD_NAME} radius
Andy Bavierba9866b2019-10-11 07:11:53 -070047${timeout} 60s
Zack Williamsec53a1b2019-09-16 15:50:52 -070048${of_id} 0
49${logical_id} 0
Andy Bavierba9866b2019-10-11 07:11:53 -070050${has_dataplane} True
51${external_libs} True
52${teardown_device} False
Zack Williamsa8fe75a2020-01-10 14:25:27 -070053${scripts} ../../scripts
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070054
55*** Test Cases ***
56Sanity E2E Test for OLT/ONU on POD
57 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
58 ... Validate successful authentication/DHCP/E2E ping for the tech profile that is used
Andy Bavierba9866b2019-10-11 07:11:53 -070059 [Tags] sanity test1
Suchitra Vemuri6db89412019-11-14 14:52:54 -080060 [Teardown] NONE
Suchitra Vemuric5295a32019-12-15 20:32:04 -080061 Run Keyword If ${has_dataplane} Clean Up Linux
Zack Williamsa8fe75a2020-01-10 14:25:27 -070062 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri582574b2019-12-10 21:11:54 -080063 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070064
Hema93762cf2020-01-29 19:59:28 +053065Test Disable and Enable OLT
66 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
67 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
68 ... Perform disable on the OLT and validate that the pings do not succeed
69 ... Perform enable on the OLT and validate that the pings are successful
70 [Tags] VOL-2410 DisableEnableOLT notready
71 [Setup] None
72 [Teardown] None
73 #Disable the OLT and verify the OLT/ONUs are disabled properly
74 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
75 Should Be Equal As Integers ${rc} 0
76 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
77 ... ${olt_serial_number}
78 FOR ${I} IN RANGE 0 ${num_onus}
79 ${src}= Set Variable ${hosts.src[${I}]}
80 ${dst}= Set Variable ${hosts.dst[${I}]}
81 ${onu_device_id}= Get Device ID From SN ${src['onu']}
82 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED DISCOVERED
83 ... UNREACHABLE ${src['onu']} onu=false
84 #Verify that ping fails
85 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
86 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
87 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}}
88 END
89 #Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
90 Enable Device ${olt_device_id}
91 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
92 ... ${olt_serial_number}
93 FOR ${I} IN RANGE 0 ${num_onus}
94 ${src}= Set Variable ${hosts.src[${I}]}
95 ${dst}= Set Variable ${hosts.dst[${I}]}
96 ${onu_device_id}= Get Device ID From SN ${src['onu']}
97 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
98 ... ${of_id}
99 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE
100 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
101 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
102 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
103 #Verify that ping workss fine again
104 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
105 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
106 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}}
107 Run Keyword and Ignore Error Collect Logs
108 END
109
110
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800111Test Disable and Enable ONU
112 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
113 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
114 ... Perform disable on the ONUs and validate that the pings do not succeed
115 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800116 [Tags] functional DisableEnableONU released
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800117 [Setup] None
suraj gour7f6d5fe2019-11-29 10:56:35 +0000118 [Teardown] None
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800119 FOR ${I} IN RANGE 0 ${num_onus}
120 ${src}= Set Variable ${hosts.src[${I}]}
121 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800122 ${onu_device_id}= Get Device ID From SN ${src['onu']}
123 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
124 ... ${of_id}
125 Disable Device ${onu_device_id}
Suchitra Vemuri15e15252020-01-20 17:38:49 -0800126 #Test Devices Disabled in VOLTHA Id=${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700127 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
128 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700129 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
130 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800131 Enable Device ${onu_device_id}
132 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
133 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700134 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
135 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700136 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
137 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
138 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
139 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800140 END
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700141 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800142
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800143Test Subscriber Delete and Add
144 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
145 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700146 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800147 ... Re-add the subscriber and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800148 [Tags] functional SubAddDelete released
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800149 [Setup] None
150 [Teardown] None
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800151 FOR ${I} IN RANGE 0 ${num_onus}
152 ${src}= Set Variable ${hosts.src[${I}]}
153 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800154 ${onu_device_id}= Get Device ID From SN ${src['onu']}
155 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
156 ... ${of_id}
157 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
158 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
159 Sleep 10s
Andy Bavier33e6dd32020-01-16 13:35:20 -0700160 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
161 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700162 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
163 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800164 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
165 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
166 Sleep 10s
167 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
168 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700169 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
170 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700171 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
172 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
173 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
174 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800175 END
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700176 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800177
suraj gourd64356b2019-11-07 13:26:20 +0000178Check OLT/ONU Authentication After Radius Pod Restart
suraj gour7f6d5fe2019-11-29 10:56:35 +0000179 [Documentation] After radius restart, triggers reassociation, checks status and
180 ... authentication, validates dhcp and ping. Note : wpa reassociate works only when
181 ... wpa supplicant is running in background hence it is recommended to remove
182 ... teardown from previous test or uncomment 'Teardown None'.
183 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800184 [Tags] functional RadiusRestart released
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700185 [Setup] None
186 [Teardown] None
suraj gourd64356b2019-11-07 13:26:20 +0000187 Wait Until Keyword Succeeds ${timeout} 15s Restart Pod ${NAMESPACE} ${RESTART_POD_NAME}
suraj gourd64356b2019-11-07 13:26:20 +0000188 FOR ${I} IN RANGE 0 ${num_onus}
189 ${src}= Set Variable ${hosts.src[${I}]}
190 ${dst}= Set Variable ${hosts.dst[${I}]}
suraj gourd64356b2019-11-07 13:26:20 +0000191 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700192 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
193 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
194 Wait Until Keyword Succeeds ${timeout} 2s
195 ... Verify Eapol Flows Added For ONU ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
196 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
197 ... Validate Authentication After Reassociate True ${src['dp_iface_name']}
198 ... ${src['ip']} ${src['user']} ${src['pass']}
suraj gourd64356b2019-11-07 13:26:20 +0000199 ... ${src['container_type']} ${src['container_name']}
200 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700201 ... ${ONOS_SSH_PORT} ${onu_port}
202 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
203 ... Validate DHCP and Ping True True ${src['dp_iface_name']}
204 ... ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
205 ... ${src['ip']} ${src['user']} ${src['pass']}
206 ... ${src['container_type']} ${src['container_name']}
207 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']}
208 ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']}
suraj gourd64356b2019-11-07 13:26:20 +0000209 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
210 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700211 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
212 Run Keyword and Ignore Error Collect Logs
suraj gourd64356b2019-11-07 13:26:20 +0000213 END
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700214 Run Keyword and Ignore Error Collect Logs
suraj gourd64356b2019-11-07 13:26:20 +0000215
suraj gourd5cfdbb2019-12-13 12:44:55 +0000216Check DHCP attempt fails when subscriber is not added
217 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
218 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700219 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800220 [Tags] functional SubsRemoveDHCP released
suraj gourd5cfdbb2019-12-13 12:44:55 +0000221 [Setup] None
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800222 [Teardown] None
suraj gourd5cfdbb2019-12-13 12:44:55 +0000223 FOR ${I} IN RANGE 0 ${num_onus}
224 ${src}= Set Variable ${hosts.src[${I}]}
225 ${dst}= Set Variable ${hosts.dst[${I}]}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700226 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000227 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
228 ... ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800229 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']}
230 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
231 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
232 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000233 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
234 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700235 Sleep 5s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800236 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
237 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700238 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
239 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
240 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
241 Run Keyword And Ignore Error Login And Run Command On Remote System
242 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800243 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000244 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
245 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
246 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
247 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
248 ... ${dst['container_name']}
249 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
250 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
251 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
252 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
253 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
254 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
255 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800256 Run Keyword and Ignore Error Collect Logs
257 END
258 Run Keyword and Ignore Error Collect Logs
259
suraj gour1ecfae92019-12-20 15:11:40 +0000260Check ONU adapter crash not forcing authentication again
261 [Documentation] After ONU adapter restart, checks wpa log for 'authentication started'
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700262 ... message count to make sure auth not started again and validates EAP status and ping.
suraj gour1ecfae92019-12-20 15:11:40 +0000263 ... Assuming that test1 or sanity was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800264 [Tags] functional ONUAdaptCrash notready
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700265 [Setup] None
266 [Teardown] None
suraj gour1ecfae92019-12-20 15:11:40 +0000267 @{before_list}= Create List
268 @{after_list}= Create List
269 FOR ${I} IN RANGE 0 ${num_onus}
270 ${src}= Set Variable ${hosts.src[${I}]}
271 ${dst}= Set Variable ${hosts.dst[${I}]}
272 ${onu_device_id}= Get Device ID From SN ${src['onu']}
273 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
274 ... ${of_id}
275 ${before}= Run Keyword If ${has_dataplane} Check Remote File Contents For WPA Logs
276 ... True /tmp/wpa.log authentication started ${src['ip']} ${src['user']} ${src['pass']}
277 ... ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700278 Append To List ${before_list} ${before}
suraj gour1ecfae92019-12-20 15:11:40 +0000279 END
280 Wait Until Keyword Succeeds ${timeout} 15s Restart Pod ${NAMESPACE} adapter-open-onu
281 Wait Until Keyword Succeeds ${timeout} 2s Validate Pod Status ${podName} ${NAMESPACE}
282 ... Running
283 FOR ${I} IN RANGE 0 ${num_onus}
284 ${src}= Set Variable ${hosts.src[${I}]}
285 ${dst}= Set Variable ${hosts.dst[${I}]}
286 ${onu_device_id}= Get Device ID From SN ${src['onu']}
287 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
288 ... ${of_id}
289 ${after}= Run Keyword If ${has_dataplane} Check Remote File Contents For WPA Logs
290 ... True /tmp/wpa.log authentication started ${src['ip']} ${src['user']} ${src['pass']}
291 ... ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700292 Append To List ${after_list} ${after}
293 ${output}= Run Keyword If ${has_dataplane} Login And Run Command On Remote System
294 ... wpa_cli status | grep SUCCESS ${src['ip']} ${src['user']} ${src['pass']}
295 ... ${src['container_type']} ${src['container_name']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700296 Run Keyword If ${has_dataplane} Should Contain ${output} SUCCESS
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700297 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
298 ... Wait Until Keyword Succeeds 60s 2s Check Ping
suraj gour1ecfae92019-12-20 15:11:40 +0000299 ... True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']} ${src['user']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700300 ... ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gour1ecfae92019-12-20 15:11:40 +0000301 END
302 Lists Should Be Equal ${after_list} ${before_list}
303 Log ${after_list}
304 Log ${before_list}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700305 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800306
307Test Disable and Enable ONU scenario for ATT workflow
308 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
309 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
310 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700311 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
312 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800313 ... VOL-2284
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800314 [Tags] functional ATT_DisableEnableONU
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800315 [Setup] None
316 #[Teardown] None
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800317 FOR ${I} IN RANGE 0 ${num_onus}
318 ${src}= Set Variable ${hosts.src[${I}]}
319 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800320 ${onu_device_id}= Get Device ID From SN ${src['onu']}
321 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
322 ... ${of_id}
323 Disable Device ${onu_device_id}
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800324 Sleep 5s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800325 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
326 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700327 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
328 ... Wait Until Keyword Succeeds 60s 2s Check Ping
329 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
330 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800331 ... ELSE sleep 60s
332 Enable Device ${onu_device_id}
333 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip}
334 ... ${ONOS_SSH_PORT} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700335 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
336 ... Validate Authentication After Reassociate True
337 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800338 ... ${src['container_type']} ${src['container_name']}
339 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700340 ... ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800341 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
342 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
343 Sleep 10s
344 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700345 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800346 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
347 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
348 ... ${dst['container_name']}
349 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
350 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800351 Run Keyword and Ignore Error Collect Logs
suraj gourd5cfdbb2019-12-13 12:44:55 +0000352 END
353 Run Keyword and Ignore Error Collect Logs
354
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800355Delete OLT, ReAdd OLT and Perform Sanity Test
356 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
357 ... Disable and Delete the OLT
358 ... Create/Enable the same OLT again
359 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuri2fa9bba2020-01-22 17:38:48 -0800360 [Tags] functional DeleteOLT
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800361 [Setup] None
362 [Teardown] NONE
363 Run Keyword If ${has_dataplane} Clean Up Linux
364 Run Keyword If ${has_dataplane} Delete Device and Verify
365 Run Keyword and Ignore Error Collect Logs
366 # Recreate the OLT
367 Run Keyword If ${has_dataplane} Setup
368 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
369 Run Keyword and Ignore Error Collect Logs
370
Hema783279b2020-01-22 15:37:37 +0530371Test disable ONUs and OLT then delete ONUs and OLT
372 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
373 ... This TC is to confirm that ONU removal is not impacting OLT
374 ... Devices will be removed during the execution of this TC
375 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuriba4f3712020-01-24 16:18:26 -0800376 [Tags] functional VOL-2354 DisableDeleteONUandOLT
Hema783279b2020-01-22 15:37:37 +0530377 [Setup] NONE
378 [Teardown] None
Suchitra Vemuriba4f3712020-01-24 16:18:26 -0800379 ${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Hema783279b2020-01-22 15:37:37 +0530380 FOR ${I} IN RANGE 0 ${num_onus}
381 ${src}= Set Variable ${hosts.src[${I}]}
382 ${dst}= Set Variable ${hosts.dst[${I}]}
383 ${onu_device_id}= Get Device ID From SN ${src['onu']}
384 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE
385 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
386 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE
387 ... REACHABLE ${olt_serial_number}
388 ${rc} ${output}= Run and Return Rc and Output
389 ... ${VOLTCTL_CONFIG}; voltctl device disable ${onu_device_id}
390 Should Be Equal As Integers ${rc} 0
391 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
392 ... REACHABLE ${src['onu']} onu=false
393 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE
394 ... REACHABLE ${olt_serial_number}
395 END
396 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
397 Should Be Equal As Integers ${rc} 0
398 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
399 ... ${olt_serial_number}
400 FOR ${I} IN RANGE 0 ${num_onus}
401 ${src}= Set Variable ${hosts.src[${I}]}
402 ${dst}= Set Variable ${hosts.dst[${I}]}
403 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuriba4f3712020-01-24 16:18:26 -0800404 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
405 ... REACHABLE ${src['onu']} onu=false
Hema783279b2020-01-22 15:37:37 +0530406 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device delete ${onu_device_id}
407 Should Be Equal As Integers ${rc} 0
408 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN
409 ... REACHABLE ${olt_serial_number}
410 END
411 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device delete ${olt_device_id}
412 Should Be Equal As Integers ${rc} 0
413 Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
414 #Adding setup here to add the devices back since this TC removes the devices
415 Run Keyword If ${has_dataplane} sleep 180s
416 setup
417
Suchitra Vemuric4203692020-01-30 20:29:46 -0800418
David Bainbridgef81cd642019-11-20 00:14:47 +0000419Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart
420 [Documentation] Deploys an device instance and waits for it to authenticate. After
421 ... authentication is successful the rw-core deployment is scaled to 0 instances to
422 ... simulate a POD crash. The test then scales the rw-core back to a single instance
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700423 ... and configures ONOS for access. The test succeeds if the device is able to
David Bainbridgef81cd642019-11-20 00:14:47 +0000424 ... complete the DHCP sequence.
425 [Tags] bbsim rwcore-restart
426 [Setup] Clear All Devices Then Create New Device
427 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
428 Set Global Variable ${of_id}
David Bainbridgef81cd642019-11-20 00:14:47 +0000429 FOR ${I} IN RANGE 0 ${num_onus}
430 ${src}= Set Variable ${hosts.src[${I}]}
431 ${dst}= Set Variable ${hosts.dst[${I}]}
432 ${onu_device_id}= Get Device ID From SN ${src['onu']}
433 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
434 ... ${of_id}
David Bainbridgef81cd642019-11-20 00:14:47 +0000435 # Bring up the device and verify it authenticates
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700436 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
David Bainbridgef81cd642019-11-20 00:14:47 +0000437 ... ${onu_device_id} onu=True onu_reason=omci-flows-pushed
438 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip}
439 ... ${ONOS_SSH_PORT} ${onu_port}
440 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
441 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
442 ... ${src['container_type']} ${src['container_name']}
443 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700444 ... ${ONOS_SSH_PORT} ${onu_port}
David Bainbridgef81cd642019-11-20 00:14:47 +0000445 # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1
446 Scale K8s Deployment voltha voltha-rw-core 0
447 Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-rw-core
448 # Ensure the ofagent POD goes "not-ready" as expected
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700449 Wait Until keyword Succeeds ${timeout} 2s
450 ... Check Expected Available Deployment Replicas voltha voltha-ofagent 0
David Bainbridgef81cd642019-11-20 00:14:47 +0000451 # Scale up the core deployment and make sure both it and the ofagent deployment are back
452 Scale K8s Deployment voltha voltha-rw-core 1
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700453 Wait Until Keyword Succeeds ${timeout} 2s
454 ... Check Expected Available Deployment Replicas voltha voltha-rw-core 1
455 Wait Until Keyword Succeeds ${timeout} 2s
456 ... Check Expected Available Deployment Replicas voltha voltha-ofagent 1
David Bainbridgef81cd642019-11-20 00:14:47 +0000457 # For some reason scaling down and up the POD behind a service causes the port forward to stop working,
458 # so restart the port forwarding for the API service
459 Restart VOLTHA Port Foward voltha-api-minimal
David Bainbridgef81cd642019-11-20 00:14:47 +0000460 # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this
461 # represents system connectivity being restored
462 Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
463 ... http://karaf:karaf@${k8s_node_ip}:${ONOS_REST_PORT} ${of_id}
David Bainbridgef81cd642019-11-20 00:14:47 +0000464 # Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
465 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
466 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
467 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
468 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
469 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
470 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
471 ... ${dst['container_name']}
472 Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
473 ... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
474 END
475
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700476*** Keywords ***
477Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700478 [Documentation] Set up the test suite
479 Common Test Suite Setup
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700480
David Bainbridgef81cd642019-11-20 00:14:47 +0000481Clear All Devices Then Create New Device
482 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000483 # Remove all devices from voltha and nos
484 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000485 # Execute normal test Setup Keyword
486 Setup
487
Suchitra Vemuri582574b2019-12-10 21:11:54 -0800488Collect Logs
489 [Documentation] Collect Logs from voltha and onos cli for various commands
Suchitra Vemuri1a970a62019-11-26 12:52:16 -0800490 Run Keyword and Ignore Error Get Device List from Voltha
491 Run Keyword and Ignore Error Get Device Output from Voltha ${olt_device_id}
492 Run Keyword and Ignore Error Get Logical Device Output from Voltha ${logical_id}
Andy Bavierba9866b2019-10-11 07:11:53 -0700493 Run Keyword If ${external_libs} Get ONOS Status ${k8s_node_ip}
Andy Bavierba9866b2019-10-11 07:11:53 -0700494
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700495Clean Up Linux
496 [Documentation] Kill processes and clean up interfaces on src+dst servers
Suchitra Vemuri8a9c3782019-10-23 12:43:01 -0700497 FOR ${I} IN RANGE 0 ${num_onus}
498 ${src}= Set Variable ${hosts.src[${I}]}
499 ${dst}= Set Variable ${hosts.dst[${I}]}
500 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
501 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
502 Run Keyword And Ignore Error Kill Linux Process [d]hclient ${src['ip']}
503 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
504 Run Keyword If '${dst['ip']}' != '${None}' Run Keyword And Ignore Error
505 ... Kill Linux Process [d]hcpd ${dst['ip']} ${dst['user']}
506 ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']}
507 Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
508 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
509 Run Keyword If '${dst['ip']}' != '${None}' Delete Interface on Remote Host
510 ... ${dst['dp_iface_name']}.${src['s_tag']} ${dst['ip']} ${dst['user']} ${dst['pass']}
511 ... ${dst['container_type']} ${dst['container_name']}
512 END
Andy Bavierba9866b2019-10-11 07:11:53 -0700513