blob: c941694516370296bf309a2e6c52e36c8e32657a [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
61${udp_packet_bytes} 1400 # UDP payload in bytes
62
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
Hema93762cf2020-01-29 19:59:28 +053096Test Disable and Enable OLT
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 OLT and validate that the pings do not succeed
100 ... Perform enable on the OLT and validate that the pings are successful
Suchitra Vemuri14c9a032020-05-27 14:01:08 -0700101 [Tags] functional VOL-2410 DisableEnableOLT notready
Andy Baviere187eda2020-04-20 15:00:02 -0700102 [Setup] Start Logging DisableEnableOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700103 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700104 ... AND Stop Logging DisableEnableOLT
Hema93762cf2020-01-29 19:59:28 +0530105 #Disable the OLT and verify the OLT/ONUs are disabled properly
106 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
107 Should Be Equal As Integers ${rc} 0
108 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
109 ... ${olt_serial_number}
110 FOR ${I} IN RANGE 0 ${num_onus}
111 ${src}= Set Variable ${hosts.src[${I}]}
112 ${dst}= Set Variable ${hosts.dst[${I}]}
113 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530114 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
115 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
Hema93762cf2020-01-29 19:59:28 +0530116 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED DISCOVERED
117 ... UNREACHABLE ${src['onu']} onu=false
118 #Verify that ping fails
TorstenThieme754fec72020-02-18 07:24:46 +0000119 Run Keyword If ${has_dataplane}
120 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
Hema93762cf2020-01-29 19:59:28 +0530121 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
Andrea Campanellaa6e17322020-05-04 14:31:44 +0200122 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530123 # Remove Subscriber Access (To replicate ATT workflow)
124 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
125 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Hema93762cf2020-01-29 19:59:28 +0530126 END
127 #Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
128 Enable Device ${olt_device_id}
129 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
130 ... ${olt_serial_number}
Hemaf64d34c2020-03-25 00:40:17 +0530131 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
132 ... PON_OLT ETHERNET_NNI
Hardik Windlass7c801e62020-05-04 19:33:21 +0530133 Run Keyword If ${has_dataplane} Clean Up Linux
134 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Hema93762cf2020-01-29 19:59:28 +0530135
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800136Test Disable and Enable ONU
137 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
138 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
139 ... Perform disable on the ONUs and validate that the pings do not succeed
140 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800141 [Tags] functional DisableEnableONU released
Andy Baviere187eda2020-04-20 15:00:02 -0700142 [Setup] Start Logging DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700143 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700144 ... AND Stop Logging DisableEnableONU
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800145 FOR ${I} IN RANGE 0 ${num_onus}
146 ${src}= Set Variable ${hosts.src[${I}]}
147 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800148 ${onu_device_id}= Get Device ID From SN ${src['onu']}
149 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
150 ... ${of_id}
151 Disable Device ${onu_device_id}
Andy Bavier46c8be32020-01-21 10:06:27 -0700152 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700153 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
154 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700155 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
156 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800157 Enable Device ${onu_device_id}
158 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800159 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530160 # Verify subscriber access flows are added for the ONU port
161 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
162 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
163 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700164 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
165 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700166 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
167 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
168 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
169 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800170 END
171
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800172Test Subscriber Delete and Add
173 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
174 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700175 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800176 ... Re-add the subscriber and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800177 [Tags] functional SubAddDelete released
Andy Baviere187eda2020-04-20 15:00:02 -0700178 [Setup] Start Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700179 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700180 ... AND Stop Logging SubAddDelete
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800181 FOR ${I} IN RANGE 0 ${num_onus}
182 ${src}= Set Variable ${hosts.src[${I}]}
183 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800184 ${onu_device_id}= Get Device ID From SN ${src['onu']}
185 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
186 ... ${of_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800187 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800188 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
189 Sleep 10s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800190 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
191 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700192 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
193 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700194 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
195 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800196 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800197 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
198 Sleep 10s
199 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800200 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
201 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800202 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530203 # Verify subscriber access flows are added for the ONU port
204 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
205 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
206 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700207 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
208 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700209 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
210 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
211 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
212 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800213 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800214
suraj gourd5cfdbb2019-12-13 12:44:55 +0000215Check DHCP attempt fails when subscriber is not added
216 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
217 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700218 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800219 [Tags] functional SubsRemoveDHCP released
Andy Baviere187eda2020-04-20 15:00:02 -0700220 [Setup] Start Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700221 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700222 ... AND Stop Logging SubsRemoveDHCP
suraj gourd5cfdbb2019-12-13 12:44:55 +0000223 FOR ${I} IN RANGE 0 ${num_onus}
224 ${src}= Set Variable ${hosts.src[${I}]}
225 ${dst}= Set Variable ${hosts.dst[${I}]}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700226 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000227 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
228 ... ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800229 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']}
230 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
231 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
232 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800233 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000234 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri8f1d3062020-02-28 11:57:37 -0800235 Sleep 15s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800236 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
237 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700238 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
239 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
240 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
241 Run Keyword And Ignore Error Login And Run Command On Remote System
242 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800243 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000244 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
245 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
246 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
247 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
248 ... ${dst['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800249 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000250 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri40fdf3c2020-05-28 23:41:03 -0700251 Sleep 10s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800252 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
253 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530254 # Verify subscriber access flows are added for the ONU port
255 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
256 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
257 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000258 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
259 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
260 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
261 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
262 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800263 Run Keyword and Ignore Error Collect Logs
264 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800265
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800266Test Disable and Enable ONU scenario for ATT workflow
267 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
268 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
269 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700270 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
271 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800272 ... VOL-2284
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800273 [Tags] functional ATT_DisableEnableONU released
Andy Baviere187eda2020-04-20 15:00:02 -0700274 [Setup] Start Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700275 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700276 ... AND Stop Logging ATT_DisableEnableONU
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800277 FOR ${I} IN RANGE 0 ${num_onus}
278 ${src}= Set Variable ${hosts.src[${I}]}
279 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800280 ${onu_device_id}= Get Device ID From SN ${src['onu']}
281 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
282 ... ${of_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800283 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700284 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800285 Disable Device ${onu_device_id}
Suchitra Vemuri3158f3c2020-05-28 17:58:26 -0700286 Sleep 10s
ubuntu6b6e7d42020-03-02 12:35:42 -0800287 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800288 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700289 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
290 ... Wait Until Keyword Succeeds 60s 2s Check Ping
291 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
292 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800293 ... ELSE sleep 60s
294 Enable Device ${onu_device_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800295 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800296 ... ${ONOS_SSH_PORT} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700297 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
298 ... Validate Authentication After Reassociate True
299 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800300 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800301 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700302 ... ${ONOS_SSH_PORT} ${onu_port}
ubuntu6b6e7d42020-03-02 12:35:42 -0800303 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800304 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri3158f3c2020-05-28 17:58:26 -0700305 Sleep 10s
Hardik Windlass21807632020-04-14 16:24:55 +0530306 # Verify subscriber access flows are added for the ONU port
307 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
308 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
309 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800310 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700311 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800312 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
313 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
314 ... ${dst['container_name']}
315 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800316 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800317 Run Keyword and Ignore Error Collect Logs
suraj gourd5cfdbb2019-12-13 12:44:55 +0000318 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000319
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800320Delete OLT, ReAdd OLT and Perform Sanity Test
321 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
322 ... Disable and Delete the OLT
323 ... Create/Enable the same OLT again
324 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800325 [Tags] functional DeleteOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700326 [Setup] Start Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700327 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700328 ... AND Stop Logging DeleteOLT
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800329 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass480f3e22020-04-02 20:14:14 +0530330 Delete Device and Verify
331 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
332 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800333 Run Keyword and Ignore Error Collect Logs
334 # Recreate the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530335 Setup
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800336 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800337
Hema567f3012020-03-25 00:51:53 +0530338Check Mib State on OLT recreation after ONU, OLT deletion
339 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable,
340 ... Disable and Delete the ONU, Disable and Delete the OLT
341 ... Create/Enable the OLT again and Check for the Mib State of the ONUs
342 [Tags] functional CheckMibState notready
Andy Baviere187eda2020-04-20 15:00:02 -0700343 [Setup] Start Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530344 [Teardown] Run Keywords Collect Logs
345 ... AND Stop Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530346 #Disable and Delete the ONU
347 FOR ${I} IN RANGE 0 ${num_onus}
348 ${src}= Set Variable ${hosts.src[${I}]}
349 ${dst}= Set Variable ${hosts.dst[${I}]}
350 ${onu_device_id}= Get Device ID From SN ${src['onu']}
351 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
352 ... ${of_id}
353 Disable Device ${onu_device_id}
354 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
355 Delete Device ${onu_device_id}
356 END
357 #Disable and Delete the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530358 Delete Device and Verify
359 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
360 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
361 # Recreate the OLT
Hema567f3012020-03-25 00:51:53 +0530362 Run Keyword If ${has_dataplane} Sleep 180s
363 ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT}
364 Set Suite Variable ${olt_device_id}
365 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED
366 ... UNKNOWN UNKNOWN ${olt_device_id}
367 Enable Device ${olt_device_id}
368 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
369 ... ${olt_serial_number}
370 #Check for the ONU status and ONU Mib State should be "omci-flows-pushed"
371 FOR ${I} IN RANGE 0 ${num_onus}
372 ${src}= Set Variable ${hosts.src[${I}]}
373 ${dst}= Set Variable ${hosts.dst[${I}]}
374 ${onu_device_id}= Get Device ID From SN ${src['onu']}
375 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
376 ... ${of_id}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700377 Wait Until Keyword Succeeds 180s 5s Validate Device ENABLED ACTIVE
Hema567f3012020-03-25 00:51:53 +0530378 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
379 END
380
Hema783279b2020-01-22 15:37:37 +0530381Test disable ONUs and OLT then delete ONUs and OLT
382 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
383 ... This TC is to confirm that ONU removal is not impacting OLT
384 ... Devices will be removed during the execution of this TC
385 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800386 [Tags] functional VOL-2354 DisableDeleteONUandOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700387 [Setup] Start Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700388 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700389 ... AND Stop Logging DisableDeleteONUandOLT
Suchitra Vemuriba4f3712020-01-24 16:18:26 -0800390 ${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Hema783279b2020-01-22 15:37:37 +0530391 FOR ${I} IN RANGE 0 ${num_onus}
392 ${src}= Set Variable ${hosts.src[${I}]}
393 ${dst}= Set Variable ${hosts.dst[${I}]}
394 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700395 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800396 ... Validate Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530397 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800398 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
399 ... Validate OLT Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530400 ... REACHABLE ${olt_serial_number}
401 ${rc} ${output}= Run and Return Rc and Output
402 ... ${VOLTCTL_CONFIG}; voltctl device disable ${onu_device_id}
403 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800404 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
405 ... Validate Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530406 ... REACHABLE ${src['onu']} onu=false
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700407 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800408 ... Validate OLT Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530409 ... REACHABLE ${olt_serial_number}
410 END
411 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
412 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800413 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
414 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
Hema783279b2020-01-22 15:37:37 +0530415 ... ${olt_serial_number}
416 FOR ${I} IN RANGE 0 ${num_onus}
417 ${src}= Set Variable ${hosts.src[${I}]}
418 ${dst}= Set Variable ${hosts.dst[${I}]}
419 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800420 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
421 ... Validate Device DISABLED DISCOVERED
422 ... UNREACHABLE ${src['onu']} onu=false
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530423 Delete Device ${onu_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800424 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
425 ... Validate OLT Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530426 ... REACHABLE ${olt_serial_number}
427 END
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530428 Delete Device ${olt_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800429 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
Hardik Windlass480f3e22020-04-02 20:14:14 +0530430 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
431 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
David Bainbridgef81cd642019-11-20 00:14:47 +0000432
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800433Validate authentication on a disabled ONU
suraj gour472da1c2020-02-25 05:44:51 +0000434 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
435 ... Perform disable on the ONUs and validate that the authentication do not succeed
436 ... Perform enable on the ONUs and validate that authentication successful
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800437 [Tags] functional DisableONU_AuthCheck
438 # Creates Devices in the Setup
Andy Baviere187eda2020-04-20 15:00:02 -0700439 [Setup] Run Keywords Start Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800440 ... AND Setup
441 [Teardown] Run Keywords Collect Logs
442 ... AND Stop Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800443 ... AND Delete Device and Verify
444 Run Keyword and Ignore Error Collect Logs
445 Run Keyword If ${has_dataplane} Clean Up Linux
446 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
447 Clean WPA Process
suraj gour472da1c2020-02-25 05:44:51 +0000448 FOR ${I} IN RANGE 0 ${num_onus}
449 ${src}= Set Variable ${hosts.src[${I}]}
450 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800451 Run Keyword and Ignore Error Collect Logs
suraj gour472da1c2020-02-25 05:44:51 +0000452 ${onu_device_id}= Get Device ID From SN ${src['onu']}
453 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
454 ... ${of_id}
455 Disable Device ${onu_device_id}
456 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
457 ... REACHABLE ${src['onu']} onu=false
Andy Bavier84834d42020-02-25 13:49:50 -0700458 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
459 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800460 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication False
461 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700462 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800463 Enable Device ${onu_device_id}
464 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
465 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
466 Run Keyword and Ignore Error Collect Logs
467 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
468 ... ENABLED ACTIVE REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
469 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
470 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700471 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
suraj gour472da1c2020-02-25 05:44:51 +0000472 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
473 END
474 Run Keyword and Ignore Error Collect Logs
475
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000476Data plane verification using TCP
477 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
478 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavierbbac4192020-06-29 21:42:10 -0700479 [Tags] dataplane BandwidthProfileTCP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700480 [Setup] Start Logging BandwidthProfileTCP
481 [Teardown] Run Keywords Collect Logs
482 ... AND Stop Logging BandwidthProfileTCP
Andy Baviereff938d2020-06-29 18:27:49 -0700483 Pass Execution If '${has_dataplane}'=='False'
484 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Andy Bavierd74f33c2020-05-12 12:45:36 -0700485 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000486 FOR ${I} IN RANGE 0 ${num_onus}
487 ${src}= Set Variable ${hosts.src[${I}]}
488 ${dst}= Set Variable ${hosts.dst[${I}]}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700489
490 # Check for iperf3 and jq tools
491 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
492 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
493 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
494
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000495 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
496 ... ${of_id}
497 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
498 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
499 ... upstreamBandwidthProfile
500 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
501 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
502 ... downstreamBandwidthProfile
503 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
504
505 # Stream TCP packets from RG to server
506 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
507 ... args=-t 30
508 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
509
510 # Stream TCP packets from server to RG
511 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
512 ... args=-R -t 30
513 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
514
515 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
516 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
517 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
518 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
519
520 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
521 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700522 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
523 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
524 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000525 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
526 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
527 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
528 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
529 END
530
531Data plane verification using UDP
532 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
533 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavierbbac4192020-06-29 21:42:10 -0700534 [Tags] dataplane BandwidthProfileUDP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700535 [Setup] Start Logging BandwidthProfileUDP
536 [Teardown] Run Keywords Collect Logs
537 ... AND Stop Logging BandwidthProfileUDP
Andy Baviereff938d2020-06-29 18:27:49 -0700538 Pass Execution If '${has_dataplane}'=='False'
539 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Andy Bavierd74f33c2020-05-12 12:45:36 -0700540 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000541 FOR ${I} IN RANGE 0 ${num_onus}
542 ${src}= Set Variable ${hosts.src[${I}]}
543 ${dst}= Set Variable ${hosts.dst[${I}]}
Andy Bavierd59f9772020-07-01 12:00:42 -0700544
545 # Check for iperf3 and jq tools
546 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
547 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
548 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
549
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000550 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
551 ... ${of_id}
552 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
553 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
554 ... upstreamBandwidthProfile
555 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
556 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
557 ... downstreamBandwidthProfile
558 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
559
560 # Stream UDP packets from RG to server
Andrea Campanella29341a32020-08-03 22:06:26 +0200561 Run Keyword If ${limiting_bw_value_upstream} != 1000000
562 ... ${uprate}= Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
563 ... ELSE
564 ... ${uprate}= Set Variable ${limiting_bw_value_upstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000565 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700566 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000567 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
568 ${actual_upstream_bw_used}= Evaluate
569 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
570
571 # Stream UDP packets from server to RG
Andrea Campanella29341a32020-08-03 22:06:26 +0200572 Run Keyword If ${limiting_bw_value_dnstream} != 1000000
573 ... ${dnrate}= Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
574 ... ELSE
575 ... ${dnrate}= Set Variable ${limiting_bw_value_dnstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000576 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700577 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000578 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
579 ${actual_dnstream_bw_used}= Evaluate
580 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
581
582 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
583 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
584 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
585 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
586
587 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
588 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700589 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
590 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
591 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000592 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
593 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
594 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
595 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
596 END
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800597
Suraj Gour33651272020-05-04 10:10:16 +0530598Validate parsing of data traffic through voltha using tech profile
599 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
600 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
601 ... Install jq tool to read json file, where test suite is being running
602 ... Make sure 9999 port is enabled or forwarded for both upsteam and downstream direction
603 ... This test sends UDP packets on port 9999 with pbits between 0 and 7 and validates that
604 ... the pbits are preserved by the PON.
Andy Bavierbbac4192020-06-29 21:42:10 -0700605 [Tags] dataplane TechProfile VOL-2054
Suraj Gour33651272020-05-04 10:10:16 +0530606 [Setup] Start Logging TechProfile
607 [Teardown] Run Keywords Collect Logs
608 ... AND Stop Logging TechProfile
609 Pass Execution If '${has_dataplane}'=='False'
610 ... Skipping test: Technology profile validation can be done only in physical pod
611 FOR ${I} IN RANGE 0 ${num_onus}
612 ${src}= Set Variable ${hosts.src[${I}]}
613 ${dst}= Set Variable ${hosts.dst[${I}]}
614
615 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
616 ${bng_user}= Get Variable Value ${dst['noroot_user']}
617 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
Andy Bavierf4b7d1d2020-06-30 11:14:04 -0700618 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
Suraj Gour33651272020-05-04 10:10:16 +0530619 ... Skipping test: credentials for BNG login required in deployment config
620
621 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
622 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
623 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
624 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
625 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
626 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
627 Log Upstream test
Andy Baviereff938d2020-06-29 18:27:49 -0700628 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Suraj Gour33651272020-05-04 10:10:16 +0530629 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src['dp_iface_name']}
630 ... 0 udp 9999 0 vlan
631 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
632 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
633 Log Downstream test
634 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
635 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
636 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
637 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
Andy Baviereff938d2020-06-29 18:27:49 -0700638 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Suraj Gour33651272020-05-04 10:10:16 +0530639 ... ${rg_ip} ${src['dp_iface_name']} ${dst['dp_iface_name']}.${src['s_tag']}
640 ... 0 udp 9999 ${src['c_tag']} udp
641 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
642 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
643 END
644
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700645*** Keywords ***
646Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700647 [Documentation] Set up the test suite
648 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700649 #Restore all ONUs
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700650 #Run Keyword If ${has_dataplane} RestoreONUs ${num_onus}
651 #power_switch.robot needs it to support different vendor's power switch
652 ${switch_type}= Get Variable Value ${web_power_switch.type}
653 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700654
David Bainbridgef81cd642019-11-20 00:14:47 +0000655Clear All Devices Then Create New Device
656 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000657 # Remove all devices from voltha and nos
658 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000659 # Execute normal test Setup Keyword
660 Setup