blob: a8e3a25ba5ae45da8d44b4638b2f788f46c13fa0 [file] [log] [blame]
David Bainbridgef81cd642019-11-20 00:14:47 +00001# Copyright 2017 - present Open Networking Foundation
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -07002#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
Matteo Scandolo1294aeb2019-09-24 16:20:32 -070014# FIXME Can we use the same test against BBSim and Hardware?
15
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070016*** Settings ***
Zack Williamsec53a1b2019-09-16 15:50:52 -070017Documentation Test various end-to-end scenarios
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070018Suite Setup Setup Suite
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070019Test Setup Setup
20Test Teardown Teardown
Andy Bavierba9866b2019-10-11 07:11:53 -070021Suite Teardown Teardown Suite
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070022Library Collections
23Library String
24Library OperatingSystem
25Library XML
26Library RequestsLibrary
Andy Bavierba9866b2019-10-11 07:11:53 -070027Library ../../libraries/DependencyLibrary.py
Suchitra Vemurib8ed2d52019-09-30 13:22:51 -070028Resource ../../libraries/onos.robot
29Resource ../../libraries/voltctl.robot
David Bainbridgef81cd642019-11-20 00:14:47 +000030Resource ../../libraries/voltha.robot
Suchitra Vemurib8ed2d52019-09-30 13:22:51 -070031Resource ../../libraries/utils.robot
Andy Bavierba9866b2019-10-11 07:11:53 -070032Resource ../../libraries/k8s.robot
Suchitra Vemurib8ed2d52019-09-30 13:22:51 -070033Resource ../../variables/variables.robot
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070034Resource ../../libraries/power_switch.robot
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070035
36*** Variables ***
Zack Williamsec53a1b2019-09-16 15:50:52 -070037${POD_NAME} flex-ocp-cord
38${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
39${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs
40#${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
41${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
42${HELM_CHARTS_DIR} ~/helm-charts
43${VOLTHA_POD_NUM} 8
Zack Williamsa8fe75a2020-01-10 14:25:27 -070044${NAMESPACE} voltha
suraj gourd64356b2019-11-07 13:26:20 +000045# For below variable value, using deployment name as using grep for
46# parsing radius pod name, we can also use full radius pod name
Zack Williamsa8fe75a2020-01-10 14:25:27 -070047${RESTART_POD_NAME} radius
Andy Bavierba9866b2019-10-11 07:11:53 -070048${timeout} 60s
Zack Williamsec53a1b2019-09-16 15:50:52 -070049${of_id} 0
50${logical_id} 0
Andrea Campanella86e24062020-08-05 19:09:18 +020051${uprate} 0
52${dnrate} 0
Andy Bavierba9866b2019-10-11 07:11:53 -070053${has_dataplane} True
Andy Bavierba9866b2019-10-11 07:11:53 -070054${teardown_device} False
Zack Williamsa8fe75a2020-01-10 14:25:27 -070055${scripts} ../../scripts
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070056
Gayathri.Selvan92d16862020-03-19 14:47:58 +000057# For dataplane bandwidth testing
58${upper_margin_pct} 105 # Allow 5% over the limit
Andy Bavierf6ab19c2020-05-14 10:34:47 -070059${lower_margin_pct} 92 # Allow 8% under the limit
Gayathri.Selvan92d16862020-03-19 14:47:58 +000060${udp_rate_multiplier} 1.10 # Send UDP at bw profile limit * rate_multiplier
Andy Bavierc80a2742020-08-28 10:59:05 -070061${udp_packet_bytes} 1470 # UDP payload in bytes
Gayathri.Selvan92d16862020-03-19 14:47:58 +000062
Andy Bavierabeba262020-02-07 16:22:16 -070063# Per-test logging on failure is turned off by default; set this variable to enable
64${container_log_dir} ${None}
65
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070066*** Test Cases ***
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070067Reboot ONUs Physically
68 [Documentation] This test reboots ONUs physically before execution all the tests
69 ... Test case runs only on the PODs that are configured with PowerSwitch that
70 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
71 [Tags] functional PowerSwitch RebootAllONUs
72 [Setup] Start Logging RebootAllONUs
73 [Teardown] Run Keywords Collect Logs
74 ... AND Stop Logging RebootAllONUs
75 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
76 FOR ${I} IN RANGE 0 ${num_onus}
77 ${src}= Set Variable ${hosts.src[${I}]}
78 ${dst}= Set Variable ${hosts.dst[${I}]}
79 Disable Switch Outlet ${src['power_switch_port']}
80 Sleep 60s
81 Enable Switch Outlet ${src['power_switch_port']}
82 Sleep 60s
83 END
84
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070085Sanity E2E Test for OLT/ONU on POD
86 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
87 ... Validate successful authentication/DHCP/E2E ping for the tech profile that is used
Andy Bavierba9866b2019-10-11 07:11:53 -070088 [Tags] sanity test1
Andy Baviere187eda2020-04-20 15:00:02 -070089 [Setup] Run Keywords Start Logging SanityTest
Andy Bavier4a8450e2020-02-04 08:58:37 -070090 ... AND Setup
91 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -070092 ... AND Stop Logging SanityTest
Suchitra Vemuric5295a32019-12-15 20:32:04 -080093 Run Keyword If ${has_dataplane} Clean Up Linux
Zack Williamsa8fe75a2020-01-10 14:25:27 -070094 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070095
Suchitra Vemuri6db89412019-11-14 14:52:54 -080096Test Disable and Enable ONU
97 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
98 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
99 ... Perform disable on the ONUs and validate that the pings do not succeed
100 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800101 [Tags] functional DisableEnableONU released
Andy Baviere187eda2020-04-20 15:00:02 -0700102 [Setup] Start Logging DisableEnableONU
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 Vemuri6db89412019-11-14 14:52:54 -0800105 FOR ${I} IN RANGE 0 ${num_onus}
106 ${src}= Set Variable ${hosts.src[${I}]}
107 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800108 ${onu_device_id}= Get Device ID From SN ${src['onu']}
109 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
110 ... ${of_id}
111 Disable Device ${onu_device_id}
Andy Bavier46c8be32020-01-21 10:06:27 -0700112 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700113 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
114 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700115 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
116 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800117 Enable Device ${onu_device_id}
118 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800119 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530120 # Verify subscriber access flows are added for the ONU port
121 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
122 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
123 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700124 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
125 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700126 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
127 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
128 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
129 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800130 END
131
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800132Test Subscriber Delete and Add
133 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
134 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700135 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800136 ... Re-add the subscriber and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800137 [Tags] functional SubAddDelete released
Andy Baviere187eda2020-04-20 15:00:02 -0700138 [Setup] Start Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700139 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700140 ... AND Stop Logging SubAddDelete
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800141 FOR ${I} IN RANGE 0 ${num_onus}
142 ${src}= Set Variable ${hosts.src[${I}]}
143 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800144 ${onu_device_id}= Get Device ID From SN ${src['onu']}
145 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
146 ... ${of_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800147 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800148 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
149 Sleep 10s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800150 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
151 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700152 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
153 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700154 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
155 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800156 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800157 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
158 Sleep 10s
159 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800160 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
161 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800162 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530163 # Verify subscriber access flows are added for the ONU port
164 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
165 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
166 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700167 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
168 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700169 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
170 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
171 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
172 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800173 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800174
suraj gourd5cfdbb2019-12-13 12:44:55 +0000175Check DHCP attempt fails when subscriber is not added
176 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
177 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700178 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800179 [Tags] functional SubsRemoveDHCP released
Andy Baviere187eda2020-04-20 15:00:02 -0700180 [Setup] Start Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700181 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700182 ... AND Stop Logging SubsRemoveDHCP
suraj gourd5cfdbb2019-12-13 12:44:55 +0000183 FOR ${I} IN RANGE 0 ${num_onus}
184 ${src}= Set Variable ${hosts.src[${I}]}
185 ${dst}= Set Variable ${hosts.dst[${I}]}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700186 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000187 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
188 ... ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800189 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']}
190 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
191 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
192 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800193 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000194 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri8f1d3062020-02-28 11:57:37 -0800195 Sleep 15s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800196 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
197 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700198 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
199 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
200 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
201 Run Keyword And Ignore Error Login And Run Command On Remote System
202 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800203 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000204 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
205 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
206 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
207 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
208 ... ${dst['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800209 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000210 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri40fdf3c2020-05-28 23:41:03 -0700211 Sleep 10s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800212 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
213 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530214 # Verify subscriber access flows are added for the ONU port
215 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
216 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
217 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000218 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
219 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
220 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
221 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
222 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800223 Run Keyword and Ignore Error Collect Logs
224 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800225
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800226Test Disable and Enable ONU scenario for ATT workflow
227 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
228 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
229 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700230 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
231 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800232 ... VOL-2284
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800233 [Tags] functional ATT_DisableEnableONU released
Andy Baviere187eda2020-04-20 15:00:02 -0700234 [Setup] Start Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700235 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700236 ... AND Stop Logging ATT_DisableEnableONU
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800237 FOR ${I} IN RANGE 0 ${num_onus}
238 ${src}= Set Variable ${hosts.src[${I}]}
239 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800240 ${onu_device_id}= Get Device ID From SN ${src['onu']}
241 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
242 ... ${of_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800243 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700244 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800245 Disable Device ${onu_device_id}
Suchitra Vemuri3158f3c2020-05-28 17:58:26 -0700246 Sleep 10s
ubuntu6b6e7d42020-03-02 12:35:42 -0800247 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800248 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700249 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
250 ... Wait Until Keyword Succeeds 60s 2s Check Ping
251 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
252 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800253 ... ELSE sleep 60s
254 Enable Device ${onu_device_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800255 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800256 ... ${ONOS_SSH_PORT} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700257 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
258 ... Validate Authentication After Reassociate True
259 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800260 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800261 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700262 ... ${ONOS_SSH_PORT} ${onu_port}
ubuntu6b6e7d42020-03-02 12:35:42 -0800263 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800264 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri3158f3c2020-05-28 17:58:26 -0700265 Sleep 10s
Hardik Windlass21807632020-04-14 16:24:55 +0530266 # Verify subscriber access flows are added for the ONU port
267 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
268 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
269 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800270 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700271 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800272 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
273 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
274 ... ${dst['container_name']}
275 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800276 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800277 Run Keyword and Ignore Error Collect Logs
suraj gourd5cfdbb2019-12-13 12:44:55 +0000278 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000279
Hardik Windlass2b37e712020-06-12 02:13:17 +0530280Test Disable and Enable OLT
281 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
282 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
283 ... Perform disable on the OLT and validate that the pings do not succeed
284 ... Perform enable on the OLT and validate that the pings are successful
285 [Tags] functional VOL-2410 DisableEnableOLT
286 [Setup] Start Logging DisableEnableOLT
287 [Teardown] Run Keywords Collect Logs
288 ... AND Stop Logging DisableEnableOLT
289 #Disable the OLT and verify the OLT/ONUs are disabled properly
290 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
291 Should Be Equal As Integers ${rc} 0
292 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
293 ... ${olt_serial_number}
294 FOR ${I} IN RANGE 0 ${num_onus}
295 ${src}= Set Variable ${hosts.src[${I}]}
296 ${dst}= Set Variable ${hosts.dst[${I}]}
297 ${onu_device_id}= Get Device ID From SN ${src['onu']}
298 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
299 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
300 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED DISCOVERED
301 ... UNREACHABLE ${src['onu']} onu=false
302 #Verify that ping fails
303 Run Keyword If ${has_dataplane}
304 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
305 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
306 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
307 # Remove Subscriber Access (To replicate ATT workflow)
308 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
309 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
310 Sleep 10s
311 END
312 #Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
313 Enable Device ${olt_device_id}
314 Sleep 15s
315 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
316 ... ${olt_serial_number}
317 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
318 ... PON_OLT ETHERNET_NNI
319 Run Keyword If ${has_dataplane} Clean Up Linux
320 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test
321
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800322Delete OLT, ReAdd OLT and Perform Sanity Test
323 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
324 ... Disable and Delete the OLT
325 ... Create/Enable the same OLT again
326 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800327 [Tags] functional DeleteOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700328 [Setup] Start Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700329 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700330 ... AND Stop Logging DeleteOLT
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800331 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass480f3e22020-04-02 20:14:14 +0530332 Delete Device and Verify
333 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
334 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800335 Run Keyword and Ignore Error Collect Logs
336 # Recreate the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530337 Setup
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800338 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800339
Hema567f3012020-03-25 00:51:53 +0530340Check Mib State on OLT recreation after ONU, OLT deletion
341 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable,
342 ... Disable and Delete the ONU, Disable and Delete the OLT
343 ... Create/Enable the OLT again and Check for the Mib State of the ONUs
344 [Tags] functional CheckMibState notready
Andy Baviere187eda2020-04-20 15:00:02 -0700345 [Setup] Start Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530346 [Teardown] Run Keywords Collect Logs
347 ... AND Stop Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530348 #Disable and Delete the ONU
349 FOR ${I} IN RANGE 0 ${num_onus}
350 ${src}= Set Variable ${hosts.src[${I}]}
351 ${dst}= Set Variable ${hosts.dst[${I}]}
352 ${onu_device_id}= Get Device ID From SN ${src['onu']}
353 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
354 ... ${of_id}
355 Disable Device ${onu_device_id}
356 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
357 Delete Device ${onu_device_id}
358 END
359 #Disable and Delete the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530360 Delete Device and Verify
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 # Recreate the OLT
Hema567f3012020-03-25 00:51:53 +0530364 Run Keyword If ${has_dataplane} Sleep 180s
365 ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT}
366 Set Suite Variable ${olt_device_id}
367 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED
368 ... UNKNOWN UNKNOWN ${olt_device_id}
369 Enable Device ${olt_device_id}
370 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
371 ... ${olt_serial_number}
372 #Check for the ONU status and ONU Mib State should be "omci-flows-pushed"
373 FOR ${I} IN RANGE 0 ${num_onus}
374 ${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']}
378 ... ${of_id}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700379 Wait Until Keyword Succeeds 180s 5s Validate Device ENABLED ACTIVE
Hema567f3012020-03-25 00:51:53 +0530380 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
381 END
382
Hema783279b2020-01-22 15:37:37 +0530383Test disable ONUs and OLT then delete ONUs and OLT
384 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
385 ... This TC is to confirm that ONU removal is not impacting OLT
386 ... Devices will be removed during the execution of this TC
387 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800388 [Tags] functional VOL-2354 DisableDeleteONUandOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700389 [Setup] Start Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700390 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700391 ... AND Stop Logging DisableDeleteONUandOLT
Suchitra Vemuriba4f3712020-01-24 16:18:26 -0800392 ${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Hema783279b2020-01-22 15:37:37 +0530393 FOR ${I} IN RANGE 0 ${num_onus}
394 ${src}= Set Variable ${hosts.src[${I}]}
395 ${dst}= Set Variable ${hosts.dst[${I}]}
396 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700397 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800398 ... Validate Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530399 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800400 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
401 ... Validate OLT Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530402 ... REACHABLE ${olt_serial_number}
403 ${rc} ${output}= Run and Return Rc and Output
404 ... ${VOLTCTL_CONFIG}; voltctl device disable ${onu_device_id}
405 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800406 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
407 ... Validate Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530408 ... REACHABLE ${src['onu']} onu=false
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700409 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800410 ... Validate OLT Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530411 ... REACHABLE ${olt_serial_number}
412 END
413 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
414 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800415 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
416 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
Hema783279b2020-01-22 15:37:37 +0530417 ... ${olt_serial_number}
418 FOR ${I} IN RANGE 0 ${num_onus}
419 ${src}= Set Variable ${hosts.src[${I}]}
420 ${dst}= Set Variable ${hosts.dst[${I}]}
421 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800422 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
423 ... Validate Device DISABLED DISCOVERED
424 ... UNREACHABLE ${src['onu']} onu=false
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530425 Delete Device ${onu_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800426 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
427 ... Validate OLT Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530428 ... REACHABLE ${olt_serial_number}
429 END
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530430 Delete Device ${olt_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800431 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
Hardik Windlass480f3e22020-04-02 20:14:14 +0530432 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
433 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
David Bainbridgef81cd642019-11-20 00:14:47 +0000434
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800435Validate authentication on a disabled ONU
suraj gour472da1c2020-02-25 05:44:51 +0000436 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
437 ... Perform disable on the ONUs and validate that the authentication do not succeed
438 ... Perform enable on the ONUs and validate that authentication successful
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800439 [Tags] functional DisableONU_AuthCheck
440 # Creates Devices in the Setup
Andy Baviere187eda2020-04-20 15:00:02 -0700441 [Setup] Run Keywords Start Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800442 ... AND Setup
443 [Teardown] Run Keywords Collect Logs
444 ... AND Stop Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800445 ... AND Delete Device and Verify
446 Run Keyword and Ignore Error Collect Logs
447 Run Keyword If ${has_dataplane} Clean Up Linux
448 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
449 Clean WPA Process
suraj gour472da1c2020-02-25 05:44:51 +0000450 FOR ${I} IN RANGE 0 ${num_onus}
451 ${src}= Set Variable ${hosts.src[${I}]}
452 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800453 Run Keyword and Ignore Error Collect Logs
suraj gour472da1c2020-02-25 05:44:51 +0000454 ${onu_device_id}= Get Device ID From SN ${src['onu']}
455 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
456 ... ${of_id}
457 Disable Device ${onu_device_id}
458 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
459 ... REACHABLE ${src['onu']} onu=false
Andy Bavier84834d42020-02-25 13:49:50 -0700460 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
461 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800462 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication False
463 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700464 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800465 Enable Device ${onu_device_id}
466 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
467 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
468 Run Keyword and Ignore Error Collect Logs
469 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
470 ... ENABLED ACTIVE REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
471 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
472 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700473 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
suraj gour472da1c2020-02-25 05:44:51 +0000474 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
475 END
476 Run Keyword and Ignore Error Collect Logs
477
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000478Data plane verification using TCP
479 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
480 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavierbbac4192020-06-29 21:42:10 -0700481 [Tags] dataplane BandwidthProfileTCP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700482 [Setup] Start Logging BandwidthProfileTCP
483 [Teardown] Run Keywords Collect Logs
484 ... AND Stop Logging BandwidthProfileTCP
Andy Baviereff938d2020-06-29 18:27:49 -0700485 Pass Execution If '${has_dataplane}'=='False'
486 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Andy Bavierd74f33c2020-05-12 12:45:36 -0700487 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000488 FOR ${I} IN RANGE 0 ${num_onus}
489 ${src}= Set Variable ${hosts.src[${I}]}
490 ${dst}= Set Variable ${hosts.dst[${I}]}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700491
492 # Check for iperf3 and jq tools
493 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
494 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
495 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
496
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000497 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
498 ... ${of_id}
499 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
500 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
501 ... upstreamBandwidthProfile
502 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
503 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
504 ... downstreamBandwidthProfile
505 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
506
507 # Stream TCP packets from RG to server
508 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
509 ... args=-t 30
510 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
511
512 # Stream TCP packets from server to RG
513 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
514 ... args=-R -t 30
515 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
516
517 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
518 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
519 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
520 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
521
522 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
523 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700524 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
525 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
526 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000527 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
528 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
529 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
530 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
531 END
532
533Data plane verification using UDP
534 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
535 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavierbbac4192020-06-29 21:42:10 -0700536 [Tags] dataplane BandwidthProfileUDP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700537 [Setup] Start Logging BandwidthProfileUDP
538 [Teardown] Run Keywords Collect Logs
539 ... AND Stop Logging BandwidthProfileUDP
Andy Baviereff938d2020-06-29 18:27:49 -0700540 Pass Execution If '${has_dataplane}'=='False'
541 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Andy Bavierd74f33c2020-05-12 12:45:36 -0700542 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000543 FOR ${I} IN RANGE 0 ${num_onus}
544 ${src}= Set Variable ${hosts.src[${I}]}
545 ${dst}= Set Variable ${hosts.dst[${I}]}
Andy Bavierd59f9772020-07-01 12:00:42 -0700546
547 # Check for iperf3 and jq tools
548 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
549 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
550 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
551
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000552 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
553 ... ${of_id}
554 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
555 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
556 ... upstreamBandwidthProfile
557 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
558 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
559 ... downstreamBandwidthProfile
560 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
561
562 # Stream UDP packets from RG to server
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200563 ${uprate}= Run Keyword If ${limiting_bw_value_upstream} != 1000000
564 ... Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200565 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200566 ... Set Variable ${limiting_bw_value_upstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000567 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700568 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000569 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
570 ${actual_upstream_bw_used}= Evaluate
571 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
572
573 # Stream UDP packets from server to RG
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200574 ${dnrate}= Run Keyword If ${limiting_bw_value_dnstream} != 1000000
575 ... Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200576 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200577 ... Set Variable ${limiting_bw_value_dnstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000578 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700579 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000580 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
581 ${actual_dnstream_bw_used}= Evaluate
582 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
583
584 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
585 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
586 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
587 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
588
589 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
590 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700591 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
592 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
593 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000594 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
595 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
596 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
597 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
598 END
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800599
Suraj Gour33651272020-05-04 10:10:16 +0530600Validate parsing of data traffic through voltha using tech profile
601 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
602 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
603 ... Install jq tool to read json file, where test suite is being running
604 ... Make sure 9999 port is enabled or forwarded for both upsteam and downstream direction
605 ... This test sends UDP packets on port 9999 with pbits between 0 and 7 and validates that
606 ... the pbits are preserved by the PON.
Andy Bavierbbac4192020-06-29 21:42:10 -0700607 [Tags] dataplane TechProfile VOL-2054
Suraj Gour33651272020-05-04 10:10:16 +0530608 [Setup] Start Logging TechProfile
609 [Teardown] Run Keywords Collect Logs
610 ... AND Stop Logging TechProfile
611 Pass Execution If '${has_dataplane}'=='False'
612 ... Skipping test: Technology profile validation can be done only in physical pod
613 FOR ${I} IN RANGE 0 ${num_onus}
614 ${src}= Set Variable ${hosts.src[${I}]}
615 ${dst}= Set Variable ${hosts.dst[${I}]}
616
617 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
618 ${bng_user}= Get Variable Value ${dst['noroot_user']}
619 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
Andy Bavierf4b7d1d2020-06-30 11:14:04 -0700620 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
Suraj Gour33651272020-05-04 10:10:16 +0530621 ... Skipping test: credentials for BNG login required in deployment config
622
623 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
624 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
625 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
626 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
627 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
628 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
629 Log Upstream test
Andy Baviereff938d2020-06-29 18:27:49 -0700630 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Suraj Gour33651272020-05-04 10:10:16 +0530631 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src['dp_iface_name']}
632 ... 0 udp 9999 0 vlan
633 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
634 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
635 Log Downstream test
636 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
637 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
638 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
639 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
Andy Baviereff938d2020-06-29 18:27:49 -0700640 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Suraj Gour33651272020-05-04 10:10:16 +0530641 ... ${rg_ip} ${src['dp_iface_name']} ${dst['dp_iface_name']}.${src['s_tag']}
642 ... 0 udp 9999 ${src['c_tag']} udp
643 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
644 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
645 END
646
Hardik Windlass16cdf962020-04-29 15:26:50 +0530647Test Disable and Enable OLT PON Port
648 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
649 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
650 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
651 ... Perform enable on the OLT PON Port and validate that the pings are successful
652 [Tags] functional DisableEnableOltPonPort VOL-2577
653 [Setup] Run Keywords Start Logging DisableEnableOltPonPort
654 ... AND Setup
655 [Teardown] Run Keywords Collect Logs
656 ... AND Stop Logging DisableEnableOltPonPort
657 ... AND Delete Device and Verify
658 Run Keyword If ${has_dataplane} Clean Up Linux
659 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
660 ${olt_pon_port_list}= Retrieve OLT PON Ports ${olt_device_id}
661 ${olt_pon_port_list_len}= Get Length ${olt_pon_port_list}
662 FOR ${INDEX0} IN RANGE 0 ${olt_pon_port_list_len}
663 ${olt_pon_port}= Get From List ${olt_pon_port_list} ${INDEX0}
664 ${olt_peer_list}= Retrieve Peer List From OLT PON Port ${olt_device_id} ${olt_pon_port}
665 # Disable the OLT PON Port and Validate OLT Device
666 DisableOrEnable OLT PON Port disable ${olt_device_id} ${olt_pon_port}
667 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
668 ... Validate OLT PON Port Status ${olt_device_id} ${olt_pon_port}
669 ... DISABLED DISCOVERED
670 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
671 ... Validate OLT Device ENABLED ACTIVE REACHABLE
672 ... ${olt_serial_number}
673 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
674 ... Validate ONUs for PON OLT Disable ${olt_peer_list}
675 # Enable the OLT PON Port back, and check ONU status are back to "ACTIVE"
676 DisableOrEnable OLT PON Port enable ${olt_device_id} ${olt_pon_port}
677 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
678 ... Validate OLT PON Port Status ${olt_device_id} ${olt_pon_port}
679 ... ENABLED ACTIVE
680 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
681 ... Validate ONUs for PON OLT Enable ${olt_peer_list}
682 END
683
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700684*** Keywords ***
685Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700686 [Documentation] Set up the test suite
687 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700688 #Restore all ONUs
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700689 #Run Keyword If ${has_dataplane} RestoreONUs ${num_onus}
690 #power_switch.robot needs it to support different vendor's power switch
691 ${switch_type}= Get Variable Value ${web_power_switch.type}
692 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700693
David Bainbridgef81cd642019-11-20 00:14:47 +0000694Clear All Devices Then Create New Device
695 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000696 # Remove all devices from voltha and nos
697 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000698 # Execute normal test Setup Keyword
699 Setup