blob: 091c479a2abf4155a6e7ec0ebd42e60f137648eb [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}]}
Girish Gowdraa3a05c62022-02-16 13:54:37 -080084 # If the power switch port is not specified, continue
85 Continue For Loop If '${src["power_switch_port"]}' == '${None}'
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070086 Disable Switch Outlet ${src['power_switch_port']}
Hardik Windlass5e214b22021-02-26 10:37:14 +000087 Sleep 10s
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070088 Enable Switch Outlet ${src['power_switch_port']}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070089 END
90
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070091Sanity E2E Test for OLT/ONU on POD
92 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
93 ... Validate successful authentication/DHCP/E2E ping for the tech profile that is used
Andy Bavierba9866b2019-10-11 07:11:53 -070094 [Tags] sanity test1
Andy Baviere187eda2020-04-20 15:00:02 -070095 [Setup] Run Keywords Start Logging SanityTest
Andy Bavier4a8450e2020-02-04 08:58:37 -070096 ... AND Setup
97 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -070098 ... AND Stop Logging SanityTest
Suchitra Vemuric5295a32019-12-15 20:32:04 -080099 Run Keyword If ${has_dataplane} Clean Up Linux
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700100 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700101
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800102Test Disable and Enable ONU
103 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
104 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
105 ... Perform disable on the ONUs and validate that the pings do not succeed
106 ... Perform enable on the ONUs and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000107 [Tags] functional DisableEnableONU released multi-uni
Girish Gowdra8fd96962021-12-14 16:20:04 +0530108 [Setup] Run Keywords Start Logging DisableEnableONU
109 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
Andy Bavier4a8450e2020-02-04 08:58:37 -0700110 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700111 ... AND Stop Logging DisableEnableONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800112 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800113 ${src}= Set Variable ${hosts.src[${I}]}
114 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800115 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000116 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800117 ${onu_device_id}= Get Device ID From SN ${src['onu']}
118 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000119 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800120 Disable Device ${onu_device_id}
Andy Bavier46c8be32020-01-21 10:06:27 -0700121 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700122 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
123 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700124 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
125 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800126 Enable Device ${onu_device_id}
Girish Gowdrafc0bdf22021-12-06 16:57:50 +0530127 Wait Until Keyword Succeeds ${timeout} 5s
128 ... Validate Device ENABLED ACTIVE
129 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
130 # Workaround for issue seen in VOL-4489. Keep this workaround until VOL-4489 is fixed.
131 Run Keyword If ${has_dataplane} Reboot XGSPON ONU ${src['olt']} ${src['onu']} omci-flows-pushed
132 # Workaround ends here for issue seen in VOL-4489.
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800133 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800134 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530135 # Verify subscriber access flows are added for the ONU port
136 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
137 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
138 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700139 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
140 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700141 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
142 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800143 END
144
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800145Test Subscriber Delete and Add
146 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
147 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700148 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800149 ... Re-add the subscriber and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000150 [Tags] functional SubAddDelete released multi-uni
Girish Gowdrafbdddc12021-12-17 15:39:55 +0530151 [Setup] Run Keywords Start Logging SubAddDelete
152 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
Andy Bavier4a8450e2020-02-04 08:58:37 -0700153 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700154 ... AND Stop Logging SubAddDelete
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800155 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800156 ${src}= Set Variable ${hosts.src[${I}]}
157 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800158 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000159 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800160 ${onu_device_id}= Get Device ID From SN ${src['onu']}
161 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000162 ... ${of_id} ${src['uni_id']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000163 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800164 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800165 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
166 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700167 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
168 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700169 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
170 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000171 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800172 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800173 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800174 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
175 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800176 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530177 # Verify subscriber access flows are added for the ONU port
178 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
179 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
180 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700181 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
182 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700183 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
184 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800185 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800186
suraj gourd5cfdbb2019-12-13 12:44:55 +0000187Check DHCP attempt fails when subscriber is not added
188 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
189 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700190 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000191 [Tags] functional SubsRemoveDHCP released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700192 [Setup] Start Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700193 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700194 ... AND Stop Logging SubsRemoveDHCP
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800195 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000196 ${src}= Set Variable ${hosts.src[${I}]}
197 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800198 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000199 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700200 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000201 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000202 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800203 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']}
204 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
205 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
206 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000207 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000208 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri8f1d3062020-02-28 11:57:37 -0800209 Sleep 15s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800210 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
211 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700212 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
213 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
214 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
215 Run Keyword And Ignore Error Login And Run Command On Remote System
216 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800217 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000218 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
219 ... False ${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']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000223 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000224 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800225 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
226 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530227 # Verify subscriber access flows are added for the ONU port
228 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
229 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
230 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000231 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
232 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
233 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
234 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
235 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800236 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800237
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800238Test Disable and Enable ONU scenario for ATT workflow
239 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
240 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
241 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700242 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
243 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800244 ... VOL-2284
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000245 [Tags] functional ATT_DisableEnableONU released multi-uni
Girish Gowdra8fd96962021-12-14 16:20:04 +0530246 [Setup] Run Keywords Start Logging ATT_DisableEnableONU
247 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
Andy Bavier4a8450e2020-02-04 08:58:37 -0700248 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700249 ... AND Stop Logging ATT_DisableEnableONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800250 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800251 ${src}= Set Variable ${hosts.src[${I}]}
252 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800253 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000254 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800255 ${onu_device_id}= Get Device ID From SN ${src['onu']}
256 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000257 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800258 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000259 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800260 Disable Device ${onu_device_id}
Hardik Windlass5e214b22021-02-26 10:37:14 +0000261 Wait Until Keyword Succeeds ${timeout} 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
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-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700264 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
265 ... Wait Until Keyword Succeeds 60s 2s Check Ping
266 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
267 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass5e214b22021-02-26 10:37:14 +0000268 ... ELSE Sleep 10s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800269 Enable Device ${onu_device_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800270 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700271 ... ${ONOS_SSH_PORT} ${of_id} ${onu_port}
Girish Gowdrafc0bdf22021-12-06 16:57:50 +0530272 # Workaround for issue seen in VOL-4489. Keep this workaround until VOL-4489 is fixed.
273 Run Keyword If ${has_dataplane} Reboot XGSPON ONU ${src['olt']} ${src['onu']} omci-flows-pushed
274 # Workaround ends here for issue seen in VOL-4489.
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700275 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
276 ... Validate Authentication After Reassociate True
277 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800278 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800279 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700280 ... ${ONOS_SSH_PORT} ${onu_port}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000281 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800282 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530283 # Verify subscriber access flows are added for the ONU port
284 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
285 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
286 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800287 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700288 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800289 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
290 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
291 ... ${dst['container_name']}
292 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800293 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000294 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000295
Hardik Windlass2b37e712020-06-12 02:13:17 +0530296Test Disable and Enable OLT
297 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
298 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
299 ... Perform disable on the OLT and validate that the pings do not succeed
300 ... Perform enable on the OLT and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000301 [Tags] functional VOL-2410 DisableEnableOLT multi-uni
Hardik Windlass2b37e712020-06-12 02:13:17 +0530302 [Setup] Start Logging DisableEnableOLT
303 [Teardown] Run Keywords Collect Logs
304 ... AND Stop Logging DisableEnableOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800305 #Disable the OLTs and verify the OLT/ONUs are disabled properly
306 FOR ${I} IN RANGE 0 ${olt_count}
307 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
308 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
309 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800310 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800311 Should Be Equal As Integers ${rc} 0
312 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
313 ... ${olt_serial_number}
314 END
315 # Validate the ONUs
316 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530317 ${src}= Set Variable ${hosts.src[${I}]}
318 ${dst}= Set Variable ${hosts.dst[${I}]}
319 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800320 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530321 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000322 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530323 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED DISCOVERED
324 ... UNREACHABLE ${src['onu']} onu=false
325 #Verify that ping fails
326 Run Keyword If ${has_dataplane}
327 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
328 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
329 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
330 # Remove Subscriber Access (To replicate ATT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000331 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530332 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530333 END
334 #Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800335 FOR ${I} IN RANGE 0 ${olt_count}
336 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
337 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
338 Enable Device ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800339 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
340 ... ${olt_serial_number}
341 #TODO: Update for PON_OLT ETHERNET_NNI
342 #Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
343 #... PON_OLT ETHERNET_NNI
344 END
Hardik Windlass2b37e712020-06-12 02:13:17 +0530345 Run Keyword If ${has_dataplane} Clean Up Linux
346 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test
347
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800348Delete OLT, ReAdd OLT and Perform Sanity Test
349 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
350 ... Disable and Delete the OLT
351 ... Create/Enable the same OLT again
352 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800353 [Tags] functional DeleteOLT released notready
Andy Baviere187eda2020-04-20 15:00:02 -0700354 [Setup] Start Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700355 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700356 ... AND Stop Logging DeleteOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800357 #TODO: Update test with new framework changes
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800358 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800359 FOR ${I} IN RANGE 0 ${olt_count}
360 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
361 ${of_id}= Get ofID From OLT List ${olt_serial_number}
362 Delete Device and Verify ${olt_serial_number}
363 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
364 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
365 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800366 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800367 # Recreate the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530368 Setup
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800369 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800370
Hema567f3012020-03-25 00:51:53 +0530371Check Mib State on OLT recreation after ONU, OLT deletion
372 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable,
373 ... Disable and Delete the ONU, Disable and Delete the OLT
374 ... Create/Enable the OLT again and Check for the Mib State of the ONUs
375 [Tags] functional CheckMibState notready
Andy Baviere187eda2020-04-20 15:00:02 -0700376 [Setup] Start Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530377 [Teardown] Run Keywords Collect Logs
378 ... AND Stop Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530379 #Disable and Delete the ONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800380 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema567f3012020-03-25 00:51:53 +0530381 ${src}= Set Variable ${hosts.src[${I}]}
382 ${dst}= Set Variable ${hosts.dst[${I}]}
383 ${onu_device_id}= Get Device ID From SN ${src['onu']}
384 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000385 ... ${of_id} ${src['uni_id']}
Hema567f3012020-03-25 00:51:53 +0530386 Disable Device ${onu_device_id}
387 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
388 Delete Device ${onu_device_id}
389 END
390 #Disable and Delete the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530391 Delete Device and Verify
392 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
393 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
394 # Recreate the OLT
Hema567f3012020-03-25 00:51:53 +0530395 Run Keyword If ${has_dataplane} Sleep 180s
Andrea Campanella3dcce272021-01-15 16:04:47 +0100396 # This dneeds to be done in for loop, test is not ready
397 ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}"
Suchitra Vemuri09f878d2021-02-10 18:19:04 -0800398 ... Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport]
399 ... ELSE Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport] ${list_olts}[${I}][type]
Hema567f3012020-03-25 00:51:53 +0530400 Set Suite Variable ${olt_device_id}
401 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED
Hardik Windlass8b446492021-06-10 06:25:23 +0000402 ... UNKNOWN UNKNOWN ${olt_device_id} by_dev_id=True
Hema567f3012020-03-25 00:51:53 +0530403 Enable Device ${olt_device_id}
404 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
405 ... ${olt_serial_number}
406 #Check for the ONU status and ONU Mib State should be "omci-flows-pushed"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800407 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema567f3012020-03-25 00:51:53 +0530408 ${src}= Set Variable ${hosts.src[${I}]}
409 ${dst}= Set Variable ${hosts.dst[${I}]}
410 ${onu_device_id}= Get Device ID From SN ${src['onu']}
411 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000412 ... ${of_id} ${src['uni_id']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700413 Wait Until Keyword Succeeds 180s 5s Validate Device ENABLED ACTIVE
Hema567f3012020-03-25 00:51:53 +0530414 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
415 END
416
Hema783279b2020-01-22 15:37:37 +0530417Test disable ONUs and OLT then delete ONUs and OLT
418 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
419 ... This TC is to confirm that ONU removal is not impacting OLT
420 ... Devices will be removed during the execution of this TC
421 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800422 [Tags] functional VOL-2354 DisableDeleteONUandOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700423 [Setup] Start Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700424 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700425 ... AND Stop Logging DisableDeleteONUandOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800426 #${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Suchitra Vemuri02170552021-03-23 16:40:50 -0700427 @{onu_reason}= Create List tech-profile-config-downloaded-success omci-flows-pushed
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800428 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema783279b2020-01-22 15:37:37 +0530429 ${src}= Set Variable ${hosts.src[${I}]}
430 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800431 ${of_id}= Get ofID From OLT List ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530432 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700433 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800434 ... Validate Device ENABLED ACTIVE
Suchitra Vemuri02170552021-03-23 16:40:50 -0700435 ... REACHABLE ${src['onu']} onu=True onu_reason=${onu_reason}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800436 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
437 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800438 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530439 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800440 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${onu_device_id}
Hema783279b2020-01-22 15:37:37 +0530441 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800442 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
443 ... Validate Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530444 ... REACHABLE ${src['onu']} onu=false
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700445 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800446 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800447 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530448 END
Matteo Scandolo5899be12020-11-11 15:38:07 -0800449
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800450 # Disable all OLTs
451 FOR ${I} IN RANGE 0 ${olt_count}
452 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
453 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
454 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800455 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800456 Should Be Equal As Integers ${rc} 0
457 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
458 ... ${olt_serial_number}
459 END
460 # Validate ONUs after OLT disable
461 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema783279b2020-01-22 15:37:37 +0530462 ${src}= Set Variable ${hosts.src[${I}]}
463 ${dst}= Set Variable ${hosts.dst[${I}]}
464 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800465 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
466 ... Validate Device DISABLED DISCOVERED
467 ... UNREACHABLE ${src['onu']} onu=false
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530468 Delete Device ${onu_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800469 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
470 ... Validate OLT Device DISABLED UNKNOWN
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800471 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530472 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800473 # Delete all OLTs
474 Delete All Devices and Verify
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000475 # Re-create the Devices and Perform Sanity
476 Setup
477 Run Keyword If ${has_dataplane} Clean Up Linux
478 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
David Bainbridgef81cd642019-11-20 00:14:47 +0000479
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800480Validate authentication on a disabled ONU
suraj gour472da1c2020-02-25 05:44:51 +0000481 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
482 ... Perform disable on the ONUs and validate that the authentication do not succeed
483 ... Perform enable on the ONUs and validate that authentication successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000484 [Tags] functional DisableONU_AuthCheck multi-uni
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800485 # Creates Devices in the Setup
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000486 [Setup] Start Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800487 [Teardown] Run Keywords Collect Logs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800488 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700489 ... AND Run Keyword If ${logging} Collect Logs
490 ... AND Stop Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800491 Clean WPA Process
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800492 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gour472da1c2020-02-25 05:44:51 +0000493 ${src}= Set Variable ${hosts.src[${I}]}
494 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800495 ${of_id}= Get ofID From OLT List ${src['olt']}
suraj gour472da1c2020-02-25 05:44:51 +0000496 ${onu_device_id}= Get Device ID From SN ${src['onu']}
497 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000498 ... ${of_id} ${src['uni_id']}
suraj gour472da1c2020-02-25 05:44:51 +0000499 Disable Device ${onu_device_id}
500 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
501 ... REACHABLE ${src['onu']} onu=false
Andy Bavier84834d42020-02-25 13:49:50 -0700502 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
503 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800504 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication False
505 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700506 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800507 Enable Device ${onu_device_id}
508 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
509 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800510 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
511 ... ENABLED ACTIVE REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
512 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
513 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700514 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
suraj gour472da1c2020-02-25 05:44:51 +0000515 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
516 END
suraj gour472da1c2020-02-25 05:44:51 +0000517
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000518Data plane verification using TCP
519 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
520 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200521 [Tags] non-critical dataplane BandwidthProfileTCP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700522 [Setup] Start Logging BandwidthProfileTCP
523 [Teardown] Run Keywords Collect Logs
524 ... AND Stop Logging BandwidthProfileTCP
Andy Baviereff938d2020-06-29 18:27:49 -0700525 Pass Execution If '${has_dataplane}'=='False'
526 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800527 Delete All Devices And Verify
528 Run Keyword If ${has_dataplane} Clean Up Linux
529 setup
530 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
531
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800532 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000533 ${src}= Set Variable ${hosts.src[${I}]}
534 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800535 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700536
537 # Check for iperf3 and jq tools
538 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
539 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
540 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
541
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000542 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000543 ... ${of_id} ${src['uni_id']}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000544 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
545 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
546 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700547 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000548 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
549 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700550 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000551
552 # Stream TCP packets from RG to server
553 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
554 ... args=-t 30
555 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
556
557 # Stream TCP packets from server to RG
558 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
559 ... args=-R -t 30
560 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
561
562 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
563 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
564 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
565 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
566
567 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
568 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700569 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
570 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
571 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000572 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
573 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
574 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
575 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
576 END
577
578Data plane verification using UDP
579 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
580 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200581 [Tags] non-critical dataplane BandwidthProfileUDP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700582 [Setup] Start Logging BandwidthProfileUDP
583 [Teardown] Run Keywords Collect Logs
584 ... AND Stop Logging BandwidthProfileUDP
Andy Baviereff938d2020-06-29 18:27:49 -0700585 Pass Execution If '${has_dataplane}'=='False'
586 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800587 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000588 ${src}= Set Variable ${hosts.src[${I}]}
589 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800590 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierd59f9772020-07-01 12:00:42 -0700591
592 # Check for iperf3 and jq tools
593 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
594 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
595 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
596
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000597 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000598 ... ${of_id} ${src['uni_id']}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000599 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
600 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
601 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700602 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000603 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
604 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700605 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000606
607 # Stream UDP packets from RG to server
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200608 ${uprate}= Run Keyword If ${limiting_bw_value_upstream} != 1000000
609 ... Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200610 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200611 ... Set Variable ${limiting_bw_value_upstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000612 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700613 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000614 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
615 ${actual_upstream_bw_used}= Evaluate
616 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
617
618 # Stream UDP packets from server to RG
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200619 ${dnrate}= Run Keyword If ${limiting_bw_value_dnstream} != 1000000
620 ... Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200621 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200622 ... Set Variable ${limiting_bw_value_dnstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000623 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700624 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000625 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
626 ${actual_dnstream_bw_used}= Evaluate
627 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
628
629 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
630 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
631 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
632 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
633
634 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
635 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700636 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
637 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
638 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000639 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
640 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
641 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
642 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
643 END
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800644
Suraj Gour33651272020-05-04 10:10:16 +0530645Validate parsing of data traffic through voltha using tech profile
646 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
647 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
648 ... Install jq tool to read json file, where test suite is being running
Girish Gowdrabbfbbc32021-05-17 14:36:58 -0700649 ... This test sends TCP packets with pbits between 0 and 7 and validates that
Suraj Gour33651272020-05-04 10:10:16 +0530650 ... the pbits are preserved by the PON.
Hardik Windlass04d791e2021-07-12 16:23:13 +0000651 [Tags] dataplane TechProfile VOL-2054 notready
Suraj Gour33651272020-05-04 10:10:16 +0530652 [Setup] Start Logging TechProfile
653 [Teardown] Run Keywords Collect Logs
654 ... AND Stop Logging TechProfile
655 Pass Execution If '${has_dataplane}'=='False'
656 ... Skipping test: Technology profile validation can be done only in physical pod
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800657 FOR ${I} IN RANGE 0 ${num_all_onus}
Suraj Gour33651272020-05-04 10:10:16 +0530658 ${src}= Set Variable ${hosts.src[${I}]}
659 ${dst}= Set Variable ${hosts.dst[${I}]}
660
661 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
662 ${bng_user}= Get Variable Value ${dst['noroot_user']}
663 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
Andy Bavierf4b7d1d2020-06-30 11:14:04 -0700664 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
Suraj Gour33651272020-05-04 10:10:16 +0530665 ... Skipping test: credentials for BNG login required in deployment config
666
667 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
668 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
669 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
670 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
671 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
672 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
673 Log Upstream test
Andy Baviereff938d2020-06-29 18:27:49 -0700674 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Suraj Gour33651272020-05-04 10:10:16 +0530675 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src['dp_iface_name']}
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700676 ... 0 tcp 0 ${src['s_tag']} upstream vlan
Suraj Gour33651272020-05-04 10:10:16 +0530677 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
678 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
679 Log Downstream test
680 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
681 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
682 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
683 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
Andy Baviereff938d2020-06-29 18:27:49 -0700684 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700685 ... ${rg_ip} ${src['dp_iface_name']} ${dst['dp_iface_name']}
686 ... 0 tcp ${src['c_tag']} ${src['s_tag']} downstream tcp
Suraj Gour33651272020-05-04 10:10:16 +0530687 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
688 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
689 END
690
Hardik Windlass16cdf962020-04-29 15:26:50 +0530691Test Disable and Enable OLT PON Port
692 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
693 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
694 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
695 ... Perform enable on the OLT PON Port and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000696 [Tags] functional DisableEnableOltPonPort VOL-2577 multi-uni
Hardik Windlass16cdf962020-04-29 15:26:50 +0530697 [Setup] Run Keywords Start Logging DisableEnableOltPonPort
Girish Gowdra8fd96962021-12-14 16:20:04 +0530698 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
Hardik Windlass16cdf962020-04-29 15:26:50 +0530699 ... AND Setup
700 [Teardown] Run Keywords Collect Logs
Hardik Windlass41701e82021-01-12 17:44:44 +0000701 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700702 ... AND Run Keyword If ${logging} Collect Logs
703 ... AND Stop Logging DisableEnableOltPonPort
Hardik Windlass16cdf962020-04-29 15:26:50 +0530704 Run Keyword If ${has_dataplane} Clean Up Linux
705 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Hardik Windlass41701e82021-01-12 17:44:44 +0000706 # Multi-OLTs
707 FOR ${I} IN RANGE 0 ${olt_count}
708 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
709 Disable Enable PON Port Per OLT ${olt_serial_number}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530710 END
711
Gayathri.Selvan5d23e522020-09-15 17:26:25 +0530712Data plane Bandwidth profile update verification
713 [Documentation] Test bandwidth profile is updated for one subscriber and not changed for other subscribers.
714 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
715 ... Assumes Default and User_Bandwidth2 profiles are configured as bandwidth profiles
716 [Tags] non-critical dataplane BandwidthProfileUpdateTCP VOL-2053
717 [Setup] Start Logging BandwidthProfileUpdateTCP
718 [Teardown] Run Keywords Collect Logs
719 ... AND Stop Logging BandwidthProfileUpdateTCP
720 ... AND Send File To Onos ${CURDIR}/../../tests/data/${POD_NAME}-sadis.json
721 Pass Execution If '${has_dataplane}'=='False'
722 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
723 Delete All Devices And Verify
724 Run Keyword If ${has_dataplane} Clean Up Linux
725 Setup
726 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
727 # Update the Bandwidth Profile for the First Subscriber under test
728 ${src}= Set Variable ${hosts.src[${0}]}
729 ${dst}= Set Variable ${hosts.dst[${0}]}
730 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000731 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Gayathri.Selvan5d23e522020-09-15 17:26:25 +0530732 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
733 ... ${of_id} ${src['uni_id']}
734 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
735 ${oldBwName} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
736 # Delete the existing subscriber
737 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
738 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
739 # Change the bandwidth profile and load the configuration
Hardik Windlassaa41bb42021-07-23 15:32:43 +0000740 ${newBwName} Set Variable If ${oldBwName} == 'Default' 'User_Bandwidth2' 'Default'
Gayathri.Selvan5d23e522020-09-15 17:26:25 +0530741 ${cmd} Catenate
742 ... sed 's/upstreamBandwidthProfile": "${oldBwName}"/upstreamBandwidthProfile": "${newBwName}"/g'
743 ... ${CURDIR}/../../tests/data/${POD_NAME}-sadis.json > ${CURDIR}/../../tests/data/${POD_NAME}-sadis-new.json
744 ${rc} Run and Return RC ${cmd}
745 Send File To Onos ${CURDIR}/../../tests/data/${POD_NAME}-sadis-new.json
746 # Re-add the subscriber with new bandwidth profile
747 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
748 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
749 # Verify that no pending flows exist for the ONU port
750 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
751 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
752 # Verify subscriber access flows are added for the ONU port
753 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
754 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
755 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
756 # Verify Meters in ONOS
757 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
758 ... Verify Meters in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
759 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
760 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
761 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
762 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
763 ... ${dst['container_name']}
764 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
765 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
766 # Verify new bandwidth profile is applied and other subscribers are working fine
767 ${checkBwName} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
768 Should Be Equal ${checkBwName} ${newBwName} The bandwidth profile is not updated properly
769 FOR ${I} IN RANGE 0 ${num_all_onus}
770 ${src}= Set Variable ${hosts.src[${I}]}
771 ${dst}= Set Variable ${hosts.dst[${I}]}
772 ${of_id}= Get ofID From OLT List ${src['olt']}
773
774 # Check for iperf3 and jq tools
775 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
776 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
777 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
778
779 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
780 ... ${of_id} ${src['uni_id']}
781 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
782 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
783 ... upstreamBandwidthProfile
784 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
785 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
786 ... downstreamBandwidthProfile
787 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
788
789 # Stream TCP packets from RG to server
790 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
791 ... args=-t 30
792 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
793
794 # Stream TCP packets from server to RG
795 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
796 ... args=-R -t 30
797 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
798
799 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
800 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
801 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
802 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
803
804 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
805 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
806 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
807 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
808 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
809 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
810 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
811 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
812 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
813 END
814
Hardik Windlassb75cf1b2021-01-18 06:59:09 +0000815Test ONU Delete and Auto-Discovery
816 [Documentation] Tests the voltctl delete and Auto-Discovery of the ONU
Andrea Campanella92e21b02022-01-04 15:32:04 +0100817 [Tags] functional VOL-3098 ONUAutoDiscovery
Hardik Windlassb75cf1b2021-01-18 06:59:09 +0000818 [Setup] Run Keywords Start Logging ONUAutoDiscovery
819 ... AND Setup
820 [Teardown] Run Keywords Collect Logs
821 ... AND Delete All Devices and Verify
822 ... AND Run Keyword If ${logging} Collect Logs
823 ... AND Stop Logging ONUAutoDiscovery
824 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
825 Run Keyword If ${has_dataplane} Clean Up Linux
826 Perform Sanity Test
827 FOR ${I} IN RANGE 0 ${num_all_onus}
828 ${src}= Set Variable ${hosts.src[${I}]}
829 ${dst}= Set Variable ${hosts.dst[${I}]}
830 ${onu_device_id}= Get Device ID From SN ${src['onu']}
831 ${of_id}= Get ofID From OLT List ${src['olt']}
832 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
833 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
834 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
835 # Remove Subscriber Access (To replicate ATT workflow)
836 Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
837 ... volt-remove-subscriber-access ${of_id} ${onu_port}
838 # Additional sleep to let subscriber delete process
839 Sleep 10s
840 # Delete ONU and Verify Ping Fails
841 Delete Device ${onu_device_id}
842 Run Keyword If ${has_dataplane} Verify ping is successful except for given device
843 ... ${num_all_onus} ${src['onu']}
844 # Verify that no pending flows exist for the ONU port
845 Wait Until Keyword Succeeds ${timeout} 2s
846 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
847 # ONU Auto-Discovery
848 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
849 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
850 # Check ONU port is Enabled in ONOS
851 Wait Until Keyword Succeeds ${timeout} 2s
852 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
853 ${onu_device_id}= Get Device ID From SN ${src['onu']}
854 Run Keyword If ${has_dataplane} Clean Up Linux ${onu_device_id}
855 # Verify default EAPOL flows are added for the ONU port
856 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
857 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
858 # Verify ONU state in voltha
859 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
860 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
861 # Perform Authentication
862 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
863 ... /tmp/wpa ${src['dp_iface_name']} log
864 Run Keyword If ${has_dataplane} Validate Authentication True
865 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
866 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
867 Wait Until Keyword Succeeds ${timeout} 2
868 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
869 Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
870 ... volt-add-subscriber-access ${of_id} ${onu_port}
871 # Verify that no pending flows exist for the ONU port
872 Wait Until Keyword Succeeds ${timeout} 2s
873 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
874 # Verify subscriber access flows are added for the ONU port
875 Wait Until Keyword Succeeds ${timeout} 5s
876 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
877 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
878 # Verify subscriber EAPOL flow is installed
879 Wait Until Keyword Succeeds ${timeout} 5s
880 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
881 ... ${onu_port} ${src['c_tag']}
882 # Verify Meters in ONOS
883 Wait Until Keyword Succeeds ${timeout} 5s
884 ... Verify Meters in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
885 Run Keyword If ${has_dataplane} Validate DHCP and Ping True
886 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
887 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
888 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
889 ... ${dst['container_name']}
890 Wait Until Keyword Succeeds ${timeout} 2s
891 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
892 END
893
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700894*** Keywords ***
895Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700896 [Documentation] Set up the test suite
897 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700898 #Restore all ONUs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800899 #Run Keyword If ${has_dataplane} RestoreONUs ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700900 #power_switch.robot needs it to support different vendor's power switch
901 ${switch_type}= Get Variable Value ${web_power_switch.type}
902 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700903
David Bainbridgef81cd642019-11-20 00:14:47 +0000904Clear All Devices Then Create New Device
905 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000906 # Remove all devices from voltha and nos
907 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000908 # Execute normal test Setup Keyword
909 Setup