blob: 111220e3c6e8ca92163025ecf10244ff3d0a85a0 [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 Vemuri1d8e8172020-06-17 17:43:56 -070034Resource ../../libraries/power_switch.robot
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070035
36*** Variables ***
Zack Williamsec53a1b2019-09-16 15:50:52 -070037${POD_NAME} flex-ocp-cord
38${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
39${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs
40#${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
41${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
42${HELM_CHARTS_DIR} ~/helm-charts
43${VOLTHA_POD_NUM} 8
Zack Williamsa8fe75a2020-01-10 14:25:27 -070044${NAMESPACE} voltha
suraj gourd64356b2019-11-07 13:26:20 +000045# For below variable value, using deployment name as using grep for
46# parsing radius pod name, we can also use full radius pod name
Zack Williamsa8fe75a2020-01-10 14:25:27 -070047${RESTART_POD_NAME} radius
Andy Bavierba9866b2019-10-11 07:11:53 -070048${timeout} 60s
Zack Williamsec53a1b2019-09-16 15:50:52 -070049${of_id} 0
50${logical_id} 0
Andrea Campanella86e24062020-08-05 19:09:18 +020051${uprate} 0
52${dnrate} 0
Andy Bavierba9866b2019-10-11 07:11:53 -070053${has_dataplane} True
Andy Bavierba9866b2019-10-11 07:11:53 -070054${teardown_device} False
Zack Williamsa8fe75a2020-01-10 14:25:27 -070055${scripts} ../../scripts
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070056
Gayathri.Selvan92d16862020-03-19 14:47:58 +000057# For dataplane bandwidth testing
58${upper_margin_pct} 105 # Allow 5% over the limit
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080059${lower_margin_pct} 90 # Allow 8% under the limit
Gayathri.Selvan92d16862020-03-19 14:47:58 +000060${udp_rate_multiplier} 1.10 # Send UDP at bw profile limit * rate_multiplier
Andy Bavierc80a2742020-08-28 10:59:05 -070061${udp_packet_bytes} 1470 # UDP payload in bytes
Gayathri.Selvan92d16862020-03-19 14:47:58 +000062
Andy Bavierabeba262020-02-07 16:22:16 -070063# Per-test logging on failure is turned off by default; set this variable to enable
64${container_log_dir} ${None}
65
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070066*** Test Cases ***
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070067Reboot ONUs Physically
68 [Documentation] This test reboots ONUs physically before execution all the tests
69 ... Test case runs only on the PODs that are configured with PowerSwitch that
70 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
71 [Tags] functional PowerSwitch RebootAllONUs
72 [Setup] Start Logging RebootAllONUs
73 [Teardown] Run Keywords Collect Logs
74 ... AND Stop Logging RebootAllONUs
75 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080076 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070077 ${src}= Set Variable ${hosts.src[${I}]}
78 ${dst}= Set Variable ${hosts.dst[${I}]}
79 Disable Switch Outlet ${src['power_switch_port']}
Hardik Windlass5e214b22021-02-26 10:37:14 +000080 Sleep 10s
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070081 Enable Switch Outlet ${src['power_switch_port']}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070082 END
83
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070084Sanity E2E Test for OLT/ONU on POD
85 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
86 ... Validate successful authentication/DHCP/E2E ping for the tech profile that is used
Andy Bavierba9866b2019-10-11 07:11:53 -070087 [Tags] sanity test1
Andy Baviere187eda2020-04-20 15:00:02 -070088 [Setup] Run Keywords Start Logging SanityTest
Andy Bavier4a8450e2020-02-04 08:58:37 -070089 ... AND Setup
90 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -070091 ... AND Stop Logging SanityTest
Suchitra Vemuric5295a32019-12-15 20:32:04 -080092 Run Keyword If ${has_dataplane} Clean Up Linux
Zack Williamsa8fe75a2020-01-10 14:25:27 -070093 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070094
Suchitra Vemuri6db89412019-11-14 14:52:54 -080095Test Disable and Enable ONU
96 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
97 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
98 ... Perform disable on the ONUs and validate that the pings do not succeed
99 ... Perform enable on the ONUs and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000100 [Tags] functional DisableEnableONU released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700101 [Setup] Start Logging DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700102 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700103 ... AND Stop Logging DisableEnableONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800104 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800105 ${src}= Set Variable ${hosts.src[${I}]}
106 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800107 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800108 ${onu_device_id}= Get Device ID From SN ${src['onu']}
109 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000110 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800111 Disable Device ${onu_device_id}
Andy Bavier46c8be32020-01-21 10:06:27 -0700112 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700113 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
114 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700115 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
116 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800117 Enable Device ${onu_device_id}
118 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800119 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530120 # Verify subscriber access flows are added for the ONU port
121 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
122 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
123 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700124 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
125 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700126 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
127 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800128 END
129
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800130Test Subscriber Delete and Add
131 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
132 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700133 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800134 ... Re-add the subscriber and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000135 [Tags] functional SubAddDelete released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700136 [Setup] Start Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700137 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700138 ... AND Stop Logging SubAddDelete
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800139 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800140 ${src}= Set Variable ${hosts.src[${I}]}
141 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800142 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800143 ${onu_device_id}= Get Device ID From SN ${src['onu']}
144 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000145 ... ${of_id} ${src['uni_id']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000146 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800147 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800148 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
149 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700150 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
151 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700152 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
153 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000154 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800155 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800156 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800157 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
158 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800159 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530160 # Verify subscriber access flows are added for the ONU port
161 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
162 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
163 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700164 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
165 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700166 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
167 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800168 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800169
suraj gourd5cfdbb2019-12-13 12:44:55 +0000170Check DHCP attempt fails when subscriber is not added
171 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
172 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700173 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000174 [Tags] functional SubsRemoveDHCP released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700175 [Setup] Start Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700176 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700177 ... AND Stop Logging SubsRemoveDHCP
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800178 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000179 ${src}= Set Variable ${hosts.src[${I}]}
180 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800181 ${of_id}= Get ofID From OLT List ${src['olt']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700182 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000183 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000184 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800185 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']}
186 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
187 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
188 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000189 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000190 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri8f1d3062020-02-28 11:57:37 -0800191 Sleep 15s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800192 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
193 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700194 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
195 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
196 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
197 Run Keyword And Ignore Error Login And Run Command On Remote System
198 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800199 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000200 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
201 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
202 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
203 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
204 ... ${dst['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000205 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000206 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800207 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
208 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530209 # Verify subscriber access flows are added for the ONU port
210 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
211 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
212 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000213 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
214 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
215 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
216 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
217 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800218 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800219
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800220Test Disable and Enable ONU scenario for ATT workflow
221 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
222 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
223 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700224 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
225 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800226 ... VOL-2284
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000227 [Tags] functional ATT_DisableEnableONU released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700228 [Setup] Start Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700229 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700230 ... AND Stop Logging ATT_DisableEnableONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800231 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800232 ${src}= Set Variable ${hosts.src[${I}]}
233 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800234 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800235 ${onu_device_id}= Get Device ID From SN ${src['onu']}
236 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000237 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800238 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000239 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800240 Disable Device ${onu_device_id}
Hardik Windlass5e214b22021-02-26 10:37:14 +0000241 Wait Until Keyword Succeeds ${timeout} 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000242 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800243 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700244 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
245 ... Wait Until Keyword Succeeds 60s 2s Check Ping
246 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
247 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass5e214b22021-02-26 10:37:14 +0000248 ... ELSE Sleep 10s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800249 Enable Device ${onu_device_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800250 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800251 ... ${ONOS_SSH_PORT} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700252 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
253 ... Validate Authentication After Reassociate True
254 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800255 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800256 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700257 ... ${ONOS_SSH_PORT} ${onu_port}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000258 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800259 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530260 # Verify subscriber access flows are added for the ONU port
261 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
262 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
263 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800264 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700265 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800266 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
267 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
268 ... ${dst['container_name']}
269 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800270 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000271 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000272
Hardik Windlass2b37e712020-06-12 02:13:17 +0530273Test Disable and Enable OLT
274 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
275 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
276 ... Perform disable on the OLT and validate that the pings do not succeed
277 ... Perform enable on the OLT and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000278 [Tags] functional VOL-2410 DisableEnableOLT multi-uni
Hardik Windlass2b37e712020-06-12 02:13:17 +0530279 [Setup] Start Logging DisableEnableOLT
280 [Teardown] Run Keywords Collect Logs
281 ... AND Stop Logging DisableEnableOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800282 #Disable the OLTs and verify the OLT/ONUs are disabled properly
283 FOR ${I} IN RANGE 0 ${olt_count}
284 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
285 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
286 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800287 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800288 Should Be Equal As Integers ${rc} 0
289 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
290 ... ${olt_serial_number}
291 END
292 # Validate the ONUs
293 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530294 ${src}= Set Variable ${hosts.src[${I}]}
295 ${dst}= Set Variable ${hosts.dst[${I}]}
296 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800297 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530298 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000299 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530300 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED DISCOVERED
301 ... UNREACHABLE ${src['onu']} onu=false
302 #Verify that ping fails
303 Run Keyword If ${has_dataplane}
304 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
305 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
306 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
307 # Remove Subscriber Access (To replicate ATT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000308 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530309 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530310 END
311 #Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800312 FOR ${I} IN RANGE 0 ${olt_count}
313 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
314 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
315 Enable Device ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800316 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
317 ... ${olt_serial_number}
318 #TODO: Update for PON_OLT ETHERNET_NNI
319 #Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
320 #... PON_OLT ETHERNET_NNI
321 END
Hardik Windlass2b37e712020-06-12 02:13:17 +0530322 Run Keyword If ${has_dataplane} Clean Up Linux
323 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test
324
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800325Delete OLT, ReAdd OLT and Perform Sanity Test
326 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
327 ... Disable and Delete the OLT
328 ... Create/Enable the same OLT again
329 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800330 [Tags] functional DeleteOLT released notready
Andy Baviere187eda2020-04-20 15:00:02 -0700331 [Setup] Start Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700332 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700333 ... AND Stop Logging DeleteOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800334 #TODO: Update test with new framework changes
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800335 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800336 FOR ${I} IN RANGE 0 ${olt_count}
337 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
338 ${of_id}= Get ofID From OLT List ${olt_serial_number}
339 Delete Device and Verify ${olt_serial_number}
340 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
341 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
342 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800343 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800344 # Recreate the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530345 Setup
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800346 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800347
Hema567f3012020-03-25 00:51:53 +0530348Check Mib State on OLT recreation after ONU, OLT deletion
349 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable,
350 ... Disable and Delete the ONU, Disable and Delete the OLT
351 ... Create/Enable the OLT again and Check for the Mib State of the ONUs
352 [Tags] functional CheckMibState notready
Andy Baviere187eda2020-04-20 15:00:02 -0700353 [Setup] Start Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530354 [Teardown] Run Keywords Collect Logs
355 ... AND Stop Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530356 #Disable and Delete the ONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800357 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema567f3012020-03-25 00:51:53 +0530358 ${src}= Set Variable ${hosts.src[${I}]}
359 ${dst}= Set Variable ${hosts.dst[${I}]}
360 ${onu_device_id}= Get Device ID From SN ${src['onu']}
361 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000362 ... ${of_id} ${src['uni_id']}
Hema567f3012020-03-25 00:51:53 +0530363 Disable Device ${onu_device_id}
364 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
365 Delete Device ${onu_device_id}
366 END
367 #Disable and Delete the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530368 Delete Device and Verify
369 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
370 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
371 # Recreate the OLT
Hema567f3012020-03-25 00:51:53 +0530372 Run Keyword If ${has_dataplane} Sleep 180s
Andrea Campanella3dcce272021-01-15 16:04:47 +0100373 # This dneeds to be done in for loop, test is not ready
374 ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}"
Suchitra Vemuri09f878d2021-02-10 18:19:04 -0800375 ... Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport]
376 ... ELSE Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport] ${list_olts}[${I}][type]
Hema567f3012020-03-25 00:51:53 +0530377 Set Suite Variable ${olt_device_id}
378 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED
Hardik Windlass8b446492021-06-10 06:25:23 +0000379 ... UNKNOWN UNKNOWN ${olt_device_id} by_dev_id=True
Hema567f3012020-03-25 00:51:53 +0530380 Enable Device ${olt_device_id}
381 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
382 ... ${olt_serial_number}
383 #Check for the ONU status and ONU Mib State should be "omci-flows-pushed"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800384 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema567f3012020-03-25 00:51:53 +0530385 ${src}= Set Variable ${hosts.src[${I}]}
386 ${dst}= Set Variable ${hosts.dst[${I}]}
387 ${onu_device_id}= Get Device ID From SN ${src['onu']}
388 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000389 ... ${of_id} ${src['uni_id']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700390 Wait Until Keyword Succeeds 180s 5s Validate Device ENABLED ACTIVE
Hema567f3012020-03-25 00:51:53 +0530391 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
392 END
393
Hema783279b2020-01-22 15:37:37 +0530394Test disable ONUs and OLT then delete ONUs and OLT
395 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
396 ... This TC is to confirm that ONU removal is not impacting OLT
397 ... Devices will be removed during the execution of this TC
398 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800399 [Tags] functional VOL-2354 DisableDeleteONUandOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700400 [Setup] Start Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700401 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700402 ... AND Stop Logging DisableDeleteONUandOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800403 #${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Suchitra Vemuri02170552021-03-23 16:40:50 -0700404 @{onu_reason}= Create List tech-profile-config-downloaded-success omci-flows-pushed
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800405 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema783279b2020-01-22 15:37:37 +0530406 ${src}= Set Variable ${hosts.src[${I}]}
407 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800408 ${of_id}= Get ofID From OLT List ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530409 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700410 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800411 ... Validate Device ENABLED ACTIVE
Suchitra Vemuri02170552021-03-23 16:40:50 -0700412 ... REACHABLE ${src['onu']} onu=True onu_reason=${onu_reason}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800413 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
414 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800415 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530416 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800417 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${onu_device_id}
Hema783279b2020-01-22 15:37:37 +0530418 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800419 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
420 ... Validate Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530421 ... REACHABLE ${src['onu']} onu=false
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700422 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800423 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800424 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530425 END
Matteo Scandolo5899be12020-11-11 15:38:07 -0800426
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800427 # Disable all OLTs
428 FOR ${I} IN RANGE 0 ${olt_count}
429 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
430 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
431 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800432 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800433 Should Be Equal As Integers ${rc} 0
434 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
435 ... ${olt_serial_number}
436 END
437 # Validate ONUs after OLT disable
438 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema783279b2020-01-22 15:37:37 +0530439 ${src}= Set Variable ${hosts.src[${I}]}
440 ${dst}= Set Variable ${hosts.dst[${I}]}
441 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800442 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
443 ... Validate Device DISABLED DISCOVERED
444 ... UNREACHABLE ${src['onu']} onu=false
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530445 Delete Device ${onu_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800446 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
447 ... Validate OLT Device DISABLED UNKNOWN
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800448 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530449 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800450 # Delete all OLTs
451 Delete All Devices and Verify
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000452 # Re-create the Devices and Perform Sanity
453 Setup
454 Run Keyword If ${has_dataplane} Clean Up Linux
455 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
David Bainbridgef81cd642019-11-20 00:14:47 +0000456
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800457Validate authentication on a disabled ONU
suraj gour472da1c2020-02-25 05:44:51 +0000458 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
459 ... Perform disable on the ONUs and validate that the authentication do not succeed
460 ... Perform enable on the ONUs and validate that authentication successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000461 [Tags] functional DisableONU_AuthCheck multi-uni
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800462 # Creates Devices in the Setup
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000463 [Setup] Start Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800464 [Teardown] Run Keywords Collect Logs
465 ... AND Stop Logging DisableONU_AuthCheck
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800466 ... AND Delete All Devices and Verify
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800467 Clean WPA Process
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800468 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gour472da1c2020-02-25 05:44:51 +0000469 ${src}= Set Variable ${hosts.src[${I}]}
470 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800471 ${of_id}= Get ofID From OLT List ${src['olt']}
suraj gour472da1c2020-02-25 05:44:51 +0000472 ${onu_device_id}= Get Device ID From SN ${src['onu']}
473 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000474 ... ${of_id} ${src['uni_id']}
suraj gour472da1c2020-02-25 05:44:51 +0000475 Disable Device ${onu_device_id}
476 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
477 ... REACHABLE ${src['onu']} onu=false
Andy Bavier84834d42020-02-25 13:49:50 -0700478 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
479 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800480 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication False
481 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700482 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800483 Enable Device ${onu_device_id}
484 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
485 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800486 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
487 ... ENABLED ACTIVE REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
488 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
489 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700490 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
suraj gour472da1c2020-02-25 05:44:51 +0000491 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
492 END
suraj gour472da1c2020-02-25 05:44:51 +0000493
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000494Data plane verification using TCP
495 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
496 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200497 [Tags] non-critical dataplane BandwidthProfileTCP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700498 [Setup] Start Logging BandwidthProfileTCP
499 [Teardown] Run Keywords Collect Logs
500 ... AND Stop Logging BandwidthProfileTCP
Andy Baviereff938d2020-06-29 18:27:49 -0700501 Pass Execution If '${has_dataplane}'=='False'
502 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800503 Delete All Devices And Verify
504 Run Keyword If ${has_dataplane} Clean Up Linux
505 setup
506 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
507
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800508 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000509 ${src}= Set Variable ${hosts.src[${I}]}
510 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800511 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700512
513 # Check for iperf3 and jq tools
514 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
515 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
516 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
517
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000518 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000519 ... ${of_id} ${src['uni_id']}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000520 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
521 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
522 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700523 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000524 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
525 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700526 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000527
528 # Stream TCP packets from RG to server
529 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
530 ... args=-t 30
531 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
532
533 # Stream TCP packets from server to RG
534 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
535 ... args=-R -t 30
536 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
537
538 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
539 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
540 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
541 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
542
543 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
544 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700545 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
546 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
547 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000548 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
549 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
550 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
551 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
552 END
553
554Data plane verification using UDP
555 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
556 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200557 [Tags] non-critical dataplane BandwidthProfileUDP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700558 [Setup] Start Logging BandwidthProfileUDP
559 [Teardown] Run Keywords Collect Logs
560 ... AND Stop Logging BandwidthProfileUDP
Andy Baviereff938d2020-06-29 18:27:49 -0700561 Pass Execution If '${has_dataplane}'=='False'
562 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800563 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000564 ${src}= Set Variable ${hosts.src[${I}]}
565 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800566 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierd59f9772020-07-01 12:00:42 -0700567
568 # Check for iperf3 and jq tools
569 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
570 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
571 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
572
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000573 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000574 ... ${of_id} ${src['uni_id']}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000575 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
576 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
577 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700578 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000579 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
580 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700581 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000582
583 # Stream UDP packets from RG to server
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200584 ${uprate}= Run Keyword If ${limiting_bw_value_upstream} != 1000000
585 ... Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200586 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200587 ... Set Variable ${limiting_bw_value_upstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000588 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700589 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000590 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
591 ${actual_upstream_bw_used}= Evaluate
592 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
593
594 # Stream UDP packets from server to RG
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200595 ${dnrate}= Run Keyword If ${limiting_bw_value_dnstream} != 1000000
596 ... Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200597 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200598 ... Set Variable ${limiting_bw_value_dnstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000599 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700600 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000601 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
602 ${actual_dnstream_bw_used}= Evaluate
603 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
604
605 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
606 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
607 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
608 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
609
610 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
611 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700612 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
613 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
614 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000615 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
616 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
617 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
618 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
619 END
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800620
Suraj Gour33651272020-05-04 10:10:16 +0530621Validate parsing of data traffic through voltha using tech profile
622 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
623 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
624 ... Install jq tool to read json file, where test suite is being running
Girish Gowdrabbfbbc32021-05-17 14:36:58 -0700625 ... This test sends TCP packets with pbits between 0 and 7 and validates that
Suraj Gour33651272020-05-04 10:10:16 +0530626 ... the pbits are preserved by the PON.
Hardik Windlass2c7b79f2021-07-13 11:43:54 +0000627 [Tags] dataplane TechProfile VOL-2054 notready
Suraj Gour33651272020-05-04 10:10:16 +0530628 [Setup] Start Logging TechProfile
629 [Teardown] Run Keywords Collect Logs
630 ... AND Stop Logging TechProfile
631 Pass Execution If '${has_dataplane}'=='False'
632 ... Skipping test: Technology profile validation can be done only in physical pod
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800633 FOR ${I} IN RANGE 0 ${num_all_onus}
Suraj Gour33651272020-05-04 10:10:16 +0530634 ${src}= Set Variable ${hosts.src[${I}]}
635 ${dst}= Set Variable ${hosts.dst[${I}]}
636
637 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
638 ${bng_user}= Get Variable Value ${dst['noroot_user']}
639 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
Andy Bavierf4b7d1d2020-06-30 11:14:04 -0700640 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
Suraj Gour33651272020-05-04 10:10:16 +0530641 ... Skipping test: credentials for BNG login required in deployment config
642
643 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
644 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
645 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
646 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
647 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
648 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
649 Log Upstream test
Andy Baviereff938d2020-06-29 18:27:49 -0700650 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Suraj Gour33651272020-05-04 10:10:16 +0530651 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src['dp_iface_name']}
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700652 ... 0 tcp 0 ${src['s_tag']} upstream vlan
Suraj Gour33651272020-05-04 10:10:16 +0530653 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
654 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
655 Log Downstream test
656 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
657 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
658 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
659 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
Andy Baviereff938d2020-06-29 18:27:49 -0700660 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700661 ... ${rg_ip} ${src['dp_iface_name']} ${dst['dp_iface_name']}
662 ... 0 tcp ${src['c_tag']} ${src['s_tag']} downstream tcp
Suraj Gour33651272020-05-04 10:10:16 +0530663 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
664 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
665 END
666
Hardik Windlass16cdf962020-04-29 15:26:50 +0530667Test Disable and Enable OLT PON Port
668 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
669 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
670 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
671 ... Perform enable on the OLT PON Port and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000672 [Tags] functional DisableEnableOltPonPort VOL-2577 multi-uni
Hardik Windlass16cdf962020-04-29 15:26:50 +0530673 [Setup] Run Keywords Start Logging DisableEnableOltPonPort
674 ... AND Setup
675 [Teardown] Run Keywords Collect Logs
676 ... AND Stop Logging DisableEnableOltPonPort
Hardik Windlass41701e82021-01-12 17:44:44 +0000677 ... AND Delete All Devices and Verify
Hardik Windlass16cdf962020-04-29 15:26:50 +0530678 Run Keyword If ${has_dataplane} Clean Up Linux
679 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Hardik Windlass41701e82021-01-12 17:44:44 +0000680 # Multi-OLTs
681 FOR ${I} IN RANGE 0 ${olt_count}
682 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
683 Disable Enable PON Port Per OLT ${olt_serial_number}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530684 END
685
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700686*** Keywords ***
687Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700688 [Documentation] Set up the test suite
689 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700690 #Restore all ONUs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800691 #Run Keyword If ${has_dataplane} RestoreONUs ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700692 #power_switch.robot needs it to support different vendor's power switch
693 ${switch_type}= Get Variable Value ${web_power_switch.type}
694 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700695
David Bainbridgef81cd642019-11-20 00:14:47 +0000696Clear All Devices Then Create New Device
697 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000698 # Remove all devices from voltha and nos
699 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000700 # Execute normal test Setup Keyword
701 Setup