blob: 2c1c33136a66a968f78d6586c2eb24cb33ad6da2 [file] [log] [blame]
Hardik Windlass17bd1142021-03-12 08:15:25 +00001# Copyright 2021 - present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14# FIXME Can we use the same test against BBSim and Hardware?
15
16*** Settings ***
17Documentation 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.
749 Delete All Devices and Verify
750 # Restart BBSIM with OMCI Extended Message
751 ${extra_helm_flags}= Run Keyword If ${is_omcc_extended} Catenate --set omccVersion=${omcc_version}
752 ... ELSE Catenate --set omccVersion=180
753 Restart BBSIM by Helm Charts ${NAMESPACE} extra_helm_flags=${extra_helm_flags}
754 # Start Onu again with OMCI Extended Message
755 Setup
756 ${onu_device_id}= Get Device ID From SN ${src['onu']}
757 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 1s
758 ... Validate Device ${admin_state} ${oper_status} ${connect_status}
759 ... ${src['onu']} onu=True onu_reason=${onu_state}
760 ${extendedonu}= Get ONU SW Upgrade Duration ${firstonu} ${activate_on_success} ${commit_on_success}
761 Log ONU ${src['onu']}: downloaded SW upgrade in ${extendedonu} sec for OMCI extended message. console=yes
762 Append To File ${outputfile}
763 ... \r\nONU ${src['onu']} downloaded SW upgrade in ${extendedonu} sec for OMCI extended message.
764 ${duration_compare}= Evaluate ${baselineonu}*0.8 > ${extendedonu}
765 Should Be True ${duration_compare} SW Upgrade too slow for OMCI extended message!
766 # Restart BBSIM with OMCI Message Version read at begin of test
767 ${extra_helm_flags}= Catenate --set omccVersion=${omcc_version}
768 Run Keyword Unless ${is_omcc_extended} Restart BBSIM by Helm Charts ${NAMESPACE} extra_helm_flags=${extra_helm_flags}
769
770Get ONU SW Upgrade Duration
771 [Documentation] This keyword delivers SW Upgrade duration of onu
772 [Arguments] ${onu} ${activate_on_success} ${commit_on_success}
773 ${src}= Set Variable ${hosts.src[${onu}]}
774 ${onu_device_id}= Get Device ID From SN ${src['onu']}
775 ${timeStart}= Get Current Date
776 Download ONU Device Image ${image_version} ${image_url} ${image_vendor}
777 ... ${activate_on_success} ${commit_on_success}
778 ... ${image_crc} ${onu_device_id}
779 ${imageState}= Run Keyword If '${activate_on_success}'=='true' and '${commit_on_success}'=='false'
780 ... Set Variable IMAGE_ACTIVE
781 ... ELSE IF '${activate_on_success}'=='true' and '${commit_on_success}'=='true'
782 ... Set Variable IMAGE_COMMITTED
783 ... ELSE Set Variable IMAGE_INACTIVE
784 ${activated}= Set Variable If '${activate_on_success}'=='true' True False
785 ${committed}= Set Variable If '${activate_on_success}'=='true' and '${commit_on_success}'=='true'
786 ... True False
787 Wait Until Keyword Succeeds ${timeout} 0s Verify ONU Device Image Status ${image_version}
788 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR ${imageState}
789 ${timeCurrent} = Get Current Date
790 ${timeTotalMs} = Subtract Date From Date ${timeCurrent} ${timeStart} result_format=number
791 Remove Adapter Image ${image_version} ${onu_device_id}
792 [Return] ${timeTotalMs}
793
TorstenThiemef3e492c2021-11-08 15:25:48 +0000794Do ONU Upgrade Image Download Simultaneously
795 [Documentation] This keyword performs the ONU Upgrade Image Download Simultaneously on all ONUs test
796 [Arguments] ${url}=${image_url}
797 [Teardown] Remove Adapter Image from ONUs ${image_version} ${list_onus}
798 # collect all ONU's device ids
799 ${list_onus} Create List
800 Build ONU Device Id List ${list_onus}
801 # prepare OLT-SN BBSIM-POD releation dictionary for later fast access
802 ${olt_bbsim_dict}= Create Dictionary
803 FOR ${J} IN RANGE 0 ${num_olts}
804 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
805 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
806 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
807 Set To Dictionary ${olt_bbsim_dict} ${olt_serial_number} ${bbsim_pod}
808 END
809 ${Images_Count_Start}= Get Images Count
810 # Download Image to all ONUs simultaneously
811 ${onu_device_ids} = Catenate @{list_onus}
812 Download ONU Device Image ${image_version} ${url} ${image_vendor}
813 ... true true ${image_crc} ${onu_device_ids}
814 # do all the check stuff
815 FOR ${onu_device_id} IN @{list_onus}
816 Log ${onu_device_id}
817 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
818 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED
819 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
820 ... ${image_version} True True True
821 END
822 # last but not least check bbsim
823 FOR ${I} IN RANGE 0 ${num_all_onus}
824 ${src}= Set Variable ${hosts.src[${I}]}
825 ${bbsim_pod}= Get From Dictionary ${olt_bbsim_dict} ${src['olt']}
826 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod}
827 ... ${src['onu']} software_image_committed
828 END
829 ${Images_Count_End}= Get Images Count
830 ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2
831 Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Start} Count of image download not correct!
832
Hardik Windlass17bd1142021-03-12 08:15:25 +0000833Setup Suite
834 [Documentation] Set up the test suite
TorstenThiemef3e492c2021-11-08 15:25:48 +0000835 Start Logging Setup or Teardown Setup-${SUITE NAME}
Hardik Windlass17bd1142021-03-12 08:15:25 +0000836 Common Test Suite Setup
TorstenThiemef3e492c2021-11-08 15:25:48 +0000837 Run Keyword If ${logging} Collect Logs
838 Stop Logging Setup or Teardown Setup-${SUITE NAME}
Hardik Windlass17bd1142021-03-12 08:15:25 +0000839
840Teardown Suite
841 [Documentation] Tear down steps for the suite
TorstenThiemef3e492c2021-11-08 15:25:48 +0000842 Start Logging Setup or Teardown Teardown-${SUITE NAME}
843 # stop port forwarding if still running
844 Run Keyword If ${portFwdHandle}!=None Terminate Process ${portFwdHandle} kill=true
Hardik Windlass17bd1142021-03-12 08:15:25 +0000845 Run Keyword If ${has_dataplane} Clean Up Linux
TorstenThiemef3e492c2021-11-08 15:25:48 +0000846 Run Keyword If ${logging} Collect Logs
847 Stop Logging Setup or Teardown Teardown-${SUITE NAME}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000848 Close All ONOS SSH Connections