blob: ff1a4e5ea6934716fd567a17905e8c82aa5dfc5b [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
Girish Gowdra8fd96962021-12-14 16:20:04 +0530106 [Setup] Run Keywords Start Logging DisableEnableONU
107 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
Andy Bavier4a8450e2020-02-04 08:58:37 -0700108 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700109 ... AND Stop Logging DisableEnableONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800110 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800111 ${src}= Set Variable ${hosts.src[${I}]}
112 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800113 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000114 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800115 ${onu_device_id}= Get Device ID From SN ${src['onu']}
116 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000117 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800118 Disable Device ${onu_device_id}
Andy Bavier46c8be32020-01-21 10:06:27 -0700119 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700120 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
121 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700122 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
123 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800124 Enable Device ${onu_device_id}
Girish Gowdrafc0bdf22021-12-06 16:57:50 +0530125 Wait Until Keyword Succeeds ${timeout} 5s
126 ... Validate Device ENABLED ACTIVE
127 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
128 # Workaround for issue seen in VOL-4489. Keep this workaround until VOL-4489 is fixed.
129 Run Keyword If ${has_dataplane} Reboot XGSPON ONU ${src['olt']} ${src['onu']} omci-flows-pushed
130 # Workaround ends here for issue seen in VOL-4489.
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800131 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800132 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530133 # Verify subscriber access flows are added for the ONU port
134 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
135 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
136 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700137 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
138 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700139 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
140 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800141 END
142
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800143Test Subscriber Delete and Add
144 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
145 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700146 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800147 ... Re-add the subscriber and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000148 [Tags] functional SubAddDelete released multi-uni
Girish Gowdrafbdddc12021-12-17 15:39:55 +0530149 [Setup] Run Keywords Start Logging SubAddDelete
150 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
Andy Bavier4a8450e2020-02-04 08:58:37 -0700151 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700152 ... AND Stop Logging SubAddDelete
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800153 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800154 ${src}= Set Variable ${hosts.src[${I}]}
155 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800156 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000157 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800158 ${onu_device_id}= Get Device ID From SN ${src['onu']}
159 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000160 ... ${of_id} ${src['uni_id']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000161 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800162 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800163 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
164 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700165 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
166 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700167 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
168 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000169 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800170 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800171 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800172 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
173 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800174 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530175 # Verify subscriber access flows are added for the ONU port
176 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
177 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
178 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700179 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
180 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700181 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
182 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800183 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800184
suraj gourd5cfdbb2019-12-13 12:44:55 +0000185Check DHCP attempt fails when subscriber is not added
186 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
187 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700188 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000189 [Tags] functional SubsRemoveDHCP released multi-uni
Andy Baviere187eda2020-04-20 15:00:02 -0700190 [Setup] Start Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700191 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700192 ... AND Stop Logging SubsRemoveDHCP
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800193 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000194 ${src}= Set Variable ${hosts.src[${I}]}
195 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800196 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000197 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700198 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000199 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000200 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800201 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']}
202 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
203 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']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000205 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000206 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri8f1d3062020-02-28 11:57:37 -0800207 Sleep 15s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800208 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
209 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700210 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
211 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
212 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
213 Run Keyword And Ignore Error Login And Run Command On Remote System
214 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800215 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000216 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
217 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
218 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
219 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
220 ... ${dst['container_name']}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000221 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000222 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800223 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
224 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530225 # Verify subscriber access flows are added for the ONU port
226 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
227 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
228 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000229 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
230 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
231 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
232 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
233 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800234 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800235
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800236Test Disable and Enable ONU scenario for ATT workflow
237 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
238 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
239 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700240 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
241 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800242 ... VOL-2284
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000243 [Tags] functional ATT_DisableEnableONU released multi-uni
Girish Gowdra8fd96962021-12-14 16:20:04 +0530244 [Setup] Run Keywords Start Logging ATT_DisableEnableONU
245 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
Andy Bavier4a8450e2020-02-04 08:58:37 -0700246 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700247 ... AND Stop Logging ATT_DisableEnableONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800248 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800249 ${src}= Set Variable ${hosts.src[${I}]}
250 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800251 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000252 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800253 ${onu_device_id}= Get Device ID From SN ${src['onu']}
254 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000255 ... ${of_id} ${src['uni_id']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800256 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Hardik Windlass39015672021-07-05 05:48:08 +0000257 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800258 Disable Device ${onu_device_id}
Hardik Windlass5e214b22021-02-26 10:37:14 +0000259 Wait Until Keyword Succeeds ${timeout} 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000260 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800261 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700262 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
263 ... Wait Until Keyword Succeeds 60s 2s Check Ping
264 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
265 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass5e214b22021-02-26 10:37:14 +0000266 ... ELSE Sleep 10s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800267 Enable Device ${onu_device_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800268 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Matteo Scandolo7e519fb2021-08-13 11:35:16 -0700269 ... ${ONOS_SSH_PORT} ${of_id} ${onu_port}
Girish Gowdrafc0bdf22021-12-06 16:57:50 +0530270 # Workaround for issue seen in VOL-4489. Keep this workaround until VOL-4489 is fixed.
271 Run Keyword If ${has_dataplane} Reboot XGSPON ONU ${src['olt']} ${src['onu']} omci-flows-pushed
272 # Workaround ends here for issue seen in VOL-4489.
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700273 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
274 ... Validate Authentication After Reassociate True
275 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800276 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800277 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700278 ... ${ONOS_SSH_PORT} ${onu_port}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000279 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800280 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530281 # Verify subscriber access flows are added for the ONU port
282 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
283 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
284 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800285 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700286 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800287 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
288 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
289 ... ${dst['container_name']}
290 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800291 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000292 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000293
Hardik Windlass2b37e712020-06-12 02:13:17 +0530294Test Disable and Enable OLT
295 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
296 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
297 ... Perform disable on the OLT and validate that the pings do not succeed
298 ... Perform enable on the OLT and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000299 [Tags] functional VOL-2410 DisableEnableOLT multi-uni
Hardik Windlass2b37e712020-06-12 02:13:17 +0530300 [Setup] Start Logging DisableEnableOLT
301 [Teardown] Run Keywords Collect Logs
302 ... AND Stop Logging DisableEnableOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800303 #Disable the OLTs and verify the OLT/ONUs are disabled properly
304 FOR ${I} IN RANGE 0 ${olt_count}
305 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
306 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
307 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800308 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800309 Should Be Equal As Integers ${rc} 0
310 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
311 ... ${olt_serial_number}
312 END
313 # Validate the ONUs
314 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530315 ${src}= Set Variable ${hosts.src[${I}]}
316 ${dst}= Set Variable ${hosts.dst[${I}]}
317 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800318 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530319 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000320 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530321 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED DISCOVERED
322 ... UNREACHABLE ${src['onu']} onu=false
323 #Verify that ping fails
324 Run Keyword If ${has_dataplane}
325 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
326 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
327 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
328 # Remove Subscriber Access (To replicate ATT workflow)
TorstenThieme4e2168e2021-06-22 14:01:47 +0000329 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530330 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530331 END
332 #Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800333 FOR ${I} IN RANGE 0 ${olt_count}
334 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
335 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
336 Enable Device ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800337 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
338 ... ${olt_serial_number}
339 #TODO: Update for PON_OLT ETHERNET_NNI
340 #Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
341 #... PON_OLT ETHERNET_NNI
342 END
Hardik Windlass2b37e712020-06-12 02:13:17 +0530343 Run Keyword If ${has_dataplane} Clean Up Linux
344 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test
345
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800346Delete OLT, ReAdd OLT and Perform Sanity Test
347 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
348 ... Disable and Delete the OLT
349 ... Create/Enable the same OLT again
350 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800351 [Tags] functional DeleteOLT released notready
Andy Baviere187eda2020-04-20 15:00:02 -0700352 [Setup] Start Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700353 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700354 ... AND Stop Logging DeleteOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800355 #TODO: Update test with new framework changes
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800356 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800357 FOR ${I} IN RANGE 0 ${olt_count}
358 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
359 ${of_id}= Get ofID From OLT List ${olt_serial_number}
360 Delete Device and Verify ${olt_serial_number}
361 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
362 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
363 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800364 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800365 # Recreate the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530366 Setup
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800367 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800368
Hema567f3012020-03-25 00:51:53 +0530369Check Mib State on OLT recreation after ONU, OLT deletion
370 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable,
371 ... Disable and Delete the ONU, Disable and Delete the OLT
372 ... Create/Enable the OLT again and Check for the Mib State of the ONUs
373 [Tags] functional CheckMibState notready
Andy Baviere187eda2020-04-20 15:00:02 -0700374 [Setup] Start Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530375 [Teardown] Run Keywords Collect Logs
376 ... AND Stop Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530377 #Disable and Delete the ONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800378 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema567f3012020-03-25 00:51:53 +0530379 ${src}= Set Variable ${hosts.src[${I}]}
380 ${dst}= Set Variable ${hosts.dst[${I}]}
381 ${onu_device_id}= Get Device ID From SN ${src['onu']}
382 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000383 ... ${of_id} ${src['uni_id']}
Hema567f3012020-03-25 00:51:53 +0530384 Disable Device ${onu_device_id}
385 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
386 Delete Device ${onu_device_id}
387 END
388 #Disable and Delete the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530389 Delete Device and Verify
390 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
391 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
392 # Recreate the OLT
Hema567f3012020-03-25 00:51:53 +0530393 Run Keyword If ${has_dataplane} Sleep 180s
Andrea Campanella3dcce272021-01-15 16:04:47 +0100394 # This dneeds to be done in for loop, test is not ready
395 ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}"
Suchitra Vemuri09f878d2021-02-10 18:19:04 -0800396 ... Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport]
397 ... ELSE Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport] ${list_olts}[${I}][type]
Hema567f3012020-03-25 00:51:53 +0530398 Set Suite Variable ${olt_device_id}
399 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED
Hardik Windlass8b446492021-06-10 06:25:23 +0000400 ... UNKNOWN UNKNOWN ${olt_device_id} by_dev_id=True
Hema567f3012020-03-25 00:51:53 +0530401 Enable Device ${olt_device_id}
402 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
403 ... ${olt_serial_number}
404 #Check for the ONU status and ONU Mib State should be "omci-flows-pushed"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800405 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema567f3012020-03-25 00:51:53 +0530406 ${src}= Set Variable ${hosts.src[${I}]}
407 ${dst}= Set Variable ${hosts.dst[${I}]}
408 ${onu_device_id}= Get Device ID From SN ${src['onu']}
409 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000410 ... ${of_id} ${src['uni_id']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700411 Wait Until Keyword Succeeds 180s 5s Validate Device ENABLED ACTIVE
Hema567f3012020-03-25 00:51:53 +0530412 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
413 END
414
Hema783279b2020-01-22 15:37:37 +0530415Test disable ONUs and OLT then delete ONUs and OLT
416 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
417 ... This TC is to confirm that ONU removal is not impacting OLT
418 ... Devices will be removed during the execution of this TC
419 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800420 [Tags] functional VOL-2354 DisableDeleteONUandOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700421 [Setup] Start Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700422 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700423 ... AND Stop Logging DisableDeleteONUandOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800424 #${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Suchitra Vemuri02170552021-03-23 16:40:50 -0700425 @{onu_reason}= Create List tech-profile-config-downloaded-success omci-flows-pushed
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800426 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema783279b2020-01-22 15:37:37 +0530427 ${src}= Set Variable ${hosts.src[${I}]}
428 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800429 ${of_id}= Get ofID From OLT List ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530430 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700431 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800432 ... Validate Device ENABLED ACTIVE
Suchitra Vemuri02170552021-03-23 16:40:50 -0700433 ... REACHABLE ${src['onu']} onu=True onu_reason=${onu_reason}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800434 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
435 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800436 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530437 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800438 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${onu_device_id}
Hema783279b2020-01-22 15:37:37 +0530439 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800440 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
441 ... Validate Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530442 ... REACHABLE ${src['onu']} onu=false
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700443 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800444 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800445 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530446 END
Matteo Scandolo5899be12020-11-11 15:38:07 -0800447
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800448 # Disable all OLTs
449 FOR ${I} IN RANGE 0 ${olt_count}
450 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
451 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
452 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800453 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800454 Should Be Equal As Integers ${rc} 0
455 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
456 ... ${olt_serial_number}
457 END
458 # Validate ONUs after OLT disable
459 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema783279b2020-01-22 15:37:37 +0530460 ${src}= Set Variable ${hosts.src[${I}]}
461 ${dst}= Set Variable ${hosts.dst[${I}]}
462 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800463 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
464 ... Validate Device DISABLED DISCOVERED
465 ... UNREACHABLE ${src['onu']} onu=false
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530466 Delete Device ${onu_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800467 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
468 ... Validate OLT Device DISABLED UNKNOWN
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800469 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530470 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800471 # Delete all OLTs
472 Delete All Devices and Verify
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000473 # Re-create the Devices and Perform Sanity
474 Setup
475 Run Keyword If ${has_dataplane} Clean Up Linux
476 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
David Bainbridgef81cd642019-11-20 00:14:47 +0000477
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800478Validate authentication on a disabled ONU
suraj gour472da1c2020-02-25 05:44:51 +0000479 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
480 ... Perform disable on the ONUs and validate that the authentication do not succeed
481 ... Perform enable on the ONUs and validate that authentication successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000482 [Tags] functional DisableONU_AuthCheck multi-uni
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800483 # Creates Devices in the Setup
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000484 [Setup] Start Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800485 [Teardown] Run Keywords Collect Logs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800486 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700487 ... AND Run Keyword If ${logging} Collect Logs
488 ... AND Stop Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800489 Clean WPA Process
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800490 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gour472da1c2020-02-25 05:44:51 +0000491 ${src}= Set Variable ${hosts.src[${I}]}
492 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800493 ${of_id}= Get ofID From OLT List ${src['olt']}
suraj gour472da1c2020-02-25 05:44:51 +0000494 ${onu_device_id}= Get Device ID From SN ${src['onu']}
495 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000496 ... ${of_id} ${src['uni_id']}
suraj gour472da1c2020-02-25 05:44:51 +0000497 Disable Device ${onu_device_id}
498 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
499 ... REACHABLE ${src['onu']} onu=false
Andy Bavier84834d42020-02-25 13:49:50 -0700500 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
501 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800502 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication False
503 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700504 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800505 Enable Device ${onu_device_id}
506 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
507 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800508 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
509 ... ENABLED ACTIVE REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
510 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
511 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700512 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
suraj gour472da1c2020-02-25 05:44:51 +0000513 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
514 END
suraj gour472da1c2020-02-25 05:44:51 +0000515
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000516Data plane verification using TCP
517 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
518 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200519 [Tags] non-critical dataplane BandwidthProfileTCP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700520 [Setup] Start Logging BandwidthProfileTCP
521 [Teardown] Run Keywords Collect Logs
522 ... AND Stop Logging BandwidthProfileTCP
Andy Baviereff938d2020-06-29 18:27:49 -0700523 Pass Execution If '${has_dataplane}'=='False'
524 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800525 Delete All Devices And Verify
526 Run Keyword If ${has_dataplane} Clean Up Linux
527 setup
528 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
529
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800530 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000531 ${src}= Set Variable ${hosts.src[${I}]}
532 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800533 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700534
535 # Check for iperf3 and jq tools
536 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
537 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
538 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
539
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000540 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000541 ... ${of_id} ${src['uni_id']}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000542 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
543 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
544 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700545 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000546 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
547 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700548 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000549
550 # Stream TCP packets from RG to server
551 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
552 ... args=-t 30
553 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
554
555 # Stream TCP packets from server to RG
556 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
557 ... args=-R -t 30
558 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
559
560 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
561 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
562 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
563 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
564
565 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
566 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700567 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
568 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
569 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000570 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
571 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
572 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
573 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
574 END
575
576Data plane verification using UDP
577 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
578 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Matteo Scandoloab48f9e2021-06-11 17:08:00 +0200579 [Tags] non-critical dataplane BandwidthProfileUDP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700580 [Setup] Start Logging BandwidthProfileUDP
581 [Teardown] Run Keywords Collect Logs
582 ... AND Stop Logging BandwidthProfileUDP
Andy Baviereff938d2020-06-29 18:27:49 -0700583 Pass Execution If '${has_dataplane}'=='False'
584 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800585 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000586 ${src}= Set Variable ${hosts.src[${I}]}
587 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800588 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierd59f9772020-07-01 12:00:42 -0700589
590 # Check for iperf3 and jq tools
591 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
592 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
593 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
594
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000595 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000596 ... ${of_id} ${src['uni_id']}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000597 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
598 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
599 ... upstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700600 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000601 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
602 ... downstreamBandwidthProfile
Girish Gowdrad769b412021-05-16 11:09:46 -0700603 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000604
605 # Stream UDP packets from RG to server
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200606 ${uprate}= Run Keyword If ${limiting_bw_value_upstream} != 1000000
607 ... Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200608 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200609 ... Set Variable ${limiting_bw_value_upstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000610 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700611 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000612 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
613 ${actual_upstream_bw_used}= Evaluate
614 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
615
616 # Stream UDP packets from server to RG
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200617 ${dnrate}= Run Keyword If ${limiting_bw_value_dnstream} != 1000000
618 ... Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200619 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200620 ... Set Variable ${limiting_bw_value_dnstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000621 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700622 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000623 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
624 ${actual_dnstream_bw_used}= Evaluate
625 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
626
627 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
628 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
629 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
630 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
631
632 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
633 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700634 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
635 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
636 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000637 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
638 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
639 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
640 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
641 END
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800642
Suraj Gour33651272020-05-04 10:10:16 +0530643Validate parsing of data traffic through voltha using tech profile
644 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
645 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
646 ... Install jq tool to read json file, where test suite is being running
Girish Gowdrabbfbbc32021-05-17 14:36:58 -0700647 ... This test sends TCP packets with pbits between 0 and 7 and validates that
Suraj Gour33651272020-05-04 10:10:16 +0530648 ... the pbits are preserved by the PON.
Hardik Windlass04d791e2021-07-12 16:23:13 +0000649 [Tags] dataplane TechProfile VOL-2054 notready
Suraj Gour33651272020-05-04 10:10:16 +0530650 [Setup] Start Logging TechProfile
651 [Teardown] Run Keywords Collect Logs
652 ... AND Stop Logging TechProfile
653 Pass Execution If '${has_dataplane}'=='False'
654 ... Skipping test: Technology profile validation can be done only in physical pod
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800655 FOR ${I} IN RANGE 0 ${num_all_onus}
Suraj Gour33651272020-05-04 10:10:16 +0530656 ${src}= Set Variable ${hosts.src[${I}]}
657 ${dst}= Set Variable ${hosts.dst[${I}]}
658
659 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
660 ${bng_user}= Get Variable Value ${dst['noroot_user']}
661 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
Andy Bavierf4b7d1d2020-06-30 11:14:04 -0700662 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
Suraj Gour33651272020-05-04 10:10:16 +0530663 ... Skipping test: credentials for BNG login required in deployment config
664
665 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
666 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
667 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
668 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
669 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
670 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
671 Log Upstream test
Andy Baviereff938d2020-06-29 18:27:49 -0700672 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Suraj Gour33651272020-05-04 10:10:16 +0530673 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src['dp_iface_name']}
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700674 ... 0 tcp 0 ${src['s_tag']} upstream vlan
Suraj Gour33651272020-05-04 10:10:16 +0530675 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
676 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
677 Log Downstream test
678 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
679 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
680 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
681 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
Andy Baviereff938d2020-06-29 18:27:49 -0700682 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Girish Gowdra66cd95d2021-07-08 10:31:54 -0700683 ... ${rg_ip} ${src['dp_iface_name']} ${dst['dp_iface_name']}
684 ... 0 tcp ${src['c_tag']} ${src['s_tag']} downstream tcp
Suraj Gour33651272020-05-04 10:10:16 +0530685 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
686 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
687 END
688
Hardik Windlass16cdf962020-04-29 15:26:50 +0530689Test Disable and Enable OLT PON Port
690 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
691 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
692 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
693 ... Perform enable on the OLT PON Port and validate that the pings are successful
Hardik Windlass1ed2eee2021-06-25 09:51:03 +0000694 [Tags] functional DisableEnableOltPonPort VOL-2577 multi-uni
Hardik Windlass16cdf962020-04-29 15:26:50 +0530695 [Setup] Run Keywords Start Logging DisableEnableOltPonPort
Girish Gowdra8fd96962021-12-14 16:20:04 +0530696 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
Hardik Windlass16cdf962020-04-29 15:26:50 +0530697 ... AND Setup
698 [Teardown] Run Keywords Collect Logs
Hardik Windlass41701e82021-01-12 17:44:44 +0000699 ... AND Delete All Devices and Verify
Girish Gowdraf244d5b2021-09-01 17:16:16 -0700700 ... AND Run Keyword If ${logging} Collect Logs
701 ... AND Stop Logging DisableEnableOltPonPort
Hardik Windlass16cdf962020-04-29 15:26:50 +0530702 Run Keyword If ${has_dataplane} Clean Up Linux
703 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Hardik Windlass41701e82021-01-12 17:44:44 +0000704 # Multi-OLTs
705 FOR ${I} IN RANGE 0 ${olt_count}
706 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
707 Disable Enable PON Port Per OLT ${olt_serial_number}
Hardik Windlass16cdf962020-04-29 15:26:50 +0530708 END
709
Gayathri.Selvan5d23e522020-09-15 17:26:25 +0530710Data plane Bandwidth profile update verification
711 [Documentation] Test bandwidth profile is updated for one subscriber and not changed for other subscribers.
712 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
713 ... Assumes Default and User_Bandwidth2 profiles are configured as bandwidth profiles
714 [Tags] non-critical dataplane BandwidthProfileUpdateTCP VOL-2053
715 [Setup] Start Logging BandwidthProfileUpdateTCP
716 [Teardown] Run Keywords Collect Logs
717 ... AND Stop Logging BandwidthProfileUpdateTCP
718 ... AND Send File To Onos ${CURDIR}/../../tests/data/${POD_NAME}-sadis.json
719 Pass Execution If '${has_dataplane}'=='False'
720 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
721 Delete All Devices And Verify
722 Run Keyword If ${has_dataplane} Clean Up Linux
723 Setup
724 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
725 # Update the Bandwidth Profile for the First Subscriber under test
726 ${src}= Set Variable ${hosts.src[${0}]}
727 ${dst}= Set Variable ${hosts.dst[${0}]}
728 ${of_id}= Get ofID From OLT List ${src['olt']}
TorstenThiemedda37652021-11-11 16:22:05 +0000729 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
Gayathri.Selvan5d23e522020-09-15 17:26:25 +0530730 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
731 ... ${of_id} ${src['uni_id']}
732 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
733 ${oldBwName} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
734 # Delete the existing subscriber
735 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
736 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
737 # Change the bandwidth profile and load the configuration
Hardik Windlassaa41bb42021-07-23 15:32:43 +0000738 ${newBwName} Set Variable If ${oldBwName} == 'Default' 'User_Bandwidth2' 'Default'
Gayathri.Selvan5d23e522020-09-15 17:26:25 +0530739 ${cmd} Catenate
740 ... sed 's/upstreamBandwidthProfile": "${oldBwName}"/upstreamBandwidthProfile": "${newBwName}"/g'
741 ... ${CURDIR}/../../tests/data/${POD_NAME}-sadis.json > ${CURDIR}/../../tests/data/${POD_NAME}-sadis-new.json
742 ${rc} Run and Return RC ${cmd}
743 Send File To Onos ${CURDIR}/../../tests/data/${POD_NAME}-sadis-new.json
744 # Re-add the subscriber with new bandwidth profile
745 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
746 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
747 # Verify that no pending flows exist for the ONU port
748 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
749 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
750 # Verify subscriber access flows are added for the ONU port
751 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
752 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
753 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
754 # Verify Meters in ONOS
755 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
756 ... Verify Meters in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
757 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
758 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
759 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
760 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
761 ... ${dst['container_name']}
762 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
763 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
764 # Verify new bandwidth profile is applied and other subscribers are working fine
765 ${checkBwName} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} upstreamBandwidthProfile
766 Should Be Equal ${checkBwName} ${newBwName} The bandwidth profile is not updated properly
767 FOR ${I} IN RANGE 0 ${num_all_onus}
768 ${src}= Set Variable ${hosts.src[${I}]}
769 ${dst}= Set Variable ${hosts.dst[${I}]}
770 ${of_id}= Get ofID From OLT List ${src['olt']}
771
772 # Check for iperf3 and jq tools
773 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
774 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
775 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
776
777 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
778 ... ${of_id} ${src['uni_id']}
779 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
780 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
781 ... upstreamBandwidthProfile
782 ${limiting_bw_value_upstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
783 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
784 ... downstreamBandwidthProfile
785 ${limiting_bw_value_dnstream} Get Limiting Bandwidth Details ${bandwidth_profile_name}
786
787 # Stream TCP packets from RG to server
788 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
789 ... args=-t 30
790 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
791
792 # Stream TCP packets from server to RG
793 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
794 ... args=-R -t 30
795 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
796
797 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
798 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
799 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
800 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
801
802 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
803 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
804 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
805 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
806 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
807 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
808 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
809 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
810 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
811 END
812
Hardik Windlassb75cf1b2021-01-18 06:59:09 +0000813Test ONU Delete and Auto-Discovery
814 [Documentation] Tests the voltctl delete and Auto-Discovery of the ONU
815 [Tags] functional VOL-3098 ONUAutoDiscovery notready
816 [Setup] Run Keywords Start Logging ONUAutoDiscovery
817 ... AND Setup
818 [Teardown] Run Keywords Collect Logs
819 ... AND Delete All Devices and Verify
820 ... AND Run Keyword If ${logging} Collect Logs
821 ... AND Stop Logging ONUAutoDiscovery
822 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
823 Run Keyword If ${has_dataplane} Clean Up Linux
824 Perform Sanity Test
825 FOR ${I} IN RANGE 0 ${num_all_onus}
826 ${src}= Set Variable ${hosts.src[${I}]}
827 ${dst}= Set Variable ${hosts.dst[${I}]}
828 ${onu_device_id}= Get Device ID From SN ${src['onu']}
829 ${of_id}= Get ofID From OLT List ${src['olt']}
830 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id}
831 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
832 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
833 # Remove Subscriber Access (To replicate ATT workflow)
834 Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
835 ... volt-remove-subscriber-access ${of_id} ${onu_port}
836 # Additional sleep to let subscriber delete process
837 Sleep 10s
838 # Delete ONU and Verify Ping Fails
839 Delete Device ${onu_device_id}
840 Run Keyword If ${has_dataplane} Verify ping is successful except for given device
841 ... ${num_all_onus} ${src['onu']}
842 # Verify that no pending flows exist for the ONU port
843 Wait Until Keyword Succeeds ${timeout} 2s
844 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
845 # ONU Auto-Discovery
846 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
847 ... Get ONU Port in ONOS ${src['onu']} ${of_id} ${src['uni_id']}
848 # Check ONU port is Enabled in ONOS
849 Wait Until Keyword Succeeds ${timeout} 2s
850 ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} ${src['uni_id']}
851 ${onu_device_id}= Get Device ID From SN ${src['onu']}
852 Run Keyword If ${has_dataplane} Clean Up Linux ${onu_device_id}
853 # Verify default EAPOL flows are added for the ONU port
854 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
855 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
856 # Verify ONU state in voltha
857 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
858 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
859 # Perform Authentication
860 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
861 ... /tmp/wpa ${src['dp_iface_name']} log
862 Run Keyword If ${has_dataplane} Validate Authentication True
863 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
864 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
865 Wait Until Keyword Succeeds ${timeout} 2
866 ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
867 Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
868 ... volt-add-subscriber-access ${of_id} ${onu_port}
869 # Verify that no pending flows exist for the ONU port
870 Wait Until Keyword Succeeds ${timeout} 2s
871 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
872 # Verify subscriber access flows are added for the ONU port
873 Wait Until Keyword Succeeds ${timeout} 5s
874 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
875 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
876 # Verify subscriber EAPOL flow is installed
877 Wait Until Keyword Succeeds ${timeout} 5s
878 ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
879 ... ${onu_port} ${src['c_tag']}
880 # Verify Meters in ONOS
881 Wait Until Keyword Succeeds ${timeout} 5s
882 ... Verify Meters in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port}
883 Run Keyword If ${has_dataplane} Validate DHCP and Ping True
884 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
885 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
886 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
887 ... ${dst['container_name']}
888 Wait Until Keyword Succeeds ${timeout} 2s
889 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
890 END
891
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700892*** Keywords ***
893Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700894 [Documentation] Set up the test suite
895 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700896 #Restore all ONUs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800897 #Run Keyword If ${has_dataplane} RestoreONUs ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700898 #power_switch.robot needs it to support different vendor's power switch
899 ${switch_type}= Get Variable Value ${web_power_switch.type}
900 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700901
David Bainbridgef81cd642019-11-20 00:14:47 +0000902Clear All Devices Then Create New Device
903 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000904 # Remove all devices from voltha and nos
905 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000906 # Execute normal test Setup Keyword
907 Setup