blob: 62c792c9e77778cb83ab404705955adca08cdb8e [file] [log] [blame]
bharat raj58488b32023-05-11 22:46:18 +05301# 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/vgc.robot
29Resource ../../libraries/voltctl.robot
30Resource ../../libraries/voltha.robot
31Resource ../../libraries/utils_vgc.robot
32Resource ../../libraries/k8s.robot
33Resource ../../variables/variables.robot
34Resource ../../libraries/power_switch.robot
35
36
37*** Variables ***
38${POD_NAME} bbsim-kind-dt
39${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
40${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs
41#${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
42#${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
43${KUBERNETES_YAML} /test/repos/voltha-system-tests/tests/data/bbsim-kind-dt-vgc.yaml
44${HELM_CHARTS_DIR} ~/helm-charts
45${VOLTHA_POD_NUM} 8
46${NAMESPACE} voltha
47${INFRA_NAMESPACE} default
48# For below variable value, using deployment name as using grep for
49# parsing radius pod name, we can also use full radius pod name
50${RESTART_POD_NAME} radius
51${timeout} 60s
52${of_id} 0
53${logical_id} 0
54${uprate} 0
55${dnrate} 0
56${has_dataplane} True
57${teardown_device} True
58${scripts} ../../scripts
59# flag to reboot OLT through Power Switch
60${power_cycle_olt} False
61
62# For dataplane bandwidth testing
63${upper_margin_pct} 105 # Allow 5% over the limit
64${lower_margin_pct} 90 # Allow 8% under the limit
65${udp_rate_multiplier} 1.10 # Send UDP at bw profile limit * rate_multiplier
66${udp_packet_bytes} 1470 # UDP payload in bytes
67
68# Per-test logging on failure is turned off by default; set this variable to enable
69${container_log_dir} ${None}
70
71# logging flag to enable Collect Logs, can be passed via the command line too
72# example: -v logging:False
73${logging} True
74
75# Flag specific to Soak Jobs
76${SOAK_TEST} False
77${bbsim_port} 50060
78
79*** Test Cases ***
80Sanity E2E Test for OLT/ONU on POD for DT
81 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
82 ... Validate successful DHCP/E2E ping (no EAPOL and DHCP flows) for the tech profile that is used
83 ... Traffic sent with same vlan from different RGs,
84 ... should reach the NNI port on the OLT with the expected double tagged vlan ids
85 ... Inner vlans from the RG should not change
86 [Tags] sanityDt soak
87 [Setup] Start Logging SanityTestDt
88# [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
89# ... AND Stop Logging SanityTestDt
90 Setup ${SOAK_TEST}
91 Run Keyword If ${has_dataplane} Clean Up Linux
92 Perform Sanity Test DT
93
94Test Subscriber Delete and Add for DT
95 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
96 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
97 ... Delete a subscriber and validate that the pings do not succeed and state is purged
98 ... Disable and Enable the ONU (This is to replicate the existing DT behaviour)
99 ... Re-add the subscriber, and validate that the flows are present and pings are successful
100 [Tags] functionalDt SubAddDeleteDt soak
101 [Setup] Run Keywords Start Logging SubAddDeleteDt
102 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
103 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
104 ... AND Stop Logging SubAddDeleteDt
105 FOR ${I} IN RANGE 0 ${num_all_onus}
106 ${src}= Set Variable ${hosts.src[${I}]}
107 ${dst}= Set Variable ${hosts.dst[${I}]}
108 ${of_id}= Get ofID From OLT List ${src['olt']}
109 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in VGC ${of_id}
110 ${onu_device_id}= Get Device ID From SN ${src['onu']}
111 ${olt_device_id}= Get OLTDeviceID From OLT List ${src['olt']}
112 ${num_of_olt_onus}= Get Num of Onus From OLT SN ${src['olt']}
113 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in VGC ${src['onu']}
114 ... ${of_id} ${src['uni_id']}
115 # Remove Subscriber Access
116 Delete Request VGC services/${of_id}/${onu_port}
117 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
118 ... Wait Until Keyword Succeeds ${timeout} 2s
119 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
120 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
121
122 # Number of Access Flows on VGC equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
123 ${vgc_flows_count}= Evaluate 4 * ( ${num_of_olt_onus} - 1 )
124 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
125 ... Verify Subscriber Access Flows Added Count DT ${VGC_SSH_IP} ${VGC_SSH_PORT}
126 ... ${of_id} ${vgc_flows_count}
127 # Verify VOLTHA flows for OLT equals twice the number of ONUS (minus ONU under test) + 1 for LLDP
128 ${olt_flows}= Evaluate 2 * ( ${num_of_olt_onus} - 1 )
129 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows
130 ... ${olt_flows} ${olt_device_id}
131 # Verify VOLTHA flows for ONU under test is Zero
132 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows
133 ... ${onu_device_id} 0
134 # Disable and Re-Enable the ONU (To replicate DT current workflow)
135 # TODO: Delete and Auto-Discovery Add of ONU (not yet supported)
136 Disable Device ${onu_device_id}
137 Wait Until Keyword Succeeds ${timeout} 5s
138 ... Validate Device DISABLED UNKNOWN
139 ... REACHABLE ${src['onu']}
140 Enable Device ${onu_device_id}
141 Wait Until Keyword Succeeds 360s 5s
142 ... Validate Device ENABLED ACTIVE
143 ... REACHABLE ${src['onu']}
144 # Add Subscriber Access
145 Post Request VGC services/${of_id}/${onu_port}
146 # Verify subscriber access flows are added for the ONU port
147 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
148 ... Verify Subscriber Access Flows Added for ONU DT in VGC ${VGC_SSH_IP} ${VGC_SSH_PORT} ${of_id}
149 ... ${onu_port} ${nni_port} ${src['s_tag']}
150 Wait Until Keyword Succeeds ${timeout} 5s
151 ... Validate Device ENABLED ACTIVE
152 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
153 # Workaround for issue seen in VOL-4489. Keep this workaround until VOL-4489 is fixed.
154 Run Keyword If ${has_dataplane} Reboot XGSPON ONU ${src['olt']} ${src['onu']} omci-flows-pushed
155 # Workaround ends here for issue seen in VOL-4489.
156 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
157 ... Wait Until Keyword Succeeds ${timeout} 2s
158 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
159 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
160 END
161 # Verify flows for all OLTs
162 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate All OLT Flows
163
164Test Disable and Enable ONU for DT
165 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
166 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
167 ... Perform disable on the ONUs and validate that the pings do not succeed
168 ... Perform enable on the ONUs and validate that the pings are successful
169 [Tags] functionalDt DisableEnableONUDt soak
170 [Setup] Run Keywords Start Logging DisableEnableONUDt
171 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
172 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
173 ... AND Stop Logging DisableEnableONUDt
174 FOR ${I} IN RANGE 0 ${num_all_onus}
175 ${src}= Set Variable ${hosts.src[${I}]}
176 ${dst}= Set Variable ${hosts.dst[${I}]}
177 ${of_id}= Get ofID From OLT List ${src['olt']}
178 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in VGC ${src['onu']}
179 ... ${of_id} ${src['uni_id']}
180 ${onu_device_id}= Get Device ID From SN ${src['onu']}
181 Disable Device ${onu_device_id}
182 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
183 ... Validate Device DISABLED UNKNOWN
184 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-admin-lock
185 Wait Until Keyword Succeeds ${timeout} 2s
186 ... Verify UNI Port Is Disabled ${VGC_SSH_IP} ${VGC_SSH_PORT} ${src['onu']} ${src['uni_id']}
187 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
188 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
189 ... Wait Until Keyword Succeeds ${timeout} 2s
190 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
191 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
192 Sleep 5s
193 Enable Device ${onu_device_id}
194 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
195 ... Validate Device ENABLED ACTIVE
196 ... REACHABLE ${src['onu']} onu=True onu_reason=onu-reenabled
197 Wait Until Keyword Succeeds ${timeout} 2s
198 ... Verify UNI Port Is Enabled ${src['onu']} ${src['uni_id']}
199 # Workaround for issue seen in VOL-4489. Keep this workaround until VOL-4489 is fixed.
200 Run Keyword If ${has_dataplane} Reboot XGSPON ONU ${src['olt']} ${src['onu']} omci-flows-pushed
201 # Workaround ends here for issue seen in VOL-4489.
202 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
203 ... Wait Until Keyword Succeeds ${timeout} 2s
204 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
205 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
206 END
207
208Test Disable and Delete OLT for DT
209 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
210 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
211 ... Perform disable on the OLT and validate ONUs state and that the pings do not succeed
212 ... Perform delete on the OLT, Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
213 [Tags] functionalDt DisableDeleteOLTDt soak
214 [Setup] Start Logging DisableDeleteOLTDt
215 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
216 ... AND Stop Logging DisableDeleteOLTDt
217 # Disable and Validate OLT Device
218 FOR ${I} IN RANGE 0 ${olt_count}
219 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
220 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
221 Disable Device ${olt_device_id}
222 ${of_id}= Get ofID From OLT List ${olt_serial_number}
223 Wait Until Keyword Succeeds ${timeout} 5s
224 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
225 ... ${olt_serial_number}
226 ${num_onus}= Set Variable ${list_olts}[${I}][onucount]
227 # Validate ONUs
228 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONUs After OLT Disable
229 ... ${num_onus} ${olt_serial_number}
230 # Verify VGC Flows
231 # Number of Access Flows on VGC equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
232 ${vgc_flows_count}= Evaluate 4 * ${num_onus}
233 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
234 ... Verify Subscriber Access Flows Added Count DT ${VGC_SSH_IP} ${VGC_SSH_PORT}
235 ... ${of_id} ${vgc_flows_count}
236 # Verify VOLTHA Flows
237 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
238 ${olt_flows}= Evaluate 2 * ${num_onus}
239 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
240 ${onu_flows}= Set Variable 2
241 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows
242 ... ${olt_flows} ${olt_device_id}
243 ${List_ONU_Serial} Create List
244 Set Suite Variable ${List_ONU_Serial}
245 Build ONU SN List ${List_ONU_Serial} ${olt_serial_number} ${num_onus}
246 Log ${List_ONU_Serial}
247 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
248 ... ${List_ONU_Serial} ${onu_flows}
249 # Delete OLT and Validate Empty Device List
250 Delete Device ${olt_device_id}
251 # Check that the OLT and the ONUs are actually removed from the system
252 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed
253 ... ${olt_serial_number}
254 Run Keyword and Continue On Failure Validate all ONUS for OLT Removed ${num_all_onus} ${hosts}
255 ... ${olt_serial_number} ${timeout}
256 Wait Until Keyword Succeeds ${timeout} 5s
257 ... Verify Device Flows Removed ${VGC_SSH_IP} ${VGC_SSH_PORT} ${of_id}
258 END
259 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
260 Run Keyword Setup ${SOAK_TEST}
261 Run Keyword If ${has_dataplane} Clean Up Linux
262 Perform Sanity Test DT
263
264Test Disable and Enable OLT for DT
265 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
266 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
267 ... Perform disable on the OLT and validate that the pings do not succeed
268 ... Perform enable on the OLT and validate that the pings are successful
269 [Tags] functionalDt DisableEnableOLTDt soak
270 [Setup] Start Logging DisableEnableOLTDt
271 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
272 ... AND Stop Logging DisableEnableOLTDt
273 # Disable and Validate OLT Device
274 FOR ${I} IN RANGE 0 ${olt_count}
275 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
276 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
277 ${rc} ${output}= Run and Return Rc and Output
Jan Klarec92d6982023-09-05 14:46:52 +0200278 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
bharat raj58488b32023-05-11 22:46:18 +0530279 Should Be Equal As Integers ${rc} 0
280 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
281 ... ${olt_serial_number}
282 END
283 # Validate ONUs
284 FOR ${I} IN RANGE 0 ${num_all_onus}
285 ${src}= Set Variable ${hosts.src[${I}]}
286 ${dst}= Set Variable ${hosts.dst[${I}]}
287 ${of_id}= Get ofID From OLT List ${src['olt']}
288 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
289 ... Get ONU Port in VGC ${src['onu']} ${of_id} ${src['uni_id']}
290 ${onu_device_id}= Get Device ID From SN ${src['onu']}
291 Wait Until Keyword Succeeds ${timeout} 2s
292 ... Verify UNI Port Is Disabled ${VGC_SSH_IP} ${VGC_SSH_PORT} ${src['onu']} ${src['uni_id']}
293 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
294 ... Wait Until Keyword Succeeds ${timeout} 2s
295 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
296 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
297 # Remove Subscriber Access (To replicate DT workflow)
298 ${onu_port_name}= Catenate SEPARATOR=- ${src['onu']} ${src['uni_id']}
299 Wait Until Keyword Succeeds ${timeout} 2s
300 ... Delete Request VGC services/${onu_port_name}
301 # Delete ONU Device (To replicate DT workflow)
302 Delete Device ${onu_device_id}
303 END
304 Sleep 5s
305 # Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
306 FOR ${I} IN RANGE 0 ${olt_count}
307 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
308 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
309 Enable Device ${olt_device_id}
310 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
311 ... ${olt_serial_number}
312 #TODO: Update for PON_OLT ETHERNET_NNI
313 #Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
314 #... PON_OLT ETHERNET_NNI
315 END
316 # Waiting extra time for the ONUs to come up
317 Sleep 60s
318 Run Keyword If ${has_dataplane} Clean Up Linux
319 Perform Sanity Test DT
320
321Test Delete and ReAdd OLT for DT
322 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
323 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
324 ... Disable and Delete the OLT
325 ... Create/Enable the same OLT again
326 ... Validate DHCP/E2E pings succeed for all the ONUs connected to the OLT
327 [Tags] functionalDt DeleteReAddOLTDt soak
328 [Setup] Start Logging DeleteReAddOLTDt
329 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
330 ... AND Stop Logging DeleteReAddOLTDt
331 FOR ${I} IN RANGE 0 ${olt_count}
332 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
333 ${of_id}= Get ofID From OLT List ${olt_serial_number}
334 Delete Device and Verify ${olt_serial_number}
335 Wait Until Keyword Succeeds ${timeout} 5s
336 ... Verify Device Flows Removed ${VGC_SSH_IP} ${VGC_SSH_PORT} ${of_id}
337 END
338 # Recreate the OLTs
339 Setup ${SOAK_TEST}
340 Run Keyword If ${has_dataplane} Clean Up Linux
341 Perform Sanity Test DT
342
343Test Disable ONUs and OLT Then Delete ONUs and OLT for DT
344 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
345 ... This TC is to confirm that ONU removal is not impacting OLT
346 ... Devices will be removed during the execution of this TC
347 ... so calling setup at the end to add the devices back to avoid the confusion.
348 [Tags] functionalDt DisableDeleteONUOLTDt
349 [Setup] Run Keywords Start Logging DisableDeleteONUOLTDt
350 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
351 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
352 ... AND Stop Logging DisableDeleteONUOLTDt
353 @{onu_reason}= Create List initial-mib-downloaded omci-flows-pushed
354 FOR ${I} IN RANGE 0 ${num_all_onus}
355 ${src}= Set Variable ${hosts.src[${I}]}
356 ${dst}= Set Variable ${hosts.dst[${I}]}
357 ${onu_device_id}= Get Device ID From SN ${src['onu']}
358 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
359 ... Validate Device ENABLED ACTIVE
360 ... REACHABLE ${src['onu']} onu=True onu_reason=${onu_reason}
361 Wait Until Keyword Succeeds ${timeout} 5s
362 ... Validate OLT Device ENABLED ACTIVE
363 ... REACHABLE ${src['olt']}
364 Disable Device ${onu_device_id}
365 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
366 ... Validate Device DISABLED UNKNOWN
367 ... REACHABLE ${src['onu']} onu=false
368 Wait Until Keyword Succeeds ${timeout} 5s
369 ... Validate OLT Device ENABLED ACTIVE
370 ... REACHABLE ${src['olt']}
371 END
372 # Disable all OLTs
373 FOR ${I} IN RANGE 0 ${olt_count}
374 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
375 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
376 ${rc} ${output}= Run and Return Rc and Output
Jan Klarec92d6982023-09-05 14:46:52 +0200377 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
bharat raj58488b32023-05-11 22:46:18 +0530378 Should Be Equal As Integers ${rc} 0
379 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
380 ... ${olt_serial_number}
381 END
382 # Validate ONUs after OLT disable
383 FOR ${I} IN RANGE 0 ${num_all_onus}
384 ${src}= Set Variable ${hosts.src[${I}]}
385 ${dst}= Set Variable ${hosts.dst[${I}]}
386 ${onu_device_id}= Get Device ID From SN ${src['onu']}
387 Wait Until Keyword Succeeds ${timeout} 5s
388 ... Validate Device DISABLED DISCOVERED
389 ... UNREACHABLE ${src['onu']} onu=false
390 Delete Device ${onu_device_id}
391 Wait Until Keyword Succeeds ${timeout} 5s
392 ... Validate OLT Device DISABLED UNKNOWN
393 ... REACHABLE ${src['olt']}
394 END
395 # Delete all OLTs
396 Delete All Devices and Verify
397
398 #Delete Device ${olt_device_id}
399 #TODO: Fix the following assertion
400 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
401 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
402 #... Verify Device Flows Removed ${VGC_SSH_IP} ${VGC_SSH_PORT} ${of_id}
403
404 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
405 Run Keyword Setup
406 Run Keyword If ${has_dataplane} Clean Up Linux
407 Perform Sanity Test DT
408
409Test Disable and Enable OLT PON Port for DT
410 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
411 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
412 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
413 ... Perform enable on the OLT PON Port and validate that the pings are successful
414 [Tags] functionalDt DisableEnableOltPonPortDt VOL-2577 soak
415 [Setup] Run Keywords Start Logging DisableEnableOltPonPortDt
416 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
417 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
418 ... AND Stop Logging DisableEnableOltPonPortDt
419 FOR ${I} IN RANGE 0 ${olt_count}
420 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
421 Disable Enable PON Port Per OLT DT ${olt_serial_number}
422 END
423
424Test ONU Delete and Auto-Discovery for DT
425 [Documentation] Tests the voltctl delete and Auto-Discovery of the ONU
426 [Tags] functionalDt VOL-3098 ONUAutoDiscoveryDt
427 [Setup] Start Logging ONUAutoDiscoveryDt
428 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
429 ... AND Stop Logging ONUAutoDiscoveryDt
430 Clear All Devices Then Create New Device
431 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
432 Run Keyword If ${has_dataplane} Clean Up Linux
433 Perform Sanity Test DT
434 FOR ${I} IN RANGE 0 ${num_all_onus}
435 ${src}= Set Variable ${hosts.src[${I}]}
436 ${dst}= Set Variable ${hosts.dst[${I}]}
437 ${of_id}= Get ofID From OLT List ${src['olt']}
438 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
439 ... Get ONU Port in VGC ${src['onu']} ${of_id}
440 ${onu_device_id}= Get Device ID From SN ${src['onu']}
441 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in VGC ${of_id}
442 # Remove Subscriber
443 Delete Request VGC services/${of_id}/${onu_port}
444 # Additional sleep to let subscriber delete process
445 Sleep 10s
446 # Delete ONU and Verify Ping Fails
447 Delete Device ${onu_device_id}
448 Run Keyword If ${has_dataplane} Verify ping is successful except for given device
449 ... ${num_all_onus} ${src['onu']}
450 # Verify that no pending flows exist for the ONU port
451 Wait Until Keyword Succeeds ${timeout} 2s
452 ... Verify No Pending Flows For ONU ${VGC_SSH_IP} ${VGC_SSH_PORT} ${onu_port}
453 # ONU Auto-Discovery
454 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
455 ... Get ONU Port in VGC ${src['onu']} ${of_id} ${src['uni_id']}
456 # Check ONU port is Enabled in VGC
457 Wait Until Keyword Succeeds ${timeout} 2s
458 ... Verify UNI Port Is Enabled ${src['onu']} ${src['uni_id']}
459 ${onu_device_id}= Get Device ID From SN ${src['onu']}
460 Run Keyword If ${has_dataplane} Clean Up Linux ${onu_device_id}
461 # Re-Add Subscriber
462 Add Subscriber Details ${of_id} ${onu_port}
463 #Post Request VGC services/${of_id}/${onu_port}
464 # Verify ONU state in voltha
465 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
466 ... Validate Device ENABLED ACTIVE REACHABLE
467 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
468 # Verify that no pending flows exist for the ONU port
469 Wait Until Keyword Succeeds ${timeout} 2s
470 ... Verify No Pending Flows For ONU ${VGC_SSH_IP} ${VGC_SSH_PORT} ${onu_port}
471 # Verify subscriber access flows are added for the ONU port
472 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
473 ... Verify Subscriber Access Flows Added For ONU DT in VGC ${VGC_SSH_IP} ${VGC_SSH_PORT} ${of_id}
474 ... ${onu_port} ${nni_port} ${src['s_tag']}
475 # Verify Meters in VGC
476 Wait Until Keyword Succeeds ${timeout} 5s
477 ... Verify Meters in VGC Ietf ${VGC_SSH_IP} ${VGC_SSH_PORT} ${of_id} ${onu_port}
478 Run Keyword If ${has_dataplane} Validate DHCP and Ping True
479 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
480 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
481 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
482 ... ${dst['container_name']}
483 END
484 # Verify flows for all OLTs
485 Wait Until Keyword Succeeds ${timeout} 5s Validate All OLT Flows
486
487*** Keywords ***
488Setup Suite
489 [Documentation] Set up the test suite
490 Common Test Suite Setup
491 #Restore all ONUs
492 #Run Keyword If ${has_dataplane} RestoreONUs ${num_all_onus}
493 #power_switch.robot needs it to support different vendor's power switch
494 ${switch_type}= Get Variable Value ${web_power_switch.type}
495 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
496
497Clear All Devices Then Create New Device
498 [Documentation] Remove any devices from VOLTHA and VGC
499 # Remove all devices from voltha and nos
500 Delete All Devices and Verify
501 # Execute normal test Setup Keyword
502 Setup
503