blob: 019f423a34a2668844d5c4244d89e4339aa4b79e [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
gstf3e25142024-12-22 03:01:35 +053021Suite Teardown Setup Teardown
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
gstf3e25142024-12-22 03:01:35 +053087 [Setup] Run Keywords Start Logging SanityTestDt
88 ... AND Verify Ofagent Pod Availablity
bharat raj58488b32023-05-11 22:46:18 +053089# [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
90# ... AND Stop Logging SanityTestDt
91 Setup ${SOAK_TEST}
92 Run Keyword If ${has_dataplane} Clean Up Linux
93 Perform Sanity Test DT
94
95Test Subscriber Delete and Add for DT
96 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
97 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
98 ... Delete a subscriber and validate that the pings do not succeed and state is purged
99 ... Disable and Enable the ONU (This is to replicate the existing DT behaviour)
100 ... Re-add the subscriber, and validate that the flows are present and pings are successful
101 [Tags] functionalDt SubAddDeleteDt soak
102 [Setup] Run Keywords Start Logging SubAddDeleteDt
103 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
gstf3e25142024-12-22 03:01:35 +0530104 ... AND Verify Ofagent Pod Availablity
bharat raj58488b32023-05-11 22:46:18 +0530105 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
106 ... AND Stop Logging SubAddDeleteDt
107 FOR ${I} IN RANGE 0 ${num_all_onus}
108 ${src}= Set Variable ${hosts.src[${I}]}
109 ${dst}= Set Variable ${hosts.dst[${I}]}
110 ${of_id}= Get ofID From OLT List ${src['olt']}
111 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in VGC ${of_id}
112 ${onu_device_id}= Get Device ID From SN ${src['onu']}
113 ${olt_device_id}= Get OLTDeviceID From OLT List ${src['olt']}
114 ${num_of_olt_onus}= Get Num of Onus From OLT SN ${src['olt']}
115 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in VGC ${src['onu']}
116 ... ${of_id} ${src['uni_id']}
117 # Remove Subscriber Access
118 Delete Request VGC services/${of_id}/${onu_port}
119 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
120 ... Wait Until Keyword Succeeds ${timeout} 2s
121 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
122 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
123
124 # Number of Access Flows on VGC equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
125 ${vgc_flows_count}= Evaluate 4 * ( ${num_of_olt_onus} - 1 )
126 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
127 ... Verify Subscriber Access Flows Added Count DT ${VGC_SSH_IP} ${VGC_SSH_PORT}
128 ... ${of_id} ${vgc_flows_count}
129 # Verify VOLTHA flows for OLT equals twice the number of ONUS (minus ONU under test) + 1 for LLDP
130 ${olt_flows}= Evaluate 2 * ( ${num_of_olt_onus} - 1 )
131 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows
132 ... ${olt_flows} ${olt_device_id}
133 # Verify VOLTHA flows for ONU under test is Zero
134 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows
135 ... ${onu_device_id} 0
136 # Disable and Re-Enable the ONU (To replicate DT current workflow)
137 # TODO: Delete and Auto-Discovery Add of ONU (not yet supported)
138 Disable Device ${onu_device_id}
139 Wait Until Keyword Succeeds ${timeout} 5s
140 ... Validate Device DISABLED UNKNOWN
141 ... REACHABLE ${src['onu']}
142 Enable Device ${onu_device_id}
143 Wait Until Keyword Succeeds 360s 5s
144 ... Validate Device ENABLED ACTIVE
145 ... REACHABLE ${src['onu']}
146 # Add Subscriber Access
147 Post Request VGC services/${of_id}/${onu_port}
148 # Verify subscriber access flows are added for the ONU port
149 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
150 ... Verify Subscriber Access Flows Added for ONU DT in VGC ${VGC_SSH_IP} ${VGC_SSH_PORT} ${of_id}
151 ... ${onu_port} ${nni_port} ${src['s_tag']}
152 Wait Until Keyword Succeeds ${timeout} 5s
153 ... Validate Device ENABLED ACTIVE
154 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
155 # Workaround for issue seen in VOL-4489. Keep this workaround until VOL-4489 is fixed.
156 Run Keyword If ${has_dataplane} Reboot XGSPON ONU ${src['olt']} ${src['onu']} omci-flows-pushed
157 # Workaround ends here for issue seen in VOL-4489.
158 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
159 ... Wait Until Keyword Succeeds ${timeout} 2s
160 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
161 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
162 END
163 # Verify flows for all OLTs
164 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate All OLT Flows
165
166Test Disable and Enable ONU for DT
167 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
168 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
169 ... Perform disable on the ONUs and validate that the pings do not succeed
170 ... Perform enable on the ONUs and validate that the pings are successful
171 [Tags] functionalDt DisableEnableONUDt soak
172 [Setup] Run Keywords Start Logging DisableEnableONUDt
173 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
gstf3e25142024-12-22 03:01:35 +0530174 ... AND Verify Ofagent Pod Availablity
bharat raj58488b32023-05-11 22:46:18 +0530175 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
176 ... AND Stop Logging DisableEnableONUDt
177 FOR ${I} IN RANGE 0 ${num_all_onus}
178 ${src}= Set Variable ${hosts.src[${I}]}
179 ${dst}= Set Variable ${hosts.dst[${I}]}
180 ${of_id}= Get ofID From OLT List ${src['olt']}
181 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in VGC ${src['onu']}
182 ... ${of_id} ${src['uni_id']}
183 ${onu_device_id}= Get Device ID From SN ${src['onu']}
184 Disable Device ${onu_device_id}
185 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
186 ... Validate Device DISABLED UNKNOWN
187 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-admin-lock
188 Wait Until Keyword Succeeds ${timeout} 2s
189 ... Verify UNI Port Is Disabled ${VGC_SSH_IP} ${VGC_SSH_PORT} ${src['onu']} ${src['uni_id']}
190 # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652)
191 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
192 ... Wait Until Keyword Succeeds ${timeout} 2s
193 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
194 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
195 Sleep 5s
196 Enable Device ${onu_device_id}
197 Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s
198 ... Validate Device ENABLED ACTIVE
199 ... REACHABLE ${src['onu']} onu=True onu_reason=onu-reenabled
200 Wait Until Keyword Succeeds ${timeout} 2s
201 ... Verify UNI Port Is Enabled ${src['onu']} ${src['uni_id']}
202 # Workaround for issue seen in VOL-4489. Keep this workaround until VOL-4489 is fixed.
203 Run Keyword If ${has_dataplane} Reboot XGSPON ONU ${src['olt']} ${src['onu']} omci-flows-pushed
204 # Workaround ends here for issue seen in VOL-4489.
205 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
206 ... Wait Until Keyword Succeeds ${timeout} 2s
207 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
208 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
209 END
210
211Test Disable and Delete OLT for DT
212 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
213 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
214 ... Perform disable on the OLT and validate ONUs state and that the pings do not succeed
215 ... Perform delete on the OLT, Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
216 [Tags] functionalDt DisableDeleteOLTDt soak
217 [Setup] Start Logging DisableDeleteOLTDt
gstf3e25142024-12-22 03:01:35 +0530218 ... AND Verify Ofagent Pod Availablity
bharat raj58488b32023-05-11 22:46:18 +0530219 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
220 ... AND Stop Logging DisableDeleteOLTDt
221 # Disable and Validate OLT Device
222 FOR ${I} IN RANGE 0 ${olt_count}
223 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
224 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
225 Disable Device ${olt_device_id}
226 ${of_id}= Get ofID From OLT List ${olt_serial_number}
227 Wait Until Keyword Succeeds ${timeout} 5s
228 ... Validate OLT Device DISABLED UNKNOWN REACHABLE
229 ... ${olt_serial_number}
230 ${num_onus}= Set Variable ${list_olts}[${I}][onucount]
231 # Validate ONUs
232 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONUs After OLT Disable
233 ... ${num_onus} ${olt_serial_number}
234 # Verify VGC Flows
235 # Number of Access Flows on VGC equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
236 ${vgc_flows_count}= Evaluate 4 * ${num_onus}
237 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
238 ... Verify Subscriber Access Flows Added Count DT ${VGC_SSH_IP} ${VGC_SSH_PORT}
239 ... ${of_id} ${vgc_flows_count}
240 # Verify VOLTHA Flows
241 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
242 ${olt_flows}= Evaluate 2 * ${num_onus}
243 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
244 ${onu_flows}= Set Variable 2
245 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows
246 ... ${olt_flows} ${olt_device_id}
247 ${List_ONU_Serial} Create List
248 Set Suite Variable ${List_ONU_Serial}
249 Build ONU SN List ${List_ONU_Serial} ${olt_serial_number} ${num_onus}
250 Log ${List_ONU_Serial}
251 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
252 ... ${List_ONU_Serial} ${onu_flows}
253 # Delete OLT and Validate Empty Device List
254 Delete Device ${olt_device_id}
255 # Check that the OLT and the ONUs are actually removed from the system
256 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed
257 ... ${olt_serial_number}
258 Run Keyword and Continue On Failure Validate all ONUS for OLT Removed ${num_all_onus} ${hosts}
259 ... ${olt_serial_number} ${timeout}
260 Wait Until Keyword Succeeds ${timeout} 5s
261 ... Verify Device Flows Removed ${VGC_SSH_IP} ${VGC_SSH_PORT} ${of_id}
262 END
263 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
264 Run Keyword Setup ${SOAK_TEST}
265 Run Keyword If ${has_dataplane} Clean Up Linux
266 Perform Sanity Test DT
267
268Test Disable and Enable OLT for DT
269 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
270 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
271 ... Perform disable on the OLT and validate that the pings do not succeed
272 ... Perform enable on the OLT and validate that the pings are successful
273 [Tags] functionalDt DisableEnableOLTDt soak
274 [Setup] Start Logging DisableEnableOLTDt
gstf3e25142024-12-22 03:01:35 +0530275 ... AND Verify Ofagent Pod Availablity
bharat raj58488b32023-05-11 22:46:18 +0530276 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
277 ... AND Stop Logging DisableEnableOLTDt
278 # Disable and Validate OLT Device
279 FOR ${I} IN RANGE 0 ${olt_count}
280 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
281 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
282 ${rc} ${output}= Run and Return Rc and Output
Jan Klarec92d6982023-09-05 14:46:52 +0200283 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
bharat raj58488b32023-05-11 22:46:18 +0530284 Should Be Equal As Integers ${rc} 0
285 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
286 ... ${olt_serial_number}
287 END
288 # Validate ONUs
289 FOR ${I} IN RANGE 0 ${num_all_onus}
290 ${src}= Set Variable ${hosts.src[${I}]}
291 ${dst}= Set Variable ${hosts.dst[${I}]}
292 ${of_id}= Get ofID From OLT List ${src['olt']}
293 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
294 ... Get ONU Port in VGC ${src['onu']} ${of_id} ${src['uni_id']}
295 ${onu_device_id}= Get Device ID From SN ${src['onu']}
296 Wait Until Keyword Succeeds ${timeout} 2s
297 ... Verify UNI Port Is Disabled ${VGC_SSH_IP} ${VGC_SSH_PORT} ${src['onu']} ${src['uni_id']}
298 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
299 ... Wait Until Keyword Succeeds ${timeout} 2s
300 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
301 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
302 # Remove Subscriber Access (To replicate DT workflow)
303 ${onu_port_name}= Catenate SEPARATOR=- ${src['onu']} ${src['uni_id']}
304 Wait Until Keyword Succeeds ${timeout} 2s
305 ... Delete Request VGC services/${onu_port_name}
306 # Delete ONU Device (To replicate DT workflow)
307 Delete Device ${onu_device_id}
308 END
309 Sleep 5s
310 # Enable the OLT back and check ONU, OLT status are back to "ACTIVE"
311 FOR ${I} IN RANGE 0 ${olt_count}
312 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
313 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
314 Enable Device ${olt_device_id}
315 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
316 ... ${olt_serial_number}
317 #TODO: Update for PON_OLT ETHERNET_NNI
318 #Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types
319 #... PON_OLT ETHERNET_NNI
320 END
321 # Waiting extra time for the ONUs to come up
322 Sleep 60s
323 Run Keyword If ${has_dataplane} Clean Up Linux
324 Perform Sanity Test DT
325
326Test Delete and ReAdd OLT for DT
327 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
328 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
329 ... Disable and Delete the OLT
330 ... Create/Enable the same OLT again
331 ... Validate DHCP/E2E pings succeed for all the ONUs connected to the OLT
332 [Tags] functionalDt DeleteReAddOLTDt soak
333 [Setup] Start Logging DeleteReAddOLTDt
gstf3e25142024-12-22 03:01:35 +0530334 ... AND Verify Ofagent Pod Availablity
bharat raj58488b32023-05-11 22:46:18 +0530335 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
336 ... AND Stop Logging DeleteReAddOLTDt
337 FOR ${I} IN RANGE 0 ${olt_count}
338 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
339 ${of_id}= Get ofID From OLT List ${olt_serial_number}
340 Delete Device and Verify ${olt_serial_number}
341 Wait Until Keyword Succeeds ${timeout} 5s
342 ... Verify Device Flows Removed ${VGC_SSH_IP} ${VGC_SSH_PORT} ${of_id}
343 END
344 # Recreate the OLTs
345 Setup ${SOAK_TEST}
346 Run Keyword If ${has_dataplane} Clean Up Linux
347 Perform Sanity Test DT
348
349Test Disable ONUs and OLT Then Delete ONUs and OLT for DT
350 [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT.
351 ... This TC is to confirm that ONU removal is not impacting OLT
352 ... Devices will be removed during the execution of this TC
353 ... so calling setup at the end to add the devices back to avoid the confusion.
354 [Tags] functionalDt DisableDeleteONUOLTDt
355 [Setup] Run Keywords Start Logging DisableDeleteONUOLTDt
356 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
gstf3e25142024-12-22 03:01:35 +0530357 ... AND Verify Ofagent Pod Availablity
bharat raj58488b32023-05-11 22:46:18 +0530358 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
359 ... AND Stop Logging DisableDeleteONUOLTDt
360 @{onu_reason}= Create List initial-mib-downloaded omci-flows-pushed
361 FOR ${I} IN RANGE 0 ${num_all_onus}
362 ${src}= Set Variable ${hosts.src[${I}]}
363 ${dst}= Set Variable ${hosts.dst[${I}]}
364 ${onu_device_id}= Get Device ID From SN ${src['onu']}
365 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
366 ... Validate Device ENABLED ACTIVE
367 ... REACHABLE ${src['onu']} onu=True onu_reason=${onu_reason}
368 Wait Until Keyword Succeeds ${timeout} 5s
369 ... Validate OLT Device ENABLED ACTIVE
370 ... REACHABLE ${src['olt']}
371 Disable Device ${onu_device_id}
372 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
373 ... Validate Device DISABLED UNKNOWN
374 ... REACHABLE ${src['onu']} onu=false
375 Wait Until Keyword Succeeds ${timeout} 5s
376 ... Validate OLT Device ENABLED ACTIVE
377 ... REACHABLE ${src['olt']}
378 END
379 # Disable all OLTs
380 FOR ${I} IN RANGE 0 ${olt_count}
381 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
382 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
383 ${rc} ${output}= Run and Return Rc and Output
Jan Klarec92d6982023-09-05 14:46:52 +0200384 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
bharat raj58488b32023-05-11 22:46:18 +0530385 Should Be Equal As Integers ${rc} 0
386 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
387 ... ${olt_serial_number}
388 END
389 # Validate ONUs after OLT disable
390 FOR ${I} IN RANGE 0 ${num_all_onus}
391 ${src}= Set Variable ${hosts.src[${I}]}
392 ${dst}= Set Variable ${hosts.dst[${I}]}
393 ${onu_device_id}= Get Device ID From SN ${src['onu']}
394 Wait Until Keyword Succeeds ${timeout} 5s
395 ... Validate Device DISABLED DISCOVERED
396 ... UNREACHABLE ${src['onu']} onu=false
397 Delete Device ${onu_device_id}
398 Wait Until Keyword Succeeds ${timeout} 5s
399 ... Validate OLT Device DISABLED UNKNOWN
400 ... REACHABLE ${src['olt']}
401 END
402 # Delete all OLTs
403 Delete All Devices and Verify
404
405 #Delete Device ${olt_device_id}
406 #TODO: Fix the following assertion
407 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List
408 #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
409 #... Verify Device Flows Removed ${VGC_SSH_IP} ${VGC_SSH_PORT} ${of_id}
410
411 # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT
412 Run Keyword Setup
413 Run Keyword If ${has_dataplane} Clean Up Linux
414 Perform Sanity Test DT
415
416Test Disable and Enable OLT PON Port for DT
417 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
418 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed)
419 ... Perform disable on the OLT PON Port and validate that the pings do not succeed
420 ... Perform enable on the OLT PON Port and validate that the pings are successful
421 [Tags] functionalDt DisableEnableOltPonPortDt VOL-2577 soak
422 [Setup] Run Keywords Start Logging DisableEnableOltPonPortDt
423 ... AND Run Keyword If ${has_dataplane} Set Non-Critical Tag for XGSPON Tech
gstf3e25142024-12-22 03:01:35 +0530424 ... AND Verify Ofagent Pod Availablity
bharat raj58488b32023-05-11 22:46:18 +0530425 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
426 ... AND Stop Logging DisableEnableOltPonPortDt
427 FOR ${I} IN RANGE 0 ${olt_count}
428 ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn
429 Disable Enable PON Port Per OLT DT ${olt_serial_number}
430 END
431
432Test ONU Delete and Auto-Discovery for DT
433 [Documentation] Tests the voltctl delete and Auto-Discovery of the ONU
434 [Tags] functionalDt VOL-3098 ONUAutoDiscoveryDt
435 [Setup] Start Logging ONUAutoDiscoveryDt
gstf3e25142024-12-22 03:01:35 +0530436 ... AND Verify Ofagent Pod Availablity
bharat raj58488b32023-05-11 22:46:18 +0530437 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
438 ... AND Stop Logging ONUAutoDiscoveryDt
439 Clear All Devices Then Create New Device
440 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
441 Run Keyword If ${has_dataplane} Clean Up Linux
442 Perform Sanity Test DT
443 FOR ${I} IN RANGE 0 ${num_all_onus}
444 ${src}= Set Variable ${hosts.src[${I}]}
445 ${dst}= Set Variable ${hosts.dst[${I}]}
446 ${of_id}= Get ofID From OLT List ${src['olt']}
447 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
448 ... Get ONU Port in VGC ${src['onu']} ${of_id}
449 ${onu_device_id}= Get Device ID From SN ${src['onu']}
450 ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in VGC ${of_id}
451 # Remove Subscriber
452 Delete Request VGC services/${of_id}/${onu_port}
453 # Additional sleep to let subscriber delete process
454 Sleep 10s
455 # Delete ONU and Verify Ping Fails
456 Delete Device ${onu_device_id}
457 Run Keyword If ${has_dataplane} Verify ping is successful except for given device
458 ... ${num_all_onus} ${src['onu']}
459 # Verify that no pending flows exist for the ONU port
460 Wait Until Keyword Succeeds ${timeout} 2s
461 ... Verify No Pending Flows For ONU ${VGC_SSH_IP} ${VGC_SSH_PORT} ${onu_port}
462 # ONU Auto-Discovery
463 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
464 ... Get ONU Port in VGC ${src['onu']} ${of_id} ${src['uni_id']}
465 # Check ONU port is Enabled in VGC
466 Wait Until Keyword Succeeds ${timeout} 2s
467 ... Verify UNI Port Is Enabled ${src['onu']} ${src['uni_id']}
468 ${onu_device_id}= Get Device ID From SN ${src['onu']}
469 Run Keyword If ${has_dataplane} Clean Up Linux ${onu_device_id}
470 # Re-Add Subscriber
471 Add Subscriber Details ${of_id} ${onu_port}
472 #Post Request VGC services/${of_id}/${onu_port}
473 # Verify ONU state in voltha
474 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
475 ... Validate Device ENABLED ACTIVE REACHABLE
476 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
477 # Verify that no pending flows exist for the ONU port
478 Wait Until Keyword Succeeds ${timeout} 2s
479 ... Verify No Pending Flows For ONU ${VGC_SSH_IP} ${VGC_SSH_PORT} ${onu_port}
480 # Verify subscriber access flows are added for the ONU port
481 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
482 ... Verify Subscriber Access Flows Added For ONU DT in VGC ${VGC_SSH_IP} ${VGC_SSH_PORT} ${of_id}
483 ... ${onu_port} ${nni_port} ${src['s_tag']}
484 # Verify Meters in VGC
485 Wait Until Keyword Succeeds ${timeout} 5s
486 ... Verify Meters in VGC Ietf ${VGC_SSH_IP} ${VGC_SSH_PORT} ${of_id} ${onu_port}
487 Run Keyword If ${has_dataplane} Validate DHCP and Ping True
488 ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
489 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
490 ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
491 ... ${dst['container_name']}
492 END
493 # Verify flows for all OLTs
494 Wait Until Keyword Succeeds ${timeout} 5s Validate All OLT Flows
495
496*** Keywords ***
497Setup Suite
498 [Documentation] Set up the test suite
499 Common Test Suite Setup
500 #Restore all ONUs
501 #Run Keyword If ${has_dataplane} RestoreONUs ${num_all_onus}
502 #power_switch.robot needs it to support different vendor's power switch
503 ${switch_type}= Get Variable Value ${web_power_switch.type}
504 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
gstf3e25142024-12-22 03:01:35 +0530505 Scale Down Ofagent Pod
506
507Setup Teardown
508 Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OFAGENT_POD} 1
509 Wait Until Keyword Succeeds ${timeout} 2s Pods Do Not Exist By Label ${NAMESPACE} app
510 ... ${OFAGENT_POD}
511 Sleep 10s
512 Teardown Suite
bharat raj58488b32023-05-11 22:46:18 +0530513
514Clear All Devices Then Create New Device
515 [Documentation] Remove any devices from VOLTHA and VGC
516 # Remove all devices from voltha and nos
517 Delete All Devices and Verify
518 # Execute normal test Setup Keyword
519 Setup
520
gstf3e25142024-12-22 03:01:35 +0530521Scale Down Ofagent Pod
522 Scale K8s Deployment by Pod Label ${NAMESPACE} app ${OFAGENT_POD} 0
523 Wait Until Keyword Succeeds ${timeout} 2s Pods Do Not Exist By Label ${NAMESPACE} app
524 ... ${OFAGENT_POD}
525 Sleep 10s
526
527Verify Ofagent Pod Availablity
528 ${output}= Pods Do Not Exist By Label ${NAMESPACE} app ${OFAGENT_POD}
529 Run Keyword If "${output}"!="True" Scale Down Ofagent Pod