blob: fd70309608ea32da182e1f021d45d9ce63050fde [file] [log] [blame]
Joey Armstrong9fadcbe2024-01-17 19:00:37 -05001# Copyright 2017-2024 Open Networking Foundation (ONF) and the ONF Contributors
bharat raj58488b32023-05-11 22:46:18 +05302#
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
gst1f86a022025-01-13 16:00:49 +053021Suite Teardown Teardown Suite
bharat raj58488b32023-05-11 22:46:18 +053022Library 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
gst1f86a022025-01-13 16:00:49 +053087 [Setup] Start Logging SanityTestDt
bharat raj58488b32023-05-11 22:46:18 +053088# [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
bharat raj58488b32023-05-11 22:46:18 +0530264Test Delete and ReAdd 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 ... Disable and Delete the OLT
268 ... Create/Enable the same OLT again
269 ... Validate DHCP/E2E pings succeed for all the ONUs connected to the OLT
270 [Tags] functionalDt DeleteReAddOLTDt soak
271 [Setup] Start Logging DeleteReAddOLTDt
272 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
273 ... AND Stop Logging DeleteReAddOLTDt
274 FOR ${I} IN RANGE 0 ${olt_count}
275 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
276 ${of_id}= Get ofID From OLT List ${olt_serial_number}
277 Delete Device and Verify ${olt_serial_number}
278 Wait Until Keyword Succeeds ${timeout} 5s
279 ... Verify Device Flows Removed ${VGC_SSH_IP} ${VGC_SSH_PORT} ${of_id}
280 END
281 # Recreate the OLTs
282 Setup ${SOAK_TEST}
283 Run Keyword If ${has_dataplane} Clean Up Linux
284 Perform Sanity Test DT
285
286Test Disable ONUs and OLT Then Delete ONUs and OLT for DT
287 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
288 ... This TC is to confirm that ONU removal is not impacting OLT
289 ... Devices will be removed during the execution of this TC
290 ... so calling setup at the end to add the devices back to avoid the confusion.
291 [Tags] functionalDt DisableDeleteONUOLTDt
292 [Setup] Run Keywords Start Logging DisableDeleteONUOLTDt
293 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
294 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
295 ... AND Stop Logging DisableDeleteONUOLTDt
296 @{onu_reason}= Create List initial-mib-downloaded omci-flows-pushed
297 FOR ${I} IN RANGE 0 ${num_all_onus}
298 ${src}= Set Variable ${hosts.src[${I}]}
299 ${dst}= Set Variable ${hosts.dst[${I}]}
300 ${onu_device_id}= Get Device ID From SN ${src['onu']}
301 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
302 ... Validate Device ENABLED ACTIVE
303 ... REACHABLE ${src['onu']} onu=True onu_reason=${onu_reason}
304 Wait Until Keyword Succeeds ${timeout} 5s
305 ... Validate OLT Device ENABLED ACTIVE
306 ... REACHABLE ${src['olt']}
307 Disable Device ${onu_device_id}
308 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
309 ... Validate Device DISABLED UNKNOWN
310 ... REACHABLE ${src['onu']} onu=false
311 Wait Until Keyword Succeeds ${timeout} 5s
312 ... Validate OLT Device ENABLED ACTIVE
313 ... REACHABLE ${src['olt']}
314 END
315 # Disable all OLTs
316 FOR ${I} IN RANGE 0 ${olt_count}
317 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
318 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
319 ${rc} ${output}= Run and Return Rc and Output
Jan Klarec92d6982023-09-05 14:46:52 +0200320 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
bharat raj58488b32023-05-11 22:46:18 +0530321 Should Be Equal As Integers ${rc} 0
322 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
323 ... ${olt_serial_number}
324 END
325 # Validate ONUs after OLT disable
326 FOR ${I} IN RANGE 0 ${num_all_onus}
327 ${src}= Set Variable ${hosts.src[${I}]}
328 ${dst}= Set Variable ${hosts.dst[${I}]}
329 ${onu_device_id}= Get Device ID From SN ${src['onu']}
330 Wait Until Keyword Succeeds ${timeout} 5s
331 ... Validate Device DISABLED DISCOVERED
332 ... UNREACHABLE ${src['onu']} onu=false
333 Delete Device ${onu_device_id}
334 Wait Until Keyword Succeeds ${timeout} 5s
335 ... Validate OLT Device DISABLED UNKNOWN
336 ... REACHABLE ${src['olt']}
337 END
338 # Delete all OLTs
339 Delete All Devices and Verify
340
341 #Delete Device ${olt_device_id}
342 #TODO: Fix the following assertion
343 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
344 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
345 #... Verify Device Flows Removed ${VGC_SSH_IP} ${VGC_SSH_PORT} ${of_id}
346
347 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
348 Run Keyword Setup
349 Run Keyword If ${has_dataplane} Clean Up Linux
350 Perform Sanity Test DT
351
352Test Disable and Enable OLT PON Port for DT
353 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
354 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
355 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
356 ... Perform enable on the OLT PON Port and validate that the pings are successful
357 [Tags] functionalDt DisableEnableOltPonPortDt VOL-2577 soak
358 [Setup] Run Keywords Start Logging DisableEnableOltPonPortDt
359 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
360 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
361 ... AND Stop Logging DisableEnableOltPonPortDt
362 FOR ${I} IN RANGE 0 ${olt_count}
363 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
364 Disable Enable PON Port Per OLT DT ${olt_serial_number}
365 END
366
367Test ONU Delete and Auto-Discovery for DT
368 [Documentation] Tests the voltctl delete and Auto-Discovery of the ONU
369 [Tags] functionalDt VOL-3098 ONUAutoDiscoveryDt
370 [Setup] Start Logging ONUAutoDiscoveryDt
371 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
372 ... AND Stop Logging ONUAutoDiscoveryDt
373 Clear All Devices Then Create New Device
374 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
375 Run Keyword If ${has_dataplane} Clean Up Linux
376 Perform Sanity Test DT
377 FOR ${I} IN RANGE 0 ${num_all_onus}
378 ${src}= Set Variable ${hosts.src[${I}]}
379 ${dst}= Set Variable ${hosts.dst[${I}]}
380 ${of_id}= Get ofID From OLT List ${src['olt']}
381 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
382 ... Get ONU Port in VGC ${src['onu']} ${of_id}
383 ${onu_device_id}= Get Device ID From SN ${src['onu']}
384 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in VGC ${of_id}
385 # Remove Subscriber
386 Delete Request VGC services/${of_id}/${onu_port}
387 # Additional sleep to let subscriber delete process
388 Sleep 10s
389 # Delete ONU and Verify Ping Fails
390 Delete Device ${onu_device_id}
391 Run Keyword If ${has_dataplane} Verify ping is successful except for given device
392 ... ${num_all_onus} ${src['onu']}
393 # Verify that no pending flows exist for the ONU port
394 Wait Until Keyword Succeeds ${timeout} 2s
395 ... Verify No Pending Flows For ONU ${VGC_SSH_IP} ${VGC_SSH_PORT} ${onu_port}
396 # ONU Auto-Discovery
397 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
398 ... Get ONU Port in VGC ${src['onu']} ${of_id} ${src['uni_id']}
399 # Check ONU port is Enabled in VGC
400 Wait Until Keyword Succeeds ${timeout} 2s
401 ... Verify UNI Port Is Enabled ${src['onu']} ${src['uni_id']}
402 ${onu_device_id}= Get Device ID From SN ${src['onu']}
403 Run Keyword If ${has_dataplane} Clean Up Linux ${onu_device_id}
404 # Re-Add Subscriber
405 Add Subscriber Details ${of_id} ${onu_port}
406 #Post Request VGC services/${of_id}/${onu_port}
407 # Verify ONU state in voltha
408 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
409 ... Validate Device ENABLED ACTIVE REACHABLE
410 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
411 # Verify that no pending flows exist for the ONU port
412 Wait Until Keyword Succeeds ${timeout} 2s
413 ... Verify No Pending Flows For ONU ${VGC_SSH_IP} ${VGC_SSH_PORT} ${onu_port}
414 # Verify subscriber access flows are added for the ONU port
415 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
416 ... Verify Subscriber Access Flows Added For ONU DT in VGC ${VGC_SSH_IP} ${VGC_SSH_PORT} ${of_id}
417 ... ${onu_port} ${nni_port} ${src['s_tag']}
418 # Verify Meters in VGC
419 Wait Until Keyword Succeeds ${timeout} 5s
420 ... Verify Meters in VGC Ietf ${VGC_SSH_IP} ${VGC_SSH_PORT} ${of_id} ${onu_port}
421 Run Keyword If ${has_dataplane} Validate DHCP and Ping True
422 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
423 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
424 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
425 ... ${dst['container_name']}
426 END
427 # Verify flows for all OLTs
428 Wait Until Keyword Succeeds ${timeout} 5s Validate All OLT Flows
429
430*** Keywords ***
431Setup Suite
432 [Documentation] Set up the test suite
433 Common Test Suite Setup
434 #Restore all ONUs
435 #Run Keyword If ${has_dataplane} RestoreONUs ${num_all_onus}
436 #power_switch.robot needs it to support different vendor's power switch
437 ${switch_type}= Get Variable Value ${web_power_switch.type}
438 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
439
440Clear All Devices Then Create New Device
441 [Documentation] Remove any devices from VOLTHA and VGC
442 # Remove all devices from voltha and nos
443 Delete All Devices and Verify
444 # Execute normal test Setup Keyword
445 Setup
446