blob: 14b5a54e13cc127895bf53b554a9a1efc3a89374 [file] [log] [blame]
David Bainbridgef81cd642019-11-20 00:14:47 +00001# Copyright 2017 - present Open Networking Foundation
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -07002#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
Matteo Scandolo1294aeb2019-09-24 16:20:32 -070014# FIXME Can we use the same test against BBSim and Hardware?
15
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070016*** Settings ***
Zack Williamsec53a1b2019-09-16 15:50:52 -070017Documentation Test various end-to-end scenarios
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070018Suite Setup Setup Suite
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070019Test Setup Setup
20Test Teardown Teardown
Andy Bavierba9866b2019-10-11 07:11:53 -070021Suite Teardown Teardown Suite
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070022Library Collections
23Library String
24Library OperatingSystem
25Library XML
26Library RequestsLibrary
Andy Bavierba9866b2019-10-11 07:11:53 -070027Library ../../libraries/DependencyLibrary.py
Suchitra Vemurib8ed2d52019-09-30 13:22:51 -070028Resource ../../libraries/onos.robot
29Resource ../../libraries/voltctl.robot
David Bainbridgef81cd642019-11-20 00:14:47 +000030Resource ../../libraries/voltha.robot
Suchitra Vemurib8ed2d52019-09-30 13:22:51 -070031Resource ../../libraries/utils.robot
Andy Bavierba9866b2019-10-11 07:11:53 -070032Resource ../../libraries/k8s.robot
Suchitra Vemurib8ed2d52019-09-30 13:22:51 -070033Resource ../../variables/variables.robot
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070034Resource ../../libraries/power_switch.robot
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070035
36*** Variables ***
Zack Williamsec53a1b2019-09-16 15:50:52 -070037${POD_NAME} flex-ocp-cord
38${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
39${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs
40#${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
41${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
42${HELM_CHARTS_DIR} ~/helm-charts
43${VOLTHA_POD_NUM} 8
Zack Williamsa8fe75a2020-01-10 14:25:27 -070044${NAMESPACE} voltha
Hardik Windlass4288c6a2021-09-28 07:22:06 +000045${INFRA_NAMESPACE} default
suraj gourd64356b2019-11-07 13:26:20 +000046# For below variable value, using deployment name as using grep for
47# parsing radius pod name, we can also use full radius pod name
Zack Williamsa8fe75a2020-01-10 14:25:27 -070048${RESTART_POD_NAME} radius
Andy Bavierba9866b2019-10-11 07:11:53 -070049${timeout} 60s
Zack Williamsec53a1b2019-09-16 15:50:52 -070050${of_id} 0
51${logical_id} 0
Andrea Campanella86e24062020-08-05 19:09:18 +020052${uprate} 0
53${dnrate} 0
Andy Bavierba9866b2019-10-11 07:11:53 -070054${has_dataplane} True
Andy Bavierba9866b2019-10-11 07:11:53 -070055${teardown_device} False
Zack Williamsa8fe75a2020-01-10 14:25:27 -070056${scripts} ../../scripts
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070057
Gayathri.Selvan92d16862020-03-19 14:47:58 +000058# For dataplane bandwidth testing
59${upper_margin_pct} 105 # Allow 5% over the limit
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080060${lower_margin_pct} 90 # Allow 8% under the limit
Gayathri.Selvan92d16862020-03-19 14:47:58 +000061${udp_rate_multiplier} 1.10 # Send UDP at bw profile limit * rate_multiplier
Andy Bavierc80a2742020-08-28 10:59:05 -070062${udp_packet_bytes} 1470 # UDP payload in bytes
Gayathri.Selvan92d16862020-03-19 14:47:58 +000063
Andy Bavierabeba262020-02-07 16:22:16 -070064# Per-test logging on failure is turned off by default; set this variable to enable
65${container_log_dir} ${None}
66
Matteo Scandoloda1c64b2021-07-20 10:14:49 -070067# logging flag to enable Collect Logs, can be passed via the command line too
68# example: -v logging:False
69${logging} True
70
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070071*** Test Cases ***
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070072Reboot ONUs Physically
73 [Documentation] This test reboots ONUs physically before execution all the tests
74 ... Test case runs only on the PODs that are configured with PowerSwitch that
75 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
76 [Tags] functional PowerSwitch RebootAllONUs
77 [Setup] Start Logging RebootAllONUs
78 [Teardown] Run Keywords Collect Logs
79 ... AND Stop Logging RebootAllONUs
80 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080081 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070082 ${src}= Set Variable ${hosts.src[${I}]}
83 ${dst}= Set Variable ${hosts.dst[${I}]}
84 Disable Switch Outlet ${src['power_switch_port']}
Hardik Windlass5e214b22021-02-26 10:37:14 +000085 Sleep 10s
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070086 Enable Switch Outlet ${src['power_switch_port']}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070087 END
88
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070089Sanity E2E Test for OLT/ONU on POD
90 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
91 ... Validate successful authentication/DHCP/E2E ping for the tech profile that is used
Andy Bavierba9866b2019-10-11 07:11:53 -070092 [Tags] sanity test1
Andy Baviere187eda2020-04-20 15:00:02 -070093 [Setup] Run Keywords Start Logging SanityTest
Andy Bavier4a8450e2020-02-04 08:58:37 -070094 ... AND Setup
95 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -070096 ... AND Stop Logging SanityTest
Suchitra Vemuric5295a32019-12-15 20:32:04 -080097 Run Keyword If ${has_dataplane} Clean Up Linux
Zack Williamsa8fe75a2020-01-10 14:25:27 -070098 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070099
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800100Test Disable and Enable ONU
101 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
102 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
103 ... Perform disable on the ONUs and validate that the pings do not succeed
104 ... Perform enable on the ONUs and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000105 [Tags] functional DisableEnableONU released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700106 [Setup] Start Logging DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700107 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700108 ... AND Stop Logging DisableEnableONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800109 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800110 ${src}= Set Variable ${hosts.src[${I}]}
111 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800112 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000113 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800114 ${onu_device_id}= Get Device ID From SN ${src['onu']}
115 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000116 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800117 Disable Device ${onu_device_id}
Andy Bavier46c8be32020-01-21 10:06:27 -0700118 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700119 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
120 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700121 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
122 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800123 Enable Device ${onu_device_id}
Girish Gowdrafc0bdf22021-12-06 16:57:50 +0530124 Wait Until Keyword Succeeds ${timeout} 5s
125 ... Validate Device ENABLED ACTIVE
126 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
127 # Workaround for issue seen in VOL-4489. Keep this workaround until VOL-4489 is fixed.
128 Run Keyword If ${has_dataplane} Reboot XGSPON ONU ${src['olt']} ${src['onu']} omci-flows-pushed
129 # Workaround ends here for issue seen in VOL-4489.
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800130 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800131 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530132 # Verify subscriber access flows are added for the ONU port
133 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
134 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
135 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700136 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
137 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700138 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
139 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800140 END
141
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800142Test Subscriber Delete and Add
143 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
144 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700145 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800146 ... Re-add the subscriber and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000147 [Tags] functional SubAddDelete released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700148 [Setup] Start Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700149 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700150 ... AND Stop Logging SubAddDelete
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800151 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800152 ${src}= Set Variable ${hosts.src[${I}]}
153 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800154 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000155 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800156 ${onu_device_id}= Get Device ID From SN ${src['onu']}
157 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000158 ... ${of_id} ${src['uni_id']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000159 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800160 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800161 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
162 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700163 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
164 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700165 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
166 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000167 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800168 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800169 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800170 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
171 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800172 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530173 # Verify subscriber access flows are added for the ONU port
174 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
175 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
176 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700177 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
178 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700179 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
180 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800181 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800182
suraj gourd5cfdbb2019-12-13 12:44:55 +0000183Check DHCP attempt fails when subscriber is not added
184 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
185 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700186 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000187 [Tags] functional SubsRemoveDHCP released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700188 [Setup] Start Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700189 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700190 ... AND Stop Logging SubsRemoveDHCP
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800191 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000192 ${src}= Set Variable ${hosts.src[${I}]}
193 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800194 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000195 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700196 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000197 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000198 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800199 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${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 ps -ef | grep dhclient ${src['ip']}
202 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000203 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000204 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri8f1d3062020-02-28 11:57:37 -0800205 Sleep 15s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800206 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
207 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700208 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
209 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
210 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
211 Run Keyword And Ignore Error Login And Run Command On Remote System
212 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800213 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000214 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
215 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
216 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
217 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
218 ... ${dst['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000219 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000220 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800221 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
222 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530223 # Verify subscriber access flows are added for the ONU port
224 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
225 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
226 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000227 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
228 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
229 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
230 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
231 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800232 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800233
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800234Test Disable and Enable ONU scenario for ATT workflow
235 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
236 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
237 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700238 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
239 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800240 ... VOL-2284
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000241 [Tags] functional ATT_DisableEnableONU released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700242 [Setup] Start Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700243 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700244 ... AND Stop Logging ATT_DisableEnableONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800245 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800246 ${src}= Set Variable ${hosts.src[${I}]}
247 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800248 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000249 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800250 ${onu_device_id}= Get Device ID From SN ${src['onu']}
251 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000252 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800253 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000254 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800255 Disable Device ${onu_device_id}
Hardik Windlass5e214b22021-02-26 10:37:14 +0000256 Wait Until Keyword Succeeds ${timeout} 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000257 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800258 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700259 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
260 ... Wait Until Keyword Succeeds 60s 2s Check Ping
261 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
262 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass5e214b22021-02-26 10:37:14 +0000263 ... ELSE Sleep 10s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800264 Enable Device ${onu_device_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800265 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700266 ... ${ONOS_SSH_PORT} ${of_id} ${onu_port}
Girish Gowdrafc0bdf22021-12-06 16:57:50 +0530267 # Workaround for issue seen in VOL-4489. Keep this workaround until VOL-4489 is fixed.
268 Run Keyword If ${has_dataplane} Reboot XGSPON ONU ${src['olt']} ${src['onu']} omci-flows-pushed
269 # Workaround ends here for issue seen in VOL-4489.
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700270 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
271 ... Validate Authentication After Reassociate True
272 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800273 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800274 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700275 ... ${ONOS_SSH_PORT} ${onu_port}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000276 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800277 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530278 # Verify subscriber access flows are added for the ONU port
279 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
280 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
281 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800282 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700283 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800284 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
285 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
286 ... ${dst['container_name']}
287 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800288 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000289 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000290
Hardik Windlass2b37e712020-06-12 02:13:17 +0530291Test Disable and Enable OLT
292 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
293 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
294 ... Perform disable on the OLT and validate that the pings do not succeed
295 ... Perform enable on the OLT and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000296 [Tags] functional VOL-2410 DisableEnableOLT multi-uni
Hardik Windlass2b37e712020-06-12 02:13:17 +0530297 [Setup] Start Logging DisableEnableOLT
298 [Teardown] Run Keywords Collect Logs
299 ... AND Stop Logging DisableEnableOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800300 #Disable the OLTs and verify the OLT/ONUs are disabled properly
301 FOR ${I} IN RANGE 0 ${olt_count}
302 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
303 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
304 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800305 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800306 Should Be Equal As Integers ${rc} 0
307 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
308 ... ${olt_serial_number}
309 END
310 # Validate the ONUs
311 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530312 ${src}= Set Variable ${hosts.src[${I}]}
313 ${dst}= Set Variable ${hosts.dst[${I}]}
314 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800315 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530316 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000317 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530318 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED DISCOVERED
319 ... UNREACHABLE ${src['onu']} onu=false
320 #Verify that ping fails
321 Run Keyword If ${has_dataplane}
322 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
323 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
324 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
325 # Remove Subscriber Access (To replicate ATT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000326 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530327 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530328 END
329 #Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800330 FOR ${I} IN RANGE 0 ${olt_count}
331 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
332 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
333 Enable Device ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800334 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
335 ... ${olt_serial_number}
336 #TODO: Update for PON_OLT ETHERNET_NNI
337 #Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
338 #... PON_OLT ETHERNET_NNI
339 END
Hardik Windlass2b37e712020-06-12 02:13:17 +0530340 Run Keyword If ${has_dataplane} Clean Up Linux
341 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test
342
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800343Delete OLT, ReAdd OLT and Perform Sanity Test
344 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
345 ... Disable and Delete the OLT
346 ... Create/Enable the same OLT again
347 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800348 [Tags] functional DeleteOLT released notready
Andy Baviere187eda2020-04-20 15:00:02 -0700349 [Setup] Start Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700350 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700351 ... AND Stop Logging DeleteOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800352 #TODO: Update test with new framework changes
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800353 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800354 FOR ${I} IN RANGE 0 ${olt_count}
355 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
356 ${of_id}= Get ofID From OLT List ${olt_serial_number}
357 Delete Device and Verify ${olt_serial_number}
358 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
359 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
360 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800361 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800362 # Recreate the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530363 Setup
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800364 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800365
Hema567f3012020-03-25 00:51:53 +0530366Check Mib State on OLT recreation after ONU, OLT deletion
367 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable,
368 ... Disable and Delete the ONU, Disable and Delete the OLT
369 ... Create/Enable the OLT again and Check for the Mib State of the ONUs
370 [Tags] functional CheckMibState notready
Andy Baviere187eda2020-04-20 15:00:02 -0700371 [Setup] Start Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530372 [Teardown] Run Keywords Collect Logs
373 ... AND Stop Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530374 #Disable and Delete the ONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800375 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema567f3012020-03-25 00:51:53 +0530376 ${src}= Set Variable ${hosts.src[${I}]}
377 ${dst}= Set Variable ${hosts.dst[${I}]}
378 ${onu_device_id}= Get Device ID From SN ${src['onu']}
379 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000380 ... ${of_id} ${src['uni_id']}
Hema567f3012020-03-25 00:51:53 +0530381 Disable Device ${onu_device_id}
382 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
383 Delete Device ${onu_device_id}
384 END
385 #Disable and Delete the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530386 Delete Device and Verify
387 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
388 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
389 # Recreate the OLT
Hema567f3012020-03-25 00:51:53 +0530390 Run Keyword If ${has_dataplane} Sleep 180s
Andrea Campanella3dcce272021-01-15 16:04:47 +0100391 # This dneeds to be done in for loop, test is not ready
392 ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}"
Suchitra Vemuri09f878d2021-02-10 18:19:04 -0800393 ... Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport]
394 ... ELSE Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport] ${list_olts}[${I}][type]
Hema567f3012020-03-25 00:51:53 +0530395 Set Suite Variable ${olt_device_id}
396 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED
Hardik Windlass8b446492021-06-10 06:25:23 +0000397 ... UNKNOWN UNKNOWN ${olt_device_id} by_dev_id=True
Hema567f3012020-03-25 00:51:53 +0530398 Enable Device ${olt_device_id}
399 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
400 ... ${olt_serial_number}
401 #Check for the ONU status and ONU Mib State should be "omci-flows-pushed"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800402 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema567f3012020-03-25 00:51:53 +0530403 ${src}= Set Variable ${hosts.src[${I}]}
404 ${dst}= Set Variable ${hosts.dst[${I}]}
405 ${onu_device_id}= Get Device ID From SN ${src['onu']}
406 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000407 ... ${of_id} ${src['uni_id']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700408 Wait Until Keyword Succeeds 180s 5s Validate Device ENABLED ACTIVE
Hema567f3012020-03-25 00:51:53 +0530409 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
410 END
411
Hema783279b2020-01-22 15:37:37 +0530412Test disable ONUs and OLT then delete ONUs and OLT
413 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
414 ... This TC is to confirm that ONU removal is not impacting OLT
415 ... Devices will be removed during the execution of this TC
416 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800417 [Tags] functional VOL-2354 DisableDeleteONUandOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700418 [Setup] Start Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700419 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700420 ... AND Stop Logging DisableDeleteONUandOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800421 #${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Suchitra Vemuri02170552021-03-23 16:40:50 -0700422 @{onu_reason}= Create List tech-profile-config-downloaded-success omci-flows-pushed
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800423 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema783279b2020-01-22 15:37:37 +0530424 ${src}= Set Variable ${hosts.src[${I}]}
425 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800426 ${of_id}= Get ofID From OLT List ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530427 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700428 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800429 ... Validate Device ENABLED ACTIVE
Suchitra Vemuri02170552021-03-23 16:40:50 -0700430 ... REACHABLE ${src['onu']} onu=True onu_reason=${onu_reason}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800431 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
432 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800433 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530434 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800435 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${onu_device_id}
Hema783279b2020-01-22 15:37:37 +0530436 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800437 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
438 ... Validate Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530439 ... REACHABLE ${src['onu']} onu=false
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700440 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800441 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800442 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530443 END
Matteo Scandolo5899be12020-11-11 15:38:07 -0800444
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800445 # Disable all OLTs
446 FOR ${I} IN RANGE 0 ${olt_count}
447 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
448 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
449 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800450 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800451 Should Be Equal As Integers ${rc} 0
452 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
453 ... ${olt_serial_number}
454 END
455 # Validate ONUs after OLT disable
456 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema783279b2020-01-22 15:37:37 +0530457 ${src}= Set Variable ${hosts.src[${I}]}
458 ${dst}= Set Variable ${hosts.dst[${I}]}
459 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800460 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
461 ... Validate Device DISABLED DISCOVERED
462 ... UNREACHABLE ${src['onu']} onu=false
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530463 Delete Device ${onu_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800464 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
465 ... Validate OLT Device DISABLED UNKNOWN
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800466 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530467 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800468 # Delete all OLTs
469 Delete All Devices and Verify
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000470 # Re-create the Devices and Perform Sanity
471 Setup
472 Run Keyword If ${has_dataplane} Clean Up Linux
473 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
David Bainbridgef81cd642019-11-20 00:14:47 +0000474
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800475Validate authentication on a disabled ONU
suraj gour472da1c2020-02-25 05:44:51 +0000476 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
477 ... Perform disable on the ONUs and validate that the authentication do not succeed
478 ... Perform enable on the ONUs and validate that authentication successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000479 [Tags] functional DisableONU_AuthCheck multi-uni
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800480 # Creates Devices in the Setup
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000481 [Setup] Start Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800482 [Teardown] Run Keywords Collect Logs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800483 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700484 ... AND Run Keyword If ${logging} Collect Logs
485 ... AND Stop Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800486 Clean WPA Process
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800487 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gour472da1c2020-02-25 05:44:51 +0000488 ${src}= Set Variable ${hosts.src[${I}]}
489 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800490 ${of_id}= Get ofID From OLT List ${src['olt']}
suraj gour472da1c2020-02-25 05:44:51 +0000491 ${onu_device_id}= Get Device ID From SN ${src['onu']}
492 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000493 ... ${of_id} ${src['uni_id']}
suraj gour472da1c2020-02-25 05:44:51 +0000494 Disable Device ${onu_device_id}
495 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
496 ... REACHABLE ${src['onu']} onu=false
Andy Bavier84834d42020-02-25 13:49:50 -0700497 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
498 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800499 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication False
500 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700501 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800502 Enable Device ${onu_device_id}
503 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
504 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800505 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
506 ... ENABLED ACTIVE REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
507 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
508 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700509 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
suraj gour472da1c2020-02-25 05:44:51 +0000510 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
511 END
suraj gour472da1c2020-02-25 05:44:51 +0000512
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000513Data plane verification using TCP
514 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
515 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200516 [Tags] non-critical dataplane BandwidthProfileTCP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700517 [Setup] Start Logging BandwidthProfileTCP
518 [Teardown] Run Keywords Collect Logs
519 ... AND Stop Logging BandwidthProfileTCP
Andy Baviereff938d2020-06-29 18:27:49 -0700520 Pass Execution If '${has_dataplane}'=='False'
521 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800522 Delete All Devices And Verify
523 Run Keyword If ${has_dataplane} Clean Up Linux
524 setup
525 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
526
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800527 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000528 ${src}= Set Variable ${hosts.src[${I}]}
529 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800530 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700531
532 # Check for iperf3 and jq tools
533 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
534 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
535 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
536
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000537 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000538 ... ${of_id} ${src['uni_id']}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000539 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
540 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
541 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700542 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000543 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
544 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700545 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000546
547 # Stream TCP packets from RG to server
548 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
549 ... args=-t 30
550 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
551
552 # Stream TCP packets from server to RG
553 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
554 ... args=-R -t 30
555 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
556
557 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
558 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
559 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
560 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
561
562 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
563 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700564 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
565 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
566 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000567 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
568 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
569 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
570 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
571 END
572
573Data plane verification using UDP
574 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
575 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200576 [Tags] non-critical dataplane BandwidthProfileUDP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700577 [Setup] Start Logging BandwidthProfileUDP
578 [Teardown] Run Keywords Collect Logs
579 ... AND Stop Logging BandwidthProfileUDP
Andy Baviereff938d2020-06-29 18:27:49 -0700580 Pass Execution If '${has_dataplane}'=='False'
581 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800582 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000583 ${src}= Set Variable ${hosts.src[${I}]}
584 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800585 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierd59f9772020-07-01 12:00:42 -0700586
587 # Check for iperf3 and jq tools
588 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
589 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
590 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
591
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000592 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000593 ... ${of_id} ${src['uni_id']}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000594 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
595 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
596 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700597 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000598 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
599 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700600 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000601
602 # Stream UDP packets from RG to server
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200603 ${uprate}= Run Keyword If ${limiting_bw_value_upstream} != 1000000
604 ... Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200605 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200606 ... Set Variable ${limiting_bw_value_upstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000607 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700608 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000609 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
610 ${actual_upstream_bw_used}= Evaluate
611 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
612
613 # Stream UDP packets from server to RG
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200614 ${dnrate}= Run Keyword If ${limiting_bw_value_dnstream} != 1000000
615 ... Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200616 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200617 ... Set Variable ${limiting_bw_value_dnstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000618 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700619 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000620 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
621 ${actual_dnstream_bw_used}= Evaluate
622 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
623
624 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
625 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
626 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
627 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
628
629 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
630 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700631 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
632 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
633 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000634 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
635 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
636 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
637 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
638 END
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800639
Suraj Gour33651272020-05-04 10:10:16 +0530640Validate parsing of data traffic through voltha using tech profile
641 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
642 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
643 ... Install jq tool to read json file, where test suite is being running
Girish Gowdrabbfbbc32021-05-17 14:36:58 -0700644 ... This test sends TCP packets with pbits between 0 and 7 and validates that
Suraj Gour33651272020-05-04 10:10:16 +0530645 ... the pbits are preserved by the PON.
Hardik Windlass04d791e2021-07-12 16:23:13 +0000646 [Tags] dataplane TechProfile VOL-2054 notready
Suraj Gour33651272020-05-04 10:10:16 +0530647 [Setup] Start Logging TechProfile
648 [Teardown] Run Keywords Collect Logs
649 ... AND Stop Logging TechProfile
650 Pass Execution If '${has_dataplane}'=='False'
651 ... Skipping test: Technology profile validation can be done only in physical pod
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800652 FOR ${I} IN RANGE 0 ${num_all_onus}
Suraj Gour33651272020-05-04 10:10:16 +0530653 ${src}= Set Variable ${hosts.src[${I}]}
654 ${dst}= Set Variable ${hosts.dst[${I}]}
655
656 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
657 ${bng_user}= Get Variable Value ${dst['noroot_user']}
658 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
Andy Bavierf4b7d1d2020-06-30 11:14:04 -0700659 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
Suraj Gour33651272020-05-04 10:10:16 +0530660 ... Skipping test: credentials for BNG login required in deployment config
661
662 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
663 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
664 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
665 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
666 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
667 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
668 Log Upstream test
Andy Baviereff938d2020-06-29 18:27:49 -0700669 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Suraj Gour33651272020-05-04 10:10:16 +0530670 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src['dp_iface_name']}
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700671 ... 0 tcp 0 ${src['s_tag']} upstream vlan
Suraj Gour33651272020-05-04 10:10:16 +0530672 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
673 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
674 Log Downstream test
675 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
676 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
677 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
678 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
Andy Baviereff938d2020-06-29 18:27:49 -0700679 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700680 ... ${rg_ip} ${src['dp_iface_name']} ${dst['dp_iface_name']}
681 ... 0 tcp ${src['c_tag']} ${src['s_tag']} downstream tcp
Suraj Gour33651272020-05-04 10:10:16 +0530682 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
683 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
684 END
685
Hardik Windlass16cdf962020-04-29 15:26:50 +0530686Test Disable and Enable OLT PON Port
687 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
688 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
689 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
690 ... Perform enable on the OLT PON Port and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000691 [Tags] functional DisableEnableOltPonPort VOL-2577 multi-uni
Hardik Windlass16cdf962020-04-29 15:26:50 +0530692 [Setup] Run Keywords Start Logging DisableEnableOltPonPort
693 ... AND Setup
694 [Teardown] Run Keywords Collect Logs
Hardik Windlass41701e82021-01-12 17:44:44 +0000695 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700696 ... AND Run Keyword If ${logging} Collect Logs
697 ... AND Stop Logging DisableEnableOltPonPort
Hardik Windlass16cdf962020-04-29 15:26:50 +0530698 Run Keyword If ${has_dataplane} Clean Up Linux
699 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Hardik Windlass41701e82021-01-12 17:44:44 +0000700 # Multi-OLTs
701 FOR ${I} IN RANGE 0 ${olt_count}
702 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
703 Disable Enable PON Port Per OLT ${olt_serial_number}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530704 END
705
Gayathri.Selvan5d23e522020-09-15 17:26:25 +0530706Data plane Bandwidth profile update verification
707 [Documentation] Test bandwidth profile is updated for one subscriber and not changed for other subscribers.
708 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
709 ... Assumes Default and User_Bandwidth2 profiles are configured as bandwidth profiles
710 [Tags] non-critical dataplane BandwidthProfileUpdateTCP VOL-2053
711 [Setup] Start Logging BandwidthProfileUpdateTCP
712 [Teardown] Run Keywords Collect Logs
713 ... AND Stop Logging BandwidthProfileUpdateTCP
714 ... AND Send File To Onos ${CURDIR}/../../tests/data/${POD_NAME}-sadis.json
715 Pass Execution If '${has_dataplane}'=='False'
716 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
717 Delete All Devices And Verify
718 Run Keyword If ${has_dataplane} Clean Up Linux
719 Setup
720 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
721 # Update the Bandwidth Profile for the First Subscriber under test
722 ${src}= Set Variable ${hosts.src[${0}]}
723 ${dst}= Set Variable ${hosts.dst[${0}]}
724 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000725 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Gayathri.Selvan5d23e522020-09-15 17:26:25 +0530726 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
727 ... ${of_id} ${src['uni_id']}
728 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
729 ${oldBwName} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
730 # Delete the existing subscriber
731 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
732 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
733 # Change the bandwidth profile and load the configuration
Hardik Windlassaa41bb42021-07-23 15:32:43 +0000734 ${newBwName} Set Variable If ${oldBwName} == 'Default' 'User_Bandwidth2' 'Default'
Gayathri.Selvan5d23e522020-09-15 17:26:25 +0530735 ${cmd} Catenate
736 ... sed 's/upstreamBandwidthProfile": "${oldBwName}"/upstreamBandwidthProfile": "${newBwName}"/g'
737 ... ${CURDIR}/../../tests/data/${POD_NAME}-sadis.json > ${CURDIR}/../../tests/data/${POD_NAME}-sadis-new.json
738 ${rc} Run and Return RC ${cmd}
739 Send File To Onos ${CURDIR}/../../tests/data/${POD_NAME}-sadis-new.json
740 # Re-add the subscriber with new bandwidth profile
741 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
742 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
743 # Verify that no pending flows exist for the ONU port
744 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
745 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
746 # Verify subscriber access flows are added for the ONU port
747 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
748 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
749 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
750 # Verify Meters in ONOS
751 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
752 ... Verify Meters in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
753 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
754 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
755 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
756 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
757 ... ${dst['container_name']}
758 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
759 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
760 # Verify new bandwidth profile is applied and other subscribers are working fine
761 ${checkBwName} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
762 Should Be Equal ${checkBwName} ${newBwName} The bandwidth profile is not updated properly
763 FOR ${I} IN RANGE 0 ${num_all_onus}
764 ${src}= Set Variable ${hosts.src[${I}]}
765 ${dst}= Set Variable ${hosts.dst[${I}]}
766 ${of_id}= Get ofID From OLT List ${src['olt']}
767
768 # Check for iperf3 and jq tools
769 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
770 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
771 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
772
773 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
774 ... ${of_id} ${src['uni_id']}
775 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
776 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
777 ... upstreamBandwidthProfile
778 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
779 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
780 ... downstreamBandwidthProfile
781 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
782
783 # Stream TCP packets from RG to server
784 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
785 ... args=-t 30
786 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
787
788 # Stream TCP packets from server to RG
789 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
790 ... args=-R -t 30
791 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
792
793 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
794 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
795 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
796 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
797
798 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
799 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
800 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
801 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
802 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
803 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
804 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
805 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
806 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
807 END
808
Hardik Windlassb75cf1b2021-01-18 06:59:09 +0000809Test ONU Delete and Auto-Discovery
810 [Documentation] Tests the voltctl delete and Auto-Discovery of the ONU
811 [Tags] functional VOL-3098 ONUAutoDiscovery notready
812 [Setup] Run Keywords Start Logging ONUAutoDiscovery
813 ... AND Setup
814 [Teardown] Run Keywords Collect Logs
815 ... AND Delete All Devices and Verify
816 ... AND Run Keyword If ${logging} Collect Logs
817 ... AND Stop Logging ONUAutoDiscovery
818 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
819 Run Keyword If ${has_dataplane} Clean Up Linux
820 Perform Sanity Test
821 FOR ${I} IN RANGE 0 ${num_all_onus}
822 ${src}= Set Variable ${hosts.src[${I}]}
823 ${dst}= Set Variable ${hosts.dst[${I}]}
824 ${onu_device_id}= Get Device ID From SN ${src['onu']}
825 ${of_id}= Get ofID From OLT List ${src['olt']}
826 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
827 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
828 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
829 # Remove Subscriber Access (To replicate ATT workflow)
830 Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
831 ... volt-remove-subscriber-access ${of_id} ${onu_port}
832 # Additional sleep to let subscriber delete process
833 Sleep 10s
834 # Delete ONU and Verify Ping Fails
835 Delete Device ${onu_device_id}
836 Run Keyword If ${has_dataplane} Verify ping is successful except for given device
837 ... ${num_all_onus} ${src['onu']}
838 # Verify that no pending flows exist for the ONU port
839 Wait Until Keyword Succeeds ${timeout} 2s
840 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
841 # ONU Auto-Discovery
842 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
843 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
844 # Check ONU port is Enabled in ONOS
845 Wait Until Keyword Succeeds ${timeout} 2s
846 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
847 ${onu_device_id}= Get Device ID From SN ${src['onu']}
848 Run Keyword If ${has_dataplane} Clean Up Linux ${onu_device_id}
849 # Verify default EAPOL flows are added for the ONU port
850 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
851 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
852 # Verify ONU state in voltha
853 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
854 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
855 # Perform Authentication
856 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
857 ... /tmp/wpa ${src['dp_iface_name']} log
858 Run Keyword If ${has_dataplane} Validate Authentication True
859 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
860 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
861 Wait Until Keyword Succeeds ${timeout} 2
862 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
863 Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
864 ... volt-add-subscriber-access ${of_id} ${onu_port}
865 # Verify that no pending flows exist for the ONU port
866 Wait Until Keyword Succeeds ${timeout} 2s
867 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
868 # Verify subscriber access flows are added for the ONU port
869 Wait Until Keyword Succeeds ${timeout} 5s
870 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
871 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
872 # Verify subscriber EAPOL flow is installed
873 Wait Until Keyword Succeeds ${timeout} 5s
874 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
875 ... ${onu_port} ${src['c_tag']}
876 # Verify Meters in ONOS
877 Wait Until Keyword Succeeds ${timeout} 5s
878 ... Verify Meters in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
879 Run Keyword If ${has_dataplane} Validate DHCP and Ping True
880 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
881 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
882 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
883 ... ${dst['container_name']}
884 Wait Until Keyword Succeeds ${timeout} 2s
885 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
886 END
887
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700888*** Keywords ***
889Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700890 [Documentation] Set up the test suite
891 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700892 #Restore all ONUs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800893 #Run Keyword If ${has_dataplane} RestoreONUs ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700894 #power_switch.robot needs it to support different vendor's power switch
895 ${switch_type}= Get Variable Value ${web_power_switch.type}
896 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700897
David Bainbridgef81cd642019-11-20 00:14:47 +0000898Clear All Devices Then Create New Device
899 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000900 # Remove all devices from voltha and nos
901 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000902 # Execute normal test Setup Keyword
903 Setup