blob: f57406c005b8f30c73aa783c90ca2b6f6cc0bbb8 [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
Hardik Windlassc4d1fd62022-04-12 13:12:28 +000057# flag to reboot OLT through Power Switch
58${power_cycle_olt} False
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070059
Gayathri.Selvan92d16862020-03-19 14:47:58 +000060# For dataplane bandwidth testing
61${upper_margin_pct} 105 # Allow 5% over the limit
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080062${lower_margin_pct} 90 # Allow 8% under the limit
Gayathri.Selvan92d16862020-03-19 14:47:58 +000063${udp_rate_multiplier} 1.10 # Send UDP at bw profile limit * rate_multiplier
Andy Bavierc80a2742020-08-28 10:59:05 -070064${udp_packet_bytes} 1470 # UDP payload in bytes
Gayathri.Selvan92d16862020-03-19 14:47:58 +000065
Andy Bavierabeba262020-02-07 16:22:16 -070066# Per-test logging on failure is turned off by default; set this variable to enable
67${container_log_dir} ${None}
68
Matteo Scandoloda1c64b2021-07-20 10:14:49 -070069# logging flag to enable Collect Logs, can be passed via the command line too
70# example: -v logging:False
71${logging} True
72
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070073*** Test Cases ***
Hardik Windlassc4d1fd62022-04-12 13:12:28 +000074Reboot ONUs and OLTs Physically
75 [Documentation] This test reboots ONUs and OLTs physically before execution all the tests
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070076 ... Test case runs only on the PODs that are configured with PowerSwitch that
77 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
Hardik Windlassc4d1fd62022-04-12 13:12:28 +000078 [Tags] functional PowerSwitch RebootAllONUsOLTs
79 [Setup] Start Logging RebootAllONUsOLTs
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070080 [Teardown] Run Keywords Collect Logs
Hardik Windlassc4d1fd62022-04-12 13:12:28 +000081 ... AND Stop Logging RebootAllONUsOLTs
82 Perform Reboot ONUs and OLTs Physically ${power_cycle_olt}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070083
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070084Sanity E2E Test for OLT/ONU on POD
85 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
86 ... Validate successful authentication/DHCP/E2E ping for the tech profile that is used
Andy Bavierba9866b2019-10-11 07:11:53 -070087 [Tags] sanity test1
Andy Baviere187eda2020-04-20 15:00:02 -070088 [Setup] Run Keywords Start Logging SanityTest
Andy Bavier4a8450e2020-02-04 08:58:37 -070089 ... AND Setup
90 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -070091 ... AND Stop Logging SanityTest
Suchitra Vemuric5295a32019-12-15 20:32:04 -080092 Run Keyword If ${has_dataplane} Clean Up Linux
Zack Williamsa8fe75a2020-01-10 14:25:27 -070093 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070094
Suchitra Vemuri6db89412019-11-14 14:52:54 -080095Test Disable and Enable ONU
96 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
97 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
98 ... Perform disable on the ONUs and validate that the pings do not succeed
99 ... Perform enable on the ONUs and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000100 [Tags] functional DisableEnableONU released multi-uni
Girish Gowdra8fd96962021-12-14 16:20:04 +0530101 [Setup] Run Keywords Start Logging DisableEnableONU
102 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
Andy Bavier4a8450e2020-02-04 08:58:37 -0700103 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700104 ... AND Stop Logging DisableEnableONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800105 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800106 ${src}= Set Variable ${hosts.src[${I}]}
107 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800108 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000109 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800110 ${onu_device_id}= Get Device ID From SN ${src['onu']}
111 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000112 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800113 Disable Device ${onu_device_id}
Andy Bavier46c8be32020-01-21 10:06:27 -0700114 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700115 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
116 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700117 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
118 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800119 Enable Device ${onu_device_id}
Girish Gowdrafc0bdf22021-12-06 16:57:50 +0530120 Wait Until Keyword Succeeds ${timeout} 5s
121 ... Validate Device ENABLED ACTIVE
122 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
123 # Workaround for issue seen in VOL-4489. Keep this workaround until VOL-4489 is fixed.
124 Run Keyword If ${has_dataplane} Reboot XGSPON ONU ${src['olt']} ${src['onu']} omci-flows-pushed
125 # Workaround ends here for issue seen in VOL-4489.
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800126 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800127 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530128 # Verify subscriber access flows are added for the ONU port
129 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
130 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
131 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700132 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
133 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700134 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
135 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800136 END
137
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800138Test Subscriber Delete and Add
139 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
140 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700141 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800142 ... Re-add the subscriber and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000143 [Tags] functional SubAddDelete released multi-uni
Girish Gowdrafbdddc12021-12-17 15:39:55 +0530144 [Setup] Run Keywords Start Logging SubAddDelete
145 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
Andy Bavier4a8450e2020-02-04 08:58:37 -0700146 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700147 ... AND Stop Logging SubAddDelete
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800148 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800149 ${src}= Set Variable ${hosts.src[${I}]}
150 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800151 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000152 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800153 ${onu_device_id}= Get Device ID From SN ${src['onu']}
154 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000155 ... ${of_id} ${src['uni_id']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000156 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800157 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800158 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
159 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700160 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
161 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700162 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
163 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000164 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800165 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800166 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800167 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
168 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800169 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530170 # Verify subscriber access flows are added for the ONU port
171 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
172 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
173 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700174 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
175 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700176 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
177 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800178 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800179
suraj gourd5cfdbb2019-12-13 12:44:55 +0000180Check DHCP attempt fails when subscriber is not added
181 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
182 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700183 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000184 [Tags] functional SubsRemoveDHCP released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700185 [Setup] Start Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700186 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700187 ... AND Stop Logging SubsRemoveDHCP
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800188 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000189 ${src}= Set Variable ${hosts.src[${I}]}
190 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800191 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000192 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700193 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000194 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000195 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800196 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']}
197 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
198 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
199 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000200 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000201 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri8f1d3062020-02-28 11:57:37 -0800202 Sleep 15s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800203 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
204 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700205 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
206 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
207 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
208 Run Keyword And Ignore Error Login And Run Command On Remote System
209 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800210 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000211 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
212 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
213 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
214 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
215 ... ${dst['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000216 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000217 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800218 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
219 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530220 # Verify subscriber access flows are added for the ONU port
221 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
222 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
223 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000224 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
225 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
226 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
227 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
228 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800229 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800230
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800231Test Disable and Enable ONU scenario for ATT workflow
232 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
233 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
234 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700235 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
236 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800237 ... VOL-2284
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000238 [Tags] functional ATT_DisableEnableONU released multi-uni
Girish Gowdra8fd96962021-12-14 16:20:04 +0530239 [Setup] Run Keywords Start Logging ATT_DisableEnableONU
240 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
Andy Bavier4a8450e2020-02-04 08:58:37 -0700241 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700242 ... AND Stop Logging ATT_DisableEnableONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800243 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800244 ${src}= Set Variable ${hosts.src[${I}]}
245 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800246 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000247 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800248 ${onu_device_id}= Get Device ID From SN ${src['onu']}
249 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000250 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800251 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000252 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800253 Disable Device ${onu_device_id}
Hardik Windlass5e214b22021-02-26 10:37:14 +0000254 Wait Until Keyword Succeeds ${timeout} 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000255 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800256 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700257 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
258 ... Wait Until Keyword Succeeds 60s 2s Check Ping
259 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
260 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass5e214b22021-02-26 10:37:14 +0000261 ... ELSE Sleep 10s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800262 Enable Device ${onu_device_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800263 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700264 ... ${ONOS_SSH_PORT} ${of_id} ${onu_port}
Girish Gowdrafc0bdf22021-12-06 16:57:50 +0530265 # Workaround for issue seen in VOL-4489. Keep this workaround until VOL-4489 is fixed.
266 Run Keyword If ${has_dataplane} Reboot XGSPON ONU ${src['olt']} ${src['onu']} omci-flows-pushed
267 # Workaround ends here for issue seen in VOL-4489.
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700268 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
269 ... Validate Authentication After Reassociate True
270 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800271 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800272 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700273 ... ${ONOS_SSH_PORT} ${onu_port}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000274 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800275 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530276 # Verify subscriber access flows are added for the ONU port
277 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
278 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
279 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800280 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700281 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800282 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
283 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
284 ... ${dst['container_name']}
285 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800286 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000287 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000288
Hardik Windlass2b37e712020-06-12 02:13:17 +0530289Test Disable and Enable OLT
290 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
291 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
292 ... Perform disable on the OLT and validate that the pings do not succeed
293 ... Perform enable on the OLT and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000294 [Tags] functional VOL-2410 DisableEnableOLT multi-uni
Hardik Windlass2b37e712020-06-12 02:13:17 +0530295 [Setup] Start Logging DisableEnableOLT
296 [Teardown] Run Keywords Collect Logs
297 ... AND Stop Logging DisableEnableOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800298 #Disable the OLTs and verify the OLT/ONUs are disabled properly
299 FOR ${I} IN RANGE 0 ${olt_count}
300 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
301 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
302 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800303 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800304 Should Be Equal As Integers ${rc} 0
305 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
306 ... ${olt_serial_number}
307 END
308 # Validate the ONUs
309 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530310 ${src}= Set Variable ${hosts.src[${I}]}
311 ${dst}= Set Variable ${hosts.dst[${I}]}
312 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800313 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530314 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000315 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530316 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED DISCOVERED
317 ... UNREACHABLE ${src['onu']} onu=false
318 #Verify that ping fails
319 Run Keyword If ${has_dataplane}
320 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
321 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
322 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
323 # Remove Subscriber Access (To replicate ATT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000324 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530325 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530326 END
327 #Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800328 FOR ${I} IN RANGE 0 ${olt_count}
329 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
330 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
331 Enable Device ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800332 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
333 ... ${olt_serial_number}
334 #TODO: Update for PON_OLT ETHERNET_NNI
335 #Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
336 #... PON_OLT ETHERNET_NNI
337 END
Hardik Windlass2b37e712020-06-12 02:13:17 +0530338 Run Keyword If ${has_dataplane} Clean Up Linux
339 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test
340
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800341Delete OLT, ReAdd OLT and Perform Sanity Test
342 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
343 ... Disable and Delete the OLT
344 ... Create/Enable the same OLT again
345 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800346 [Tags] functional DeleteOLT released notready
Andy Baviere187eda2020-04-20 15:00:02 -0700347 [Setup] Start Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700348 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700349 ... AND Stop Logging DeleteOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800350 #TODO: Update test with new framework changes
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800351 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800352 FOR ${I} IN RANGE 0 ${olt_count}
353 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
354 ${of_id}= Get ofID From OLT List ${olt_serial_number}
355 Delete Device and Verify ${olt_serial_number}
356 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
357 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
358 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800359 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800360 # Recreate the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530361 Setup
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800362 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800363
Hema567f3012020-03-25 00:51:53 +0530364Check Mib State on OLT recreation after ONU, OLT deletion
365 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable,
366 ... Disable and Delete the ONU, Disable and Delete the OLT
367 ... Create/Enable the OLT again and Check for the Mib State of the ONUs
368 [Tags] functional CheckMibState notready
Andy Baviere187eda2020-04-20 15:00:02 -0700369 [Setup] Start Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530370 [Teardown] Run Keywords Collect Logs
371 ... AND Stop Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530372 #Disable and Delete the ONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800373 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema567f3012020-03-25 00:51:53 +0530374 ${src}= Set Variable ${hosts.src[${I}]}
375 ${dst}= Set Variable ${hosts.dst[${I}]}
376 ${onu_device_id}= Get Device ID From SN ${src['onu']}
377 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000378 ... ${of_id} ${src['uni_id']}
Hema567f3012020-03-25 00:51:53 +0530379 Disable Device ${onu_device_id}
380 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
381 Delete Device ${onu_device_id}
382 END
383 #Disable and Delete the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530384 Delete Device and Verify
385 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
386 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
387 # Recreate the OLT
Hema567f3012020-03-25 00:51:53 +0530388 Run Keyword If ${has_dataplane} Sleep 180s
Andrea Campanella3dcce272021-01-15 16:04:47 +0100389 # This dneeds to be done in for loop, test is not ready
390 ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}"
Suchitra Vemuri09f878d2021-02-10 18:19:04 -0800391 ... Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport]
392 ... ELSE Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport] ${list_olts}[${I}][type]
Hema567f3012020-03-25 00:51:53 +0530393 Set Suite Variable ${olt_device_id}
394 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED
Hardik Windlass8b446492021-06-10 06:25:23 +0000395 ... UNKNOWN UNKNOWN ${olt_device_id} by_dev_id=True
Hema567f3012020-03-25 00:51:53 +0530396 Enable Device ${olt_device_id}
397 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
398 ... ${olt_serial_number}
399 #Check for the ONU status and ONU Mib State should be "omci-flows-pushed"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800400 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema567f3012020-03-25 00:51:53 +0530401 ${src}= Set Variable ${hosts.src[${I}]}
402 ${dst}= Set Variable ${hosts.dst[${I}]}
403 ${onu_device_id}= Get Device ID From SN ${src['onu']}
404 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000405 ... ${of_id} ${src['uni_id']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700406 Wait Until Keyword Succeeds 180s 5s Validate Device ENABLED ACTIVE
Hema567f3012020-03-25 00:51:53 +0530407 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
408 END
409
Hema783279b2020-01-22 15:37:37 +0530410Test disable ONUs and OLT then delete ONUs and OLT
411 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
412 ... This TC is to confirm that ONU removal is not impacting OLT
413 ... Devices will be removed during the execution of this TC
414 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800415 [Tags] functional VOL-2354 DisableDeleteONUandOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700416 [Setup] Start Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700417 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700418 ... AND Stop Logging DisableDeleteONUandOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800419 #${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Suchitra Vemuri02170552021-03-23 16:40:50 -0700420 @{onu_reason}= Create List tech-profile-config-downloaded-success omci-flows-pushed
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800421 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema783279b2020-01-22 15:37:37 +0530422 ${src}= Set Variable ${hosts.src[${I}]}
423 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800424 ${of_id}= Get ofID From OLT List ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530425 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700426 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800427 ... Validate Device ENABLED ACTIVE
Suchitra Vemuri02170552021-03-23 16:40:50 -0700428 ... REACHABLE ${src['onu']} onu=True onu_reason=${onu_reason}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800429 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
430 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800431 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530432 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800433 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${onu_device_id}
Hema783279b2020-01-22 15:37:37 +0530434 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800435 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
436 ... Validate Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530437 ... REACHABLE ${src['onu']} onu=false
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700438 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800439 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800440 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530441 END
Matteo Scandolo5899be12020-11-11 15:38:07 -0800442
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800443 # Disable all OLTs
444 FOR ${I} IN RANGE 0 ${olt_count}
445 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
446 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
447 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800448 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800449 Should Be Equal As Integers ${rc} 0
450 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
451 ... ${olt_serial_number}
452 END
453 # Validate ONUs after OLT disable
454 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema783279b2020-01-22 15:37:37 +0530455 ${src}= Set Variable ${hosts.src[${I}]}
456 ${dst}= Set Variable ${hosts.dst[${I}]}
457 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800458 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
459 ... Validate Device DISABLED DISCOVERED
460 ... UNREACHABLE ${src['onu']} onu=false
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530461 Delete Device ${onu_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800462 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
463 ... Validate OLT Device DISABLED UNKNOWN
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800464 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530465 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800466 # Delete all OLTs
467 Delete All Devices and Verify
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000468 # Re-create the Devices and Perform Sanity
469 Setup
470 Run Keyword If ${has_dataplane} Clean Up Linux
471 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
David Bainbridgef81cd642019-11-20 00:14:47 +0000472
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800473Validate authentication on a disabled ONU
suraj gour472da1c2020-02-25 05:44:51 +0000474 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
475 ... Perform disable on the ONUs and validate that the authentication do not succeed
476 ... Perform enable on the ONUs and validate that authentication successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000477 [Tags] functional DisableONU_AuthCheck multi-uni
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800478 # Creates Devices in the Setup
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000479 [Setup] Start Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800480 [Teardown] Run Keywords Collect Logs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800481 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700482 ... AND Run Keyword If ${logging} Collect Logs
483 ... AND Stop Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800484 Clean WPA Process
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800485 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gour472da1c2020-02-25 05:44:51 +0000486 ${src}= Set Variable ${hosts.src[${I}]}
487 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800488 ${of_id}= Get ofID From OLT List ${src['olt']}
suraj gour472da1c2020-02-25 05:44:51 +0000489 ${onu_device_id}= Get Device ID From SN ${src['onu']}
490 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000491 ... ${of_id} ${src['uni_id']}
suraj gour472da1c2020-02-25 05:44:51 +0000492 Disable Device ${onu_device_id}
493 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
494 ... REACHABLE ${src['onu']} onu=false
Andy Bavier84834d42020-02-25 13:49:50 -0700495 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
496 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800497 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication False
498 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700499 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800500 Enable Device ${onu_device_id}
501 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
502 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800503 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
504 ... ENABLED ACTIVE REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
505 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
506 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700507 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
suraj gour472da1c2020-02-25 05:44:51 +0000508 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
509 END
suraj gour472da1c2020-02-25 05:44:51 +0000510
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000511Data plane verification using TCP
512 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
513 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200514 [Tags] non-critical dataplane BandwidthProfileTCP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700515 [Setup] Start Logging BandwidthProfileTCP
516 [Teardown] Run Keywords Collect Logs
517 ... AND Stop Logging BandwidthProfileTCP
Andy Baviereff938d2020-06-29 18:27:49 -0700518 Pass Execution If '${has_dataplane}'=='False'
519 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800520 Delete All Devices And Verify
521 Run Keyword If ${has_dataplane} Clean Up Linux
522 setup
523 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
524
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800525 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000526 ${src}= Set Variable ${hosts.src[${I}]}
527 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800528 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700529
530 # Check for iperf3 and jq tools
531 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
532 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
533 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
534
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000535 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000536 ... ${of_id} ${src['uni_id']}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000537 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
538 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
539 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700540 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000541 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
542 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700543 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000544
545 # Stream TCP packets from RG to server
546 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
547 ... args=-t 30
548 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
549
550 # Stream TCP packets from server to RG
551 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
552 ... args=-R -t 30
553 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
554
555 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
556 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
557 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
558 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
559
560 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
561 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700562 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
563 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
564 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000565 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
566 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
567 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
568 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
569 END
570
571Data plane verification using UDP
572 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
573 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200574 [Tags] non-critical dataplane BandwidthProfileUDP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700575 [Setup] Start Logging BandwidthProfileUDP
576 [Teardown] Run Keywords Collect Logs
577 ... AND Stop Logging BandwidthProfileUDP
Andy Baviereff938d2020-06-29 18:27:49 -0700578 Pass Execution If '${has_dataplane}'=='False'
579 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800580 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000581 ${src}= Set Variable ${hosts.src[${I}]}
582 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800583 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierd59f9772020-07-01 12:00:42 -0700584
585 # Check for iperf3 and jq tools
586 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
587 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
588 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
589
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000590 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000591 ... ${of_id} ${src['uni_id']}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000592 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
593 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
594 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700595 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000596 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
597 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700598 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000599
600 # Stream UDP packets from RG to server
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200601 ${uprate}= Run Keyword If ${limiting_bw_value_upstream} != 1000000
602 ... Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200603 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200604 ... Set Variable ${limiting_bw_value_upstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000605 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700606 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000607 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
608 ${actual_upstream_bw_used}= Evaluate
609 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
610
611 # Stream UDP packets from server to RG
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200612 ${dnrate}= Run Keyword If ${limiting_bw_value_dnstream} != 1000000
613 ... Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200614 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200615 ... Set Variable ${limiting_bw_value_dnstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000616 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700617 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000618 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
619 ${actual_dnstream_bw_used}= Evaluate
620 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
621
622 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
623 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
624 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
625 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
626
627 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
628 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700629 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
630 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
631 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000632 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
633 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
634 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
635 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
636 END
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800637
Suraj Gour33651272020-05-04 10:10:16 +0530638Validate parsing of data traffic through voltha using tech profile
639 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
640 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
641 ... Install jq tool to read json file, where test suite is being running
Girish Gowdrabbfbbc32021-05-17 14:36:58 -0700642 ... This test sends TCP packets with pbits between 0 and 7 and validates that
Suraj Gour33651272020-05-04 10:10:16 +0530643 ... the pbits are preserved by the PON.
Hardik Windlass04d791e2021-07-12 16:23:13 +0000644 [Tags] dataplane TechProfile VOL-2054 notready
Suraj Gour33651272020-05-04 10:10:16 +0530645 [Setup] Start Logging TechProfile
646 [Teardown] Run Keywords Collect Logs
647 ... AND Stop Logging TechProfile
648 Pass Execution If '${has_dataplane}'=='False'
649 ... Skipping test: Technology profile validation can be done only in physical pod
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800650 FOR ${I} IN RANGE 0 ${num_all_onus}
Suraj Gour33651272020-05-04 10:10:16 +0530651 ${src}= Set Variable ${hosts.src[${I}]}
652 ${dst}= Set Variable ${hosts.dst[${I}]}
653
654 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
655 ${bng_user}= Get Variable Value ${dst['noroot_user']}
656 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
Andy Bavierf4b7d1d2020-06-30 11:14:04 -0700657 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
Suraj Gour33651272020-05-04 10:10:16 +0530658 ... Skipping test: credentials for BNG login required in deployment config
659
660 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
661 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
662 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
663 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
664 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
665 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
666 Log Upstream test
Andy Baviereff938d2020-06-29 18:27:49 -0700667 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Suraj Gour33651272020-05-04 10:10:16 +0530668 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src['dp_iface_name']}
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700669 ... 0 tcp 0 ${src['s_tag']} upstream vlan
Suraj Gour33651272020-05-04 10:10:16 +0530670 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
671 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
672 Log Downstream test
673 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
674 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
675 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
676 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
Andy Baviereff938d2020-06-29 18:27:49 -0700677 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700678 ... ${rg_ip} ${src['dp_iface_name']} ${dst['dp_iface_name']}
679 ... 0 tcp ${src['c_tag']} ${src['s_tag']} downstream tcp
Suraj Gour33651272020-05-04 10:10:16 +0530680 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
681 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
682 END
683
Hardik Windlass16cdf962020-04-29 15:26:50 +0530684Test Disable and Enable OLT PON Port
685 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
686 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
687 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
688 ... Perform enable on the OLT PON Port and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000689 [Tags] functional DisableEnableOltPonPort VOL-2577 multi-uni
Hardik Windlass16cdf962020-04-29 15:26:50 +0530690 [Setup] Run Keywords Start Logging DisableEnableOltPonPort
Girish Gowdra8fd96962021-12-14 16:20:04 +0530691 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
Hardik Windlass16cdf962020-04-29 15:26:50 +0530692 ... AND Setup
693 [Teardown] Run Keywords Collect Logs
Hardik Windlass41701e82021-01-12 17:44:44 +0000694 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700695 ... AND Run Keyword If ${logging} Collect Logs
696 ... AND Stop Logging DisableEnableOltPonPort
Hardik Windlass16cdf962020-04-29 15:26:50 +0530697 Run Keyword If ${has_dataplane} Clean Up Linux
698 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Hardik Windlass41701e82021-01-12 17:44:44 +0000699 # Multi-OLTs
700 FOR ${I} IN RANGE 0 ${olt_count}
701 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
702 Disable Enable PON Port Per OLT ${olt_serial_number}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530703 END
704
Gayathri.Selvan5d23e522020-09-15 17:26:25 +0530705Data plane Bandwidth profile update verification
706 [Documentation] Test bandwidth profile is updated for one subscriber and not changed for other subscribers.
707 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
708 ... Assumes Default and User_Bandwidth2 profiles are configured as bandwidth profiles
709 [Tags] non-critical dataplane BandwidthProfileUpdateTCP VOL-2053
710 [Setup] Start Logging BandwidthProfileUpdateTCP
711 [Teardown] Run Keywords Collect Logs
712 ... AND Stop Logging BandwidthProfileUpdateTCP
713 ... AND Send File To Onos ${CURDIR}/../../tests/data/${POD_NAME}-sadis.json
714 Pass Execution If '${has_dataplane}'=='False'
715 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
716 Delete All Devices And Verify
717 Run Keyword If ${has_dataplane} Clean Up Linux
718 Setup
719 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
720 # Update the Bandwidth Profile for the First Subscriber under test
721 ${src}= Set Variable ${hosts.src[${0}]}
722 ${dst}= Set Variable ${hosts.dst[${0}]}
723 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000724 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Gayathri.Selvan5d23e522020-09-15 17:26:25 +0530725 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
726 ... ${of_id} ${src['uni_id']}
727 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
728 ${oldBwName} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
729 # Delete the existing subscriber
730 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
731 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
732 # Change the bandwidth profile and load the configuration
Hardik Windlassaa41bb42021-07-23 15:32:43 +0000733 ${newBwName} Set Variable If ${oldBwName} == 'Default' 'User_Bandwidth2' 'Default'
Gayathri.Selvan5d23e522020-09-15 17:26:25 +0530734 ${cmd} Catenate
735 ... sed 's/upstreamBandwidthProfile": "${oldBwName}"/upstreamBandwidthProfile": "${newBwName}"/g'
736 ... ${CURDIR}/../../tests/data/${POD_NAME}-sadis.json > ${CURDIR}/../../tests/data/${POD_NAME}-sadis-new.json
737 ${rc} Run and Return RC ${cmd}
738 Send File To Onos ${CURDIR}/../../tests/data/${POD_NAME}-sadis-new.json
739 # Re-add the subscriber with new bandwidth profile
740 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
741 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
742 # Verify that no pending flows exist for the ONU port
743 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
744 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
745 # Verify subscriber access flows are added for the ONU port
746 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
747 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
748 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
749 # Verify Meters in ONOS
750 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
751 ... Verify Meters in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
752 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
753 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
754 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
755 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
756 ... ${dst['container_name']}
757 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
758 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
759 # Verify new bandwidth profile is applied and other subscribers are working fine
760 ${checkBwName} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
761 Should Be Equal ${checkBwName} ${newBwName} The bandwidth profile is not updated properly
762 FOR ${I} IN RANGE 0 ${num_all_onus}
763 ${src}= Set Variable ${hosts.src[${I}]}
764 ${dst}= Set Variable ${hosts.dst[${I}]}
765 ${of_id}= Get ofID From OLT List ${src['olt']}
766
767 # Check for iperf3 and jq tools
768 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
769 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
770 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
771
772 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
773 ... ${of_id} ${src['uni_id']}
774 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
775 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
776 ... upstreamBandwidthProfile
777 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
778 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
779 ... downstreamBandwidthProfile
780 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
781
782 # Stream TCP packets from RG to server
783 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
784 ... args=-t 30
785 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
786
787 # Stream TCP packets from server to RG
788 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
789 ... args=-R -t 30
790 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
791
792 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
793 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
794 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
795 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
796
797 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
798 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
799 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
800 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
801 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
802 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
803 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
804 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
805 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
806 END
807
Hardik Windlassb75cf1b2021-01-18 06:59:09 +0000808Test ONU Delete and Auto-Discovery
809 [Documentation] Tests the voltctl delete and Auto-Discovery of the ONU
Andrea Campanella92e21b02022-01-04 15:32:04 +0100810 [Tags] functional VOL-3098 ONUAutoDiscovery
Hardik Windlassb75cf1b2021-01-18 06:59:09 +0000811 [Setup] Run Keywords Start Logging ONUAutoDiscovery
812 ... AND Setup
813 [Teardown] Run Keywords Collect Logs
814 ... AND Delete All Devices and Verify
815 ... AND Run Keyword If ${logging} Collect Logs
816 ... AND Stop Logging ONUAutoDiscovery
817 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
818 Run Keyword If ${has_dataplane} Clean Up Linux
819 Perform Sanity Test
820 FOR ${I} IN RANGE 0 ${num_all_onus}
821 ${src}= Set Variable ${hosts.src[${I}]}
822 ${dst}= Set Variable ${hosts.dst[${I}]}
823 ${onu_device_id}= Get Device ID From SN ${src['onu']}
824 ${of_id}= Get ofID From OLT List ${src['olt']}
825 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
826 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
827 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
828 # Remove Subscriber Access (To replicate ATT workflow)
829 Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
830 ... volt-remove-subscriber-access ${of_id} ${onu_port}
831 # Additional sleep to let subscriber delete process
832 Sleep 10s
833 # Delete ONU and Verify Ping Fails
834 Delete Device ${onu_device_id}
835 Run Keyword If ${has_dataplane} Verify ping is successful except for given device
836 ... ${num_all_onus} ${src['onu']}
837 # Verify that no pending flows exist for the ONU port
838 Wait Until Keyword Succeeds ${timeout} 2s
839 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
840 # ONU Auto-Discovery
841 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
842 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
843 # Check ONU port is Enabled in ONOS
844 Wait Until Keyword Succeeds ${timeout} 2s
845 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
846 ${onu_device_id}= Get Device ID From SN ${src['onu']}
847 Run Keyword If ${has_dataplane} Clean Up Linux ${onu_device_id}
848 # Verify default EAPOL flows are added for the ONU port
849 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
850 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
851 # Verify ONU state in voltha
852 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
853 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
854 # Perform Authentication
855 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
856 ... /tmp/wpa ${src['dp_iface_name']} log
857 Run Keyword If ${has_dataplane} Validate Authentication True
858 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
859 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
860 Wait Until Keyword Succeeds ${timeout} 2
861 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
862 Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
863 ... volt-add-subscriber-access ${of_id} ${onu_port}
864 # Verify that no pending flows exist for the ONU port
865 Wait Until Keyword Succeeds ${timeout} 2s
866 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
867 # Verify subscriber access flows are added for the ONU port
868 Wait Until Keyword Succeeds ${timeout} 5s
869 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
870 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
871 # Verify subscriber EAPOL flow is installed
872 Wait Until Keyword Succeeds ${timeout} 5s
873 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
874 ... ${onu_port} ${src['c_tag']}
875 # Verify Meters in ONOS
876 Wait Until Keyword Succeeds ${timeout} 5s
877 ... Verify Meters in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
878 Run Keyword If ${has_dataplane} Validate DHCP and Ping True
879 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
880 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
881 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
882 ... ${dst['container_name']}
883 Wait Until Keyword Succeeds ${timeout} 2s
884 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
885 END
886
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700887*** Keywords ***
888Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700889 [Documentation] Set up the test suite
890 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700891 #Restore all ONUs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800892 #Run Keyword If ${has_dataplane} RestoreONUs ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700893 #power_switch.robot needs it to support different vendor's power switch
894 ${switch_type}= Get Variable Value ${web_power_switch.type}
895 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700896
David Bainbridgef81cd642019-11-20 00:14:47 +0000897Clear All Devices Then Create New Device
898 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000899 # Remove all devices from voltha and nos
900 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000901 # Execute normal test Setup Keyword
902 Setup