blob: 98eb13379effddb4e58042ae1b379fdd022ebe69 [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
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080059${lower_margin_pct} 90 # Allow 8% under the limit
Gayathri.Selvan92d16862020-03-19 14:47:58 +000060${udp_rate_multiplier} 1.10 # Send UDP at bw profile limit * rate_multiplier
Andy Bavierc80a2742020-08-28 10:59:05 -070061${udp_packet_bytes} 1470 # UDP payload in bytes
Gayathri.Selvan92d16862020-03-19 14:47:58 +000062
Andy Bavierabeba262020-02-07 16:22:16 -070063# Per-test logging on failure is turned off by default; set this variable to enable
64${container_log_dir} ${None}
65
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070066*** Test Cases ***
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070067Reboot ONUs Physically
68 [Documentation] This test reboots ONUs physically before execution all the tests
69 ... Test case runs only on the PODs that are configured with PowerSwitch that
70 ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot)
71 [Tags] functional PowerSwitch RebootAllONUs
72 [Setup] Start Logging RebootAllONUs
73 [Teardown] Run Keywords Collect Logs
74 ... AND Stop Logging RebootAllONUs
75 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080076 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070077 ${src}= Set Variable ${hosts.src[${I}]}
78 ${dst}= Set Variable ${hosts.dst[${I}]}
79 Disable Switch Outlet ${src['power_switch_port']}
80 Sleep 60s
81 Enable Switch Outlet ${src['power_switch_port']}
82 Sleep 60s
83 END
84
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070085Sanity E2E Test for OLT/ONU on POD
86 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
87 ... Validate successful authentication/DHCP/E2E ping for the tech profile that is used
Andy Bavierba9866b2019-10-11 07:11:53 -070088 [Tags] sanity test1
Andy Baviere187eda2020-04-20 15:00:02 -070089 [Setup] Run Keywords Start Logging SanityTest
Andy Bavier4a8450e2020-02-04 08:58:37 -070090 ... AND Setup
91 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -070092 ... AND Stop Logging SanityTest
Suchitra Vemuric5295a32019-12-15 20:32:04 -080093 Run Keyword If ${has_dataplane} Clean Up Linux
Zack Williamsa8fe75a2020-01-10 14:25:27 -070094 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -070095
Suchitra Vemuri6db89412019-11-14 14:52:54 -080096Test Disable and Enable ONU
97 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
98 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
99 ... Perform disable on the ONUs and validate that the pings do not succeed
100 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800101 [Tags] functional DisableEnableONU released
Andy Baviere187eda2020-04-20 15:00:02 -0700102 [Setup] Start Logging DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700103 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700104 ... AND Stop Logging DisableEnableONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800105 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800106 ${src}= Set Variable ${hosts.src[${I}]}
107 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800108 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800109 ${onu_device_id}= Get Device ID From SN ${src['onu']}
110 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
111 ... ${of_id}
112 Disable Device ${onu_device_id}
Andy Bavier46c8be32020-01-21 10:06:27 -0700113 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700114 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
115 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700116 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
117 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800118 Enable Device ${onu_device_id}
119 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800120 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530121 # Verify subscriber access flows are added for the ONU port
122 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
123 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
124 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700125 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
126 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700127 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
128 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
129 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
130 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri6db89412019-11-14 14:52:54 -0800131 END
132
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800133Test Subscriber Delete and Add
134 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
135 ... Assuming that all the ONUs are authenticated/DHCP/pingable
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700136 ... Delete a subscriber and validate that the pings do not succeed
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800137 ... Re-add the subscriber and validate that the pings are successful
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800138 [Tags] functional SubAddDelete released
Andy Baviere187eda2020-04-20 15:00:02 -0700139 [Setup] Start Logging SubAddDelete
Andy Bavier4a8450e2020-02-04 08:58:37 -0700140 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700141 ... AND Stop Logging SubAddDelete
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800142 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800143 ${src}= Set Variable ${hosts.src[${I}]}
144 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800145 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -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}
ubuntu6b6e7d42020-03-02 12:35:42 -0800149 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800150 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
151 Sleep 10s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800152 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
153 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700154 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
155 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700156 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
157 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800158 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800159 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
160 Sleep 10s
161 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800162 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
163 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800164 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530165 # Verify subscriber access flows are added for the ONU port
166 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
167 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
168 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Andy Bavier33e6dd32020-01-16 13:35:20 -0700169 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
170 ... Wait Until Keyword Succeeds 60s 2s
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700171 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
172 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
173 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
174 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800175 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800176
suraj gourd5cfdbb2019-12-13 12:44:55 +0000177Check DHCP attempt fails when subscriber is not added
178 [Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
179 ... when again added subscriber access, DHCP attempt, ping succeeds
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700180 ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
Suchitra Vemuri04245f72020-01-08 16:43:24 -0800181 [Tags] functional SubsRemoveDHCP released
Andy Baviere187eda2020-04-20 15:00:02 -0700182 [Setup] Start Logging SubsRemoveDHCP
Andy Bavier4a8450e2020-02-04 08:58:37 -0700183 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700184 ... AND Stop Logging SubsRemoveDHCP
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800185 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000186 ${src}= Set Variable ${hosts.src[${I}]}
187 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800188 ${of_id}= Get ofID From OLT List ${src['olt']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700189 ${onu_device_id}= Get Device ID From SN ${src['onu']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000190 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
191 ... ${of_id}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800192 Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']}
193 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
194 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
195 ... ${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}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000197 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri8f1d3062020-02-28 11:57:37 -0800198 Sleep 15s
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800199 Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
200 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700201 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
202 ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
203 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
204 Run Keyword And Ignore Error Login And Run Command On Remote System
205 ... ifconfig | grep -A 10 ens ${src['ip']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800206 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000207 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
208 ... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
209 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
210 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
211 ... ${dst['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800212 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000213 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri40fdf3c2020-05-28 23:41:03 -0700214 Sleep 10s
Suchitra Vemuri9da44302020-03-04 14:24:49 -0800215 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
216 ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlass21807632020-04-14 16:24:55 +0530217 # Verify subscriber access flows are added for the ONU port
218 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
219 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
220 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
suraj gourd5cfdbb2019-12-13 12:44:55 +0000221 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
222 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
223 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
224 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
225 ... ${dst['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800226 Run Keyword and Ignore Error Collect Logs
227 END
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800228
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800229Test Disable and Enable ONU scenario for ATT workflow
230 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
231 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
232 ... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700233 ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
234 ... validate that the pings are successful
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800235 ... VOL-2284
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800236 [Tags] functional ATT_DisableEnableONU released
Andy Baviere187eda2020-04-20 15:00:02 -0700237 [Setup] Start Logging ATT_DisableEnableONU
Andy Bavier4a8450e2020-02-04 08:58:37 -0700238 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700239 ... AND Stop Logging ATT_DisableEnableONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800240 FOR ${I} IN RANGE 0 ${num_all_onus}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800241 ${src}= Set Variable ${hosts.src[${I}]}
242 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800243 ${of_id}= Get ofID From OLT List ${src['olt']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800244 ${onu_device_id}= Get Device ID From SN ${src['onu']}
245 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
246 ... ${of_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800247 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700248 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800249 Disable Device ${onu_device_id}
Suchitra Vemuri3158f3c2020-05-28 17:58:26 -0700250 Sleep 10s
ubuntu6b6e7d42020-03-02 12:35:42 -0800251 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800252 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700253 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
254 ... Wait Until Keyword Succeeds 60s 2s Check Ping
255 ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
256 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800257 ... ELSE sleep 60s
258 Enable Device ${onu_device_id}
ubuntu6b6e7d42020-03-02 12:35:42 -0800259 Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800260 ... ${ONOS_SSH_PORT} ${onu_port}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700261 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
262 ... Validate Authentication After Reassociate True
263 ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800264 ... ${src['container_type']} ${src['container_name']}
ubuntu6b6e7d42020-03-02 12:35:42 -0800265 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${ONOS_SSH_IP}
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700266 ... ${ONOS_SSH_PORT} ${onu_port}
ubuntu6b6e7d42020-03-02 12:35:42 -0800267 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800268 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Suchitra Vemuri3158f3c2020-05-28 17:58:26 -0700269 Sleep 10s
Hardik Windlass21807632020-04-14 16:24:55 +0530270 # Verify subscriber access flows are added for the ONU port
271 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
272 ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
273 ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800274 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
Andy Bavier08ae5852019-12-19 09:12:42 -0700275 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800276 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
277 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
278 ... ${dst['container_name']}
279 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
ubuntu6b6e7d42020-03-02 12:35:42 -0800280 ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Suchitra Vemuri5994cd12019-12-17 22:20:55 -0800281 Run Keyword and Ignore Error Collect Logs
suraj gourd5cfdbb2019-12-13 12:44:55 +0000282 END
suraj gourd5cfdbb2019-12-13 12:44:55 +0000283
Hardik Windlass2b37e712020-06-12 02:13:17 +0530284Test Disable and Enable OLT
285 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
286 ... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
287 ... Perform disable on the OLT and validate that the pings do not succeed
288 ... Perform enable on the OLT and validate that the pings are successful
289 [Tags] functional VOL-2410 DisableEnableOLT
290 [Setup] Start Logging DisableEnableOLT
291 [Teardown] Run Keywords Collect Logs
292 ... AND Stop Logging DisableEnableOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800293 #Disable the OLTs and verify the OLT/ONUs are disabled properly
294 FOR ${I} IN RANGE 0 ${olt_count}
295 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
296 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
297 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800298 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800299 Should Be Equal As Integers ${rc} 0
300 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
301 ... ${olt_serial_number}
302 END
303 # Validate the ONUs
304 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530305 ${src}= Set Variable ${hosts.src[${I}]}
306 ${dst}= Set Variable ${hosts.dst[${I}]}
307 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800308 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530309 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
310 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
311 Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED DISCOVERED
312 ... UNREACHABLE ${src['onu']} onu=false
313 #Verify that ping fails
314 Run Keyword If ${has_dataplane}
315 ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
316 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
317 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
318 # Remove Subscriber Access (To replicate ATT workflow)
319 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
320 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
321 Sleep 10s
322 END
323 #Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800324 FOR ${I} IN RANGE 0 ${olt_count}
325 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
326 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
327 Enable Device ${olt_device_id}
328 Sleep 15s
329 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
330 ... ${olt_serial_number}
331 #TODO: Update for PON_OLT ETHERNET_NNI
332 #Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
333 #... PON_OLT ETHERNET_NNI
334 END
Hardik Windlass2b37e712020-06-12 02:13:17 +0530335 Run Keyword If ${has_dataplane} Clean Up Linux
336 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test
337
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800338Delete OLT, ReAdd OLT and Perform Sanity Test
339 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
340 ... Disable and Delete the OLT
341 ... Create/Enable the same OLT again
342 ... Validate authentication/DHCP/E2E pings succeed for all the ONUs connected to the OLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800343 [Tags] functional DeleteOLT released notready
Andy Baviere187eda2020-04-20 15:00:02 -0700344 [Setup] Start Logging DeleteOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700345 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700346 ... AND Stop Logging DeleteOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800347 #TODO: Update test with new framework changes
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800348 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800349 FOR ${I} IN RANGE 0 ${olt_count}
350 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
351 ${of_id}= Get ofID From OLT List ${olt_serial_number}
352 Delete Device and Verify ${olt_serial_number}
353 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
354 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
355 END
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800356 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800357 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800358 # Recreate the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530359 Setup
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800360 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuri937cd392020-01-12 17:10:42 -0800361
Hema567f3012020-03-25 00:51:53 +0530362Check Mib State on OLT recreation after ONU, OLT deletion
363 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable,
364 ... Disable and Delete the ONU, Disable and Delete the OLT
365 ... Create/Enable the OLT again and Check for the Mib State of the ONUs
366 [Tags] functional CheckMibState notready
Andy Baviere187eda2020-04-20 15:00:02 -0700367 [Setup] Start Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530368 [Teardown] Run Keywords Collect Logs
369 ... AND Stop Logging CheckMibState
Hema567f3012020-03-25 00:51:53 +0530370 #Disable and Delete the ONU
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800371 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema567f3012020-03-25 00:51:53 +0530372 ${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}
377 Disable Device ${onu_device_id}
378 Wait Until Keyword Succeeds 20s 2s Test Devices Disabled in VOLTHA Id=${onu_device_id}
379 Delete Device ${onu_device_id}
380 END
381 #Disable and Delete the OLT
Hardik Windlass480f3e22020-04-02 20:14:14 +0530382 Delete Device and Verify
383 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
384 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
385 # Recreate the OLT
Hema567f3012020-03-25 00:51:53 +0530386 Run Keyword If ${has_dataplane} Sleep 180s
Andrea Campanellab2d09f12021-01-15 16:04:47 +0100387 # This dneeds to be done in for loop, test is not ready
388 ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}"
389 ... Create Device ${list_olts}[${I}][ip] ${OLT_PORT}
390 ... ELSE Create Device ${list_olts}[${I}][ip] ${OLT_PORT} ${list_olts}[${I}][type]
Hema567f3012020-03-25 00:51:53 +0530391 Set Suite Variable ${olt_device_id}
392 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED
393 ... UNKNOWN UNKNOWN ${olt_device_id}
394 Enable Device ${olt_device_id}
395 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
396 ... ${olt_serial_number}
397 #Check for the ONU status and ONU Mib State should be "omci-flows-pushed"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800398 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema567f3012020-03-25 00:51:53 +0530399 ${src}= Set Variable ${hosts.src[${I}]}
400 ${dst}= Set Variable ${hosts.dst[${I}]}
401 ${onu_device_id}= Get Device ID From SN ${src['onu']}
402 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
403 ... ${of_id}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700404 Wait Until Keyword Succeeds 180s 5s Validate Device ENABLED ACTIVE
Hema567f3012020-03-25 00:51:53 +0530405 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
406 END
407
Hema783279b2020-01-22 15:37:37 +0530408Test disable ONUs and OLT then delete ONUs and OLT
409 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
410 ... This TC is to confirm that ONU removal is not impacting OLT
411 ... Devices will be removed during the execution of this TC
412 ... so calling setup at the end to add the devices back to avoid the confusion.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800413 [Tags] functional VOL-2354 DisableDeleteONUandOLT released
Andy Baviere187eda2020-04-20 15:00:02 -0700414 [Setup] Start Logging DisableDeleteONUandOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -0700415 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700416 ... AND Stop Logging DisableDeleteONUandOLT
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800417 #${olt_device_id}= Get Device ID From SN ${olt_serial_number}
418 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema783279b2020-01-22 15:37:37 +0530419 ${src}= Set Variable ${hosts.src[${I}]}
420 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800421 ${of_id}= Get ofID From OLT List ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530422 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700423 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800424 ... Validate Device ENABLED ACTIVE
Hema783279b2020-01-22 15:37:37 +0530425 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800426 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
427 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800428 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530429 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800430 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${onu_device_id}
Hema783279b2020-01-22 15:37:37 +0530431 Should Be Equal As Integers ${rc} 0
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800432 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
433 ... Validate Device DISABLED UNKNOWN
Hema783279b2020-01-22 15:37:37 +0530434 ... REACHABLE ${src['onu']} onu=false
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700435 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800436 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800437 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530438 END
Matteo Scandolo5899be12020-11-11 15:38:07 -0800439
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800440 # Disable all OLTs
441 FOR ${I} IN RANGE 0 ${olt_count}
442 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
443 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
444 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800445 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800446 Should Be Equal As Integers ${rc} 0
447 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
448 ... ${olt_serial_number}
449 END
450 # Validate ONUs after OLT disable
451 FOR ${I} IN RANGE 0 ${num_all_onus}
Hema783279b2020-01-22 15:37:37 +0530452 ${src}= Set Variable ${hosts.src[${I}]}
453 ${dst}= Set Variable ${hosts.dst[${I}]}
454 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800455 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
456 ... Validate Device DISABLED DISCOVERED
457 ... UNREACHABLE ${src['onu']} onu=false
Hardik Windlass7da42ca2020-03-13 14:25:44 +0530458 Delete Device ${onu_device_id}
Suchitra Vemuri014b6032020-02-14 18:13:13 -0800459 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
460 ... Validate OLT Device DISABLED UNKNOWN
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800461 ... REACHABLE ${src['olt']}
Hema783279b2020-01-22 15:37:37 +0530462 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800463 # Delete all OLTs
464 Delete All Devices and Verify
465 #Delete Device ${olt_device_id}
466 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
467 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
468 #... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
David Bainbridgef81cd642019-11-20 00:14:47 +0000469
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800470Validate authentication on a disabled ONU
suraj gour472da1c2020-02-25 05:44:51 +0000471 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
472 ... Perform disable on the ONUs and validate that the authentication do not succeed
473 ... Perform enable on the ONUs and validate that authentication successful
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800474 [Tags] functional DisableONU_AuthCheck
475 # Creates Devices in the Setup
Andy Baviere187eda2020-04-20 15:00:02 -0700476 [Setup] Run Keywords Start Logging DisableONU_AuthCheck
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800477 ... AND Setup
478 [Teardown] Run Keywords Collect Logs
479 ... AND Stop Logging DisableONU_AuthCheck
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800480 ... AND Delete All Devices and Verify
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800481 Run Keyword and Ignore Error Collect Logs
482 Run Keyword If ${has_dataplane} Clean Up Linux
483 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
484 Clean WPA Process
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800485 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gour472da1c2020-02-25 05:44:51 +0000486 ${src}= Set Variable ${hosts.src[${I}]}
487 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800488 Run Keyword and Ignore Error Collect Logs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800489 ${of_id}= Get ofID From OLT List ${src['olt']}
suraj gour472da1c2020-02-25 05:44:51 +0000490 ${onu_device_id}= Get Device ID From SN ${src['onu']}
491 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
492 ... ${of_id}
493 Disable Device ${onu_device_id}
494 Wait Until Keyword Succeeds ${timeout} 5s Validate Device DISABLED UNKNOWN
495 ... REACHABLE ${src['onu']} onu=false
Andy Bavier84834d42020-02-25 13:49:50 -0700496 ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=.
497 ... /tmp/wpa ${src['dp_iface_name']} log
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800498 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication False
499 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700500 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800501 Enable Device ${onu_device_id}
502 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
503 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
504 Run Keyword and Ignore Error Collect Logs
505 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
506 ... ENABLED ACTIVE REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
507 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
508 ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
Andy Bavier84834d42020-02-25 13:49:50 -0700509 ... ${src['container_type']} ${src['container_name']} ${wpa_log}
suraj gour472da1c2020-02-25 05:44:51 +0000510 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
511 END
512 Run Keyword and Ignore Error Collect Logs
513
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000514Data plane verification using TCP
515 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
516 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavierbbac4192020-06-29 21:42:10 -0700517 [Tags] dataplane BandwidthProfileTCP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700518 [Setup] Start Logging BandwidthProfileTCP
519 [Teardown] Run Keywords Collect Logs
520 ... AND Stop Logging BandwidthProfileTCP
Andy Baviereff938d2020-06-29 18:27:49 -0700521 Pass Execution If '${has_dataplane}'=='False'
522 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800523 Delete All Devices And Verify
524 Run Keyword If ${has_dataplane} Clean Up Linux
525 setup
526 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
527
528 #${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
529 #... ${olt_serial_number}
530 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000531 ${src}= Set Variable ${hosts.src[${I}]}
532 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800533 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700534
535 # Check for iperf3 and jq tools
536 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
537 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
538 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
539
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000540 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
541 ... ${of_id}
542 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
543 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
544 ... upstreamBandwidthProfile
545 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
546 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
547 ... downstreamBandwidthProfile
548 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
549
550 # Stream TCP packets from RG to server
551 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
552 ... args=-t 30
553 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
554
555 # Stream TCP packets from server to RG
556 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
557 ... args=-R -t 30
558 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
559
560 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
561 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
562 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
563 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
564
565 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
566 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700567 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
568 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
569 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000570 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
571 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
572 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
573 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
574 END
575
576Data plane verification using UDP
577 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
578 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavierbbac4192020-06-29 21:42:10 -0700579 [Tags] dataplane BandwidthProfileUDP VOL-2052
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700580 [Setup] Start Logging BandwidthProfileUDP
581 [Teardown] Run Keywords Collect Logs
582 ... AND Stop Logging BandwidthProfileUDP
Andy Baviereff938d2020-06-29 18:27:49 -0700583 Pass Execution If '${has_dataplane}'=='False'
584 ... Bandwidth profile validation can be done only in physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800585 #${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
586 FOR ${I} IN RANGE 0 ${num_all_onus}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000587 ${src}= Set Variable ${hosts.src[${I}]}
588 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800589 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierd59f9772020-07-01 12:00:42 -0700590
591 # Check for iperf3 and jq tools
592 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
593 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
594 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
595
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000596 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
597 ... ${of_id}
598 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
599 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
600 ... upstreamBandwidthProfile
601 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
602 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
603 ... downstreamBandwidthProfile
604 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
605
606 # Stream UDP packets from RG to server
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200607 ${uprate}= Run Keyword If ${limiting_bw_value_upstream} != 1000000
608 ... Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200609 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200610 ... Set Variable ${limiting_bw_value_upstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000611 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700612 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000613 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
614 ${actual_upstream_bw_used}= Evaluate
615 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
616
617 # Stream UDP packets from server to RG
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200618 ${dnrate}= Run Keyword If ${limiting_bw_value_dnstream} != 1000000
619 ... Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
Andrea Campanella29341a32020-08-03 22:06:26 +0200620 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200621 ... Set Variable ${limiting_bw_value_dnstream}
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000622 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700623 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000624 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
625 ${actual_dnstream_bw_used}= Evaluate
626 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
627
628 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
629 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
630 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
631 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
632
633 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
634 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Baviereff938d2020-06-29 18:27:49 -0700635 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
636 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
637 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Gayathri.Selvan92d16862020-03-19 14:47:58 +0000638 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
639 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
640 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
641 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
642 END
Suchitra Vemurif7a033c2020-02-26 17:22:41 -0800643
Suraj Gour33651272020-05-04 10:10:16 +0530644Validate parsing of data traffic through voltha using tech profile
645 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
646 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
647 ... Install jq tool to read json file, where test suite is being running
648 ... Make sure 9999 port is enabled or forwarded for both upsteam and downstream direction
649 ... This test sends UDP packets on port 9999 with pbits between 0 and 7 and validates that
650 ... the pbits are preserved by the PON.
Andy Bavierbbac4192020-06-29 21:42:10 -0700651 [Tags] dataplane TechProfile VOL-2054
Suraj Gour33651272020-05-04 10:10:16 +0530652 [Setup] Start Logging TechProfile
653 [Teardown] Run Keywords Collect Logs
654 ... AND Stop Logging TechProfile
655 Pass Execution If '${has_dataplane}'=='False'
656 ... Skipping test: Technology profile validation can be done only in physical pod
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800657 FOR ${I} IN RANGE 0 ${num_all_onus}
Suraj Gour33651272020-05-04 10:10:16 +0530658 ${src}= Set Variable ${hosts.src[${I}]}
659 ${dst}= Set Variable ${hosts.dst[${I}]}
660
661 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
662 ${bng_user}= Get Variable Value ${dst['noroot_user']}
663 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
Andy Bavierf4b7d1d2020-06-30 11:14:04 -0700664 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
Suraj Gour33651272020-05-04 10:10:16 +0530665 ... Skipping test: credentials for BNG login required in deployment config
666
667 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
668 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
669 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
670 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
671 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
672 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
673 Log Upstream test
Andy Baviereff938d2020-06-29 18:27:49 -0700674 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Suraj Gour33651272020-05-04 10:10:16 +0530675 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src['dp_iface_name']}
676 ... 0 udp 9999 0 vlan
677 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
678 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
679 Log Downstream test
680 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
681 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
682 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
683 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
Andy Baviereff938d2020-06-29 18:27:49 -0700684 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Suraj Gour33651272020-05-04 10:10:16 +0530685 ... ${rg_ip} ${src['dp_iface_name']} ${dst['dp_iface_name']}.${src['s_tag']}
686 ... 0 udp 9999 ${src['c_tag']} udp
687 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
688 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
689 END
690
Hardik Windlass16cdf962020-04-29 15:26:50 +0530691Test Disable and Enable OLT PON Port
692 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
693 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
694 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
695 ... Perform enable on the OLT PON Port and validate that the pings are successful
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800696 [Tags] functional DisableEnableOltPonPort VOL-2577 notready
Hardik Windlass16cdf962020-04-29 15:26:50 +0530697 [Setup] Run Keywords Start Logging DisableEnableOltPonPort
698 ... AND Setup
699 [Teardown] Run Keywords Collect Logs
700 ... AND Stop Logging DisableEnableOltPonPort
701 ... AND Delete Device and Verify
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800702 #TODO: Update this test for new framework changes
Hardik Windlass16cdf962020-04-29 15:26:50 +0530703 Run Keyword If ${has_dataplane} Clean Up Linux
704 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
705 ${olt_pon_port_list}= Retrieve OLT PON Ports ${olt_device_id}
706 ${olt_pon_port_list_len}= Get Length ${olt_pon_port_list}
707 FOR ${INDEX0} IN RANGE 0 ${olt_pon_port_list_len}
708 ${olt_pon_port}= Get From List ${olt_pon_port_list} ${INDEX0}
709 ${olt_peer_list}= Retrieve Peer List From OLT PON Port ${olt_device_id} ${olt_pon_port}
710 # Disable the OLT PON Port and Validate OLT Device
711 DisableOrEnable OLT PON Port disable ${olt_device_id} ${olt_pon_port}
712 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
713 ... Validate OLT PON Port Status ${olt_device_id} ${olt_pon_port}
714 ... DISABLED DISCOVERED
715 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
716 ... Validate OLT Device ENABLED ACTIVE REACHABLE
717 ... ${olt_serial_number}
718 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
719 ... Validate ONUs for PON OLT Disable ${olt_peer_list}
720 # Enable the OLT PON Port back, and check ONU status are back to "ACTIVE"
721 DisableOrEnable OLT PON Port enable ${olt_device_id} ${olt_pon_port}
722 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
723 ... Validate OLT PON Port Status ${olt_device_id} ${olt_pon_port}
724 ... ENABLED ACTIVE
725 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
726 ... Validate ONUs for PON OLT Enable ${olt_peer_list}
727 END
728
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700729*** Keywords ***
730Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700731 [Documentation] Set up the test suite
732 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700733 #Restore all ONUs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800734 #Run Keyword If ${has_dataplane} RestoreONUs ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700735 #power_switch.robot needs it to support different vendor's power switch
736 ${switch_type}= Get Variable Value ${web_power_switch.type}
737 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Suchitra Vemuri65cd65f2019-08-30 14:39:22 -0700738
David Bainbridgef81cd642019-11-20 00:14:47 +0000739Clear All Devices Then Create New Device
740 [Documentation] Remove any devices from VOLTHA and ONOS
David Bainbridgef81cd642019-11-20 00:14:47 +0000741 # Remove all devices from voltha and nos
742 Delete All Devices and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000743 # Execute normal test Setup Keyword
744 Setup