blob: d17f71ad826f8cb7c9140577a6a326bd9b3d19cf [file] [log] [blame]
Hardik Windlassa3d04b92020-02-17 15:06:05 +00001# Copyright 2017 - present Open Networking Foundation
2#
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.
14# FIXME Can we use the same test against BBSim and Hardware?
15
16*** Settings ***
17Documentation Test various end-to-end scenarios
18Suite Setup Setup Suite
19Test Setup Setup
20Test Teardown Teardown
21Suite Teardown Teardown Suite
22Library Collections
23Library String
24Library OperatingSystem
25Library XML
26Library RequestsLibrary
27Library ../../libraries/DependencyLibrary.py
28Resource ../../libraries/onos.robot
29Resource ../../libraries/voltctl.robot
30Resource ../../libraries/voltha.robot
31Resource ../../libraries/utils.robot
32Resource ../../libraries/k8s.robot
33Resource ../../variables/variables.robot
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070034Resource ../../libraries/power_switch.robot
Hardik Windlassa3d04b92020-02-17 15:06:05 +000035
36*** Variables ***
37${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
44${NAMESPACE} voltha
45# For below variable value, using deployment name as using grep for
46# parsing radius pod name, we can also use full radius pod name
47${RESTART_POD_NAME} radius
Suchitra Vemurie9c6ca62020-07-27 16:44:53 -070048${timeout} 360s
Hardik Windlassa3d04b92020-02-17 15:06:05 +000049${of_id} 0
50${logical_id} 0
Andrea Campanella86e24062020-08-05 19:09:18 +020051${uprate} 0
52${dnrate} 0
Hardik Windlassa3d04b92020-02-17 15:06:05 +000053${has_dataplane} True
Hardik Windlassffbf0602020-04-24 23:14:45 +053054${teardown_device} True
Hardik Windlassa3d04b92020-02-17 15:06:05 +000055${scripts} ../../scripts
56
Andy Baviere19991a2020-05-08 10:42:40 -070057# 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
Andy Baviere19991a2020-05-08 10:42:40 -070060${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
Andy Baviere19991a2020-05-08 10:42:40 -070062
Hardik Windlassa3d04b92020-02-17 15:06:05 +000063# Per-test logging on failure is turned off by default; set this variable to enable
64${container_log_dir} ${None}
65
66*** Test Cases ***
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070067Reboot DT 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)
Hardik Windlassd6aa0822020-06-29 20:18:12 +053071 [Tags] functionalDt PowerSwitch RebootAllDTONUs
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -070072 [Setup] Start Logging RebootAllDTONUs
73 [Teardown] Run Keywords Collect Logs
74 ... AND Stop Logging RebootAllDTONUs
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
Hardik Windlassa3d04b92020-02-17 15:06:05 +000085Sanity E2E Test for OLT/ONU on POD for DT
86 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
87 ... Validate successful DHCP/E2E ping (no EAPOL and DHCP flows) for the tech profile that is used
88 ... Traffic sent with same vlan from different RGs,
89 ... should reach the NNI port on the OLT with the expected double tagged vlan ids
90 ... Inner vlans from the RG should not change
Suchitra Vemurif2388ad2020-03-15 21:44:44 -070091 [Tags] sanityDt
Andy Baviere187eda2020-04-20 15:00:02 -070092 [Setup] Run Keywords Start Logging SanityTestDt
Hardik Windlassa3d04b92020-02-17 15:06:05 +000093 ... AND Setup
94 [Teardown] Run Keywords Collect Logs
95 ... AND Stop Logging SanityTestDt
Hardik Windlassa3d04b92020-02-17 15:06:05 +000096 Run Keyword If ${has_dataplane} Clean Up Linux
97 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
98
Hardik Windlass35706ba2020-02-20 08:16:42 +000099Test Subscriber Delete and Add for DT
100 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
Hardik Windlass63d5e002020-03-06 21:07:09 +0530101 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
Hardik Windlass35706ba2020-02-20 08:16:42 +0000102 ... Delete a subscriber and validate that the pings do not succeed and state is purged
103 ... Disable and Enable the ONU (This is to replicate the existing DT behaviour)
104 ... Re-add the subscriber, and validate that the flows are present and pings are successful
Suchitra Vemurif2388ad2020-03-15 21:44:44 -0700105 [Tags] functionalDt SubAddDeleteDt
Andy Baviere187eda2020-04-20 15:00:02 -0700106 [Setup] Start Logging SubAddDeleteDt
Hardik Windlass35706ba2020-02-20 08:16:42 +0000107 [Teardown] Run Keywords Collect Logs
108 ... AND Stop Logging SubAddDeleteDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800109 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000110 ${src}= Set Variable ${hosts.src[${I}]}
111 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800112 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000113 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800114 ${olt_device_id}= Get OLTDeviceID From OLT List ${src['olt']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000115 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
116 ... ${of_id}
117 # Remove Subscriber Access
ubuntu6b6e7d42020-03-02 12:35:42 -0800118 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000119 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
120 Sleep 10s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000121 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
122 ... Wait Until Keyword Succeeds 60s 2s
123 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
124 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800125 # TODO: Enhance the test to validate flows per OLT
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530126 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800127 ${onos_flows_count}= Evaluate 4 * ( ${num_all_onus} - 1 )
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530128 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
129 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Suchitra Vemuri93db32b2020-11-23 21:27:05 -0800130 ... ${of_id} ${onos_flows_count}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000131 # Verify VOLTHA flows for OLT equals twice the number of ONUS (minus ONU under test) + 1 for LLDP
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800132 ${olt_flows}= Evaluate 2 * ( ${num_all_onus} - 1 ) + 1
Hardik Windlass35706ba2020-02-20 08:16:42 +0000133 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800134 ... ${olt_device_id}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000135 # Verify VOLTHA flows for ONU under test is Zero
136 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows
137 ... ${onu_device_id} 0
138 # Disable and Re-Enable the ONU (To replicate DT current workflow)
139 # TODO: Delete and Auto-Discovery Add of ONU (not yet supported)
140 Disable Device ${onu_device_id}
141 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
142 ... Validate Device DISABLED UNKNOWN
143 ... REACHABLE ${src['onu']}
144 Enable Device ${onu_device_id}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700145 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000146 ... Validate Device ENABLED ACTIVE
147 ... REACHABLE ${src['onu']}
148 # Add Subscriber Access
ubuntu6b6e7d42020-03-02 12:35:42 -0800149 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000150 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
151 Sleep 10s
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530152 # Verify subscriber access flows are added for the ONU port
153 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass25e11702020-03-30 20:05:19 +0530154 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
155 ... ${onu_port} ${nni_port} ${src['s_tag']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700156 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000157 ... Validate Device ENABLED ACTIVE
158 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530159 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass35706ba2020-02-20 08:16:42 +0000160 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
161 ... Wait Until Keyword Succeeds 60s 2s
162 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
163 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
164 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
165 Run Keyword and Ignore Error Collect Logs
166 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800167 # Verify flows for all OLTs
168 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate All OLT Flows
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530169 # Verify ONOS Flows
170 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800171 #${onos_flows_count}= Evaluate 4 * ${num_all_onus}
172 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
173 #... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
174 #... ${of_id} ${onos_flows_count}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530175 # Verify VOLTHA Flows
Hardik Windlass35706ba2020-02-20 08:16:42 +0000176 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800177 #${olt_flows}= Evaluate 2 * ${num_all_onus} + 1
Hardik Windlass35706ba2020-02-20 08:16:42 +0000178 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800179 #${onu_flows}= Set Variable 2
180 #Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
181 #${List_ONU_Serial} Create List
182 #Set Suite Variable ${List_ONU_Serial}
183 #Build ONU SN List ${List_ONU_Serial}
184 #Log ${List_ONU_Serial}
185 #Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
186 #... ${List_ONU_Serial} ${onu_flows}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000187
Hardik Windlass63d5e002020-03-06 21:07:09 +0530188Test Disable and Enable ONU for DT
189 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
190 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
191 ... Perform disable on the ONUs and validate that the pings do not succeed
192 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemurif2388ad2020-03-15 21:44:44 -0700193 [Tags] functionalDt DisableEnableONUDt
Andy Baviere187eda2020-04-20 15:00:02 -0700194 [Setup] Start Logging DisableEnableONUDt
Hardik Windlass63d5e002020-03-06 21:07:09 +0530195 [Teardown] Run Keywords Collect Logs
196 ... AND Stop Logging DisableEnableONUDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800197 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530198 ${src}= Set Variable ${hosts.src[${I}]}
199 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800200 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass63d5e002020-03-06 21:07:09 +0530201 ${onu_device_id}= Get Device ID From SN ${src['onu']}
202 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
203 ... ${of_id}
204 Disable Device ${onu_device_id}
205 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
206 ... Validate Device DISABLED UNKNOWN
207 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-admin-lock
208 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700209 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530210 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass63d5e002020-03-06 21:07:09 +0530211 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
212 ... Wait Until Keyword Succeeds 60s 2s
213 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
214 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
215 Sleep 5s
216 Enable Device ${onu_device_id}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700217 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass63d5e002020-03-06 21:07:09 +0530218 ... Validate Device ENABLED ACTIVE
219 ... REACHABLE ${src['onu']} onu=True onu_reason=onu-reenabled
220 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700221 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530222 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass63d5e002020-03-06 21:07:09 +0530223 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
224 ... Wait Until Keyword Succeeds 60s 2s
225 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
226 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
227 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
228 Run Keyword and Ignore Error Collect Logs
229 END
230
Hardik Windlassaaea3402020-03-10 19:45:45 +0530231Test Disable and Delete OLT for DT
232 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
233 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
234 ... Perform disable on the OLT and validate ONUs state and that the pings do not succeed
235 ... Perform delete on the OLT, Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
Suchitra Vemurif2388ad2020-03-15 21:44:44 -0700236 [Tags] functionalDt DisableDeleteOLTDt
Suchitra Vemuri221398a2020-05-29 22:45:17 -0700237 [Setup] Start Logging DisableDeleteOLTDt
Hardik Windlassaaea3402020-03-10 19:45:45 +0530238 [Teardown] Run Keywords Collect Logs
239 ... AND Stop Logging DisableDeleteOLTDt
Hardik Windlassaaea3402020-03-10 19:45:45 +0530240 # Disable and Validate OLT Device
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800241 FOR ${I} IN RANGE 0 ${olt_count}
242 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
243 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
244 Disable Device ${olt_device_id}
245 ${of_id}= Get ofID From OLT List ${olt_serial_number}
246 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
247 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
248 ... ${olt_serial_number}
249 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
250 ... ${olt_serial_number}
251 ${num_onus}= Set Variable ${list_olts}[${I}][onucount]
252 # Validate ONUs
253 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONUs After OLT Disable
254 ... ${num_onus}
255 # Verify ONOS Flows
256 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
257 ${onos_flows_count}= Evaluate 4 * ${num_onus}
258 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
259 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
260 ... ${of_id} ${onos_flows_count}
261 # Verify VOLTHA Flows
262 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
263 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
264 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
265 ${onu_flows}= Set Variable 2
266 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
267 ... ${olt_device_id}
268 ${List_ONU_Serial} Create List
269 Set Suite Variable ${List_ONU_Serial}
Andrea Campanella99a548b2020-11-18 09:50:32 +0100270 Build ONU SN List ${List_ONU_Serial} ${olt_serial_number} ${num_onus}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800271 Log ${List_ONU_Serial}
272 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
273 ... ${List_ONU_Serial} ${onu_flows}
274 # Delete OLT and Validate Empty Device List
275 Delete Device ${olt_device_id}
276 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
277 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
278 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
279 Run Keyword and Ignore Error Collect Logs
280 END
281 #Disable Device ${olt_device_id}
282 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
283 #... Validate OLT Device DISABLED UNKNOWN REACHABLE
284 #... ${olt_serial_number}
285
Hardik Windlassaaea3402020-03-10 19:45:45 +0530286 # Validate ONUs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800287 #Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONUs After OLT Disable
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530288 # Verify ONOS Flows
289 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800290 #${onos_flows_count}= Evaluate 4 * ${num_all_onus}
291 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
292 #... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
293 #... ${of_id} ${onos_flows_count}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530294 # Verify VOLTHA Flows
Hardik Windlassaaea3402020-03-10 19:45:45 +0530295 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800296 #${olt_flows}= Evaluate 2 * ${num_all_onus} + 1
Hardik Windlassaaea3402020-03-10 19:45:45 +0530297 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800298 #${onu_flows}= Set Variable 2
299 #Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
300 #${List_ONU_Serial} Create List
301 #Set Suite Variable ${List_ONU_Serial}
302 #Build ONU SN List ${List_ONU_Serial}
303 #Log ${List_ONU_Serial}
304 #Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
305 #... ${List_ONU_Serial} ${onu_flows}
Hardik Windlassaaea3402020-03-10 19:45:45 +0530306 # Delete OLT and Validate Empty Device List
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800307 #Delete Device ${olt_device_id}
308 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
309 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
310 #... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
311 #Run Keyword and Ignore Error Collect Logs
Hardik Windlassaaea3402020-03-10 19:45:45 +0530312 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
313 Run Keyword Setup
Suchitra Vemuriae9cecb2020-03-12 12:59:14 -0700314 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800315 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
316 #Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlassaaea3402020-03-10 19:45:45 +0530317
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530318Test Disable and Enable OLT for DT
319 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
320 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
321 ... Perform disable on the OLT and validate that the pings do not succeed
322 ... Perform enable on the OLT and validate that the pings are successful
Hardik Windlass2b37e712020-06-12 02:13:17 +0530323 [Tags] functionalDt DisableEnableOLTDt
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530324 [Setup] Start Logging DisableEnableOLTDt
325 [Teardown] Run Keywords Collect Logs
326 ... AND Stop Logging DisableEnableOLTDt
327 # Disable and Validate OLT Device
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800328 FOR ${I} IN RANGE 0 ${olt_count}
329 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
330 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
331 ${rc} ${output}= Run and Return Rc and Output
332 ... ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
333 Should Be Equal As Integers ${rc} 0
334 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
335 ... ${olt_serial_number}
336 END
337 #Disable Device ${olt_device_id}
338 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
339 #... Validate OLT Device DISABLED UNKNOWN REACHABLE
340 #... ${olt_serial_number}
341 # Validate ONUs
342 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530343 ${src}= Set Variable ${hosts.src[${I}]}
344 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800345 ${of_id}= Get ofID From OLT List ${src['olt']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530346 ${onu_device_id}= Get Device ID From SN ${src['onu']}
347 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
348 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
349 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700350 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530351 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
352 ... Wait Until Keyword Succeeds 60s 2s
353 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
354 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
355 # Remove Subscriber Access (To replicate DT workflow)
356 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
357 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530358 Sleep 10s
Hardik Windlass7c801e62020-05-04 19:33:21 +0530359 # Delete ONU Device (To replicate DT workflow)
360 Delete Device ${onu_device_id}
Hardik Windlass2b37e712020-06-12 02:13:17 +0530361 Sleep 5s
Hardik Windlass7c801e62020-05-04 19:33:21 +0530362 END
Hardik Windlass2b37e712020-06-12 02:13:17 +0530363 Sleep 5s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530364 # Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800365 FOR ${I} IN RANGE 0 ${olt_count}
366 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
367 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
368 Enable Device ${olt_device_id}
369 Sleep 15s
370 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
371 ... ${olt_serial_number}
372 #TODO: Update for PON_OLT ETHERNET_NNI
373 #Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
374 #... PON_OLT ETHERNET_NNI
375 END
Hardik Windlass7c801e62020-05-04 19:33:21 +0530376 # Waiting extra time for the ONUs to come up
377 Sleep 60s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800378 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass7c801e62020-05-04 19:33:21 +0530379 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530380
381Test Delete and ReAdd OLT for DT
382 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
383 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
384 ... Disable and Delete the OLT
385 ... Create/Enable the same OLT again
386 ... Validate DHCP/E2E pings succeed for all the ONUs connected to the OLT
387 [Tags] functionalDt DeleteReAddOLTDt
388 [Setup] Start Logging DeleteReAddOLTDt
389 [Teardown] Run Keywords Collect Logs
390 ... AND Stop Logging DeleteReAddOLTDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800391 FOR ${I} IN RANGE 0 ${olt_count}
392 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
393 ${of_id}= Get ofID From OLT List ${olt_serial_number}
394 Delete Device and Verify ${olt_serial_number}
395 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
396 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
397 Run Keyword and Ignore Error Collect Logs
398 END
399 # Recreate the OLTs
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530400 Setup
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800401 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530402 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
403
404Test Disable ONUs and OLT Then Delete ONUs and OLT for DT
405 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
406 ... This TC is to confirm that ONU removal is not impacting OLT
407 ... Devices will be removed during the execution of this TC
408 ... so calling setup at the end to add the devices back to avoid the confusion.
409 [Tags] functionalDt DisableDeleteONUOLTDt
410 [Setup] Start Logging DisableDeleteONUOLTDt
411 [Teardown] Run Keywords Collect Logs
412 ... AND Stop Logging DisableDeleteONUOLTDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800413 #${olt_device_id}= Get Device ID From SN ${olt_serial_number}
414 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530415 ${src}= Set Variable ${hosts.src[${I}]}
416 ${dst}= Set Variable ${hosts.dst[${I}]}
417 ${onu_device_id}= Get Device ID From SN ${src['onu']}
418 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
419 ... Validate Device ENABLED ACTIVE
420 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
421 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
422 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800423 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530424 Disable Device ${onu_device_id}
425 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
426 ... Validate Device DISABLED UNKNOWN
427 ... REACHABLE ${src['onu']} onu=false
428 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
429 ... Validate OLT Device ENABLED ACTIVE
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800430 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530431 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800432 #Disable Device ${olt_device_id}
433 # Disable all OLTs
434 FOR ${I} IN RANGE 0 ${olt_count}
435 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
436 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
437 ${rc} ${output}= Run and Return Rc and Output
438 ... ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
439 Should Be Equal As Integers ${rc} 0
440 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
441 ... ${olt_serial_number}
442 END
443 # Validate ONUs after OLT disable
444 FOR ${I} IN RANGE 0 ${num_all_onus}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530445 ${src}= Set Variable ${hosts.src[${I}]}
446 ${dst}= Set Variable ${hosts.dst[${I}]}
447 ${onu_device_id}= Get Device ID From SN ${src['onu']}
448 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
449 ... Validate Device DISABLED DISCOVERED
450 ... UNREACHABLE ${src['onu']} onu=false
451 Delete Device ${onu_device_id}
452 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
453 ... Validate OLT Device DISABLED UNKNOWN
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800454 ... REACHABLE ${src['olt']}
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530455 END
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800456 # Delete all OLTs
457 Delete All Devices and Verify
458
459 #Delete Device ${olt_device_id}
460 #TODO: Fix the following assertion
461 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
462 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
463 #... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
464
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530465 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
466 Run Keyword Setup
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800467 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530468 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530469
Andy Baviere19991a2020-05-08 10:42:40 -0700470Data plane verification using TCP for DT
471 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
472 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavier7613b9a2020-07-08 07:25:47 -0700473 [Tags] dataplaneDt BandwidthProfileTCPDt VOL-3061
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700474 [Setup] Start Logging BandwidthProfileTCPDt
475 [Teardown] Run Keywords Collect Logs
476 ... AND Stop Logging BandwidthProfileTCPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700477 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
478 ... physical pod. Skipping this test in BBSIM.
Suchitra Vemuria4e3e072020-11-06 14:23:47 -0800479 Delete All Devices And Verify
480 Run Keyword If ${has_dataplane} Clean Up Linux
481 setup
482 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
483
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800484 #${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
485 #... ${olt_serial_number}
486 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Baviere19991a2020-05-08 10:42:40 -0700487 ${src}= Set Variable ${hosts.src[${I}]}
488 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800489 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700490 # Check for iperf3 and jq tools
491 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
492 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
493 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
494
Andy Baviere19991a2020-05-08 10:42:40 -0700495 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
496 ... ${of_id}
497 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
498 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
499 ... upstreamBandwidthProfile
500 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
501 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
502 ... downstreamBandwidthProfile
503 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
504
505 # Stream TCP packets from RG to server
506 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
507 ... args=-t 30
508 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
509
510 # Stream TCP packets from server to RG
511 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
512 ... args=-R -t 30
513 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
514
515 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
516 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
517 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
518 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
519
520 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
521 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Bavier7613b9a2020-07-08 07:25:47 -0700522 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
523 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
524 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Andy Baviere19991a2020-05-08 10:42:40 -0700525 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
526 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
527 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
528 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
529 END
530
531Data plane verification using UDP for DT
532 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
533 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavier7613b9a2020-07-08 07:25:47 -0700534 [Tags] dataplaneDt BandwidthProfileUDPDt VOL-3061
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700535 [Setup] Start Logging BandwidthProfileUDPDt
536 [Teardown] Run Keywords Collect Logs
537 ... AND Stop Logging BandwidthProfileUDPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700538 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
539 ... physical pod. Skipping this test in BBSIM.
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800540 #${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
541 #... ${olt_serial_number}
542 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Baviere19991a2020-05-08 10:42:40 -0700543 ${src}= Set Variable ${hosts.src[${I}]}
544 ${dst}= Set Variable ${hosts.dst[${I}]}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800545 ${of_id}= Get ofID From OLT List ${src['olt']}
Andy Bavier7613b9a2020-07-08 07:25:47 -0700546
547 # Check for iperf3 and jq tools
548 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
549 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
550 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
551
Andy Baviere19991a2020-05-08 10:42:40 -0700552 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
553 ... ${of_id}
554 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
555 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
556 ... upstreamBandwidthProfile
557 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
558 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
559 ... downstreamBandwidthProfile
560 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
561
562 # Stream UDP packets from RG to server
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200563 ${uprate}= Run Keyword If ${limiting_bw_value_upstream} != 1000000
564 ... Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
Andrea Campanella580e0492020-08-05 15:35:48 +0200565 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200566 ... Set Variable ${limiting_bw_value_upstream}
Andrea Campanella580e0492020-08-05 15:35:48 +0200567
Andy Baviere19991a2020-05-08 10:42:40 -0700568 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700569 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700570 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
571 ${actual_upstream_bw_used}= Evaluate
572 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
573
574 # Stream UDP packets from server to RG
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200575 ${dnrate}= Run Keyword If ${limiting_bw_value_dnstream} != 1000000
576 ... Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
Andrea Campanella580e0492020-08-05 15:35:48 +0200577 ... ELSE
Andrea Campanella1d34bfc2020-08-06 09:58:49 +0200578 ... Set Variable ${limiting_bw_value_dnstream}
Andy Baviere19991a2020-05-08 10:42:40 -0700579 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700580 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700581 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
582 ${actual_dnstream_bw_used}= Evaluate
583 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
584
585 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
586 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
587 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
588 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
589
590 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
591 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Bavier7613b9a2020-07-08 07:25:47 -0700592 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
593 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
594 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Andy Baviere19991a2020-05-08 10:42:40 -0700595 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
596 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
597 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
598 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
599 END
600
Andy Bavier7613b9a2020-07-08 07:25:47 -0700601Validate parsing of data traffic through voltha using tech profile
602 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
603 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
604 ... Install jq tool to read json file, where test suite is being running
605 ... Make sure 9999 port is enabled or forwarded for both upsteam and downstream direction
606 ... This test sends UDP packets on port 9999 with pbits between 0 and 7 and validates that
607 ... the pbits are preserved by the PON.
608 [Tags] dataplaneDt TechProfileDt VOL-3291
609 [Setup] Start Logging TechProfileDt
610 [Teardown] Run Keywords Collect Logs
611 ... AND Stop Logging TechProfileDt
612 Pass Execution If '${has_dataplane}'=='False'
613 ... Skipping test: Technology profile validation can be done only in physical pod
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800614 FOR ${I} IN RANGE 0 ${num_all_onus}
Andy Bavier7613b9a2020-07-08 07:25:47 -0700615 ${src}= Set Variable ${hosts.src[${I}]}
616 ${dst}= Set Variable ${hosts.dst[${I}]}
617
Andy Bavier275414a2020-07-16 13:07:17 -0700618 ${src_iface_name}= Fetch From Left ${src['dp_iface_name']} .
619
Andy Bavier7613b9a2020-07-08 07:25:47 -0700620 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
621 ${bng_user}= Get Variable Value ${dst['noroot_user']}
622 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
623 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
624 ... Skipping test: credentials for BNG login required in deployment config
625
626 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
627 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
628 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
629 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
630 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
631 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
632 Log Upstream test
633 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Andy Bavier275414a2020-07-16 13:07:17 -0700634 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src_iface_name}
635 ... 0 udp 9999 ${src['c_tag']} vlan
Andy Bavier7613b9a2020-07-08 07:25:47 -0700636 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
637 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
638 Log Downstream test
639 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
640 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
641 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
642 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
643 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Andy Bavier275414a2020-07-16 13:07:17 -0700644 ... ${rg_ip} ${src_iface_name} ${dst['dp_iface_name']}.${src['s_tag']}
Andy Bavier7613b9a2020-07-08 07:25:47 -0700645 ... 0 udp 9999 ${src['c_tag']} udp
646 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
647 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
648 END
649
Hardik Windlass16cdf962020-04-29 15:26:50 +0530650Test Disable and Enable OLT PON Port for DT
651 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
652 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
653 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
654 ... Perform enable on the OLT PON Port and validate that the pings are successful
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800655 [Tags] functionalDt DisableEnableOltPonPortDt VOL-2577 notready
Hardik Windlass16cdf962020-04-29 15:26:50 +0530656 [Setup] Start Logging DisableEnableOltPonPortDt
657 [Teardown] Run Keywords Collect Logs
658 ... AND Stop Logging DisableEnableOltPonPortDt
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800659 TODO: Fix the keywords and test later
Hardik Windlass16cdf962020-04-29 15:26:50 +0530660 ${olt_pon_port_list}= Retrieve OLT PON Ports ${olt_device_id}
661 ${olt_pon_port_list_len}= Get Length ${olt_pon_port_list}
662 FOR ${INDEX0} IN RANGE 0 ${olt_pon_port_list_len}
663 ${olt_pon_port}= Get From List ${olt_pon_port_list} ${INDEX0}
664 ${olt_peer_list}= Retrieve Peer List From OLT PON Port ${olt_device_id} ${olt_pon_port}
665 # Disable the OLT PON Port and Validate OLT Device
666 DisableOrEnable OLT PON Port disable ${olt_device_id} ${olt_pon_port}
667 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
668 ... Validate OLT PON Port Status ${olt_device_id} ${olt_pon_port}
669 ... DISABLED DISCOVERED
670 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
671 ... Validate OLT Device ENABLED ACTIVE REACHABLE
672 ... ${olt_serial_number}
673 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
674 ... Validate ONUs for PON OLT Disable DT ${olt_peer_list}
675 Sleep 15s
676 # Enable the OLT PON Port back, and check ONU status are back to "ACTIVE"
677 DisableOrEnable OLT PON Port enable ${olt_device_id} ${olt_pon_port}
678 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
679 ... Validate OLT PON Port Status ${olt_device_id} ${olt_pon_port}
680 ... ENABLED ACTIVE
681 # Waiting extra time for the ONUs to come up
682 Sleep 60s
683 ${olt_peer_list_new}= Retrieve Peer List From OLT PON Port ${olt_device_id} ${olt_pon_port}
684 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
685 ... Validate ONUs for PON OLT Enable DT ${olt_peer_list_new}
686 END
687
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000688*** Keywords ***
689Setup Suite
690 [Documentation] Set up the test suite
691 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700692 #Restore all ONUs
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800693 #Run Keyword If ${has_dataplane} RestoreONUs ${num_all_onus}
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700694 #power_switch.robot needs it to support different vendor's power switch
695 ${switch_type}= Get Variable Value ${web_power_switch.type}
696 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000697
698Clear All Devices Then Create New Device
699 [Documentation] Remove any devices from VOLTHA and ONOS
700 # Remove all devices from voltha and nos
701 Delete All Devices and Verify
702 # Execute normal test Setup Keyword
703 Setup
704