blob: eb9e8e2fcc8a18878fd0fed8692e212e0bdf6c31 [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
Andy Bavierba9866b2019-10-11 07:11:53 -070051${has_dataplane} True
Andy Bavierba9866b2019-10-11 07:11:53 -070052${teardown_device} False
Zack Williamsa8fe75a2020-01-10 14:25:27 -070053${scripts} ../../scripts
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070054
Gayathri.Selvan92d16862020-03-19 14:47:58 +000055# For dataplane bandwidth testing
56${upper_margin_pct} 105 # Allow 5% over the limit
Andy Bavierf6ab19c2020-05-14 10:34:47 -070057${lower_margin_pct} 92 # Allow 8% under the limit
Gayathri.Selvan92d16862020-03-19 14:47:58 +000058${udp_rate_multiplier} 1.10 # Send UDP at bw profile limit * rate_multiplier
59${udp_packet_bytes} 1400 # UDP payload in bytes
60
Andy Bavierabeba262020-02-07 16:22:16 -070061# Per-test logging on failure is turned off by default; set this variable to enable
62${container_log_dir} ${None}
63
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070064*** Test Cases ***
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070065Reboot ONUs Physically
66 [Documentation] This test reboots ONUs physically before execution all the tests
67 ... Test case runs only on the PODs that are configured with PowerSwitch that
68 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
69 [Tags] functional PowerSwitch RebootAllONUs
70 [Setup] Start Logging RebootAllONUs
71 [Teardown] Run Keywords Collect Logs
72 ... AND Stop Logging RebootAllONUs
73 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
74 FOR ${I} IN RANGE 0 ${num_onus}
75 ${src}= Set Variable ${hosts.src[${I}]}
76 ${dst}= Set Variable ${hosts.dst[${I}]}
77 Disable Switch Outlet ${src['power_switch_port']}
78 Sleep 60s
79 Enable Switch Outlet ${src['power_switch_port']}
80 Sleep 60s
81 END
82
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070083Sanity E2E Test for OLT/ONU on POD
84 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
85 ... Validate successful authentication/DHCP/E2E ping for the tech profile that is used
Andy Bavierba9866b2019-10-11 07:11:53 -070086 [Tags] sanity test1
Andy Baviere187eda2020-04-20 15:00:02 -070087 [Setup] Run Keywords Start Logging SanityTest
Andy Bavier4a8450e2020-02-04 08:58:37 -070088 ... AND Setup
89 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -070090 ... AND Stop Logging SanityTest
Suchitra Vemuric5295a32019-12-15 20:32:04 -080091 Run Keyword If ${has_dataplane} Clean Up Linux
Zack Williamsa8fe75a2020-01-10 14:25:27 -070092 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070093
Hema93762cf2020-01-29 19:59:28 +053094Test Disable and Enable OLT
95 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
96 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
97 ... Perform disable on the OLT and validate that the pings do not succeed
98 ... Perform enable on the OLT and validate that the pings are successful
Suchitra Vemuri14c9a032020-05-27 14:01:08 -070099 [Tags] functional VOL-2410 DisableEnableOLT notready
Andy Baviere187eda2020-04-20 15:00:02 -0700100 [Setup] Start Logging DisableEnableOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700101 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700102 ... AND Stop Logging DisableEnableOLT
Hema93762cf2020-01-29 19:59:28 +0530103 #Disable the OLT and verify the OLT/ONUs are disabled properly
104 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
105 Should Be Equal As Integers ${rc} 0
106 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
107 ... ${olt_serial_number}
108 FOR ${I} IN RANGE 0 ${num_onus}
109 ${src}= Set Variable ${hosts.src[${I}]}
110 ${dst}= Set Variable ${hosts.dst[${I}]}
111 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530112 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
113 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
Hema93762cf2020-01-29 19:59:28 +0530114 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED DISCOVERED
115 ... UNREACHABLE ${src['onu']} onu=false
116 #Verify that ping fails
TorstenThieme754fec72020-02-18 07:24:46 +0000117 Run Keyword If ${has_dataplane}
118 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
Hema93762cf2020-01-29 19:59:28 +0530119 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
Andrea Campanellaa6e17322020-05-04 14:31:44 +0200120 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530121 # Remove Subscriber Access (To replicate ATT workflow)
122 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
123 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Hema93762cf2020-01-29 19:59:28 +0530124 END
125 #Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
126 Enable Device ${olt_device_id}
127 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
128 ... ${olt_serial_number}
Hemaf64d34c2020-03-25 00:40:17 +0530129 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
130 ... PON_OLT ETHERNET_NNI
Hardik Windlass7c801e62020-05-04 19:33:21 +0530131 Run Keyword If ${has_dataplane} Clean Up Linux
132 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Hema93762cf2020-01-29 19:59:28 +0530133
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800134Test Disable and Enable ONU
135 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
136 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
137 ... Perform disable on the ONUs and validate that the pings do not succeed
138 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800139 [Tags] functional DisableEnableONU released
Andy Baviere187eda2020-04-20 15:00:02 -0700140 [Setup] Start Logging DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700141 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700142 ... AND Stop Logging DisableEnableONU
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800143 FOR ${I} IN RANGE 0 ${num_onus}
144 ${src}= Set Variable ${hosts.src[${I}]}
145 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800146 ${onu_device_id}= Get Device ID From SN ${src['onu']}
147 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
148 ... ${of_id}
149 Disable Device ${onu_device_id}
Andy Bavier46c8be32020-01-21 10:06:27 -0700150 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700151 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
152 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700153 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
154 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800155 Enable Device ${onu_device_id}
156 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800157 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530158 # Verify subscriber access flows are added for the ONU port
159 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
160 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
161 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700162 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
163 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700164 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
165 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
166 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
167 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800168 END
169
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800170Test Subscriber Delete and Add
171 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
172 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700173 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800174 ... Re-add the subscriber and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800175 [Tags] functional SubAddDelete released
Andy Baviere187eda2020-04-20 15:00:02 -0700176 [Setup] Start Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700177 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700178 ... AND Stop Logging SubAddDelete
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800179 FOR ${I} IN RANGE 0 ${num_onus}
180 ${src}= Set Variable ${hosts.src[${I}]}
181 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800182 ${onu_device_id}= Get Device ID From SN ${src['onu']}
183 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
184 ... ${of_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800185 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800186 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
187 Sleep 10s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800188 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
189 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700190 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
191 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700192 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
193 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800194 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800195 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
196 Sleep 10s
197 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800198 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
199 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800200 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530201 # Verify subscriber access flows are added for the ONU port
202 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
203 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
204 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700205 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
206 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700207 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
208 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
209 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
210 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800211 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800212
suraj gourd5cfdbb2019-12-13 12:44:55 +0000213Check DHCP attempt fails when subscriber is not added
214 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
215 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700216 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800217 [Tags] functional SubsRemoveDHCP released
Andy Baviere187eda2020-04-20 15:00:02 -0700218 [Setup] Start Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700219 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700220 ... AND Stop Logging SubsRemoveDHCP
suraj gourd5cfdbb2019-12-13 12:44:55 +0000221 FOR ${I} IN RANGE 0 ${num_onus}
222 ${src}= Set Variable ${hosts.src[${I}]}
223 ${dst}= Set Variable ${hosts.dst[${I}]}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700224 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000225 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
226 ... ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800227 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']}
228 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
229 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
230 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800231 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000232 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri8f1d3062020-02-28 11:57:37 -0800233 Sleep 15s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800234 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
235 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700236 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
237 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
238 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
239 Run Keyword And Ignore Error Login And Run Command On Remote System
240 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800241 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000242 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
243 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
244 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
245 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
246 ... ${dst['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800247 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000248 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri40fdf3c2020-05-28 23:41:03 -0700249 Sleep 10s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800250 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
251 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530252 # Verify subscriber access flows are added for the ONU port
253 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
254 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
255 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000256 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
257 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
258 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
259 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
260 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800261 Run Keyword and Ignore Error Collect Logs
262 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800263
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800264Test Disable and Enable ONU scenario for ATT workflow
265 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
266 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
267 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700268 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
269 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800270 ... VOL-2284
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800271 [Tags] functional ATT_DisableEnableONU released
Andy Baviere187eda2020-04-20 15:00:02 -0700272 [Setup] Start Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700273 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700274 ... AND Stop Logging ATT_DisableEnableONU
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800275 FOR ${I} IN RANGE 0 ${num_onus}
276 ${src}= Set Variable ${hosts.src[${I}]}
277 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800278 ${onu_device_id}= Get Device ID From SN ${src['onu']}
279 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
280 ... ${of_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800281 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700282 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800283 Disable Device ${onu_device_id}
Suchitra Vemuri3158f3c2020-05-28 17:58:26 -0700284 Sleep 10s
ubuntu6b6e7d42020-03-02 12:35:42 -0800285 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800286 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700287 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
288 ... Wait Until Keyword Succeeds 60s 2s Check Ping
289 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
290 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800291 ... ELSE sleep 60s
292 Enable Device ${onu_device_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800293 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800294 ... ${ONOS_SSH_PORT} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700295 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
296 ... Validate Authentication After Reassociate True
297 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800298 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800299 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700300 ... ${ONOS_SSH_PORT} ${onu_port}
ubuntu6b6e7d42020-03-02 12:35:42 -0800301 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800302 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri3158f3c2020-05-28 17:58:26 -0700303 Sleep 10s
Hardik Windlass21807632020-04-14 16:24:55 +0530304 # Verify subscriber access flows are added for the ONU port
305 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
306 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
307 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800308 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700309 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800310 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
311 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
312 ... ${dst['container_name']}
313 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800314 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800315 Run Keyword and Ignore Error Collect Logs
suraj gourd5cfdbb2019-12-13 12:44:55 +0000316 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000317
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800318Delete OLT, ReAdd OLT and Perform Sanity Test
319 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
320 ... Disable and Delete the OLT
321 ... Create/Enable the same OLT again
322 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800323 [Tags] functional DeleteOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700324 [Setup] Start Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700325 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700326 ... AND Stop Logging DeleteOLT
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800327 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass480f3e22020-04-02 20:14:14 +0530328 Delete Device and Verify
329 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
330 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800331 Run Keyword and Ignore Error Collect Logs
332 # Recreate the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530333 Setup
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800334 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800335
Hema567f3012020-03-25 00:51:53 +0530336Check Mib State on OLT recreation after ONU, OLT deletion
337 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable,
338 ... Disable and Delete the ONU, Disable and Delete the OLT
339 ... Create/Enable the OLT again and Check for the Mib State of the ONUs
340 [Tags] functional CheckMibState notready
Andy Baviere187eda2020-04-20 15:00:02 -0700341 [Setup] Start Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530342 [Teardown] Run Keywords Collect Logs
343 ... AND Stop Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530344 #Disable and Delete the ONU
345 FOR ${I} IN RANGE 0 ${num_onus}
346 ${src}= Set Variable ${hosts.src[${I}]}
347 ${dst}= Set Variable ${hosts.dst[${I}]}
348 ${onu_device_id}= Get Device ID From SN ${src['onu']}
349 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
350 ... ${of_id}
351 Disable Device ${onu_device_id}
352 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
353 Delete Device ${onu_device_id}
354 END
355 #Disable and Delete the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530356 Delete Device and Verify
357 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
358 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
359 # Recreate the OLT
Hema567f3012020-03-25 00:51:53 +0530360 Run Keyword If ${has_dataplane} Sleep 180s
361 ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT}
362 Set Suite Variable ${olt_device_id}
363 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED
364 ... UNKNOWN UNKNOWN ${olt_device_id}
365 Enable Device ${olt_device_id}
366 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
367 ... ${olt_serial_number}
368 #Check for the ONU status and ONU Mib State should be "omci-flows-pushed"
369 FOR ${I} IN RANGE 0 ${num_onus}
370 ${src}= Set Variable ${hosts.src[${I}]}
371 ${dst}= Set Variable ${hosts.dst[${I}]}
372 ${onu_device_id}= Get Device ID From SN ${src['onu']}
373 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
374 ... ${of_id}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700375 Wait Until Keyword Succeeds 180s 5s Validate Device ENABLED ACTIVE
Hema567f3012020-03-25 00:51:53 +0530376 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
377 END
378
Hema783279b2020-01-22 15:37:37 +0530379Test disable ONUs and OLT then delete ONUs and OLT
380 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
381 ... This TC is to confirm that ONU removal is not impacting OLT
382 ... Devices will be removed during the execution of this TC
383 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800384 [Tags] functional VOL-2354 DisableDeleteONUandOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700385 [Setup] Start Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700386 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700387 ... AND Stop Logging DisableDeleteONUandOLT
Suchitra Vemuriba4f3712020-01-24 16:18:26 -0800388 ${olt_device_id}= Get Device ID From SN ${olt_serial_number}
Hema783279b2020-01-22 15:37:37 +0530389 FOR ${I} IN RANGE 0 ${num_onus}
390 ${src}= Set Variable ${hosts.src[${I}]}
391 ${dst}= Set Variable ${hosts.dst[${I}]}
392 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700393 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800394 ... Validate Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530395 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800396 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
397 ... Validate OLT Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530398 ... REACHABLE ${olt_serial_number}
399 ${rc} ${output}= Run and Return Rc and Output
400 ... ${VOLTCTL_CONFIG}; voltctl device disable ${onu_device_id}
401 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800402 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
403 ... Validate Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530404 ... REACHABLE ${src['onu']} onu=false
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700405 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800406 ... Validate OLT Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530407 ... REACHABLE ${olt_serial_number}
408 END
409 ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
410 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800411 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
412 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
Hema783279b2020-01-22 15:37:37 +0530413 ... ${olt_serial_number}
414 FOR ${I} IN RANGE 0 ${num_onus}
415 ${src}= Set Variable ${hosts.src[${I}]}
416 ${dst}= Set Variable ${hosts.dst[${I}]}
417 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800418 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
419 ... Validate Device DISABLED DISCOVERED
420 ... UNREACHABLE ${src['onu']} onu=false
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530421 Delete Device ${onu_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800422 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
423 ... Validate OLT Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530424 ... REACHABLE ${olt_serial_number}
425 END
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530426 Delete Device ${olt_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800427 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
Hardik Windlass480f3e22020-04-02 20:14:14 +0530428 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
429 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
David Bainbridgef81cd642019-11-20 00:14:47 +0000430
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800431Validate authentication on a disabled ONU
suraj gour472da1c2020-02-25 05:44:51 +0000432 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
433 ... Perform disable on the ONUs and validate that the authentication do not succeed
434 ... Perform enable on the ONUs and validate that authentication successful
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800435 [Tags] functional DisableONU_AuthCheck
436 # Creates Devices in the Setup
Andy Baviere187eda2020-04-20 15:00:02 -0700437 [Setup] Run Keywords Start Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800438 ... AND Setup
439 [Teardown] Run Keywords Collect Logs
440 ... AND Stop Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800441 ... AND Delete Device and Verify
442 Run Keyword and Ignore Error Collect Logs
443 Run Keyword If ${has_dataplane} Clean Up Linux
444 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
445 Clean WPA Process
suraj gour472da1c2020-02-25 05:44:51 +0000446 FOR ${I} IN RANGE 0 ${num_onus}
447 ${src}= Set Variable ${hosts.src[${I}]}
448 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800449 Run Keyword and Ignore Error Collect Logs
suraj gour472da1c2020-02-25 05:44:51 +0000450 ${onu_device_id}= Get Device ID From SN ${src['onu']}
451 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
452 ... ${of_id}
453 Disable Device ${onu_device_id}
454 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
455 ... REACHABLE ${src['onu']} onu=false
Andy Bavier84834d42020-02-25 13:49:50 -0700456 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
457 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800458 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication False
459 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700460 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800461 Enable Device ${onu_device_id}
462 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
463 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
464 Run Keyword and Ignore Error Collect Logs
465 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
466 ... ENABLED ACTIVE REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
467 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
468 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700469 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
suraj gour472da1c2020-02-25 05:44:51 +0000470 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
471 END
472 Run Keyword and Ignore Error Collect Logs
473
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000474Data plane verification using TCP
475 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
476 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavierbbac4192020-06-29 21:42:10 -0700477 [Tags] dataplane BandwidthProfileTCP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700478 [Setup] Start Logging BandwidthProfileTCP
479 [Teardown] Run Keywords Collect Logs
480 ... AND Stop Logging BandwidthProfileTCP
Andy Baviereff938d2020-06-29 18:27:49 -0700481 Pass Execution If '${has_dataplane}'=='False'
482 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Andy Bavierd74f33c2020-05-12 12:45:36 -0700483 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000484 FOR ${I} IN RANGE 0 ${num_onus}
485 ${src}= Set Variable ${hosts.src[${I}]}
486 ${dst}= Set Variable ${hosts.dst[${I}]}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700487
488 # Check for iperf3 and jq tools
489 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
490 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
491 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
492
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000493 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
494 ... ${of_id}
495 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
496 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
497 ... upstreamBandwidthProfile
498 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
499 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
500 ... downstreamBandwidthProfile
501 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
502
503 # Stream TCP packets from RG to server
504 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
505 ... args=-t 30
506 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
507
508 # Stream TCP packets from server to RG
509 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
510 ... args=-R -t 30
511 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
512
513 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
514 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
515 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
516 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
517
518 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
519 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700520 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
521 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
522 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000523 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
524 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
525 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
526 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
527 END
528
529Data plane verification using UDP
530 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
531 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavierbbac4192020-06-29 21:42:10 -0700532 [Tags] dataplane BandwidthProfileUDP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700533 [Setup] Start Logging BandwidthProfileUDP
534 [Teardown] Run Keywords Collect Logs
535 ... AND Stop Logging BandwidthProfileUDP
Andy Baviereff938d2020-06-29 18:27:49 -0700536 Pass Execution If '${has_dataplane}'=='False'
537 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Andy Bavierd74f33c2020-05-12 12:45:36 -0700538 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000539 FOR ${I} IN RANGE 0 ${num_onus}
540 ${src}= Set Variable ${hosts.src[${I}]}
541 ${dst}= Set Variable ${hosts.dst[${I}]}
Andy Bavierd59f9772020-07-01 12:00:42 -0700542
543 # Check for iperf3 and jq tools
544 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
545 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
546 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
547
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000548 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
549 ... ${of_id}
550 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
551 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
552 ... upstreamBandwidthProfile
553 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
554 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
555 ... downstreamBandwidthProfile
556 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
557
558 # Stream UDP packets from RG to server
559 ${uprate}= Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
560 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700561 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000562 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
563 ${actual_upstream_bw_used}= Evaluate
564 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
565
566 # Stream UDP packets from server to RG
567 ${dnrate}= Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
568 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700569 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000570 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
571 ${actual_dnstream_bw_used}= Evaluate
572 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
573
574 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
575 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
576 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
577 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
578
579 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
580 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700581 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
582 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
583 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000584 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
585 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
586 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
587 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
588 END
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800589
Suraj Gour33651272020-05-04 10:10:16 +0530590Validate parsing of data traffic through voltha using tech profile
591 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
592 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
593 ... Install jq tool to read json file, where test suite is being running
594 ... Make sure 9999 port is enabled or forwarded for both upsteam and downstream direction
595 ... This test sends UDP packets on port 9999 with pbits between 0 and 7 and validates that
596 ... the pbits are preserved by the PON.
Andy Bavierbbac4192020-06-29 21:42:10 -0700597 [Tags] dataplane TechProfile VOL-2054
Suraj Gour33651272020-05-04 10:10:16 +0530598 [Setup] Start Logging TechProfile
599 [Teardown] Run Keywords Collect Logs
600 ... AND Stop Logging TechProfile
601 Pass Execution If '${has_dataplane}'=='False'
602 ... Skipping test: Technology profile validation can be done only in physical pod
603 FOR ${I} IN RANGE 0 ${num_onus}
604 ${src}= Set Variable ${hosts.src[${I}]}
605 ${dst}= Set Variable ${hosts.dst[${I}]}
606
607 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
608 ${bng_user}= Get Variable Value ${dst['noroot_user']}
609 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
Andy Bavierf4b7d1d2020-06-30 11:14:04 -0700610 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
Suraj Gour33651272020-05-04 10:10:16 +0530611 ... Skipping test: credentials for BNG login required in deployment config
612
613 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
614 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
615 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
616 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
617 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
618 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
619 Log Upstream test
Andy Baviereff938d2020-06-29 18:27:49 -0700620 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Suraj Gour33651272020-05-04 10:10:16 +0530621 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src['dp_iface_name']}
622 ... 0 udp 9999 0 vlan
623 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
624 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
625 Log Downstream test
626 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
627 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
628 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
629 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
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 ... ${rg_ip} ${src['dp_iface_name']} ${dst['dp_iface_name']}.${src['s_tag']}
632 ... 0 udp 9999 ${src['c_tag']} udp
633 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
634 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
635 END
636
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700637*** Keywords ***
638Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700639 [Documentation] Set up the test suite
640 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700641 #Restore all ONUs
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700642 #Run Keyword If ${has_dataplane} RestoreONUs ${num_onus}
643 #power_switch.robot needs it to support different vendor's power switch
644 ${switch_type}= Get Variable Value ${web_power_switch.type}
645 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700646
David Bainbridgef81cd642019-11-20 00:14:47 +0000647Clear All Devices Then Create New Device
648 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000649 # Remove all devices from voltha and nos
650 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000651 # Execute normal test Setup Keyword
652 Setup