blob: a1d707ebd22c06314936b4d78cea97918d400486 [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
Andy Bavierf6ab19c2020-05-14 10:34:47 -070059${lower_margin_pct} 92 # 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
61${udp_packet_bytes} 1400 # UDP payload in bytes
62
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}
76 FOR ${I} IN RANGE 0 ${num_onus}
77 ${src}= Set Variable ${hosts.src[${I}]}
78 ${dst}= Set Variable ${hosts.dst[${I}]}
79 Disable Switch Outlet ${src['power_switch_port']}
80 Sleep 60s
81 Enable Switch Outlet ${src['power_switch_port']}
82 Sleep 60s
83 END
84
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
Hardik Windlass35706ba2020-02-20 08:16:42 +0000109 FOR ${I} IN RANGE 0 ${num_onus}
110 ${src}= Set Variable ${hosts.src[${I}]}
111 ${dst}= Set Variable ${hosts.dst[${I}]}
112 ${onu_device_id}= Get Device ID From SN ${src['onu']}
113 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
114 ... ${of_id}
115 # Remove Subscriber Access
ubuntu6b6e7d42020-03-02 12:35:42 -0800116 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000117 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
118 Sleep 10s
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530119 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass35706ba2020-02-20 08:16:42 +0000120 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
121 ... Wait Until Keyword Succeeds 60s 2s
122 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
123 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530124 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
125 ${onos_flows_count}= Evaluate 4 * ( ${num_onus} - 1 )
126 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
127 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hardik Windlass25e11702020-03-30 20:05:19 +0530128 ... ${of_id} ${onos_flows_count}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000129 # Verify VOLTHA flows for OLT equals twice the number of ONUS (minus ONU under test) + 1 for LLDP
130 ${olt_flows}= Evaluate 2 * ( ${num_onus} - 1 ) + 1
131 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
132 # Verify VOLTHA flows for ONU under test is Zero
133 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows
134 ... ${onu_device_id} 0
135 # Disable and Re-Enable the ONU (To replicate DT current workflow)
136 # TODO: Delete and Auto-Discovery Add of ONU (not yet supported)
137 Disable Device ${onu_device_id}
138 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
139 ... Validate Device DISABLED UNKNOWN
140 ... REACHABLE ${src['onu']}
141 Enable Device ${onu_device_id}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700142 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000143 ... Validate Device ENABLED ACTIVE
144 ... REACHABLE ${src['onu']}
145 # Add Subscriber Access
ubuntu6b6e7d42020-03-02 12:35:42 -0800146 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000147 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
148 Sleep 10s
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530149 # Verify subscriber access flows are added for the ONU port
150 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass25e11702020-03-30 20:05:19 +0530151 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
152 ... ${onu_port} ${nni_port} ${src['s_tag']}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700153 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass35706ba2020-02-20 08:16:42 +0000154 ... Validate Device ENABLED ACTIVE
155 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530156 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass35706ba2020-02-20 08:16:42 +0000157 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
158 ... Wait Until Keyword Succeeds 60s 2s
159 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
160 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
161 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
162 Run Keyword and Ignore Error Collect Logs
163 END
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530164 # Verify ONOS Flows
165 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
166 ${onos_flows_count}= Evaluate 4 * ${num_onus}
167 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass25e11702020-03-30 20:05:19 +0530168 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
169 ... ${of_id} ${onos_flows_count}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530170 # Verify VOLTHA Flows
Hardik Windlass35706ba2020-02-20 08:16:42 +0000171 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
172 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
173 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
174 ${onu_flows}= Set Variable 2
175 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
176 ${List_ONU_Serial} Create List
177 Set Suite Variable ${List_ONU_Serial}
178 Build ONU SN List ${List_ONU_Serial}
179 Log ${List_ONU_Serial}
180 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
181 ... ${List_ONU_Serial} ${onu_flows}
182
Hardik Windlass63d5e002020-03-06 21:07:09 +0530183Test Disable and Enable ONU for DT
184 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
185 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
186 ... Perform disable on the ONUs and validate that the pings do not succeed
187 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemurif2388ad2020-03-15 21:44:44 -0700188 [Tags] functionalDt DisableEnableONUDt
Andy Baviere187eda2020-04-20 15:00:02 -0700189 [Setup] Start Logging DisableEnableONUDt
Hardik Windlass63d5e002020-03-06 21:07:09 +0530190 [Teardown] Run Keywords Collect Logs
191 ... AND Stop Logging DisableEnableONUDt
Hardik Windlass63d5e002020-03-06 21:07:09 +0530192 FOR ${I} IN RANGE 0 ${num_onus}
193 ${src}= Set Variable ${hosts.src[${I}]}
194 ${dst}= Set Variable ${hosts.dst[${I}]}
195 ${onu_device_id}= Get Device ID From SN ${src['onu']}
196 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
197 ... ${of_id}
198 Disable Device ${onu_device_id}
199 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
200 ... Validate Device DISABLED UNKNOWN
201 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-admin-lock
202 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700203 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530204 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass63d5e002020-03-06 21:07:09 +0530205 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
206 ... Wait Until Keyword Succeeds 60s 2s
207 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
208 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
209 Sleep 5s
210 Enable Device ${onu_device_id}
Suchitra Vemuricdc32d82020-07-17 12:24:46 -0700211 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
Hardik Windlass63d5e002020-03-06 21:07:09 +0530212 ... Validate Device ENABLED ACTIVE
213 ... REACHABLE ${src['onu']} onu=True onu_reason=onu-reenabled
214 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700215 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530216 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass63d5e002020-03-06 21:07:09 +0530217 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
218 ... Wait Until Keyword Succeeds 60s 2s
219 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
220 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
221 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
222 Run Keyword and Ignore Error Collect Logs
223 END
224
Hardik Windlassaaea3402020-03-10 19:45:45 +0530225Test Disable and Delete OLT for DT
226 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
227 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
228 ... Perform disable on the OLT and validate ONUs state and that the pings do not succeed
229 ... Perform delete on the OLT, Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
Suchitra Vemurif2388ad2020-03-15 21:44:44 -0700230 [Tags] functionalDt DisableDeleteOLTDt
Suchitra Vemuri221398a2020-05-29 22:45:17 -0700231 [Setup] Start Logging DisableDeleteOLTDt
Hardik Windlassaaea3402020-03-10 19:45:45 +0530232 [Teardown] Run Keywords Collect Logs
233 ... AND Stop Logging DisableDeleteOLTDt
Hardik Windlassaaea3402020-03-10 19:45:45 +0530234 # Disable and Validate OLT Device
235 Disable Device ${olt_device_id}
236 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
237 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
238 ... ${olt_serial_number}
239 # Validate ONUs
240 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONUs After OLT Disable
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530241 # Verify ONOS Flows
242 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
243 ${onos_flows_count}= Evaluate 4 * ${num_onus}
244 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass25e11702020-03-30 20:05:19 +0530245 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
246 ... ${of_id} ${onos_flows_count}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530247 # Verify VOLTHA Flows
Hardik Windlassaaea3402020-03-10 19:45:45 +0530248 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
249 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
250 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
251 ${onu_flows}= Set Variable 2
252 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
253 ${List_ONU_Serial} Create List
254 Set Suite Variable ${List_ONU_Serial}
255 Build ONU SN List ${List_ONU_Serial}
256 Log ${List_ONU_Serial}
257 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
258 ... ${List_ONU_Serial} ${onu_flows}
259 # Delete OLT and Validate Empty Device List
260 Delete Device ${olt_device_id}
261 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
Hardik Windlass480f3e22020-04-02 20:14:14 +0530262 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
263 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Hardik Windlassaaea3402020-03-10 19:45:45 +0530264 Run Keyword and Ignore Error Collect Logs
265 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
266 Run Keyword Setup
267 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Suchitra Vemuriae9cecb2020-03-12 12:59:14 -0700268 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlassaaea3402020-03-10 19:45:45 +0530269
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530270Test Disable and Enable OLT for DT
271 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
272 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
273 ... Perform disable on the OLT and validate that the pings do not succeed
274 ... Perform enable on the OLT and validate that the pings are successful
Suchitra Vemuri221398a2020-05-29 22:45:17 -0700275 [Tags] functionalDt DisableEnableOLTDt notready
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530276 [Setup] Start Logging DisableEnableOLTDt
277 [Teardown] Run Keywords Collect Logs
278 ... AND Stop Logging DisableEnableOLTDt
279 # Disable and Validate OLT Device
280 Disable Device ${olt_device_id}
281 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
282 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
283 ... ${olt_serial_number}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530284 FOR ${I} IN RANGE 0 ${num_onus}
285 ${src}= Set Variable ${hosts.src[${I}]}
286 ${dst}= Set Variable ${hosts.dst[${I}]}
287 ${onu_device_id}= Get Device ID From SN ${src['onu']}
288 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
289 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
290 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
Suchitra Vemuri760bdd32020-06-17 12:34:48 -0700291 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530292 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
293 ... Wait Until Keyword Succeeds 60s 2s
294 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
295 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
296 # Remove Subscriber Access (To replicate DT workflow)
297 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
298 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
299 # Delete ONU Device (To replicate DT workflow)
300 Delete Device ${onu_device_id}
301 END
302 Sleep 15s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530303 # Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
304 Enable Device ${olt_device_id}
305 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
306 ... ${olt_serial_number}
307 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
308 ... PON_OLT ETHERNET_NNI
Hardik Windlass7c801e62020-05-04 19:33:21 +0530309 # Waiting extra time for the ONUs to come up
310 Sleep 60s
311 Run Keyword If ${has_dataplane} Clean Up Linux
312 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530313
314Test Delete and ReAdd OLT for DT
315 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
316 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
317 ... Disable and Delete the OLT
318 ... Create/Enable the same OLT again
319 ... Validate DHCP/E2E pings succeed for all the ONUs connected to the OLT
320 [Tags] functionalDt DeleteReAddOLTDt
321 [Setup] Start Logging DeleteReAddOLTDt
322 [Teardown] Run Keywords Collect Logs
323 ... AND Stop Logging DeleteReAddOLTDt
324 Run Keyword If ${has_dataplane} Clean Up Linux
325 Delete Device and Verify
326 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
327 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
328 Run Keyword and Ignore Error Collect Logs
329 # Recreate the OLT
330 Setup
331 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
332
333Test Disable ONUs and OLT Then Delete ONUs and OLT for DT
334 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
335 ... This TC is to confirm that ONU removal is not impacting OLT
336 ... Devices will be removed during the execution of this TC
337 ... so calling setup at the end to add the devices back to avoid the confusion.
338 [Tags] functionalDt DisableDeleteONUOLTDt
339 [Setup] Start Logging DisableDeleteONUOLTDt
340 [Teardown] Run Keywords Collect Logs
341 ... AND Stop Logging DisableDeleteONUOLTDt
342 ${olt_device_id}= Get Device ID From SN ${olt_serial_number}
343 FOR ${I} IN RANGE 0 ${num_onus}
344 ${src}= Set Variable ${hosts.src[${I}]}
345 ${dst}= Set Variable ${hosts.dst[${I}]}
346 ${onu_device_id}= Get Device ID From SN ${src['onu']}
347 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
348 ... Validate Device ENABLED ACTIVE
349 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
350 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
351 ... Validate OLT Device ENABLED ACTIVE
352 ... REACHABLE ${olt_serial_number}
353 Disable Device ${onu_device_id}
354 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
355 ... Validate Device DISABLED UNKNOWN
356 ... REACHABLE ${src['onu']} onu=false
357 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
358 ... Validate OLT Device ENABLED ACTIVE
359 ... REACHABLE ${olt_serial_number}
360 END
361 Disable Device ${olt_device_id}
362 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
363 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
364 ... ${olt_serial_number}
365 FOR ${I} IN RANGE 0 ${num_onus}
366 ${src}= Set Variable ${hosts.src[${I}]}
367 ${dst}= Set Variable ${hosts.dst[${I}]}
368 ${onu_device_id}= Get Device ID From SN ${src['onu']}
369 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
370 ... Validate Device DISABLED DISCOVERED
371 ... UNREACHABLE ${src['onu']} onu=false
372 Delete Device ${onu_device_id}
373 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
374 ... Validate OLT Device DISABLED UNKNOWN
375 ... REACHABLE ${olt_serial_number}
376 END
377 Delete Device ${olt_device_id}
378 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
379 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
380 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
381 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
382 Run Keyword Setup
383 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
384 Run Keyword If ${has_dataplane} Clean Up Linux
385
Andy Baviere19991a2020-05-08 10:42:40 -0700386Data plane verification using TCP for DT
387 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
388 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavier7613b9a2020-07-08 07:25:47 -0700389 [Tags] dataplaneDt BandwidthProfileTCPDt VOL-3061
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700390 [Setup] Start Logging BandwidthProfileTCPDt
391 [Teardown] Run Keywords Collect Logs
392 ... AND Stop Logging BandwidthProfileTCPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700393 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
394 ... physical pod. Skipping this test in BBSIM.
Andy Bavierd74f33c2020-05-12 12:45:36 -0700395 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
Andy Baviere19991a2020-05-08 10:42:40 -0700396 FOR ${I} IN RANGE 0 ${num_onus}
397 ${src}= Set Variable ${hosts.src[${I}]}
398 ${dst}= Set Variable ${hosts.dst[${I}]}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700399
400 # Check for iperf3 and jq tools
401 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
402 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
403 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
404
Andy Baviere19991a2020-05-08 10:42:40 -0700405 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
406 ... ${of_id}
407 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
408 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
409 ... upstreamBandwidthProfile
410 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
411 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
412 ... downstreamBandwidthProfile
413 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
414
415 # Stream TCP packets from RG to server
416 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
417 ... args=-t 30
418 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
419
420 # Stream TCP packets from server to RG
421 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
422 ... args=-R -t 30
423 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
424
425 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
426 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
427 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
428 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
429
430 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
431 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Bavier7613b9a2020-07-08 07:25:47 -0700432 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
433 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
434 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Andy Baviere19991a2020-05-08 10:42:40 -0700435 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
436 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
437 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
438 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
439 END
440
441Data plane verification using UDP for DT
442 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
443 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavier7613b9a2020-07-08 07:25:47 -0700444 [Tags] dataplaneDt BandwidthProfileUDPDt VOL-3061
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700445 [Setup] Start Logging BandwidthProfileUDPDt
446 [Teardown] Run Keywords Collect Logs
447 ... AND Stop Logging BandwidthProfileUDPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700448 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
449 ... physical pod. Skipping this test in BBSIM.
Andy Bavierd74f33c2020-05-12 12:45:36 -0700450 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
Andy Baviere19991a2020-05-08 10:42:40 -0700451 FOR ${I} IN RANGE 0 ${num_onus}
452 ${src}= Set Variable ${hosts.src[${I}]}
453 ${dst}= Set Variable ${hosts.dst[${I}]}
Andy Bavier7613b9a2020-07-08 07:25:47 -0700454
455 # Check for iperf3 and jq tools
456 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
457 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
458 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
459
Andy Baviere19991a2020-05-08 10:42:40 -0700460 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
461 ... ${of_id}
462 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
463 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
464 ... upstreamBandwidthProfile
465 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
466 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
467 ... downstreamBandwidthProfile
468 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
469
470 # Stream UDP packets from RG to server
Andrea Campanella580e0492020-08-05 15:35:48 +0200471 Run Keyword If ${limiting_bw_value_upstream} != 1000000
472 ... ${uprate}= Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
473 ... ELSE
474 ... ${uprate}= Set Variable ${limiting_bw_value_upstream}
475
Andy Baviere19991a2020-05-08 10:42:40 -0700476 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700477 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700478 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
479 ${actual_upstream_bw_used}= Evaluate
480 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
481
482 # Stream UDP packets from server to RG
Andrea Campanella580e0492020-08-05 15:35:48 +0200483 Run Keyword If ${limiting_bw_value_dnstream} != 1000000
484 ... ${dnrate}= Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
485 ... ELSE
486 ... ${dnrate}= Set Variable ${limiting_bw_value_dnstream}
Andy Baviere19991a2020-05-08 10:42:40 -0700487 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700488 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700489 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
490 ${actual_dnstream_bw_used}= Evaluate
491 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
492
493 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
494 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
495 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
496 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
497
498 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
499 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
Andy Bavier7613b9a2020-07-08 07:25:47 -0700500 # VOL-3125: downstream bw limit not enforced. Uncomment when fixed.
501 #Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
502 #... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
Andy Baviere19991a2020-05-08 10:42:40 -0700503 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
504 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
505 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
506 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
507 END
508
Andy Bavier7613b9a2020-07-08 07:25:47 -0700509Validate parsing of data traffic through voltha using tech profile
510 [Documentation] Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
511 ... Prerequisite tools : Tcpdump and Mausezahn traffic generator on both RG and DHCP/BNG VMs
512 ... Install jq tool to read json file, where test suite is being running
513 ... Make sure 9999 port is enabled or forwarded for both upsteam and downstream direction
514 ... This test sends UDP packets on port 9999 with pbits between 0 and 7 and validates that
515 ... the pbits are preserved by the PON.
516 [Tags] dataplaneDt TechProfileDt VOL-3291
517 [Setup] Start Logging TechProfileDt
518 [Teardown] Run Keywords Collect Logs
519 ... AND Stop Logging TechProfileDt
520 Pass Execution If '${has_dataplane}'=='False'
521 ... Skipping test: Technology profile validation can be done only in physical pod
522 FOR ${I} IN RANGE 0 ${num_onus}
523 ${src}= Set Variable ${hosts.src[${I}]}
524 ${dst}= Set Variable ${hosts.dst[${I}]}
525
Andy Bavier275414a2020-07-16 13:07:17 -0700526 ${src_iface_name}= Fetch From Left ${src['dp_iface_name']} .
527
Andy Bavier7613b9a2020-07-08 07:25:47 -0700528 ${bng_ip}= Get Variable Value ${dst['noroot_ip']}
529 ${bng_user}= Get Variable Value ${dst['noroot_user']}
530 ${bng_pass}= Get Variable Value ${dst['noroot_pass']}
531 Pass Execution If "${bng_ip}" == "${NONE}" or "${bng_user}" == "${NONE}" or "${bng_pass}" == "${NONE}"
532 ... Skipping test: credentials for BNG login required in deployment config
533
534 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
535 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
536 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the RG
537 ${stdout} ${stderr} ${rc}= Execute Remote Command which mausezahn tcpdump
538 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
539 Pass Execution If ${rc} != 0 Skipping test: mausezahn / tcpdump not found on the BNG
540 Log Upstream test
541 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Andy Bavier275414a2020-07-16 13:07:17 -0700542 ... ${dst['dp_iface_ip_qinq']} ${dst['dp_iface_name']} ${src_iface_name}
543 ... 0 udp 9999 ${src['c_tag']} vlan
Andy Bavier7613b9a2020-07-08 07:25:47 -0700544 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
545 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
546 Log Downstream test
547 ${rg_ip} ${stderr} ${rc}= Execute Remote Command
548 ... ifconfig ${src['dp_iface_name']} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'
549 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
550 Should Be Equal As Integers ${rc} 0 Could not get RG's IP address
551 Run Keyword If ${has_dataplane} Create traffic with each pbit and capture at other end
Andy Bavier275414a2020-07-16 13:07:17 -0700552 ... ${rg_ip} ${src_iface_name} ${dst['dp_iface_name']}.${src['s_tag']}
Andy Bavier7613b9a2020-07-08 07:25:47 -0700553 ... 0 udp 9999 ${src['c_tag']} udp
554 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
555 ... ${bng_ip} ${bng_user} ${bng_pass} ${dst['container_type']} ${dst['container_name']}
556 END
557
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000558*** Keywords ***
559Setup Suite
560 [Documentation] Set up the test suite
561 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700562 #Restore all ONUs
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700563 #Run Keyword If ${has_dataplane} RestoreONUs ${num_onus}
564 #power_switch.robot needs it to support different vendor's power switch
565 ${switch_type}= Get Variable Value ${web_power_switch.type}
566 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000567
568Clear All Devices Then Create New Device
569 [Documentation] Remove any devices from VOLTHA and ONOS
570 # Remove all devices from voltha and nos
571 Delete All Devices and Verify
572 # Execute normal test Setup Keyword
573 Setup
574