blob: 11f47a1669c0b5b24b4c83a5cefb27362bb4abb5 [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
Hardik Windlass4288c6a2021-09-28 07:22:06 +000045${INFRA_NAMESPACE} default
suraj gourd64356b2019-11-07 13:26:20 +000046# For below variable value, using deployment name as using grep for
47# parsing radius pod name, we can also use full radius pod name
Zack Williamsa8fe75a2020-01-10 14:25:27 -070048${RESTART_POD_NAME} radius
Andy Bavierba9866b2019-10-11 07:11:53 -070049${timeout} 60s
Zack Williamsec53a1b2019-09-16 15:50:52 -070050${of_id} 0
51${logical_id} 0
Andrea Campanella86e24062020-08-05 19:09:18 +020052${uprate} 0
53${dnrate} 0
Andy Bavierba9866b2019-10-11 07:11:53 -070054${has_dataplane} True
Andy Bavierba9866b2019-10-11 07:11:53 -070055${teardown_device} False
Zack Williamsa8fe75a2020-01-10 14:25:27 -070056${scripts} ../../scripts
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070057
Gayathri.Selvan92d16862020-03-19 14:47:58 +000058# For dataplane bandwidth testing
59${upper_margin_pct} 105 # Allow 5% over the limit
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080060${lower_margin_pct} 90 # Allow 8% under the limit
Gayathri.Selvan92d16862020-03-19 14:47:58 +000061${udp_rate_multiplier} 1.10 # Send UDP at bw profile limit * rate_multiplier
Andy Bavierc80a2742020-08-28 10:59:05 -070062${udp_packet_bytes} 1470 # UDP payload in bytes
Gayathri.Selvan92d16862020-03-19 14:47:58 +000063
Andy Bavierabeba262020-02-07 16:22:16 -070064# Per-test logging on failure is turned off by default; set this variable to enable
65${container_log_dir} ${None}
66
Matteo Scandoloda1c64b2021-07-20 10:14:49 -070067# logging flag to enable Collect Logs, can be passed via the command line too
68# example: -v logging:False
69${logging} True
70
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070071*** Test Cases ***
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070072Reboot ONUs Physically
73 [Documentation] This test reboots ONUs physically before execution all the tests
74 ... Test case runs only on the PODs that are configured with PowerSwitch that
75 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
76 [Tags] functional PowerSwitch RebootAllONUs
77 [Setup] Start Logging RebootAllONUs
78 [Teardown] Run Keywords Collect Logs
79 ... AND Stop Logging RebootAllONUs
80 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080081 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070082 ${src}= Set Variable ${hosts.src[${I}]}
83 ${dst}= Set Variable ${hosts.dst[${I}]}
84 Disable Switch Outlet ${src['power_switch_port']}
Hardik Windlass5e214b22021-02-26 10:37:14 +000085 Sleep 10s
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070086 Enable Switch Outlet ${src['power_switch_port']}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070087 END
88
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070089Sanity E2E Test for OLT/ONU on POD
90 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
91 ... Validate successful authentication/DHCP/E2E ping for the tech profile that is used
Andy Bavierba9866b2019-10-11 07:11:53 -070092 [Tags] sanity test1
Andy Baviere187eda2020-04-20 15:00:02 -070093 [Setup] Run Keywords Start Logging SanityTest
Andy Bavier4a8450e2020-02-04 08:58:37 -070094 ... AND Setup
95 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -070096 ... AND Stop Logging SanityTest
Suchitra Vemuric5295a32019-12-15 20:32:04 -080097 Run Keyword If ${has_dataplane} Clean Up Linux
Zack Williamsa8fe75a2020-01-10 14:25:27 -070098 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070099
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800100Test Disable and Enable ONU
101 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
102 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
103 ... Perform disable on the ONUs and validate that the pings do not succeed
104 ... Perform enable on the ONUs and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000105 [Tags] functional DisableEnableONU released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700106 [Setup] Start Logging DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700107 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700108 ... AND Stop Logging DisableEnableONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800109 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800110 ${src}= Set Variable ${hosts.src[${I}]}
111 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800112 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800113 ${onu_device_id}= Get Device ID From SN ${src['onu']}
114 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000115 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800116 Disable Device ${onu_device_id}
Andy Bavier46c8be32020-01-21 10:06:27 -0700117 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700118 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
119 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700120 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
121 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800122 Enable Device ${onu_device_id}
123 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800124 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530125 # Verify subscriber access flows are added for the ONU port
126 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
127 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
128 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700129 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
130 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700131 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
132 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800133 END
134
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800135Test Subscriber Delete and Add
136 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
137 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700138 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800139 ... Re-add the subscriber and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000140 [Tags] functional SubAddDelete released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700141 [Setup] Start Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700142 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700143 ... AND Stop Logging SubAddDelete
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800144 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800145 ${src}= Set Variable ${hosts.src[${I}]}
146 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800147 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800148 ${onu_device_id}= Get Device ID From SN ${src['onu']}
149 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000150 ... ${of_id} ${src['uni_id']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000151 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800152 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800153 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
154 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700155 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
156 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700157 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
158 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000159 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800160 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800161 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800162 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
163 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800164 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530165 # Verify subscriber access flows are added for the ONU port
166 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
167 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
168 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
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']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800173 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800174
suraj gourd5cfdbb2019-12-13 12:44:55 +0000175Check DHCP attempt fails when subscriber is not added
176 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
177 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700178 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000179 [Tags] functional SubsRemoveDHCP released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700180 [Setup] Start Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700181 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700182 ... AND Stop Logging SubsRemoveDHCP
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800183 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000184 ${src}= Set Variable ${hosts.src[${I}]}
185 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800186 ${of_id}= Get ofID From OLT List ${src['olt']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700187 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000188 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000189 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800190 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']}
191 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
192 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']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000194 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000195 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri8f1d3062020-02-28 11:57:37 -0800196 Sleep 15s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800197 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
198 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700199 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
200 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
201 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
202 Run Keyword And Ignore Error Login And Run Command On Remote System
203 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800204 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000205 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
206 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
207 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
208 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
209 ... ${dst['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000210 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000211 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800212 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
213 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530214 # Verify subscriber access flows are added for the ONU port
215 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
216 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
217 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000218 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
219 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
220 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
221 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
222 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800223 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800224
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800225Test Disable and Enable ONU scenario for ATT workflow
226 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
227 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
228 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700229 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
230 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800231 ... VOL-2284
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000232 [Tags] functional ATT_DisableEnableONU released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700233 [Setup] Start Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700234 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700235 ... AND Stop Logging ATT_DisableEnableONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800236 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800237 ${src}= Set Variable ${hosts.src[${I}]}
238 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800239 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800240 ${onu_device_id}= Get Device ID From SN ${src['onu']}
241 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000242 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800243 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000244 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800245 Disable Device ${onu_device_id}
Hardik Windlass5e214b22021-02-26 10:37:14 +0000246 Wait Until Keyword Succeeds ${timeout} 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000247 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800248 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700249 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
250 ... Wait Until Keyword Succeeds 60s 2s Check Ping
251 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
252 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass5e214b22021-02-26 10:37:14 +0000253 ... ELSE Sleep 10s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800254 Enable Device ${onu_device_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800255 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700256 ... ${ONOS_SSH_PORT} ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700257 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
258 ... Validate Authentication After Reassociate True
259 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800260 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800261 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700262 ... ${ONOS_SSH_PORT} ${onu_port}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000263 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800264 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530265 # Verify subscriber access flows are added for the ONU port
266 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
267 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
268 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800269 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700270 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800271 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
272 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
273 ... ${dst['container_name']}
274 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800275 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000276 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000277
Hardik Windlass2b37e712020-06-12 02:13:17 +0530278Test Disable and Enable OLT
279 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
280 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
281 ... Perform disable on the OLT and validate that the pings do not succeed
282 ... Perform enable on the OLT and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000283 [Tags] functional VOL-2410 DisableEnableOLT multi-uni
Hardik Windlass2b37e712020-06-12 02:13:17 +0530284 [Setup] Start Logging DisableEnableOLT
285 [Teardown] Run Keywords Collect Logs
286 ... AND Stop Logging DisableEnableOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800287 #Disable the OLTs and verify the OLT/ONUs are disabled properly
288 FOR ${I} IN RANGE 0 ${olt_count}
289 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
290 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
291 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800292 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800293 Should Be Equal As Integers ${rc} 0
294 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
295 ... ${olt_serial_number}
296 END
297 # Validate the ONUs
298 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530299 ${src}= Set Variable ${hosts.src[${I}]}
300 ${dst}= Set Variable ${hosts.dst[${I}]}
301 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800302 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530303 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000304 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530305 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED DISCOVERED
306 ... UNREACHABLE ${src['onu']} onu=false
307 #Verify that ping fails
308 Run Keyword If ${has_dataplane}
309 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
310 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
311 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
312 # Remove Subscriber Access (To replicate ATT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000313 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530314 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530315 END
316 #Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800317 FOR ${I} IN RANGE 0 ${olt_count}
318 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
319 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
320 Enable Device ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800321 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
322 ... ${olt_serial_number}
323 #TODO: Update for PON_OLT ETHERNET_NNI
324 #Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
325 #... PON_OLT ETHERNET_NNI
326 END
Hardik Windlass2b37e712020-06-12 02:13:17 +0530327 Run Keyword If ${has_dataplane} Clean Up Linux
328 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test
329
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800330Delete OLT, ReAdd OLT and Perform Sanity Test
331 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
332 ... Disable and Delete the OLT
333 ... Create/Enable the same OLT again
334 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800335 [Tags] functional DeleteOLT released notready
Andy Baviere187eda2020-04-20 15:00:02 -0700336 [Setup] Start Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700337 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700338 ... AND Stop Logging DeleteOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800339 #TODO: Update test with new framework changes
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800340 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800341 FOR ${I} IN RANGE 0 ${olt_count}
342 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
343 ${of_id}= Get ofID From OLT List ${olt_serial_number}
344 Delete Device and Verify ${olt_serial_number}
345 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
346 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
347 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800348 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800349 # Recreate the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530350 Setup
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800351 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800352
Hema567f3012020-03-25 00:51:53 +0530353Check Mib State on OLT recreation after ONU, OLT deletion
354 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable,
355 ... Disable and Delete the ONU, Disable and Delete the OLT
356 ... Create/Enable the OLT again and Check for the Mib State of the ONUs
357 [Tags] functional CheckMibState notready
Andy Baviere187eda2020-04-20 15:00:02 -0700358 [Setup] Start Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530359 [Teardown] Run Keywords Collect Logs
360 ... AND Stop Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530361 #Disable and Delete the ONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800362 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema567f3012020-03-25 00:51:53 +0530363 ${src}= Set Variable ${hosts.src[${I}]}
364 ${dst}= Set Variable ${hosts.dst[${I}]}
365 ${onu_device_id}= Get Device ID From SN ${src['onu']}
366 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000367 ... ${of_id} ${src['uni_id']}
Hema567f3012020-03-25 00:51:53 +0530368 Disable Device ${onu_device_id}
369 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
370 Delete Device ${onu_device_id}
371 END
372 #Disable and Delete the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530373 Delete Device and Verify
374 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
375 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
376 # Recreate the OLT
Hema567f3012020-03-25 00:51:53 +0530377 Run Keyword If ${has_dataplane} Sleep 180s
Andrea Campanella3dcce272021-01-15 16:04:47 +0100378 # This dneeds to be done in for loop, test is not ready
379 ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}"
Suchitra Vemuri09f878d2021-02-10 18:19:04 -0800380 ... Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport]
381 ... ELSE Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport] ${list_olts}[${I}][type]
Hema567f3012020-03-25 00:51:53 +0530382 Set Suite Variable ${olt_device_id}
383 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED
Hardik Windlass8b446492021-06-10 06:25:23 +0000384 ... UNKNOWN UNKNOWN ${olt_device_id} by_dev_id=True
Hema567f3012020-03-25 00:51:53 +0530385 Enable Device ${olt_device_id}
386 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
387 ... ${olt_serial_number}
388 #Check for the ONU status and ONU Mib State should be "omci-flows-pushed"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800389 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema567f3012020-03-25 00:51:53 +0530390 ${src}= Set Variable ${hosts.src[${I}]}
391 ${dst}= Set Variable ${hosts.dst[${I}]}
392 ${onu_device_id}= Get Device ID From SN ${src['onu']}
393 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000394 ... ${of_id} ${src['uni_id']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700395 Wait Until Keyword Succeeds 180s 5s Validate Device ENABLED ACTIVE
Hema567f3012020-03-25 00:51:53 +0530396 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
397 END
398
Hema783279b2020-01-22 15:37:37 +0530399Test disable ONUs and OLT then delete ONUs and OLT
400 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
401 ... This TC is to confirm that ONU removal is not impacting OLT
402 ... Devices will be removed during the execution of this TC
403 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800404 [Tags] functional VOL-2354 DisableDeleteONUandOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700405 [Setup] Start Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700406 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700407 ... AND Stop Logging DisableDeleteONUandOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800408 #${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Suchitra Vemuri02170552021-03-23 16:40:50 -0700409 @{onu_reason}= Create List tech-profile-config-downloaded-success omci-flows-pushed
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800410 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema783279b2020-01-22 15:37:37 +0530411 ${src}= Set Variable ${hosts.src[${I}]}
412 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800413 ${of_id}= Get ofID From OLT List ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530414 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700415 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800416 ... Validate Device ENABLED ACTIVE
Suchitra Vemuri02170552021-03-23 16:40:50 -0700417 ... REACHABLE ${src['onu']} onu=True onu_reason=${onu_reason}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800418 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
419 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800420 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530421 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800422 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${onu_device_id}
Hema783279b2020-01-22 15:37:37 +0530423 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800424 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
425 ... Validate Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530426 ... REACHABLE ${src['onu']} onu=false
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700427 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800428 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800429 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530430 END
Matteo Scandolo5899be12020-11-11 15:38:07 -0800431
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800432 # Disable all OLTs
433 FOR ${I} IN RANGE 0 ${olt_count}
434 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
435 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
436 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800437 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800438 Should Be Equal As Integers ${rc} 0
439 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
440 ... ${olt_serial_number}
441 END
442 # Validate ONUs after OLT disable
443 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema783279b2020-01-22 15:37:37 +0530444 ${src}= Set Variable ${hosts.src[${I}]}
445 ${dst}= Set Variable ${hosts.dst[${I}]}
446 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800447 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
448 ... Validate Device DISABLED DISCOVERED
449 ... UNREACHABLE ${src['onu']} onu=false
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530450 Delete Device ${onu_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800451 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
452 ... Validate OLT Device DISABLED UNKNOWN
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800453 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530454 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800455 # Delete all OLTs
456 Delete All Devices and Verify
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000457 # Re-create the Devices and Perform Sanity
458 Setup
459 Run Keyword If ${has_dataplane} Clean Up Linux
460 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
David Bainbridgef81cd642019-11-20 00:14:47 +0000461
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800462Validate authentication on a disabled ONU
suraj gour472da1c2020-02-25 05:44:51 +0000463 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
464 ... Perform disable on the ONUs and validate that the authentication do not succeed
465 ... Perform enable on the ONUs and validate that authentication successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000466 [Tags] functional DisableONU_AuthCheck multi-uni
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800467 # Creates Devices in the Setup
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000468 [Setup] Start Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800469 [Teardown] Run Keywords Collect Logs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800470 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700471 ... AND Run Keyword If ${logging} Collect Logs
472 ... AND Stop Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800473 Clean WPA Process
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800474 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gour472da1c2020-02-25 05:44:51 +0000475 ${src}= Set Variable ${hosts.src[${I}]}
476 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800477 ${of_id}= Get ofID From OLT List ${src['olt']}
suraj gour472da1c2020-02-25 05:44:51 +0000478 ${onu_device_id}= Get Device ID From SN ${src['onu']}
479 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000480 ... ${of_id} ${src['uni_id']}
suraj gour472da1c2020-02-25 05:44:51 +0000481 Disable Device ${onu_device_id}
482 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
483 ... REACHABLE ${src['onu']} onu=false
Andy Bavier84834d42020-02-25 13:49:50 -0700484 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
485 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800486 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication False
487 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700488 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800489 Enable Device ${onu_device_id}
490 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
491 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800492 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
493 ... ENABLED ACTIVE REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
494 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
495 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700496 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
suraj gour472da1c2020-02-25 05:44:51 +0000497 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
498 END
suraj gour472da1c2020-02-25 05:44:51 +0000499
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000500Data plane verification using TCP
501 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
502 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200503 [Tags] non-critical dataplane BandwidthProfileTCP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700504 [Setup] Start Logging BandwidthProfileTCP
505 [Teardown] Run Keywords Collect Logs
506 ... AND Stop Logging BandwidthProfileTCP
Andy Baviereff938d2020-06-29 18:27:49 -0700507 Pass Execution If '${has_dataplane}'=='False'
508 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800509 Delete All Devices And Verify
510 Run Keyword If ${has_dataplane} Clean Up Linux
511 setup
512 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
513
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800514 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000515 ${src}= Set Variable ${hosts.src[${I}]}
516 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800517 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700518
519 # Check for iperf3 and jq tools
520 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
521 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
522 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
523
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000524 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000525 ... ${of_id} ${src['uni_id']}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000526 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
527 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
528 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700529 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000530 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
531 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700532 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000533
534 # Stream TCP packets from RG to server
535 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
536 ... args=-t 30
537 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
538
539 # Stream TCP packets from server to RG
540 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
541 ... args=-R -t 30
542 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
543
544 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
545 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
546 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
547 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
548
549 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
550 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700551 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
552 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
553 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000554 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
555 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
556 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
557 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
558 END
559
560Data plane verification using UDP
561 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
562 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200563 [Tags] non-critical dataplane BandwidthProfileUDP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700564 [Setup] Start Logging BandwidthProfileUDP
565 [Teardown] Run Keywords Collect Logs
566 ... AND Stop Logging BandwidthProfileUDP
Andy Baviereff938d2020-06-29 18:27:49 -0700567 Pass Execution If '${has_dataplane}'=='False'
568 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800569 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000570 ${src}= Set Variable ${hosts.src[${I}]}
571 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800572 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierd59f9772020-07-01 12:00:42 -0700573
574 # Check for iperf3 and jq tools
575 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
576 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
577 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
578
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000579 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000580 ... ${of_id} ${src['uni_id']}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000581 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
582 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
583 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700584 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000585 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
586 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700587 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000588
589 # Stream UDP packets from RG to server
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200590 ${uprate}= Run Keyword If ${limiting_bw_value_upstream} != 1000000
591 ... Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200592 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200593 ... Set Variable ${limiting_bw_value_upstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000594 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700595 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000596 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
597 ${actual_upstream_bw_used}= Evaluate
598 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
599
600 # Stream UDP packets from server to RG
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200601 ${dnrate}= Run Keyword If ${limiting_bw_value_dnstream} != 1000000
602 ... Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200603 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200604 ... Set Variable ${limiting_bw_value_dnstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000605 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700606 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000607 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
608 ${actual_dnstream_bw_used}= Evaluate
609 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
610
611 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
612 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
613 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
614 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
615
616 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
617 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700618 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
619 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
620 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000621 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
622 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
623 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
624 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
625 END
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800626
Suraj Gour33651272020-05-04 10:10:16 +0530627Validate parsing of data traffic through voltha using tech profile
628 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
629 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
630 ... Install jq tool to read json file, where test suite is being running
Girish Gowdrabbfbbc32021-05-17 14:36:58 -0700631 ... This test sends TCP packets with pbits between 0 and 7 and validates that
Suraj Gour33651272020-05-04 10:10:16 +0530632 ... the pbits are preserved by the PON.
Hardik Windlass04d791e2021-07-12 16:23:13 +0000633 [Tags] dataplane TechProfile VOL-2054 notready
Suraj Gour33651272020-05-04 10:10:16 +0530634 [Setup] Start Logging TechProfile
635 [Teardown] Run Keywords Collect Logs
636 ... AND Stop Logging TechProfile
637 Pass Execution If '${has_dataplane}'=='False'
638 ... Skipping test: Technology profile validation can be done only in physical pod
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800639 FOR ${I} IN RANGE 0 ${num_all_onus}
Suraj Gour33651272020-05-04 10:10:16 +0530640 ${src}= Set Variable ${hosts.src[${I}]}
641 ${dst}= Set Variable ${hosts.dst[${I}]}
642
643 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
644 ${bng_user}= Get Variable Value ${dst['noroot_user']}
645 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
Andy Bavierf4b7d1d2020-06-30 11:14:04 -0700646 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
Suraj Gour33651272020-05-04 10:10:16 +0530647 ... Skipping test: credentials for BNG login required in deployment config
648
649 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
650 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
651 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
652 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
653 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
654 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
655 Log Upstream test
Andy Baviereff938d2020-06-29 18:27:49 -0700656 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Suraj Gour33651272020-05-04 10:10:16 +0530657 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src['dp_iface_name']}
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700658 ... 0 tcp 0 ${src['s_tag']} upstream vlan
Suraj Gour33651272020-05-04 10:10:16 +0530659 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
660 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
661 Log Downstream test
662 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
663 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
664 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
665 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
Andy Baviereff938d2020-06-29 18:27:49 -0700666 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700667 ... ${rg_ip} ${src['dp_iface_name']} ${dst['dp_iface_name']}
668 ... 0 tcp ${src['c_tag']} ${src['s_tag']} downstream tcp
Suraj Gour33651272020-05-04 10:10:16 +0530669 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
670 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
671 END
672
Hardik Windlass16cdf962020-04-29 15:26:50 +0530673Test Disable and Enable OLT PON Port
674 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
675 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
676 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
677 ... Perform enable on the OLT PON Port and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000678 [Tags] functional DisableEnableOltPonPort VOL-2577 multi-uni
Hardik Windlass16cdf962020-04-29 15:26:50 +0530679 [Setup] Run Keywords Start Logging DisableEnableOltPonPort
680 ... AND Setup
681 [Teardown] Run Keywords Collect Logs
Hardik Windlass41701e82021-01-12 17:44:44 +0000682 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700683 ... AND Run Keyword If ${logging} Collect Logs
684 ... AND Stop Logging DisableEnableOltPonPort
Hardik Windlass16cdf962020-04-29 15:26:50 +0530685 Run Keyword If ${has_dataplane} Clean Up Linux
686 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Hardik Windlass41701e82021-01-12 17:44:44 +0000687 # Multi-OLTs
688 FOR ${I} IN RANGE 0 ${olt_count}
689 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
690 Disable Enable PON Port Per OLT ${olt_serial_number}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530691 END
692
Gayathri.Selvan5d23e522020-09-15 17:26:25 +0530693Data plane Bandwidth profile update verification
694 [Documentation] Test bandwidth profile is updated for one subscriber and not changed for other subscribers.
695 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
696 ... Assumes Default and User_Bandwidth2 profiles are configured as bandwidth profiles
697 [Tags] non-critical dataplane BandwidthProfileUpdateTCP VOL-2053
698 [Setup] Start Logging BandwidthProfileUpdateTCP
699 [Teardown] Run Keywords Collect Logs
700 ... AND Stop Logging BandwidthProfileUpdateTCP
701 ... AND Send File To Onos ${CURDIR}/../../tests/data/${POD_NAME}-sadis.json
702 Pass Execution If '${has_dataplane}'=='False'
703 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
704 Delete All Devices And Verify
705 Run Keyword If ${has_dataplane} Clean Up Linux
706 Setup
707 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
708 # Update the Bandwidth Profile for the First Subscriber under test
709 ${src}= Set Variable ${hosts.src[${0}]}
710 ${dst}= Set Variable ${hosts.dst[${0}]}
711 ${of_id}= Get ofID From OLT List ${src['olt']}
712 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
713 ... ${of_id} ${src['uni_id']}
714 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
715 ${oldBwName} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
716 # Delete the existing subscriber
717 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
718 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
719 # Change the bandwidth profile and load the configuration
Hardik Windlassaa41bb42021-07-23 15:32:43 +0000720 ${newBwName} Set Variable If ${oldBwName} == 'Default' 'User_Bandwidth2' 'Default'
Gayathri.Selvan5d23e522020-09-15 17:26:25 +0530721 ${cmd} Catenate
722 ... sed 's/upstreamBandwidthProfile": "${oldBwName}"/upstreamBandwidthProfile": "${newBwName}"/g'
723 ... ${CURDIR}/../../tests/data/${POD_NAME}-sadis.json > ${CURDIR}/../../tests/data/${POD_NAME}-sadis-new.json
724 ${rc} Run and Return RC ${cmd}
725 Send File To Onos ${CURDIR}/../../tests/data/${POD_NAME}-sadis-new.json
726 # Re-add the subscriber with new bandwidth profile
727 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
728 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
729 # Verify that no pending flows exist for the ONU port
730 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
731 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
732 # Verify subscriber access flows are added for the ONU port
733 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
734 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
735 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
736 # Verify Meters in ONOS
737 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
738 ... Verify Meters in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
739 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
740 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
741 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
742 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
743 ... ${dst['container_name']}
744 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
745 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
746 # Verify new bandwidth profile is applied and other subscribers are working fine
747 ${checkBwName} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
748 Should Be Equal ${checkBwName} ${newBwName} The bandwidth profile is not updated properly
749 FOR ${I} IN RANGE 0 ${num_all_onus}
750 ${src}= Set Variable ${hosts.src[${I}]}
751 ${dst}= Set Variable ${hosts.dst[${I}]}
752 ${of_id}= Get ofID From OLT List ${src['olt']}
753
754 # Check for iperf3 and jq tools
755 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
756 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
757 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
758
759 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
760 ... ${of_id} ${src['uni_id']}
761 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
762 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
763 ... upstreamBandwidthProfile
764 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
765 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
766 ... downstreamBandwidthProfile
767 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
768
769 # Stream TCP packets from RG to server
770 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
771 ... args=-t 30
772 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
773
774 # Stream TCP packets from server to RG
775 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
776 ... args=-R -t 30
777 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
778
779 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
780 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
781 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
782 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
783
784 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
785 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
786 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
787 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
788 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
789 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
790 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
791 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
792 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
793 END
794
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700795*** Keywords ***
796Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700797 [Documentation] Set up the test suite
798 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700799 #Restore all ONUs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800800 #Run Keyword If ${has_dataplane} RestoreONUs ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700801 #power_switch.robot needs it to support different vendor's power switch
802 ${switch_type}= Get Variable Value ${web_power_switch.type}
803 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700804
David Bainbridgef81cd642019-11-20 00:14:47 +0000805Clear All Devices Then Create New Device
806 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000807 # Remove all devices from voltha and nos
808 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000809 # Execute normal test Setup Keyword
810 Setup