blob: 0c33c7341ca17ecc30d526f2eaef2f37fc2719f4 [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
34
35*** Variables ***
36${POD_NAME} flex-ocp-cord
37${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
38${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs
39#${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
40${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
41${HELM_CHARTS_DIR} ~/helm-charts
42${VOLTHA_POD_NUM} 8
43${NAMESPACE} voltha
44# For below variable value, using deployment name as using grep for
45# parsing radius pod name, we can also use full radius pod name
46${RESTART_POD_NAME} radius
47${timeout} 60s
48${of_id} 0
49${logical_id} 0
50${has_dataplane} True
Hardik Windlassffbf0602020-04-24 23:14:45 +053051${teardown_device} True
Hardik Windlassa3d04b92020-02-17 15:06:05 +000052${scripts} ../../scripts
53
Andy Baviere19991a2020-05-08 10:42:40 -070054# For dataplane bandwidth testing
55${upper_margin_pct} 105 # Allow 5% over the limit
Andy Bavierf6ab19c2020-05-14 10:34:47 -070056${lower_margin_pct} 92 # Allow 8% under the limit
Andy Baviere19991a2020-05-08 10:42:40 -070057${udp_rate_multiplier} 1.10 # Send UDP at bw profile limit * rate_multiplier
58${udp_packet_bytes} 1400 # UDP payload in bytes
59
Hardik Windlassa3d04b92020-02-17 15:06:05 +000060# Per-test logging on failure is turned off by default; set this variable to enable
61${container_log_dir} ${None}
62
63*** Test Cases ***
64Sanity E2E Test for OLT/ONU on POD for DT
65 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
66 ... Validate successful DHCP/E2E ping (no EAPOL and DHCP flows) for the tech profile that is used
67 ... Traffic sent with same vlan from different RGs,
68 ... should reach the NNI port on the OLT with the expected double tagged vlan ids
69 ... Inner vlans from the RG should not change
Suchitra Vemurif2388ad2020-03-15 21:44:44 -070070 [Tags] sanityDt
Andy Baviere187eda2020-04-20 15:00:02 -070071 [Setup] Run Keywords Start Logging SanityTestDt
Hardik Windlassa3d04b92020-02-17 15:06:05 +000072 ... AND Setup
73 [Teardown] Run Keywords Collect Logs
74 ... AND Stop Logging SanityTestDt
Hardik Windlassa3d04b92020-02-17 15:06:05 +000075 Run Keyword If ${has_dataplane} Clean Up Linux
76 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
77
Hardik Windlass35706ba2020-02-20 08:16:42 +000078Test Subscriber Delete and Add for DT
79 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
Hardik Windlass63d5e002020-03-06 21:07:09 +053080 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
Hardik Windlass35706ba2020-02-20 08:16:42 +000081 ... Delete a subscriber and validate that the pings do not succeed and state is purged
82 ... Disable and Enable the ONU (This is to replicate the existing DT behaviour)
83 ... Re-add the subscriber, and validate that the flows are present and pings are successful
Suchitra Vemurif2388ad2020-03-15 21:44:44 -070084 [Tags] functionalDt SubAddDeleteDt
Andy Baviere187eda2020-04-20 15:00:02 -070085 [Setup] Start Logging SubAddDeleteDt
Hardik Windlass35706ba2020-02-20 08:16:42 +000086 [Teardown] Run Keywords Collect Logs
87 ... AND Stop Logging SubAddDeleteDt
Hardik Windlass35706ba2020-02-20 08:16:42 +000088 FOR ${I} IN RANGE 0 ${num_onus}
89 ${src}= Set Variable ${hosts.src[${I}]}
90 ${dst}= Set Variable ${hosts.dst[${I}]}
91 ${onu_device_id}= Get Device ID From SN ${src['onu']}
92 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
93 ... ${of_id}
94 # Remove Subscriber Access
ubuntu6b6e7d42020-03-02 12:35:42 -080095 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +000096 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
97 Sleep 10s
Hardik Windlassfb5eace2020-03-26 14:49:01 +053098 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass35706ba2020-02-20 08:16:42 +000099 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
100 ... Wait Until Keyword Succeeds 60s 2s
101 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
102 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530103 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
104 ${onos_flows_count}= Evaluate 4 * ( ${num_onus} - 1 )
105 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
106 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
Hardik Windlass25e11702020-03-30 20:05:19 +0530107 ... ${of_id} ${onos_flows_count}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000108 # Verify VOLTHA flows for OLT equals twice the number of ONUS (minus ONU under test) + 1 for LLDP
109 ${olt_flows}= Evaluate 2 * ( ${num_onus} - 1 ) + 1
110 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
111 # Verify VOLTHA flows for ONU under test is Zero
112 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows
113 ... ${onu_device_id} 0
114 # Disable and Re-Enable the ONU (To replicate DT current workflow)
115 # TODO: Delete and Auto-Discovery Add of ONU (not yet supported)
116 Disable Device ${onu_device_id}
117 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
118 ... Validate Device DISABLED UNKNOWN
119 ... REACHABLE ${src['onu']}
120 Enable Device ${onu_device_id}
121 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
122 ... Validate Device ENABLED ACTIVE
123 ... REACHABLE ${src['onu']}
124 # Add Subscriber Access
ubuntu6b6e7d42020-03-02 12:35:42 -0800125 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000126 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
127 Sleep 10s
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530128 # Verify subscriber access flows are added for the ONU port
129 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass25e11702020-03-30 20:05:19 +0530130 ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
131 ... ${onu_port} ${nni_port} ${src['s_tag']}
Hardik Windlass35706ba2020-02-20 08:16:42 +0000132 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
133 ... Validate Device ENABLED ACTIVE
134 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530135 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass35706ba2020-02-20 08:16:42 +0000136 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
137 ... Wait Until Keyword Succeeds 60s 2s
138 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
139 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
140 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
141 Run Keyword and Ignore Error Collect Logs
142 END
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530143 # Verify ONOS Flows
144 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
145 ${onos_flows_count}= Evaluate 4 * ${num_onus}
146 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass25e11702020-03-30 20:05:19 +0530147 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
148 ... ${of_id} ${onos_flows_count}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530149 # Verify VOLTHA Flows
Hardik Windlass35706ba2020-02-20 08:16:42 +0000150 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
151 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
152 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
153 ${onu_flows}= Set Variable 2
154 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
155 ${List_ONU_Serial} Create List
156 Set Suite Variable ${List_ONU_Serial}
157 Build ONU SN List ${List_ONU_Serial}
158 Log ${List_ONU_Serial}
159 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
160 ... ${List_ONU_Serial} ${onu_flows}
161
Hardik Windlass63d5e002020-03-06 21:07:09 +0530162Test Disable and Enable ONU for DT
163 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
164 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
165 ... Perform disable on the ONUs and validate that the pings do not succeed
166 ... Perform enable on the ONUs and validate that the pings are successful
Suchitra Vemurif2388ad2020-03-15 21:44:44 -0700167 [Tags] functionalDt DisableEnableONUDt
Andy Baviere187eda2020-04-20 15:00:02 -0700168 [Setup] Start Logging DisableEnableONUDt
Hardik Windlass63d5e002020-03-06 21:07:09 +0530169 [Teardown] Run Keywords Collect Logs
170 ... AND Stop Logging DisableEnableONUDt
Hardik Windlass63d5e002020-03-06 21:07:09 +0530171 FOR ${I} IN RANGE 0 ${num_onus}
172 ${src}= Set Variable ${hosts.src[${I}]}
173 ${dst}= Set Variable ${hosts.dst[${I}]}
174 ${onu_device_id}= Get Device ID From SN ${src['onu']}
175 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
176 ... ${of_id}
177 Disable Device ${onu_device_id}
178 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
179 ... Validate Device DISABLED UNKNOWN
180 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-admin-lock
181 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
182 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530183 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass63d5e002020-03-06 21:07:09 +0530184 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
185 ... Wait Until Keyword Succeeds 60s 2s
186 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
187 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
188 Sleep 5s
189 Enable Device ${onu_device_id}
190 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
191 ... Validate Device ENABLED ACTIVE
192 ... REACHABLE ${src['onu']} onu=True onu_reason=onu-reenabled
193 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
194 ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530195 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
Hardik Windlass63d5e002020-03-06 21:07:09 +0530196 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
197 ... Wait Until Keyword Succeeds 60s 2s
198 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
199 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
200 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
201 Run Keyword and Ignore Error Collect Logs
202 END
203
Hardik Windlassaaea3402020-03-10 19:45:45 +0530204Test Disable and Delete OLT for DT
205 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
206 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
207 ... Perform disable on the OLT and validate ONUs state and that the pings do not succeed
208 ... Perform delete on the OLT, Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
Suchitra Vemurif2388ad2020-03-15 21:44:44 -0700209 [Tags] functionalDt DisableDeleteOLTDt
Suchitra Vemuri221398a2020-05-29 22:45:17 -0700210 [Setup] Start Logging DisableDeleteOLTDt
Hardik Windlassaaea3402020-03-10 19:45:45 +0530211 [Teardown] Run Keywords Collect Logs
212 ... AND Stop Logging DisableDeleteOLTDt
Hardik Windlassaaea3402020-03-10 19:45:45 +0530213 # Disable and Validate OLT Device
214 Disable Device ${olt_device_id}
215 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
216 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
217 ... ${olt_serial_number}
218 # Validate ONUs
219 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONUs After OLT Disable
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530220 # Verify ONOS Flows
221 # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
222 ${onos_flows_count}= Evaluate 4 * ${num_onus}
223 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass25e11702020-03-30 20:05:19 +0530224 ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
225 ... ${of_id} ${onos_flows_count}
Hardik Windlassfb5eace2020-03-26 14:49:01 +0530226 # Verify VOLTHA Flows
Hardik Windlassaaea3402020-03-10 19:45:45 +0530227 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
228 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
229 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
230 ${onu_flows}= Set Variable 2
231 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
232 ${List_ONU_Serial} Create List
233 Set Suite Variable ${List_ONU_Serial}
234 Build ONU SN List ${List_ONU_Serial}
235 Log ${List_ONU_Serial}
236 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
237 ... ${List_ONU_Serial} ${onu_flows}
238 # Delete OLT and Validate Empty Device List
239 Delete Device ${olt_device_id}
240 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
Hardik Windlass480f3e22020-04-02 20:14:14 +0530241 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
242 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
Hardik Windlassaaea3402020-03-10 19:45:45 +0530243 Run Keyword and Ignore Error Collect Logs
244 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
245 Run Keyword Setup
246 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Suchitra Vemuriae9cecb2020-03-12 12:59:14 -0700247 Run Keyword If ${has_dataplane} Clean Up Linux
Hardik Windlassaaea3402020-03-10 19:45:45 +0530248
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530249Test Disable and Enable OLT for DT
250 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
251 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
252 ... Perform disable on the OLT and validate that the pings do not succeed
253 ... Perform enable on the OLT and validate that the pings are successful
Suchitra Vemuri221398a2020-05-29 22:45:17 -0700254 [Tags] functionalDt DisableEnableOLTDt notready
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530255 [Setup] Start Logging DisableEnableOLTDt
256 [Teardown] Run Keywords Collect Logs
257 ... AND Stop Logging DisableEnableOLTDt
258 # Disable and Validate OLT Device
259 Disable Device ${olt_device_id}
260 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
261 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
262 ... ${olt_serial_number}
Hardik Windlass7c801e62020-05-04 19:33:21 +0530263 FOR ${I} IN RANGE 0 ${num_onus}
264 ${src}= Set Variable ${hosts.src[${I}]}
265 ${dst}= Set Variable ${hosts.dst[${I}]}
266 ${onu_device_id}= Get Device ID From SN ${src['onu']}
267 ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
268 ... Get ONU Port in ONOS ${src['onu']} ${of_id}
269 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
270 ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
271 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
272 ... Wait Until Keyword Succeeds 60s 2s
273 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
274 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
275 # Remove Subscriber Access (To replicate DT workflow)
276 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP}
277 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
278 # Delete ONU Device (To replicate DT workflow)
279 Delete Device ${onu_device_id}
280 END
281 Sleep 15s
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530282 # Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
283 Enable Device ${olt_device_id}
284 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
285 ... ${olt_serial_number}
286 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
287 ... PON_OLT ETHERNET_NNI
Hardik Windlass7c801e62020-05-04 19:33:21 +0530288 # Waiting extra time for the ONUs to come up
289 Sleep 60s
290 Run Keyword If ${has_dataplane} Clean Up Linux
291 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Hardik Windlass3b531fa2020-04-23 18:51:44 +0530292
293Test Delete and ReAdd OLT for DT
294 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
295 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
296 ... Disable and Delete the OLT
297 ... Create/Enable the same OLT again
298 ... Validate DHCP/E2E pings succeed for all the ONUs connected to the OLT
299 [Tags] functionalDt DeleteReAddOLTDt
300 [Setup] Start Logging DeleteReAddOLTDt
301 [Teardown] Run Keywords Collect Logs
302 ... AND Stop Logging DeleteReAddOLTDt
303 Run Keyword If ${has_dataplane} Clean Up Linux
304 Delete Device and Verify
305 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
306 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
307 Run Keyword and Ignore Error Collect Logs
308 # Recreate the OLT
309 Setup
310 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
311
312Test Disable ONUs and OLT Then Delete ONUs and OLT for DT
313 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
314 ... This TC is to confirm that ONU removal is not impacting OLT
315 ... Devices will be removed during the execution of this TC
316 ... so calling setup at the end to add the devices back to avoid the confusion.
317 [Tags] functionalDt DisableDeleteONUOLTDt
318 [Setup] Start Logging DisableDeleteONUOLTDt
319 [Teardown] Run Keywords Collect Logs
320 ... AND Stop Logging DisableDeleteONUOLTDt
321 ${olt_device_id}= Get Device ID From SN ${olt_serial_number}
322 FOR ${I} IN RANGE 0 ${num_onus}
323 ${src}= Set Variable ${hosts.src[${I}]}
324 ${dst}= Set Variable ${hosts.dst[${I}]}
325 ${onu_device_id}= Get Device ID From SN ${src['onu']}
326 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
327 ... Validate Device ENABLED ACTIVE
328 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
329 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
330 ... Validate OLT Device ENABLED ACTIVE
331 ... REACHABLE ${olt_serial_number}
332 Disable Device ${onu_device_id}
333 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
334 ... Validate Device DISABLED UNKNOWN
335 ... REACHABLE ${src['onu']} onu=false
336 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
337 ... Validate OLT Device ENABLED ACTIVE
338 ... REACHABLE ${olt_serial_number}
339 END
340 Disable Device ${olt_device_id}
341 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
342 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
343 ... ${olt_serial_number}
344 FOR ${I} IN RANGE 0 ${num_onus}
345 ${src}= Set Variable ${hosts.src[${I}]}
346 ${dst}= Set Variable ${hosts.dst[${I}]}
347 ${onu_device_id}= Get Device ID From SN ${src['onu']}
348 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
349 ... Validate Device DISABLED DISCOVERED
350 ... UNREACHABLE ${src['onu']} onu=false
351 Delete Device ${onu_device_id}
352 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
353 ... Validate OLT Device DISABLED UNKNOWN
354 ... REACHABLE ${olt_serial_number}
355 END
356 Delete Device ${olt_device_id}
357 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
358 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
359 ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id}
360 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
361 Run Keyword Setup
362 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
363 Run Keyword If ${has_dataplane} Clean Up Linux
364
Andy Baviere19991a2020-05-08 10:42:40 -0700365Data plane verification using TCP for DT
366 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
367 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavier1b144eb2020-05-28 11:22:11 -0700368 [Tags] dataplaneDt BandwidthProfileTCPDt VOL-3061 notready
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700369 [Setup] Start Logging BandwidthProfileTCPDt
370 [Teardown] Run Keywords Collect Logs
371 ... AND Stop Logging BandwidthProfileTCPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700372 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
373 ... physical pod. Skipping this test in BBSIM.
Andy Bavierd74f33c2020-05-12 12:45:36 -0700374 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
Andy Baviere19991a2020-05-08 10:42:40 -0700375 FOR ${I} IN RANGE 0 ${num_onus}
376 ${src}= Set Variable ${hosts.src[${I}]}
377 ${dst}= Set Variable ${hosts.dst[${I}]}
Andy Bavierf6ab19c2020-05-14 10:34:47 -0700378
379 # Check for iperf3 and jq tools
380 ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq
381 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
382 Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG
383
Andy Baviere19991a2020-05-08 10:42:40 -0700384 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
385 ... ${of_id}
386 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
387 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
388 ... upstreamBandwidthProfile
389 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
390 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
391 ... downstreamBandwidthProfile
392 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
393
394 # Stream TCP packets from RG to server
395 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
396 ... args=-t 30
397 ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000
398
399 # Stream TCP packets from server to RG
400 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
401 ... args=-R -t 30
402 ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000
403
404 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
405 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
406 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
407 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
408
409 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
410 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
411 Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
412 ... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
413 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
414 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
415 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
416 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
417 END
418
419Data plane verification using UDP for DT
420 [Documentation] Test bandwidth profile is met and not exceeded for each subscriber.
421 ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server
Andy Bavierdfbcaef2020-05-27 15:34:18 -0700422 [Tags] dataplaneDt BandwidthProfileUDPDt VOL-3061 notready
423 [Setup] Start Logging BandwidthProfileUDPDt
424 [Teardown] Run Keywords Collect Logs
425 ... AND Stop Logging BandwidthProfileUDPDt
Andy Baviere19991a2020-05-08 10:42:40 -0700426 Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in
427 ... physical pod. Skipping this test in BBSIM.
Andy Bavierd74f33c2020-05-12 12:45:36 -0700428 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
Andy Baviere19991a2020-05-08 10:42:40 -0700429 FOR ${I} IN RANGE 0 ${num_onus}
430 ${src}= Set Variable ${hosts.src[${I}]}
431 ${dst}= Set Variable ${hosts.dst[${I}]}
432 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
433 ... ${of_id}
434 ${subscriber_id}= Set Variable ${of_id}/${onu_port}
435 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
436 ... upstreamBandwidthProfile
437 ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name}
438 ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id}
439 ... downstreamBandwidthProfile
440 ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name}
441
442 # Stream UDP packets from RG to server
443 ${uprate}= Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier}
444 ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700445 ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700446 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
447 ${actual_upstream_bw_used}= Evaluate
448 ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000
449
450 # Stream UDP packets from server to RG
451 ${dnrate}= Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier}
452 ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']}
Andy Bavier7dc50622020-05-28 14:34:12 -0700453 ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0
Andy Baviere19991a2020-05-08 10:42:40 -0700454 # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput.
455 ${actual_dnstream_bw_used}= Evaluate
456 ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000
457
458 ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream}
459 ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream}
460 Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%)
461 Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%)
462
463 Should Be True ${pct_limit_up} <= ${upper_margin_pct}
464 ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit)
465 Should Be True ${pct_limit_dn} <= ${upper_margin_pct}
466 ... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit)
467 Should Be True ${pct_limit_up} >= ${lower_margin_pct}
468 ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv)
469 Should Be True ${pct_limit_dn} >= ${lower_margin_pct}
470 ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv)
471 END
472
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000473*** Keywords ***
474Setup Suite
475 [Documentation] Set up the test suite
476 Common Test Suite Setup
Hung-Wei Chiucc6e6552020-06-04 12:57:38 -0700477 #Restore all ONUs
478 Run Keyword If ${has_dataplane} RestoreONUs ${num_onus}
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000479
480Clear All Devices Then Create New Device
481 [Documentation] Remove any devices from VOLTHA and ONOS
482 # Remove all devices from voltha and nos
483 Delete All Devices and Verify
484 # Execute normal test Setup Keyword
485 Setup
486