blob: beaedf8a6933b8a125f181b66640d7a4cff1c150 [file] [log] [blame]
Joey Armstrong9fadcbe2024-01-17 19:00:37 -05001# Copyright 2021-2024 Open Networking Foundation (ONF) and the ONF Contributors
Hardik Windlass17bd1142021-03-12 08:15:25 +00002#
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 Tests ONU Software Upgrade
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
TorstenThiemeb56633f2022-07-06 09:41:04 +000033Resource ../../libraries/onu_utilities.robot
Hardik Windlassc310c7c2021-03-25 13:16:59 +000034Resource ../../libraries/bbsim.robot
Hardik Windlass17bd1142021-03-12 08:15:25 +000035Resource ../../variables/variables.robot
36
37*** Variables ***
38${POD_NAME} flex-ocp-cord
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${HELM_CHARTS_DIR} ~/helm-charts
44${VOLTHA_POD_NUM} 8
45${NAMESPACE} voltha
Hardik Windlass4288c6a2021-09-28 07:22:06 +000046${INFRA_NAMESPACE} default
Hardik Windlass17bd1142021-03-12 08:15:25 +000047# For below variable value, using deployment name as using grep for
48# parsing radius pod name, we can also use full radius pod name
49${RESTART_POD_NAME} radius
50${timeout} 60s
51${of_id} 0
52${logical_id} 0
53${has_dataplane} True
54${teardown_device} False
55${scripts} ../../scripts
56
57# Per-test logging on failure is turned off by default; set this variable to enable
58${container_log_dir} ${None}
59
60${suppressaddsubscriber} True
61
Hardik Windlassf0ce2062021-07-23 11:04:39 +000062# logging flag to enable Collect Logs, can be passed via the command line too
63# example: -v logging:False
64${logging} True
65
Hardik Windlass17bd1142021-03-12 08:15:25 +000066# ONU Image to test for Upgrade needs to be passed in the following format:
Hardik Windlassba1bd272021-06-22 08:29:33 +000067${image_version} ${EMPTY}
68# Example value: BBSM_IMG_00002
69${image_url} ${EMPTY}
Hardik Windlass17bd1142021-03-12 08:15:25 +000070# Example value: http://bbsim0:50074/images/software-image.img
Hardik Windlassba1bd272021-06-22 08:29:33 +000071${image_vendor} ${EMPTY}
72# Example value: BBSM
73${image_activate_on_success} ${EMPTY}
74# Example value: false
75${image_commit_on_success} ${EMPTY}
76# Example value: false
77${image_crc} ${EMPTY}
Hardik Windlass17bd1142021-03-12 08:15:25 +000078# Example value: 0
Hardik Windlass17bd1142021-03-12 08:15:25 +000079
TorstenThiemef3e492c2021-11-08 15:25:48 +000080# when voltha is running in k8s port forwarding is needed
81# example: -v PORT_FORWARDING:False
82${PORT_FORWARDING} True
83
84# Next values are default values for port forward, do not need to be passed, will be overwritten by values taken from image-url
85# bbsim webserver port
86# example: -v BBSIM_WEBSERVER_PORT:50074
87${BBSIM_WEBSERVER_PORT} 50074
88# bbsim instance
89# example: -v BBSIM_INSTANCE:bbsim0
90${BBSIM_INSTANCE} bbsim0
91# port forward handle
92${portFwdHandle} None
93
TorstenThiemeb56633f2022-07-06 09:41:04 +000094# Log Level of Helm chart
95# example: -v helmloglevel:WARN
96${helmloglevel} DEBUG
97
98
Hardik Windlass17bd1142021-03-12 08:15:25 +000099*** Test Cases ***
100Test ONU Upgrade
101 [Documentation] Validates the ONU Upgrade doesn't affect the system functionality
102 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
103 ... Requirement: Pass image details in following parameters in the robot command
104 ... onu_image_name, onu_image_url, onu_image_version, onu_image_crc, onu_image_local_dir
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000105 ... Note: The TC expects the image url and other parameters to be common for all ONUs on all BBSim
Hardik Windlass17bd1142021-03-12 08:15:25 +0000106 ... Check [VOL-3903] for more details
107 [Tags] functional ONUUpgrade
108 [Setup] Start Logging ONUUpgrade
TorstenThieme37165402021-09-03 11:39:40 +0000109 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass17bd1142021-03-12 08:15:25 +0000110 ... AND Delete All Devices and Verify
TorstenThieme37165402021-09-03 11:39:40 +0000111 ... AND Restart And Check BBSIM ${NAMESPACE}
112 ... AND Stop Logging ONUUpgrade
TorstenThiemef3e492c2021-11-08 15:25:48 +0000113 Do ONU Upgrade All OLTs
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000114
115Test ONU Upgrade All Activate and Commit Combinations
116 [Documentation] Validates the ONU Upgrade doesn't affect the system functionality by use all combinations of
117 ... flags activate_on_success and commit_on_success
118 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
119 ... Requirement: Pass image details in following parameters in the robot command
120 ... onu_image_name, onu_image_url, onu_image_version, onu_image_crc, onu_image_local_dir
121 ... Note: The TC expects the image url and other parameters to be common for all ONUs on all BBSim
122 ... Check [VOL-4250] for more details
TorstenThieme37165402021-09-03 11:39:40 +0000123 [Tags] functional ONUUpgradeAllCombies
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000124 [Setup] Start Logging ONUUpgradeAllCombies
TorstenThieme37165402021-09-03 11:39:40 +0000125 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000126 ... AND Delete All Devices and Verify
TorstenThieme37165402021-09-03 11:39:40 +0000127 ... AND Restart And Check BBSIM ${NAMESPACE}
128 ... AND Stop Logging ONUUpgradeAllCombies
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000129 ${false_false}= Create Dictionary activate false commit false
130 ${true_false}= Create Dictionary activate true commit false
131 ${false_true}= Create Dictionary activate false commit true
132 ${true_true}= Create Dictionary activate true commit true
133 ${flag_list}= Create List ${false_false} ${true_false} ${false_true} ${true_true}
134 FOR ${item} IN @{flag_list}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000135 Do ONU Upgrade All OLTs ${item['activate']} ${item['commit']}
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000136 Delete All Devices and Verify
TorstenThieme37165402021-09-03 11:39:40 +0000137 Restart And Check BBSIM ${NAMESPACE}
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000138 END
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000139
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000140Test ONU Upgrade Correct Indication of Download Wrong Url
141 [Documentation] Validates the ONU Upgrade download from wrong URL failure will be indicated correctly
142 ... and doesn't affect the system functionality
143 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
144 ... Check [VOL-4257] for more details
TorstenThieme7cb9de72021-08-24 09:40:57 +0000145 [Tags] functional ONUUpgradeDownloadWrongUrl
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000146 [Setup] Start Logging ONUUpgradeDownloadWrongUrl
TorstenThieme37165402021-09-03 11:39:40 +0000147 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000148 ... AND Delete All Devices and Verify
TorstenThieme37165402021-09-03 11:39:40 +0000149 ... AND Restart And Check BBSIM ${NAMESPACE}
150 ... AND Stop Logging ONUUpgradeDownloadWrongUrl
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000151 # Add OLT device
152 Setup
153 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
154 Run Keyword If ${has_dataplane} Clean Up Linux
155 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
156 FOR ${J} IN RANGE 0 ${num_olts}
157 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
158 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
159 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000160 Do ONU Upgrade Download Failure Per OLT ${bbsim_pod} ${olt_serial_number}
TorstenThieme7cb9de72021-08-24 09:40:57 +0000161 ... url=http://bbsim0:50074/images/wrong-image.img$
162 ... dwl_dwlstate=DOWNLOAD_FAILED dwl_reason=INVALID_URL dwl_imgstate=IMAGE_UNKNOWN
163 ... dwlstate=DOWNLOAD_UNKNOWN reason=NO_ERROR imgstate=IMAGE_UNKNOWN
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000164 List ONUs ${NAMESPACE} ${bbsim_pod}
165 END
166 # Additional Verification
167 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
168 Setup
169 Run Keyword If ${has_dataplane} Clean Up Linux
170 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
171
TorstenThieme7cb9de72021-08-24 09:40:57 +0000172Test ONU Upgrade Correct Indication of Download Failure
173 [Documentation] Validates the ONU Upgrade download failure will be indicated correctly and
174 ... doesn't affect the system functionality
175 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
176 ... Check [VOL-3935] for more details
177 [Tags] functional ONUUpgradeDownloadFailure
178 [Setup] Start Logging ONUUpgradeDownloadFailure
TorstenThieme37165402021-09-03 11:39:40 +0000179 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
TorstenThieme7cb9de72021-08-24 09:40:57 +0000180 ... AND Delete All Devices and Verify
TorstenThieme37165402021-09-03 11:39:40 +0000181 ... AND Restart And Check BBSIM ${NAMESPACE}
182 ... AND Stop Logging ONUUpgradeDownloadFailure
TorstenThieme7cb9de72021-08-24 09:40:57 +0000183 # Add OLT device
184 Setup
185 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
186 Run Keyword If ${has_dataplane} Clean Up Linux
187 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
188 FOR ${J} IN RANGE 0 ${num_olts}
189 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
190 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
191 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000192 Do ONU Upgrade Download Failure Per OLT ${bbsim_pod} ${olt_serial_number}
TorstenThieme7cb9de72021-08-24 09:40:57 +0000193 ... dwlstate=DOWNLOAD_FAILED reason=CANCELLED_ON_ONU_STATE imgstate=IMAGE_UNKNOWN
194 List ONUs ${NAMESPACE} ${bbsim_pod}
195 END
196 # Additional Verification
197 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
198 Setup
199 Run Keyword If ${has_dataplane} Clean Up Linux
200 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000201
TorstenThiemef3e492c2021-11-08 15:25:48 +0000202Test ONU Upgrade Correct Indication of Downloading Abort
203 [Documentation] Validates the ONU Upgrade downloading abort will be indicated correctly and
TorstenThieme37165402021-09-03 11:39:40 +0000204 ... doesn't affect the system functionality
205 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
206 ... Check [VOL-4318] for more details
TorstenThiemef3e492c2021-11-08 15:25:48 +0000207 [Tags] functional ONUUpgradeDownloadingAbort
208 [Setup] Start Logging ONUUpgradeDownloadingAbort
TorstenThieme37165402021-09-03 11:39:40 +0000209 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
210 ... AND Delete All Devices and Verify
TorstenThiemec96d0962021-09-10 10:01:39 +0000211 ... AND Restart And Check BBSIM ${NAMESPACE}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000212 ... AND Stop Logging ONUUpgradeDownloadingAbort
TorstenThieme37165402021-09-03 11:39:40 +0000213 # Add OLT device
214 Setup
215 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
216 Run Keyword If ${has_dataplane} Clean Up Linux
217 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
218 FOR ${J} IN RANGE 0 ${num_olts}
219 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
220 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
221 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000222 Do ONU Upgrade Downloading Abort Per OLT ${bbsim_pod} ${olt_serial_number}
TorstenThieme37165402021-09-03 11:39:40 +0000223 List ONUs ${NAMESPACE} ${bbsim_pod}
224 END
225 # Additional Verification
226 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
227 Setup
228 Run Keyword If ${has_dataplane} Clean Up Linux
229 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
230
TorstenThiemef3e492c2021-11-08 15:25:48 +0000231Test ONU Upgrade Correct Indication of Downloaded Abort
232 [Documentation] Validates the ONU Upgrade downloaded abort will be indicated correctly and
TorstenThiemec96d0962021-09-10 10:01:39 +0000233 ... doesn't affect the system functionality
234 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
TorstenThiemef3e492c2021-11-08 15:25:48 +0000235 ... Check [VOL-4320] for more details
236 [Tags] functional ONUUpgradeDownloadedAbort
237 [Setup] Start Logging ONUUpgradeDownloadedAbort
TorstenThiemec96d0962021-09-10 10:01:39 +0000238 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
239 ... AND Delete All Devices and Verify
240 ... AND Restart And Check BBSIM ${NAMESPACE}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000241 ... AND Stop Logging ONUUpgradeDownloadedAbort
TorstenThiemec96d0962021-09-10 10:01:39 +0000242 # Add OLT device
243 Setup
244 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
245 Run Keyword If ${has_dataplane} Clean Up Linux
246 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
247 FOR ${J} IN RANGE 0 ${num_olts}
248 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
249 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
250 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000251 Do ONU Upgrade Downloaded Abort Per OLT ${bbsim_pod} ${olt_serial_number}
TorstenThiemec96d0962021-09-10 10:01:39 +0000252 List ONUs ${NAMESPACE} ${bbsim_pod}
253 END
254 # Additional Verification
255 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
256 Setup
257 Run Keyword If ${has_dataplane} Clean Up Linux
258 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000259
TorstenThiemef3e492c2021-11-08 15:25:48 +0000260Test ONU Upgrade Correct Indication of Activating Abort
261 [Documentation] Validates the ONU Upgrade activating abort will be indicated correctly and
262 ... doesn't affect the system functionality
263 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
264 ... Check [VOL-4319] for more details
265 [Tags] functional ONUUpgradeActivatingAbort
266 [Setup] Start Logging ONUUpgradeActivatingAbort
267 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
268 ... AND Delete All Devices and Verify
269 ... AND Restart And Check BBSIM ${NAMESPACE}
270 ... AND Stop Logging ONUUpgradeActivatingAbort
271 # Add OLT device
272 Setup
273 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
274 Run Keyword If ${has_dataplane} Clean Up Linux
275 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
276 FOR ${J} IN RANGE 0 ${num_olts}
277 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
278 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
279 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
280 Do ONU Upgrade Activating Abort Per OLT ${bbsim_pod} ${olt_serial_number}
281 List ONUs ${NAMESPACE} ${bbsim_pod}
282 END
283 # Additional Verification
284 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
285 Setup
286 Run Keyword If ${has_dataplane} Clean Up Linux
287 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
288
289Test ONU Upgrade Correct Indication of Active Abort
290 [Documentation] Validates the ONU Upgrade active abort will be indicated correctly and
291 ... doesn't affect the system functionality
292 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
293 ... Check [VOL-4320] for more details
294 [Tags] functional ONUUpgradeActiveAbort
295 [Setup] Start Logging ONUUpgradeActiveAbort
296 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
297 ... AND Delete All Devices and Verify
298 ... AND Restart And Check BBSIM ${NAMESPACE}
299 ... AND Stop Logging ONUUpgradeActiveAbort
300 # Add OLT device
301 Setup
302 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
303 Run Keyword If ${has_dataplane} Clean Up Linux
304 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
305 FOR ${J} IN RANGE 0 ${num_olts}
306 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
307 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
308 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
309 Do ONU Upgrade Active Abort Per OLT ${bbsim_pod} ${olt_serial_number}
310 List ONUs ${NAMESPACE} ${bbsim_pod}
311 END
312 # Additional Verification
313 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
314 Setup
315 Run Keyword If ${has_dataplane} Clean Up Linux
316 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
317
318Test ONU Upgrade Correct Indication of Committed Abort
319 [Documentation] Validates the ONU Upgrade committed abort will be indicated correctly and
320 ... doesn't affect the system functionality. Check BBSIM server transfer image counter after further download,
321 ... counter should be incremented.
322 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
323 ... Check [VOL-4320] for more details
324 [Tags] functional ONUUpgradeCommittedAbort
325 [Setup] Start Logging ONUUpgradeCommittedAbort
326 [Teardown] Run Keywords Run Keyword If ${portFwdHandle}!=None Terminate Process ${portFwdHandle} kill=true
327 ... AND Set Suite Variable ${portFwdHandle} None
328 ... AND Run Keyword If ${logging} Collect Logs
329 ... AND Delete All Devices and Verify
330 ... AND Restart And Check BBSIM ${NAMESPACE}
331 ... AND Stop Logging ONUUpgradeCommittedAbort
332 # Add OLT device
333 Setup
334 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
335 Run Keyword If ${has_dataplane} Clean Up Linux
336 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
337 # in case of bbsim is running in k8s port forwarding of WEBSERVER is needed
338 ${BBSIM_INSTANCE} ${BBSIM_WEBSERVER_PORT}= Run Keyword If '${image_url}'!='${EMPTY}' Get BBSIM Svc and Webserver Port
339 ${cmd} Catenate
340 ... kubectl port-forward --address 0.0.0.0 -n ${NAMESPACE} svc/${BBSIM_INSTANCE}
341 ... ${BBSIM_WEBSERVER_PORT}:${BBSIM_WEBSERVER_PORT} &
342 ${portFwdHandle}= Run Keyword If ${PORT_FORWARDING} Start Process ${cmd} shell=true
343 Set Suite Variable ${portFwdHandle}
344 Sleep 5s
345 FOR ${J} IN RANGE 0 ${num_olts}
346 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
347 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
348 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
349 Do ONU Upgrade Committed Abort Per OLT ${bbsim_pod} ${olt_serial_number}
350 List ONUs ${NAMESPACE} ${bbsim_pod}
351 END
352 # Additional Verification
353 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
354 Setup
355 Run Keyword If ${has_dataplane} Clean Up Linux
356 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
357
358Test ONU Upgrade Correct Indication Multiple Image Download
359 [Documentation] Validates the ONU Upgrade multiple Image Download will be indicated correctly,
360 ... In case of (re-) download the same image without aborting the cached one in openonu-adapter should taken,
361 ... no further download from server has executed. Check BBSIM server transfer image counter after further download,
362 ... counter should NOT be incremented.
363 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
364 ... Check [VOL-4320] for more details
365 [Tags] functional ONUUpgradeMultipleImageDownload
366 [Setup] Start Logging ONUUpgradeMultipleImageDownload
367 [Teardown] Run Keywords Run Keyword If ${portFwdHandle}!=None Terminate Process ${portFwdHandle} kill=true
368 ... AND Set Suite Variable ${portFwdHandle} None
369 ... AND Run Keyword If ${logging} Collect Logs
370 ... AND Delete All Devices and Verify
371 ... AND Restart And Check BBSIM ${NAMESPACE}
372 ... AND Stop Logging ONUUpgradeMultipleImageDownload
373 # Add OLT device
374 Setup
375 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
376 Run Keyword If ${has_dataplane} Clean Up Linux
377 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
378 # in case of bbsim is running in k8s port forwarding of WEBSERVER is needed
379 ${BBSIM_INSTANCE} ${BBSIM_WEBSERVER_PORT}= Run Keyword If '${image_url}'!='${EMPTY}' Get BBSIM Svc and Webserver Port
380 ${cmd} Catenate
381 ... kubectl port-forward --address 0.0.0.0 -n ${NAMESPACE} svc/${BBSIM_INSTANCE}
382 ... ${BBSIM_WEBSERVER_PORT}:${BBSIM_WEBSERVER_PORT} &
383 ${portFwdHandle}= Run Keyword If ${PORT_FORWARDING} Start Process ${cmd} shell=true
384 Set Suite Variable ${portFwdHandle}
385 Sleep 5s
386 FOR ${J} IN RANGE 0 ${num_olts}
387 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
388 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
389 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
390 Do ONU Upgrade Multiple Image Download Per OLT ${bbsim_pod} ${olt_serial_number}
391 List ONUs ${NAMESPACE} ${bbsim_pod}
392 END
393 # Additional Verification
394 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
395 Setup
396 Run Keyword If ${has_dataplane} Clean Up Linux
397 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
398
TorstenThiemeb56633f2022-07-06 09:41:04 +0000399Test ONU Upgrade Compare OMCI Message Version
400 [Documentation] Validates the ONU Upgrade duration depending on OMCI message version
401 ... - setup one ONU with baseline OMCI message (EXTRA_HELM_FLAGS=" --set omccVersion=163)
402 ... - perform a SW upgrade
403 ... - store SW upgrade duration
404 ... - delete all devices
405 ... - setup one ONU with extended OMCI message (EXTRA_HELM_FLAGS=" --set omccVersion=180)
406 ... - perform a SW upgrade
407 ... - store SW upgrade duration
408 ... - compare both duration
409 ... - duration of extended msg ONU should be at least less than 80% of the baseline one
410 ... Check [VOL-4733] for more details
411 [Tags] functional ONUUpgradeOmciBaselineVersusExtendedOnuGo
412 [Setup] Start Logging ONUUpgradeOmciBaselineVersusExtendedOnuGo
413 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
414 ... AND Delete All Devices and Verify
415 ... AND Restart And Check BBSIM ${NAMESPACE}
416 ... AND Stop Logging ONUUpgradeOmciBaselineVersusExtendedOnuGo
417 Do ONU Upgrade Compare OMCI Message Version
418
TorstenThiemef3e492c2021-11-08 15:25:48 +0000419Test ONU Upgrade Image Download Simultaneously
420 [Documentation] Validates the ONU Upgrade Image Download to all ONUs simultaneously.
421 ... Test case should executed in multiple ONU (OLT) environment!
422 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
423 ... Check [VOL-4320] for more details
424 [Tags] functionalMultipleONUs ONUUpgradeImageDownloadSimultaneously
425 [Setup] Start Logging ONUUpgradeImageDownloadSimultaneously
426 [Teardown] Run Keywords Run Keyword If ${portFwdHandle}!=None Terminate Process ${portFwdHandle} kill=true
427 ... AND Set Suite Variable ${portFwdHandle} None
428 ... AND Run Keyword If ${logging} Collect Logs
429 ... AND Delete All Devices and Verify
430 ... AND Restart And Check BBSIM ${NAMESPACE}
431 ... AND Stop Logging ONUUpgradeImageDownloadSimultaneously
432 # Add OLT device
433 Setup
434 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
435 Run Keyword If ${has_dataplane} Clean Up Linux
436 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
437 # in case of bbsim is running in k8s port forwarding of WEBSERVER is needed
438 ${BBSIM_INSTANCE} ${BBSIM_WEBSERVER_PORT}= Run Keyword If '${image_url}'!='${EMPTY}' Get BBSIM Svc and Webserver Port
439 ${cmd} Catenate
440 ... kubectl port-forward --address 0.0.0.0 -n ${NAMESPACE} svc/${BBSIM_INSTANCE}
441 ... ${BBSIM_WEBSERVER_PORT}:${BBSIM_WEBSERVER_PORT} &
442 ${portFwdHandle}= Run Keyword If ${PORT_FORWARDING} Start Process ${cmd} shell=true
443 Set Suite Variable ${portFwdHandle}
444 Sleep 5s
445 Do ONU Upgrade Image Download Simultaneously
446 # Additional Verification
447 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
448 Setup
449 Run Keyword If ${has_dataplane} Clean Up Linux
450 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
451
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000452*** Keywords ***
TorstenThiemef3e492c2021-11-08 15:25:48 +0000453Do ONU Upgrade All OLTs
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000454 [Documentation] This keyword performs the ONU Upgrade test on all OLTs
455 [Arguments] ${activate_on_success}=${image_activate_on_success} ${commit_on_success}=${image_commit_on_success}
456 # Add OLT device
457 Setup
458 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
459 Run Keyword If ${has_dataplane} Clean Up Linux
460 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
461 FOR ${J} IN RANGE 0 ${num_olts}
462 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
463 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
464 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000465 Do ONU Upgrade Per OLT ${bbsim_pod} ${olt_serial_number} ${activate_on_success} ${commit_on_success}
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000466 List ONUs ${NAMESPACE} ${bbsim_pod}
467 END
468 # Additional Verification
469 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
470 Setup
471 Run Keyword If ${has_dataplane} Clean Up Linux
472 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
473
TorstenThiemef3e492c2021-11-08 15:25:48 +0000474Do ONU Upgrade Per OLT
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000475 [Documentation] This keyword performs the ONU Upgrade test on single OLT
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000476 [Arguments] ${bbsim_pod} ${olt_serial_number} ${activate_on_success}=${image_activate_on_success}
477 ... ${commit_on_success}=${image_commit_on_success}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000478 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id}
Hardik Windlass17bd1142021-03-12 08:15:25 +0000479 FOR ${I} IN RANGE 0 ${num_all_onus}
480 ${src}= Set Variable ${hosts.src[${I}]}
481 ${dst}= Set Variable ${hosts.dst[${I}]}
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000482 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
Hardik Windlass17bd1142021-03-12 08:15:25 +0000483 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Hardik Windlassba1bd272021-06-22 08:29:33 +0000484 # Download Image
485 Download ONU Device Image ${image_version} ${image_url} ${image_vendor}
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000486 ... ${activate_on_success} ${commit_on_success}
Hardik Windlassba1bd272021-06-22 08:29:33 +0000487 ... ${image_crc} ${onu_device_id}
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000488 ${imageState}= Run Keyword If '${activate_on_success}'=='true' and '${commit_on_success}'=='false'
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000489 ... Set Variable IMAGE_ACTIVE
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000490 ... ELSE IF '${activate_on_success}'=='true' and '${commit_on_success}'=='true'
Hardik Windlassba1bd272021-06-22 08:29:33 +0000491 ... Set Variable IMAGE_COMMITTED
492 ... ELSE Set Variable IMAGE_INACTIVE
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000493 ${activated}= Set Variable If '${activate_on_success}'=='true' True False
494 ${committed}= Set Variable If '${activate_on_success}'=='true' and '${commit_on_success}'=='true'
Hardik Windlassba1bd272021-06-22 08:29:33 +0000495 ... True False
496 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
497 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR ${imageState}
498 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
499 ... ${image_version} ${committed} ${activated} True
500 # Activate Image
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000501 ${imageState}= Set Variable If '${commit_on_success}'=='true' IMAGE_COMMITTED IMAGE_ACTIVE
502 ${committed}= Set Variable If '${commit_on_success}'=='true' True False
503 Run Keyword If '${activate_on_success}'=='false' Run Keywords
504 ... Activate ONU Device Image ${image_version} ${commit_on_success} ${onu_device_id}
Hardik Windlassba1bd272021-06-22 08:29:33 +0000505 ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
506 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR ${imageState}
507 ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
508 ... ${image_version} ${committed} True True
509 # Commit Image
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000510 Run Keyword If '${commit_on_success}'=='false' Run Keywords
Hardik Windlassba1bd272021-06-22 08:29:33 +0000511 ... Commit ONU Device Image ${image_version} ${onu_device_id}
512 ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
513 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED
514 ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
515 ... ${image_version} True True True
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000516 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod}
517 ... ${src['onu']} software_image_committed
Hardik Windlass17bd1142021-03-12 08:15:25 +0000518 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
Andrea Campanellaf3b88f62021-10-01 18:43:03 +0200519 # to remove the image again from adapter, Multi-Onu tests could be restructured - not yet in focus
520 Remove Adapter Image ${image_version} ${onu_device_id}
Hardik Windlass17bd1142021-03-12 08:15:25 +0000521 END
Hardik Windlass17bd1142021-03-12 08:15:25 +0000522
TorstenThiemef3e492c2021-11-08 15:25:48 +0000523Do ONU Upgrade Download Failure Per OLT
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000524 [Documentation] This keyword performs the ONU Upgrade Dowload Failure test on single OLT
TorstenThieme7cb9de72021-08-24 09:40:57 +0000525 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
526 ... ${dwl_dwlstate}=DOWNLOAD_STARTED ${dwl_reason}=NO_ERROR ${dwl_imgstate}=IMAGE_UNKNOWN
527 ... ${dwlstate}=DOWNLOAD_SUCCEEDED ${reason}=NO_ERROR ${imgstate}=IMAGE_INACTIVE
TorstenThiemef3e492c2021-11-08 15:25:48 +0000528 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image INVALID_IMAGE ${onu_device_id}
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000529 FOR ${I} IN RANGE 0 ${num_all_onus}
530 ${src}= Set Variable ${hosts.src[${I}]}
531 ${dst}= Set Variable ${hosts.dst[${I}]}
532 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
533 ${onu_device_id}= Get Device ID From SN ${src['onu']}
534 # Download Image
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000535 Download ONU Device Image INVALID_IMAGE ${url} ${image_vendor}
TorstenThieme7cb9de72021-08-24 09:40:57 +0000536 ... ${image_activate_on_success} ${image_commit_on_success} ${image_crc} ${onu_device_id}
537 ... download_state=${dwl_dwlstate} expected_reason=${dwl_reason} image_state=${dwl_imgstate}
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000538 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status INVALID_IMAGE
TorstenThieme7cb9de72021-08-24 09:40:57 +0000539 ... ${onu_device_id} ${dwlstate} ${reason} ${imgstate}
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000540 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
Andrea Campanellaf3b88f62021-10-01 18:43:03 +0200541 # to remove the image again from adapter, Multi-Onu tests could be restructured - not yet in focus
542 Remove Adapter Image INVALID_IMAGE ${onu_device_id}
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000543 END
544
TorstenThiemef3e492c2021-11-08 15:25:48 +0000545Do ONU Upgrade Downloading Abort Per OLT
546 [Documentation] This keyword performs the ONU Upgrade Downloading Abort test on single OLT
TorstenThieme37165402021-09-03 11:39:40 +0000547 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000548 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id}
TorstenThieme37165402021-09-03 11:39:40 +0000549 FOR ${I} IN RANGE 0 ${num_all_onus}
550 ${src}= Set Variable ${hosts.src[${I}]}
551 ${dst}= Set Variable ${hosts.dst[${I}]}
552 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
553 ${onu_device_id}= Get Device ID From SN ${src['onu']}
554 # Download Image
555 Download ONU Device Image ${image_version} ${url} ${image_vendor}
556 ... ${image_activate_on_success} ${image_commit_on_success} ${image_crc} ${onu_device_id}
557 Abort ONU Device Image ${image_version} ${onu_device_id}
Andrea Campanellaf3b88f62021-10-01 18:43:03 +0200558 ... DOWNLOAD_STARTED CANCELLED_ON_REQUEST IMAGE_DOWNLOADING
TorstenThieme37165402021-09-03 11:39:40 +0000559 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
Andrea Campanellaf3b88f62021-10-01 18:43:03 +0200560 ... ${onu_device_id} DOWNLOAD_CANCELLED CANCELLED_ON_REQUEST IMAGE_UNKNOWN
TorstenThieme37165402021-09-03 11:39:40 +0000561 # !!! Expected is image is not visible in list !!!
562 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
TorstenThieme70790282021-11-19 10:26:25 +0000563 ... ${image_version} False False False image_should_not_in_list=True
TorstenThieme37165402021-09-03 11:39:40 +0000564 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
565 END
566
TorstenThiemef3e492c2021-11-08 15:25:48 +0000567Do ONU Upgrade Downloaded Abort Per OLT
568 [Documentation] This keyword performs the ONU Upgrade Downloaded Abort test on single OLT
TorstenThiemec96d0962021-09-10 10:01:39 +0000569 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000570 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id}
TorstenThiemec96d0962021-09-10 10:01:39 +0000571 FOR ${I} IN RANGE 0 ${num_all_onus}
572 ${src}= Set Variable ${hosts.src[${I}]}
573 ${dst}= Set Variable ${hosts.dst[${I}]}
574 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
575 ${onu_device_id}= Get Device ID From SN ${src['onu']}
576 # Download Image
577 Download ONU Device Image ${image_version} ${url} ${image_vendor}
578 ... false false ${image_crc} ${onu_device_id}
579 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
580 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE
TorstenThiemef3e492c2021-11-08 15:25:48 +0000581 Abort ONU Device Image ${image_version} ${onu_device_id}
582 ... DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_INACTIVE
583 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
584 ... ${onu_device_id} DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_INACTIVE
TorstenThiemef3e492c2021-11-08 15:25:48 +0000585 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
586 ... ${image_version} False False True
587 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
588 END
589
590Do ONU Upgrade Activating Abort Per OLT
591 [Documentation] This keyword performs the ONU Upgrade Activating Abort test on single OLT
592 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
593 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id}
594 FOR ${I} IN RANGE 0 ${num_all_onus}
595 ${src}= Set Variable ${hosts.src[${I}]}
596 ${dst}= Set Variable ${hosts.dst[${I}]}
597 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
598 ${onu_device_id}= Get Device ID From SN ${src['onu']}
599 # Download Image
600 Download ONU Device Image ${image_version} ${url} ${image_vendor}
601 ... false false ${image_crc} ${onu_device_id}
602 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
603 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE
604 Activate ONU Device Image ${image_version} false ${onu_device_id}
TorstenThiemec96d0962021-09-10 10:01:39 +0000605 Abort ONU Device Image ${image_version} ${onu_device_id}
Andrea Campanellaf3b88f62021-10-01 18:43:03 +0200606 ... DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVATING
TorstenThiemec96d0962021-09-10 10:01:39 +0000607 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
Andrea Campanellaf3b88f62021-10-01 18:43:03 +0200608 ... ${onu_device_id} DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVATION_ABORTED
TorstenThiemec96d0962021-09-10 10:01:39 +0000609 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
610 ... ${image_version} False True True
611 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
612 END
613
TorstenThiemef3e492c2021-11-08 15:25:48 +0000614Do ONU Upgrade Active Abort Per OLT
615 [Documentation] This keyword performs the ONU Upgrade Active Abort test on single OLT
616 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
617 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id}
618 FOR ${I} IN RANGE 0 ${num_all_onus}
619 ${src}= Set Variable ${hosts.src[${I}]}
620 ${dst}= Set Variable ${hosts.dst[${I}]}
621 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
622 ${onu_device_id}= Get Device ID From SN ${src['onu']}
623 # Download Image
624 Download ONU Device Image ${image_version} ${url} ${image_vendor}
625 ... false false ${image_crc} ${onu_device_id}
626 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
627 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE
628 Activate ONU Device Image ${image_version} false ${onu_device_id}
629 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
630 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_ACTIVE
631 Abort ONU Device Image ${image_version} ${onu_device_id}
632 ... DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVE
633 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
634 ... ${onu_device_id} DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVE
TorstenThiemef3e492c2021-11-08 15:25:48 +0000635 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
636 ... ${image_version} False True True
637 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
638 END
639
640Do ONU Upgrade Committed Abort Per OLT
641 [Documentation] This keyword performs the ONU Upgrade Committed Abort test on single OLT
642 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
643 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id}
644 FOR ${I} IN RANGE 0 ${num_all_onus}
645 ${src}= Set Variable ${hosts.src[${I}]}
646 ${dst}= Set Variable ${hosts.dst[${I}]}
647 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
648 ${onu_device_id}= Get Device ID From SN ${src['onu']}
649 ${Images_Count_Start}= Get Images Count
650 # Download Image
651 Download ONU Device Image ${image_version} ${url} ${image_vendor}
652 ... false false ${image_crc} ${onu_device_id}
653 # After download of image, check image counter of BBSIM, has to be incremented by 2, because bbsim increments counter
654 # whenever openonu adapter touch the image, so one increment for check image is available and one for downloading
655 ${Images_Count_First}= Get Images Count
656 ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2
657 Should Be Equal as Integers ${Images_Count_First} ${Images_Count_Start} Count of image download not correct!
658 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
659 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE
660 Activate ONU Device Image ${image_version} false ${onu_device_id}
661 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
662 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_ACTIVE
663 Commit ONU Device Image ${image_version} ${onu_device_id}
664 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
665 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED
666 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
667 ... ${image_version} True True True
668 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod}
669 ... ${src['onu']} software_image_committed
670 Abort ONU Device Image ${image_version} ${onu_device_id}
671 ... DOWNLOAD_UNKNOWN NO_ERROR IMAGE_UNKNOWN
672 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
673 ... ${onu_device_id} DOWNLOAD_UNKNOWN NO_ERROR IMAGE_UNKNOWN
TorstenThiemef3e492c2021-11-08 15:25:48 +0000674 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
675 ... ${image_version} True True True
676 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
677 ${Images_Count_Intermediate}= Get Images Count
678 # Repeat download of aborted image, check image counter of BBSIM, has to be incremented by 2, because bbsim increments
679 # whenever openonu adapter touch the image, so one increment for check image is available and one for downloading
680 Download ONU Device Image ${image_version} ${url} ${image_vendor}
681 ... false false ${image_crc} ${onu_device_id}
682 ${Images_Count_End}= Get Images Count
683 ${Images_Count_Intermediate}= Evaluate ${Images_Count_Intermediate}+2
684 Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Intermediate} Count of image download not correct!
685 Remove Adapter Image ${image_version} ${onu_device_id}
686 END
687
688Do ONU Upgrade Multiple Image Download Per OLT
689 [Documentation] This keyword performs the ONU Upgrade Image Download test on single OLT
690 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
691 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id}
692 FOR ${I} IN RANGE 0 ${num_all_onus}
693 ${src}= Set Variable ${hosts.src[${I}]}
694 ${dst}= Set Variable ${hosts.dst[${I}]}
695 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
696 ${onu_device_id}= Get Device ID From SN ${src['onu']}
697 ${Images_Count_Start}= Get Images Count
698 # Download Image
699 Download ONU Device Image ${image_version} ${url} ${image_vendor}
700 ... true true ${image_crc} ${onu_device_id}
701 # After download of image, check image counter of BBSIM, has to be incremented by 2, because bbsim increments counter
702 # whenever openonu adapter touch the image, so one increment for check image is available and one for downloading
703 ${Images_Count_First}= Get Images Count
704 ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2
705 Should Be Equal as Integers ${Images_Count_First} ${Images_Count_Start} Count of image download not correct!
706 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
707 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED
708 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
709 ... ${image_version} True True True
710 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod}
711 ... ${src['onu']} software_image_committed
712 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
713 ${Images_Count_Intermediate}= Get Images Count
714 # Repeat download of same image, check image counter of BBSIM, has to be not incremented, because no download from
715 # server will be executed, the cached one from openonu-adapter will taken
716 Download ONU Device Image ${image_version} ${url} ${image_vendor}
717 ... false false ${image_crc} ${onu_device_id}
718 ${Images_Count_End}= Get Images Count
719 Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Intermediate} Count of image download not correct!
720 Remove Adapter Image ${image_version} ${onu_device_id}
721 END
722
TorstenThiemeb56633f2022-07-06 09:41:04 +0000723Do ONU Upgrade Compare OMCI Message Version
724 [Documentation] This keyword performs the ONU Upgrade Compare OMCI Message Version test for the first OLT/ONU
725 [Arguments] ${activate_on_success}=${image_activate_on_success} ${commit_on_success}=${image_commit_on_success}
TorstenThiemee7b10bd2022-07-08 08:32:10 +0000726 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' and '${onu_device_id}'!='${EMPTY}'
727 ... Remove Adapter Image ${image_version} ${onu_device_id}
728 ${onu_device_id}= Set Variable ${EMPTY}
729 ${firstonu}= Set Variable 0
730 ${outputfile}= Set variable ${OUTPUTDIR}/ONU_SW_Upgrade_Time.txt
TorstenThiemeb56633f2022-07-06 09:41:04 +0000731 ${omcc_version} ${is_omcc_extended}= Get BBSIM OMCC Version ${NAMESPACE}
732 # Restart BBSIM with OMCI Baseline Message if needed
733 Create File ${outputfile} This file contains the SW Upgrade download durations
734 ${extra_helm_flags} Catenate --set omccVersion=163
735 Run Keyword If ${is_omcc_extended} Restart BBSIM by Helm Charts ${NAMESPACE} extra_helm_flags=${extra_helm_flags}
736 # Add OLT device
737 Setup
738 ${src}= Set Variable ${hosts.src[${firstonu}]}
739 ${onu_device_id}= Get Device ID From SN ${src['onu']}
740 ${admin_state} ${oper_status} ${connect_status} ${onu_state_nb} ${onu_state}=
741 ... Map State omci-flows-pushed
742 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 1s
743 ... Validate Device ${admin_state} ${oper_status} ${connect_status}
744 ... ${src['onu']} onu=True onu_reason=${onu_state}
745 ${baselineonu}= Get ONU SW Upgrade Duration ${firstonu} ${activate_on_success} ${commit_on_success}
746 Log ONU ${src['onu']}: downloaded SW upgrade in ${baselineonu} sec for OMCI baseline message. console=yes
747 Append To File ${outputfile}
748 ... \r\nONU ${src['onu']} downloaded SW upgrade in ${baselineonu} sec for OMCI baseline message.
TorstenThieme517b7ce2022-12-19 11:56:34 +0000749 # get ONU OMCI counter statistics
750 ${onu_device_id}= Get Device ID From SN ${src['onu']}
751 ${rc} ${OMCI_counter_dict}= Get OMCI counter statistics dictionary ${onu_device_id}
752 Run Keyword If ${rc} != 0 FAIL Could not get baseline ONU OMCI counter statistic of ONU ${src['onu']}!
753 ${BaseTxNoArFrames}= Get From Dictionary ${OMCI_counter_dict} BaseTxNoArFrames
754 Should Be True 0 < ${BaseTxNoArFrames} No BaseTxNoArFrames found in baseline OMCI!
755 # some additional checks
756 ${ExtRxAkFrames}= Get From Dictionary ${OMCI_counter_dict} ExtRxAkFrames
757 ${ExtRxNoAkFrames}= Get From Dictionary ${OMCI_counter_dict} ExtRxNoAkFrames
758 ${ExtTxArFrames}= Get From Dictionary ${OMCI_counter_dict} ExtTxArFrames
759 ${ExtTxNoArFrames}= Get From Dictionary ${OMCI_counter_dict} ExtTxNoArFrames
760 ${TxOmciCounterRetries}= Get From Dictionary ${OMCI_counter_dict} TxOmciCounterRetries
761 ${TxOmciCounterTimeouts}= Get From Dictionary ${OMCI_counter_dict} TxOmciCounterTimeouts
762 Should Be Equal 0 ${ExtRxAkFrames} ExtRxAkFrames found in baseline OMCI!
763 Should Be Equal 0 ${ExtRxNoAkFrames} ExtRxNoAkFrames found in baseline OMCI!
764 Should Be Equal 0 ${ExtTxArFrames} ExtTxArFrames found in baseline OMCI!
765 Should Be Equal 0 ${ExtTxNoArFrames} ExtTxNoArFrames found in baseline OMCI!
766 Should Be Equal 0 ${TxOmciCounterRetries} TxOmciCounterRetries found in baseline OMCI!
767 Should Be Equal 0 ${TxOmciCounterTimeouts} TxOmciCounterTimeouts found in baseline OMCI!
TorstenThiemeb56633f2022-07-06 09:41:04 +0000768 Delete All Devices and Verify
769 # Restart BBSIM with OMCI Extended Message
770 ${extra_helm_flags}= Run Keyword If ${is_omcc_extended} Catenate --set omccVersion=${omcc_version}
771 ... ELSE Catenate --set omccVersion=180
772 Restart BBSIM by Helm Charts ${NAMESPACE} extra_helm_flags=${extra_helm_flags}
773 # Start Onu again with OMCI Extended Message
774 Setup
775 ${onu_device_id}= Get Device ID From SN ${src['onu']}
776 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 1s
777 ... Validate Device ${admin_state} ${oper_status} ${connect_status}
778 ... ${src['onu']} onu=True onu_reason=${onu_state}
779 ${extendedonu}= Get ONU SW Upgrade Duration ${firstonu} ${activate_on_success} ${commit_on_success}
780 Log ONU ${src['onu']}: downloaded SW upgrade in ${extendedonu} sec for OMCI extended message. console=yes
781 Append To File ${outputfile}
782 ... \r\nONU ${src['onu']} downloaded SW upgrade in ${extendedonu} sec for OMCI extended message.
783 ${duration_compare}= Evaluate ${baselineonu}*0.8 > ${extendedonu}
784 Should Be True ${duration_compare} SW Upgrade too slow for OMCI extended message!
TorstenThieme517b7ce2022-12-19 11:56:34 +0000785 # get ONU OMCI counter statistics
786 ${onu_device_id}= Get Device ID From SN ${src['onu']}
787 ${rc} ${OMCI_counter_dict}= Get OMCI counter statistics dictionary ${onu_device_id}
788 Run Keyword If ${rc} != 0 FAIL Could not get extended ONU OMCI counter statistic of ONU ${src['onu']}!
789 ${ExtTxNoArFrames}= Get From Dictionary ${OMCI_counter_dict} ExtTxNoArFrames
790 Should Be True 0 < ${ExtTxNoArFrames} No ExtTxNoArFrames found in extended OMCI!
791 # check baseline and extended OMCI frames counter
792 ${TxNoArFrames_compare}= Evaluate ${BaseTxNoArFrames}*0.05 > ${ExtTxNoArFrames}
793 Should Be True ${TxNoArFrames_compare} Comparison of TxNoArFrames failed (${BaseTxNoArFrames}:${ExtTxNoArFrames})!
794 # some additional checks
795 ${TxOmciCounterRetries}= Get From Dictionary ${OMCI_counter_dict} TxOmciCounterRetries
796 ${TxOmciCounterTimeouts}= Get From Dictionary ${OMCI_counter_dict} TxOmciCounterTimeouts
797 Should Be Equal 0 ${TxOmciCounterRetries} TxOmciCounterRetries found in extended OMCI!
798 Should Be Equal 0 ${TxOmciCounterTimeouts} TxOmciCounterTimeouts found in extended OMCI!
TorstenThiemeb56633f2022-07-06 09:41:04 +0000799 # Restart BBSIM with OMCI Message Version read at begin of test
800 ${extra_helm_flags}= Catenate --set omccVersion=${omcc_version}
801 Run Keyword Unless ${is_omcc_extended} Restart BBSIM by Helm Charts ${NAMESPACE} extra_helm_flags=${extra_helm_flags}
802
803Get ONU SW Upgrade Duration
804 [Documentation] This keyword delivers SW Upgrade duration of onu
805 [Arguments] ${onu} ${activate_on_success} ${commit_on_success}
806 ${src}= Set Variable ${hosts.src[${onu}]}
807 ${onu_device_id}= Get Device ID From SN ${src['onu']}
808 ${timeStart}= Get Current Date
809 Download ONU Device Image ${image_version} ${image_url} ${image_vendor}
810 ... ${activate_on_success} ${commit_on_success}
811 ... ${image_crc} ${onu_device_id}
812 ${imageState}= Run Keyword If '${activate_on_success}'=='true' and '${commit_on_success}'=='false'
813 ... Set Variable IMAGE_ACTIVE
814 ... ELSE IF '${activate_on_success}'=='true' and '${commit_on_success}'=='true'
815 ... Set Variable IMAGE_COMMITTED
816 ... ELSE Set Variable IMAGE_INACTIVE
817 ${activated}= Set Variable If '${activate_on_success}'=='true' True False
818 ${committed}= Set Variable If '${activate_on_success}'=='true' and '${commit_on_success}'=='true'
819 ... True False
820 Wait Until Keyword Succeeds ${timeout} 0s Verify ONU Device Image Status ${image_version}
821 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR ${imageState}
822 ${timeCurrent} = Get Current Date
823 ${timeTotalMs} = Subtract Date From Date ${timeCurrent} ${timeStart} result_format=number
824 Remove Adapter Image ${image_version} ${onu_device_id}
825 [Return] ${timeTotalMs}
826
TorstenThiemef3e492c2021-11-08 15:25:48 +0000827Do ONU Upgrade Image Download Simultaneously
828 [Documentation] This keyword performs the ONU Upgrade Image Download Simultaneously on all ONUs test
829 [Arguments] ${url}=${image_url}
830 [Teardown] Remove Adapter Image from ONUs ${image_version} ${list_onus}
831 # collect all ONU's device ids
832 ${list_onus} Create List
833 Build ONU Device Id List ${list_onus}
834 # prepare OLT-SN BBSIM-POD releation dictionary for later fast access
835 ${olt_bbsim_dict}= Create Dictionary
836 FOR ${J} IN RANGE 0 ${num_olts}
837 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
838 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
839 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
840 Set To Dictionary ${olt_bbsim_dict} ${olt_serial_number} ${bbsim_pod}
841 END
842 ${Images_Count_Start}= Get Images Count
843 # Download Image to all ONUs simultaneously
844 ${onu_device_ids} = Catenate @{list_onus}
845 Download ONU Device Image ${image_version} ${url} ${image_vendor}
846 ... true true ${image_crc} ${onu_device_ids}
847 # do all the check stuff
848 FOR ${onu_device_id} IN @{list_onus}
849 Log ${onu_device_id}
850 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
851 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED
852 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
853 ... ${image_version} True True True
854 END
855 # last but not least check bbsim
856 FOR ${I} IN RANGE 0 ${num_all_onus}
857 ${src}= Set Variable ${hosts.src[${I}]}
858 ${bbsim_pod}= Get From Dictionary ${olt_bbsim_dict} ${src['olt']}
859 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod}
860 ... ${src['onu']} software_image_committed
861 END
862 ${Images_Count_End}= Get Images Count
863 ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2
864 Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Start} Count of image download not correct!
865
Hardik Windlass17bd1142021-03-12 08:15:25 +0000866Setup Suite
867 [Documentation] Set up the test suite
TorstenThiemef3e492c2021-11-08 15:25:48 +0000868 Start Logging Setup or Teardown Setup-${SUITE NAME}
Hardik Windlass17bd1142021-03-12 08:15:25 +0000869 Common Test Suite Setup
TorstenThiemef3607942022-09-06 08:54:17 +0000870 # set log level for org.onosproject.store.device.impl.GossipDeviceStore to TRACE to get reason for hanging ONOS resources
871 ${LogLevelGossipDeviceStore}= Wait Until Keyword Succeeds ${timeout} 2s
872 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
873 ... log:get org.onosproject.store.device.impl.GossipDeviceStore
874 Set Suite Variable ${LogLevelGossipDeviceStore}
875 Log Old Log Level of GossipDeviceStore is ${LogLevelGossipDeviceStore}
876 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
877 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
878 ... log:set TRACE org.onosproject.store.device.impl.GossipDeviceStore
879 ${NewLogLevelGossipDeviceStore}= Wait Until Keyword Succeeds ${timeout} 2s
880 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
881 ... log:get org.onosproject.store.device.impl.GossipDeviceStore
882 Log New Log Level of GossipDeviceStore is ${NewLogLevelGossipDeviceStore}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000883 Run Keyword If ${logging} Collect Logs
884 Stop Logging Setup or Teardown Setup-${SUITE NAME}
Hardik Windlass17bd1142021-03-12 08:15:25 +0000885
886Teardown Suite
887 [Documentation] Tear down steps for the suite
TorstenThiemef3e492c2021-11-08 15:25:48 +0000888 Start Logging Setup or Teardown Teardown-${SUITE NAME}
889 # stop port forwarding if still running
890 Run Keyword If ${portFwdHandle}!=None Terminate Process ${portFwdHandle} kill=true
Hardik Windlass17bd1142021-03-12 08:15:25 +0000891 Run Keyword If ${has_dataplane} Clean Up Linux
TorstenThiemef3e492c2021-11-08 15:25:48 +0000892 Run Keyword If ${logging} Collect Logs
TorstenThiemef3607942022-09-06 08:54:17 +0000893 # reset log level for org.onosproject.store.device.impl.GossipDeviceStore to to previous level
894 ${NewLogLevelGossipDeviceStore}= Wait Until Keyword Succeeds ${timeout} 2s
895 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
896 ... log:get org.onosproject.store.device.impl.GossipDeviceStore
897 Log Log Level of GossipDeviceStore is ${NewLogLevelGossipDeviceStore}
898 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
899 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
900 ... log:set ${LogLevelGossipDeviceStore} org.onosproject.store.device.impl.GossipDeviceStore
901 ${LogLevelGossipDeviceStore}= Wait Until Keyword Succeeds ${timeout} 2s
902 ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
903 ... log:get org.onosproject.store.device.impl.GossipDeviceStore
904 Log New Log Level of GossipDeviceStore is ${LogLevelGossipDeviceStore}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000905 Stop Logging Setup or Teardown Teardown-${SUITE NAME}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000906 Close All ONOS SSH Connections