blob: b863740f1679b69ffc481afe693179cd0e76938e [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
Matteo Scandoloda1c64b2021-07-20 10:14:49 -070066# logging flag to enable Collect Logs, can be passed via the command line too
67# example: -v logging:False
68${logging} True
69
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070070*** Test Cases ***
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070071Reboot ONUs Physically
72 [Documentation] This test reboots ONUs physically before execution all the tests
73 ... Test case runs only on the PODs that are configured with PowerSwitch that
74 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
75 [Tags] functional PowerSwitch RebootAllONUs
76 [Setup] Start Logging RebootAllONUs
77 [Teardown] Run Keywords Collect Logs
78 ... AND Stop Logging RebootAllONUs
79 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080080 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070081 ${src}= Set Variable ${hosts.src[${I}]}
82 ${dst}= Set Variable ${hosts.dst[${I}]}
83 Disable Switch Outlet ${src['power_switch_port']}
Hardik Windlass5e214b22021-02-26 10:37:14 +000084 Sleep 10s
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070085 Enable Switch Outlet ${src['power_switch_port']}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070086 END
87
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070088Sanity E2E Test for OLT/ONU on POD
89 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
90 ... Validate successful authentication/DHCP/E2E ping for the tech profile that is used
Andy Bavierba9866b2019-10-11 07:11:53 -070091 [Tags] sanity test1
Andy Baviere187eda2020-04-20 15:00:02 -070092 [Setup] Run Keywords Start Logging SanityTest
Andy Bavier4a8450e2020-02-04 08:58:37 -070093 ... AND Setup
94 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -070095 ... AND Stop Logging SanityTest
Suchitra Vemuric5295a32019-12-15 20:32:04 -080096 Run Keyword If ${has_dataplane} Clean Up Linux
Zack Williamsa8fe75a2020-01-10 14:25:27 -070097 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070098
Suchitra Vemuri6db89412019-11-14 14:52:54 -080099Test Disable and Enable ONU
100 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
101 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
102 ... Perform disable on the ONUs and validate that the pings do not succeed
103 ... Perform enable on the ONUs and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000104 [Tags] functional DisableEnableONU released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700105 [Setup] Start Logging DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700106 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700107 ... AND Stop Logging DisableEnableONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800108 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800109 ${src}= Set Variable ${hosts.src[${I}]}
110 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800111 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800112 ${onu_device_id}= Get Device ID From SN ${src['onu']}
113 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000114 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800115 Disable Device ${onu_device_id}
Andy Bavier46c8be32020-01-21 10:06:27 -0700116 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700117 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
118 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700119 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
120 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800121 Enable Device ${onu_device_id}
122 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800123 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530124 # Verify subscriber access flows are added for the ONU port
125 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
126 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
127 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700128 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
129 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700130 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
131 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800132 END
133
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800134Test Subscriber Delete and Add
135 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
136 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700137 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800138 ... Re-add the subscriber and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000139 [Tags] functional SubAddDelete released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700140 [Setup] Start Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700141 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700142 ... AND Stop Logging SubAddDelete
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800143 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800144 ${src}= Set Variable ${hosts.src[${I}]}
145 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800146 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800147 ${onu_device_id}= Get Device ID From SN ${src['onu']}
148 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000149 ... ${of_id} ${src['uni_id']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000150 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800151 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800152 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
153 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700154 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
155 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700156 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
157 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000158 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800159 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800160 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800161 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
162 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800163 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530164 # Verify subscriber access flows are added for the ONU port
165 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
166 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
167 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700168 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
169 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700170 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
171 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800172 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800173
suraj gourd5cfdbb2019-12-13 12:44:55 +0000174Check DHCP attempt fails when subscriber is not added
175 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
176 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700177 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000178 [Tags] functional SubsRemoveDHCP released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700179 [Setup] Start Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700180 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700181 ... AND Stop Logging SubsRemoveDHCP
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800182 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000183 ${src}= Set Variable ${hosts.src[${I}]}
184 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800185 ${of_id}= Get ofID From OLT List ${src['olt']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700186 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000187 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000188 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800189 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']}
190 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
191 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
192 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000193 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000194 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri8f1d3062020-02-28 11:57:37 -0800195 Sleep 15s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800196 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
197 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700198 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
199 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
200 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
201 Run Keyword And Ignore Error Login And Run Command On Remote System
202 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800203 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000204 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
205 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
206 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
207 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
208 ... ${dst['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000209 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000210 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800211 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
212 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530213 # Verify subscriber access flows are added for the ONU port
214 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
215 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
216 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000217 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
218 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
219 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
220 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
221 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800222 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800223
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800224Test Disable and Enable ONU scenario for ATT workflow
225 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
226 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
227 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700228 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
229 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800230 ... VOL-2284
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000231 [Tags] functional ATT_DisableEnableONU released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700232 [Setup] Start Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700233 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700234 ... AND Stop Logging ATT_DisableEnableONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800235 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800236 ${src}= Set Variable ${hosts.src[${I}]}
237 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800238 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800239 ${onu_device_id}= Get Device ID From SN ${src['onu']}
240 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000241 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800242 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000243 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800244 Disable Device ${onu_device_id}
Hardik Windlass5e214b22021-02-26 10:37:14 +0000245 Wait Until Keyword Succeeds ${timeout} 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000246 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800247 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700248 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
249 ... Wait Until Keyword Succeeds 60s 2s Check Ping
250 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
251 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass5e214b22021-02-26 10:37:14 +0000252 ... ELSE Sleep 10s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800253 Enable Device ${onu_device_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800254 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800255 ... ${ONOS_SSH_PORT} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700256 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
257 ... Validate Authentication After Reassociate True
258 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800259 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800260 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700261 ... ${ONOS_SSH_PORT} ${onu_port}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000262 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800263 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530264 # Verify subscriber access flows are added for the ONU port
265 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
266 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
267 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800268 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700269 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800270 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
271 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
272 ... ${dst['container_name']}
273 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800274 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000275 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000276
Hardik Windlass2b37e712020-06-12 02:13:17 +0530277Test Disable and Enable OLT
278 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
279 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
280 ... Perform disable on the OLT and validate that the pings do not succeed
281 ... Perform enable on the OLT and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000282 [Tags] functional VOL-2410 DisableEnableOLT multi-uni
Hardik Windlass2b37e712020-06-12 02:13:17 +0530283 [Setup] Start Logging DisableEnableOLT
284 [Teardown] Run Keywords Collect Logs
285 ... AND Stop Logging DisableEnableOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800286 #Disable the OLTs and verify the OLT/ONUs are disabled properly
287 FOR ${I} IN RANGE 0 ${olt_count}
288 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
289 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
290 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800291 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800292 Should Be Equal As Integers ${rc} 0
293 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
294 ... ${olt_serial_number}
295 END
296 # Validate the ONUs
297 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530298 ${src}= Set Variable ${hosts.src[${I}]}
299 ${dst}= Set Variable ${hosts.dst[${I}]}
300 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800301 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530302 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000303 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530304 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED DISCOVERED
305 ... UNREACHABLE ${src['onu']} onu=false
306 #Verify that ping fails
307 Run Keyword If ${has_dataplane}
308 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
309 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
310 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
311 # Remove Subscriber Access (To replicate ATT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000312 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530313 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530314 END
315 #Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800316 FOR ${I} IN RANGE 0 ${olt_count}
317 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
318 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
319 Enable Device ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800320 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
321 ... ${olt_serial_number}
322 #TODO: Update for PON_OLT ETHERNET_NNI
323 #Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
324 #... PON_OLT ETHERNET_NNI
325 END
Hardik Windlass2b37e712020-06-12 02:13:17 +0530326 Run Keyword If ${has_dataplane} Clean Up Linux
327 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test
328
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800329Delete OLT, ReAdd OLT and Perform Sanity Test
330 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
331 ... Disable and Delete the OLT
332 ... Create/Enable the same OLT again
333 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800334 [Tags] functional DeleteOLT released notready
Andy Baviere187eda2020-04-20 15:00:02 -0700335 [Setup] Start Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700336 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700337 ... AND Stop Logging DeleteOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800338 #TODO: Update test with new framework changes
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800339 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800340 FOR ${I} IN RANGE 0 ${olt_count}
341 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
342 ${of_id}= Get ofID From OLT List ${olt_serial_number}
343 Delete Device and Verify ${olt_serial_number}
344 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
345 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
346 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800347 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800348 # Recreate the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530349 Setup
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800350 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800351
Hema567f3012020-03-25 00:51:53 +0530352Check Mib State on OLT recreation after ONU, OLT deletion
353 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable,
354 ... Disable and Delete the ONU, Disable and Delete the OLT
355 ... Create/Enable the OLT again and Check for the Mib State of the ONUs
356 [Tags] functional CheckMibState notready
Andy Baviere187eda2020-04-20 15:00:02 -0700357 [Setup] Start Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530358 [Teardown] Run Keywords Collect Logs
359 ... AND Stop Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530360 #Disable and Delete the ONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800361 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema567f3012020-03-25 00:51:53 +0530362 ${src}= Set Variable ${hosts.src[${I}]}
363 ${dst}= Set Variable ${hosts.dst[${I}]}
364 ${onu_device_id}= Get Device ID From SN ${src['onu']}
365 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000366 ... ${of_id} ${src['uni_id']}
Hema567f3012020-03-25 00:51:53 +0530367 Disable Device ${onu_device_id}
368 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
369 Delete Device ${onu_device_id}
370 END
371 #Disable and Delete the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530372 Delete Device and Verify
373 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
374 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
375 # Recreate the OLT
Hema567f3012020-03-25 00:51:53 +0530376 Run Keyword If ${has_dataplane} Sleep 180s
Andrea Campanella3dcce272021-01-15 16:04:47 +0100377 # This dneeds to be done in for loop, test is not ready
378 ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}"
Suchitra Vemuri09f878d2021-02-10 18:19:04 -0800379 ... Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport]
380 ... ELSE Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport] ${list_olts}[${I}][type]
Hema567f3012020-03-25 00:51:53 +0530381 Set Suite Variable ${olt_device_id}
382 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED
Hardik Windlass8b446492021-06-10 06:25:23 +0000383 ... UNKNOWN UNKNOWN ${olt_device_id} by_dev_id=True
Hema567f3012020-03-25 00:51:53 +0530384 Enable Device ${olt_device_id}
385 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
386 ... ${olt_serial_number}
387 #Check for the ONU status and ONU Mib State should be "omci-flows-pushed"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800388 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema567f3012020-03-25 00:51:53 +0530389 ${src}= Set Variable ${hosts.src[${I}]}
390 ${dst}= Set Variable ${hosts.dst[${I}]}
391 ${onu_device_id}= Get Device ID From SN ${src['onu']}
392 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000393 ... ${of_id} ${src['uni_id']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700394 Wait Until Keyword Succeeds 180s 5s Validate Device ENABLED ACTIVE
Hema567f3012020-03-25 00:51:53 +0530395 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
396 END
397
Hema783279b2020-01-22 15:37:37 +0530398Test disable ONUs and OLT then delete ONUs and OLT
399 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
400 ... This TC is to confirm that ONU removal is not impacting OLT
401 ... Devices will be removed during the execution of this TC
402 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800403 [Tags] functional VOL-2354 DisableDeleteONUandOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700404 [Setup] Start Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700405 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700406 ... AND Stop Logging DisableDeleteONUandOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800407 #${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Suchitra Vemuri02170552021-03-23 16:40:50 -0700408 @{onu_reason}= Create List tech-profile-config-downloaded-success omci-flows-pushed
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800409 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema783279b2020-01-22 15:37:37 +0530410 ${src}= Set Variable ${hosts.src[${I}]}
411 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800412 ${of_id}= Get ofID From OLT List ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530413 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700414 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800415 ... Validate Device ENABLED ACTIVE
Suchitra Vemuri02170552021-03-23 16:40:50 -0700416 ... REACHABLE ${src['onu']} onu=True onu_reason=${onu_reason}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800417 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
418 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800419 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530420 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800421 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${onu_device_id}
Hema783279b2020-01-22 15:37:37 +0530422 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800423 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
424 ... Validate Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530425 ... REACHABLE ${src['onu']} onu=false
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700426 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800427 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800428 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530429 END
Matteo Scandolo5899be12020-11-11 15:38:07 -0800430
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800431 # Disable all OLTs
432 FOR ${I} IN RANGE 0 ${olt_count}
433 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
434 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
435 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800436 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800437 Should Be Equal As Integers ${rc} 0
438 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
439 ... ${olt_serial_number}
440 END
441 # Validate ONUs after OLT disable
442 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema783279b2020-01-22 15:37:37 +0530443 ${src}= Set Variable ${hosts.src[${I}]}
444 ${dst}= Set Variable ${hosts.dst[${I}]}
445 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800446 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
447 ... Validate Device DISABLED DISCOVERED
448 ... UNREACHABLE ${src['onu']} onu=false
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530449 Delete Device ${onu_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800450 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
451 ... Validate OLT Device DISABLED UNKNOWN
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800452 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530453 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800454 # Delete all OLTs
455 Delete All Devices and Verify
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000456 # Re-create the Devices and Perform Sanity
457 Setup
458 Run Keyword If ${has_dataplane} Clean Up Linux
459 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
David Bainbridgef81cd642019-11-20 00:14:47 +0000460
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800461Validate authentication on a disabled ONU
suraj gour472da1c2020-02-25 05:44:51 +0000462 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
463 ... Perform disable on the ONUs and validate that the authentication do not succeed
464 ... Perform enable on the ONUs and validate that authentication successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000465 [Tags] functional DisableONU_AuthCheck multi-uni
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800466 # Creates Devices in the Setup
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000467 [Setup] Start Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800468 [Teardown] Run Keywords Collect Logs
469 ... AND Stop Logging DisableONU_AuthCheck
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800470 ... AND Delete All Devices and Verify
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800471 Clean WPA Process
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800472 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gour472da1c2020-02-25 05:44:51 +0000473 ${src}= Set Variable ${hosts.src[${I}]}
474 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800475 ${of_id}= Get ofID From OLT List ${src['olt']}
suraj gour472da1c2020-02-25 05:44:51 +0000476 ${onu_device_id}= Get Device ID From SN ${src['onu']}
477 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000478 ... ${of_id} ${src['uni_id']}
suraj gour472da1c2020-02-25 05:44:51 +0000479 Disable Device ${onu_device_id}
480 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
481 ... REACHABLE ${src['onu']} onu=false
Andy Bavier84834d42020-02-25 13:49:50 -0700482 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
483 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800484 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication False
485 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700486 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800487 Enable Device ${onu_device_id}
488 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
489 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800490 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
491 ... ENABLED ACTIVE REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
492 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
493 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700494 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
suraj gour472da1c2020-02-25 05:44:51 +0000495 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
496 END
suraj gour472da1c2020-02-25 05:44:51 +0000497
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000498Data plane verification using TCP
499 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
500 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200501 [Tags] non-critical dataplane BandwidthProfileTCP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700502 [Setup] Start Logging BandwidthProfileTCP
503 [Teardown] Run Keywords Collect Logs
504 ... AND Stop Logging BandwidthProfileTCP
Andy Baviereff938d2020-06-29 18:27:49 -0700505 Pass Execution If '${has_dataplane}'=='False'
506 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800507 Delete All Devices And Verify
508 Run Keyword If ${has_dataplane} Clean Up Linux
509 setup
510 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
511
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800512 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000513 ${src}= Set Variable ${hosts.src[${I}]}
514 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800515 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700516
517 # Check for iperf3 and jq tools
518 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
519 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
520 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
521
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000522 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000523 ... ${of_id} ${src['uni_id']}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000524 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
525 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
526 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700527 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000528 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
529 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700530 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000531
532 # Stream TCP packets from RG to server
533 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
534 ... args=-t 30
535 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
536
537 # Stream TCP packets from server to RG
538 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
539 ... args=-R -t 30
540 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
541
542 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
543 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
544 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
545 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
546
547 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
548 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700549 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
550 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
551 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000552 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
553 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
554 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
555 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
556 END
557
558Data plane verification using UDP
559 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
560 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200561 [Tags] non-critical dataplane BandwidthProfileUDP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700562 [Setup] Start Logging BandwidthProfileUDP
563 [Teardown] Run Keywords Collect Logs
564 ... AND Stop Logging BandwidthProfileUDP
Andy Baviereff938d2020-06-29 18:27:49 -0700565 Pass Execution If '${has_dataplane}'=='False'
566 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800567 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000568 ${src}= Set Variable ${hosts.src[${I}]}
569 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800570 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierd59f9772020-07-01 12:00:42 -0700571
572 # Check for iperf3 and jq tools
573 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
574 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
575 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
576
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000577 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000578 ... ${of_id} ${src['uni_id']}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000579 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
580 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
581 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700582 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000583 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
584 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700585 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000586
587 # Stream UDP packets from RG to server
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200588 ${uprate}= Run Keyword If ${limiting_bw_value_upstream} != 1000000
589 ... Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200590 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200591 ... Set Variable ${limiting_bw_value_upstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000592 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700593 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000594 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
595 ${actual_upstream_bw_used}= Evaluate
596 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
597
598 # Stream UDP packets from server to RG
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200599 ${dnrate}= Run Keyword If ${limiting_bw_value_dnstream} != 1000000
600 ... Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200601 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200602 ... Set Variable ${limiting_bw_value_dnstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000603 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700604 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000605 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
606 ${actual_dnstream_bw_used}= Evaluate
607 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
608
609 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
610 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
611 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
612 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
613
614 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
615 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700616 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
617 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
618 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000619 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
620 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
621 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
622 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
623 END
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800624
Suraj Gour33651272020-05-04 10:10:16 +0530625Validate parsing of data traffic through voltha using tech profile
626 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
627 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
628 ... Install jq tool to read json file, where test suite is being running
Girish Gowdrabbfbbc32021-05-17 14:36:58 -0700629 ... This test sends TCP packets with pbits between 0 and 7 and validates that
Suraj Gour33651272020-05-04 10:10:16 +0530630 ... the pbits are preserved by the PON.
Hardik Windlass04d791e2021-07-12 16:23:13 +0000631 [Tags] dataplane TechProfile VOL-2054 notready
Suraj Gour33651272020-05-04 10:10:16 +0530632 [Setup] Start Logging TechProfile
633 [Teardown] Run Keywords Collect Logs
634 ... AND Stop Logging TechProfile
635 Pass Execution If '${has_dataplane}'=='False'
636 ... Skipping test: Technology profile validation can be done only in physical pod
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800637 FOR ${I} IN RANGE 0 ${num_all_onus}
Suraj Gour33651272020-05-04 10:10:16 +0530638 ${src}= Set Variable ${hosts.src[${I}]}
639 ${dst}= Set Variable ${hosts.dst[${I}]}
640
641 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
642 ${bng_user}= Get Variable Value ${dst['noroot_user']}
643 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
Andy Bavierf4b7d1d2020-06-30 11:14:04 -0700644 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
Suraj Gour33651272020-05-04 10:10:16 +0530645 ... Skipping test: credentials for BNG login required in deployment config
646
647 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
648 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
649 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
650 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
651 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
652 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
653 Log Upstream test
Andy Baviereff938d2020-06-29 18:27:49 -0700654 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Suraj Gour33651272020-05-04 10:10:16 +0530655 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src['dp_iface_name']}
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700656 ... 0 tcp 0 ${src['s_tag']} upstream vlan
Suraj Gour33651272020-05-04 10:10:16 +0530657 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
658 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
659 Log Downstream test
660 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
661 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
662 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
663 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
Andy Baviereff938d2020-06-29 18:27:49 -0700664 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700665 ... ${rg_ip} ${src['dp_iface_name']} ${dst['dp_iface_name']}
666 ... 0 tcp ${src['c_tag']} ${src['s_tag']} downstream tcp
Suraj Gour33651272020-05-04 10:10:16 +0530667 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
668 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
669 END
670
Hardik Windlass16cdf962020-04-29 15:26:50 +0530671Test Disable and Enable OLT PON Port
672 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
673 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
674 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
675 ... Perform enable on the OLT PON Port and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000676 [Tags] functional DisableEnableOltPonPort VOL-2577 multi-uni
Hardik Windlass16cdf962020-04-29 15:26:50 +0530677 [Setup] Run Keywords Start Logging DisableEnableOltPonPort
678 ... AND Setup
679 [Teardown] Run Keywords Collect Logs
680 ... AND Stop Logging DisableEnableOltPonPort
Hardik Windlass41701e82021-01-12 17:44:44 +0000681 ... AND Delete All Devices and Verify
Hardik Windlass16cdf962020-04-29 15:26:50 +0530682 Run Keyword If ${has_dataplane} Clean Up Linux
683 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Hardik Windlass41701e82021-01-12 17:44:44 +0000684 # Multi-OLTs
685 FOR ${I} IN RANGE 0 ${olt_count}
686 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
687 Disable Enable PON Port Per OLT ${olt_serial_number}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530688 END
689
Gayathri.Selvan5d23e522020-09-15 17:26:25 +0530690Data plane Bandwidth profile update verification
691 [Documentation] Test bandwidth profile is updated for one subscriber and not changed for other subscribers.
692 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
693 ... Assumes Default and User_Bandwidth2 profiles are configured as bandwidth profiles
694 [Tags] non-critical dataplane BandwidthProfileUpdateTCP VOL-2053
695 [Setup] Start Logging BandwidthProfileUpdateTCP
696 [Teardown] Run Keywords Collect Logs
697 ... AND Stop Logging BandwidthProfileUpdateTCP
698 ... AND Send File To Onos ${CURDIR}/../../tests/data/${POD_NAME}-sadis.json
699 Pass Execution If '${has_dataplane}'=='False'
700 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
701 Delete All Devices And Verify
702 Run Keyword If ${has_dataplane} Clean Up Linux
703 Setup
704 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
705 # Update the Bandwidth Profile for the First Subscriber under test
706 ${src}= Set Variable ${hosts.src[${0}]}
707 ${dst}= Set Variable ${hosts.dst[${0}]}
708 ${of_id}= Get ofID From OLT List ${src['olt']}
709 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
710 ... ${of_id} ${src['uni_id']}
711 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
712 ${oldBwName} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
713 # Delete the existing subscriber
714 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
715 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
716 # Change the bandwidth profile and load the configuration
Hardik Windlassaa41bb42021-07-23 15:32:43 +0000717 ${newBwName} Set Variable If ${oldBwName} == 'Default' 'User_Bandwidth2' 'Default'
Gayathri.Selvan5d23e522020-09-15 17:26:25 +0530718 ${cmd} Catenate
719 ... sed 's/upstreamBandwidthProfile": "${oldBwName}"/upstreamBandwidthProfile": "${newBwName}"/g'
720 ... ${CURDIR}/../../tests/data/${POD_NAME}-sadis.json > ${CURDIR}/../../tests/data/${POD_NAME}-sadis-new.json
721 ${rc} Run and Return RC ${cmd}
722 Send File To Onos ${CURDIR}/../../tests/data/${POD_NAME}-sadis-new.json
723 # Re-add the subscriber with new bandwidth profile
724 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
725 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
726 # Verify that no pending flows exist for the ONU port
727 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
728 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
729 # Verify subscriber access flows are added for the ONU port
730 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
731 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
732 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
733 # Verify Meters in ONOS
734 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
735 ... Verify Meters in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
736 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
737 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
738 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
739 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
740 ... ${dst['container_name']}
741 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
742 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
743 # Verify new bandwidth profile is applied and other subscribers are working fine
744 ${checkBwName} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
745 Should Be Equal ${checkBwName} ${newBwName} The bandwidth profile is not updated properly
746 FOR ${I} IN RANGE 0 ${num_all_onus}
747 ${src}= Set Variable ${hosts.src[${I}]}
748 ${dst}= Set Variable ${hosts.dst[${I}]}
749 ${of_id}= Get ofID From OLT List ${src['olt']}
750
751 # Check for iperf3 and jq tools
752 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
753 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
754 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
755
756 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
757 ... ${of_id} ${src['uni_id']}
758 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
759 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
760 ... upstreamBandwidthProfile
761 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
762 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
763 ... downstreamBandwidthProfile
764 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
765
766 # Stream TCP packets from RG to server
767 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
768 ... args=-t 30
769 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
770
771 # Stream TCP packets from server to RG
772 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
773 ... args=-R -t 30
774 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
775
776 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
777 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
778 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
779 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
780
781 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
782 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
783 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
784 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
785 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
786 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
787 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
788 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
789 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
790 END
791
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700792*** Keywords ***
793Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700794 [Documentation] Set up the test suite
795 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700796 #Restore all ONUs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800797 #Run Keyword If ${has_dataplane} RestoreONUs ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700798 #power_switch.robot needs it to support different vendor's power switch
799 ${switch_type}= Get Variable Value ${web_power_switch.type}
800 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700801
David Bainbridgef81cd642019-11-20 00:14:47 +0000802Clear All Devices Then Create New Device
803 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000804 # Remove all devices from voltha and nos
805 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000806 # Execute normal test Setup Keyword
807 Setup