blob: 99be3ecf1865159b56cdc82169e992b1538e41d5 [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
Hardik Windlassc310c7c2021-03-25 13:16:59 +000033Resource ../../libraries/bbsim.robot
Hardik Windlass17bd1142021-03-12 08:15:25 +000034Resource ../../variables/variables.robot
35
36*** Variables ***
37${POD_NAME} flex-ocp-cord
38${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
39${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs
40#${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
41${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
42${HELM_CHARTS_DIR} ~/helm-charts
43${VOLTHA_POD_NUM} 8
44${NAMESPACE} voltha
Hardik Windlass4288c6a2021-09-28 07:22:06 +000045${INFRA_NAMESPACE} default
Hardik Windlass17bd1142021-03-12 08:15:25 +000046# For below variable value, using deployment name as using grep for
47# parsing radius pod name, we can also use full radius pod name
48${RESTART_POD_NAME} radius
49${timeout} 60s
50${of_id} 0
51${logical_id} 0
52${has_dataplane} True
53${teardown_device} False
54${scripts} ../../scripts
55
56# Per-test logging on failure is turned off by default; set this variable to enable
57${container_log_dir} ${None}
58
59${suppressaddsubscriber} True
60
Hardik Windlassf0ce2062021-07-23 11:04:39 +000061# logging flag to enable Collect Logs, can be passed via the command line too
62# example: -v logging:False
63${logging} True
64
Hardik Windlass17bd1142021-03-12 08:15:25 +000065# ONU Image to test for Upgrade needs to be passed in the following format:
Hardik Windlassba1bd272021-06-22 08:29:33 +000066${image_version} ${EMPTY}
67# Example value: BBSM_IMG_00002
68${image_url} ${EMPTY}
Hardik Windlass17bd1142021-03-12 08:15:25 +000069# Example value: http://bbsim0:50074/images/software-image.img
Hardik Windlassba1bd272021-06-22 08:29:33 +000070${image_vendor} ${EMPTY}
71# Example value: BBSM
72${image_activate_on_success} ${EMPTY}
73# Example value: false
74${image_commit_on_success} ${EMPTY}
75# Example value: false
76${image_crc} ${EMPTY}
Hardik Windlass17bd1142021-03-12 08:15:25 +000077# Example value: 0
Hardik Windlass17bd1142021-03-12 08:15:25 +000078
TorstenThiemef3e492c2021-11-08 15:25:48 +000079# when voltha is running in k8s port forwarding is needed
80# example: -v PORT_FORWARDING:False
81${PORT_FORWARDING} True
82
83# Next values are default values for port forward, do not need to be passed, will be overwritten by values taken from image-url
84# bbsim webserver port
85# example: -v BBSIM_WEBSERVER_PORT:50074
86${BBSIM_WEBSERVER_PORT} 50074
87# bbsim instance
88# example: -v BBSIM_INSTANCE:bbsim0
89${BBSIM_INSTANCE} bbsim0
90# port forward handle
91${portFwdHandle} None
92
Hardik Windlass17bd1142021-03-12 08:15:25 +000093*** Test Cases ***
94Test ONU Upgrade
95 [Documentation] Validates the ONU Upgrade doesn't affect the system functionality
96 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
97 ... Requirement: Pass image details in following parameters in the robot command
98 ... onu_image_name, onu_image_url, onu_image_version, onu_image_crc, onu_image_local_dir
Hardik Windlassc310c7c2021-03-25 13:16:59 +000099 ... 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 +0000100 ... Check [VOL-3903] for more details
101 [Tags] functional ONUUpgrade
102 [Setup] Start Logging ONUUpgrade
TorstenThieme37165402021-09-03 11:39:40 +0000103 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass17bd1142021-03-12 08:15:25 +0000104 ... AND Delete All Devices and Verify
TorstenThieme37165402021-09-03 11:39:40 +0000105 ... AND Restart And Check BBSIM ${NAMESPACE}
106 ... AND Stop Logging ONUUpgrade
TorstenThiemef3e492c2021-11-08 15:25:48 +0000107 Do ONU Upgrade All OLTs
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000108
109Test ONU Upgrade All Activate and Commit Combinations
110 [Documentation] Validates the ONU Upgrade doesn't affect the system functionality by use all combinations of
111 ... flags activate_on_success and commit_on_success
112 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
113 ... Requirement: Pass image details in following parameters in the robot command
114 ... onu_image_name, onu_image_url, onu_image_version, onu_image_crc, onu_image_local_dir
115 ... Note: The TC expects the image url and other parameters to be common for all ONUs on all BBSim
116 ... Check [VOL-4250] for more details
TorstenThieme37165402021-09-03 11:39:40 +0000117 [Tags] functional ONUUpgradeAllCombies
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000118 [Setup] Start Logging ONUUpgradeAllCombies
TorstenThieme37165402021-09-03 11:39:40 +0000119 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000120 ... AND Delete All Devices and Verify
TorstenThieme37165402021-09-03 11:39:40 +0000121 ... AND Restart And Check BBSIM ${NAMESPACE}
122 ... AND Stop Logging ONUUpgradeAllCombies
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000123 ${false_false}= Create Dictionary activate false commit false
124 ${true_false}= Create Dictionary activate true commit false
125 ${false_true}= Create Dictionary activate false commit true
126 ${true_true}= Create Dictionary activate true commit true
127 ${flag_list}= Create List ${false_false} ${true_false} ${false_true} ${true_true}
128 FOR ${item} IN @{flag_list}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000129 Do ONU Upgrade All OLTs ${item['activate']} ${item['commit']}
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000130 Delete All Devices and Verify
TorstenThieme37165402021-09-03 11:39:40 +0000131 Restart And Check BBSIM ${NAMESPACE}
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000132 END
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000133
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000134Test ONU Upgrade Correct Indication of Download Wrong Url
135 [Documentation] Validates the ONU Upgrade download from wrong URL failure will be indicated correctly
136 ... and doesn't affect the system functionality
137 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
138 ... Check [VOL-4257] for more details
TorstenThieme7cb9de72021-08-24 09:40:57 +0000139 [Tags] functional ONUUpgradeDownloadWrongUrl
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000140 [Setup] Start Logging ONUUpgradeDownloadWrongUrl
TorstenThieme37165402021-09-03 11:39:40 +0000141 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000142 ... AND Delete All Devices and Verify
TorstenThieme37165402021-09-03 11:39:40 +0000143 ... AND Restart And Check BBSIM ${NAMESPACE}
144 ... AND Stop Logging ONUUpgradeDownloadWrongUrl
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000145 # Add OLT device
146 Setup
147 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
148 Run Keyword If ${has_dataplane} Clean Up Linux
149 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
150 FOR ${J} IN RANGE 0 ${num_olts}
151 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
152 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
153 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000154 Do ONU Upgrade Download Failure Per OLT ${bbsim_pod} ${olt_serial_number}
TorstenThieme7cb9de72021-08-24 09:40:57 +0000155 ... url=http://bbsim0:50074/images/wrong-image.img$
156 ... dwl_dwlstate=DOWNLOAD_FAILED dwl_reason=INVALID_URL dwl_imgstate=IMAGE_UNKNOWN
157 ... dwlstate=DOWNLOAD_UNKNOWN reason=NO_ERROR imgstate=IMAGE_UNKNOWN
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000158 List ONUs ${NAMESPACE} ${bbsim_pod}
159 END
160 # Additional Verification
161 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
162 Setup
163 Run Keyword If ${has_dataplane} Clean Up Linux
164 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
165
TorstenThieme7cb9de72021-08-24 09:40:57 +0000166Test ONU Upgrade Correct Indication of Download Failure
167 [Documentation] Validates the ONU Upgrade download failure will be indicated correctly and
168 ... doesn't affect the system functionality
169 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
170 ... Check [VOL-3935] for more details
171 [Tags] functional ONUUpgradeDownloadFailure
172 [Setup] Start Logging ONUUpgradeDownloadFailure
TorstenThieme37165402021-09-03 11:39:40 +0000173 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
TorstenThieme7cb9de72021-08-24 09:40:57 +0000174 ... AND Delete All Devices and Verify
TorstenThieme37165402021-09-03 11:39:40 +0000175 ... AND Restart And Check BBSIM ${NAMESPACE}
176 ... AND Stop Logging ONUUpgradeDownloadFailure
TorstenThieme7cb9de72021-08-24 09:40:57 +0000177 # Add OLT device
178 Setup
179 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
180 Run Keyword If ${has_dataplane} Clean Up Linux
181 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
182 FOR ${J} IN RANGE 0 ${num_olts}
183 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
184 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
185 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000186 Do ONU Upgrade Download Failure Per OLT ${bbsim_pod} ${olt_serial_number}
TorstenThieme7cb9de72021-08-24 09:40:57 +0000187 ... dwlstate=DOWNLOAD_FAILED reason=CANCELLED_ON_ONU_STATE imgstate=IMAGE_UNKNOWN
188 List ONUs ${NAMESPACE} ${bbsim_pod}
189 END
190 # Additional Verification
191 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
192 Setup
193 Run Keyword If ${has_dataplane} Clean Up Linux
194 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000195
TorstenThiemef3e492c2021-11-08 15:25:48 +0000196Test ONU Upgrade Correct Indication of Downloading Abort
197 [Documentation] Validates the ONU Upgrade downloading abort will be indicated correctly and
TorstenThieme37165402021-09-03 11:39:40 +0000198 ... doesn't affect the system functionality
199 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
200 ... Check [VOL-4318] for more details
TorstenThiemef3e492c2021-11-08 15:25:48 +0000201 [Tags] functional ONUUpgradeDownloadingAbort
202 [Setup] Start Logging ONUUpgradeDownloadingAbort
TorstenThieme37165402021-09-03 11:39:40 +0000203 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
204 ... AND Delete All Devices and Verify
TorstenThiemec96d0962021-09-10 10:01:39 +0000205 ... AND Restart And Check BBSIM ${NAMESPACE}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000206 ... AND Stop Logging ONUUpgradeDownloadingAbort
TorstenThieme37165402021-09-03 11:39:40 +0000207 # Add OLT device
208 Setup
209 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
210 Run Keyword If ${has_dataplane} Clean Up Linux
211 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
212 FOR ${J} IN RANGE 0 ${num_olts}
213 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
214 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
215 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000216 Do ONU Upgrade Downloading Abort Per OLT ${bbsim_pod} ${olt_serial_number}
TorstenThieme37165402021-09-03 11:39:40 +0000217 List ONUs ${NAMESPACE} ${bbsim_pod}
218 END
219 # Additional Verification
220 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
221 Setup
222 Run Keyword If ${has_dataplane} Clean Up Linux
223 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
224
TorstenThiemef3e492c2021-11-08 15:25:48 +0000225Test ONU Upgrade Correct Indication of Downloaded Abort
226 [Documentation] Validates the ONU Upgrade downloaded abort will be indicated correctly and
TorstenThiemec96d0962021-09-10 10:01:39 +0000227 ... doesn't affect the system functionality
228 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
TorstenThiemef3e492c2021-11-08 15:25:48 +0000229 ... Check [VOL-4320] for more details
230 [Tags] functional ONUUpgradeDownloadedAbort
231 [Setup] Start Logging ONUUpgradeDownloadedAbort
TorstenThiemec96d0962021-09-10 10:01:39 +0000232 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
233 ... AND Delete All Devices and Verify
234 ... AND Restart And Check BBSIM ${NAMESPACE}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000235 ... AND Stop Logging ONUUpgradeDownloadedAbort
TorstenThiemec96d0962021-09-10 10:01:39 +0000236 # Add OLT device
237 Setup
238 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
239 Run Keyword If ${has_dataplane} Clean Up Linux
240 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
241 FOR ${J} IN RANGE 0 ${num_olts}
242 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
243 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
244 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000245 Do ONU Upgrade Downloaded Abort Per OLT ${bbsim_pod} ${olt_serial_number}
TorstenThiemec96d0962021-09-10 10:01:39 +0000246 List ONUs ${NAMESPACE} ${bbsim_pod}
247 END
248 # Additional Verification
249 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
250 Setup
251 Run Keyword If ${has_dataplane} Clean Up Linux
252 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000253
TorstenThiemef3e492c2021-11-08 15:25:48 +0000254Test ONU Upgrade Correct Indication of Activating Abort
255 [Documentation] Validates the ONU Upgrade activating abort will be indicated correctly and
256 ... doesn't affect the system functionality
257 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
258 ... Check [VOL-4319] for more details
259 [Tags] functional ONUUpgradeActivatingAbort
260 [Setup] Start Logging ONUUpgradeActivatingAbort
261 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
262 ... AND Delete All Devices and Verify
263 ... AND Restart And Check BBSIM ${NAMESPACE}
264 ... AND Stop Logging ONUUpgradeActivatingAbort
265 # Add OLT device
266 Setup
267 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
268 Run Keyword If ${has_dataplane} Clean Up Linux
269 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
270 FOR ${J} IN RANGE 0 ${num_olts}
271 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
272 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
273 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
274 Do ONU Upgrade Activating Abort Per OLT ${bbsim_pod} ${olt_serial_number}
275 List ONUs ${NAMESPACE} ${bbsim_pod}
276 END
277 # Additional Verification
278 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
279 Setup
280 Run Keyword If ${has_dataplane} Clean Up Linux
281 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
282
283Test ONU Upgrade Correct Indication of Active Abort
284 [Documentation] Validates the ONU Upgrade active abort will be indicated correctly and
285 ... doesn't affect the system functionality
286 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
287 ... Check [VOL-4320] for more details
288 [Tags] functional ONUUpgradeActiveAbort
289 [Setup] Start Logging ONUUpgradeActiveAbort
290 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
291 ... AND Delete All Devices and Verify
292 ... AND Restart And Check BBSIM ${NAMESPACE}
293 ... AND Stop Logging ONUUpgradeActiveAbort
294 # Add OLT device
295 Setup
296 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
297 Run Keyword If ${has_dataplane} Clean Up Linux
298 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
299 FOR ${J} IN RANGE 0 ${num_olts}
300 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
301 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
302 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
303 Do ONU Upgrade Active Abort Per OLT ${bbsim_pod} ${olt_serial_number}
304 List ONUs ${NAMESPACE} ${bbsim_pod}
305 END
306 # Additional Verification
307 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
308 Setup
309 Run Keyword If ${has_dataplane} Clean Up Linux
310 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
311
312Test ONU Upgrade Correct Indication of Committed Abort
313 [Documentation] Validates the ONU Upgrade committed abort will be indicated correctly and
314 ... doesn't affect the system functionality. Check BBSIM server transfer image counter after further download,
315 ... counter should be incremented.
316 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
317 ... Check [VOL-4320] for more details
318 [Tags] functional ONUUpgradeCommittedAbort
319 [Setup] Start Logging ONUUpgradeCommittedAbort
320 [Teardown] Run Keywords Run Keyword If ${portFwdHandle}!=None Terminate Process ${portFwdHandle} kill=true
321 ... AND Set Suite Variable ${portFwdHandle} None
322 ... AND Run Keyword If ${logging} Collect Logs
323 ... AND Delete All Devices and Verify
324 ... AND Restart And Check BBSIM ${NAMESPACE}
325 ... AND Stop Logging ONUUpgradeCommittedAbort
326 # Add OLT device
327 Setup
328 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
329 Run Keyword If ${has_dataplane} Clean Up Linux
330 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
331 # in case of bbsim is running in k8s port forwarding of WEBSERVER is needed
332 ${BBSIM_INSTANCE} ${BBSIM_WEBSERVER_PORT}= Run Keyword If '${image_url}'!='${EMPTY}' Get BBSIM Svc and Webserver Port
333 ${cmd} Catenate
334 ... kubectl port-forward --address 0.0.0.0 -n ${NAMESPACE} svc/${BBSIM_INSTANCE}
335 ... ${BBSIM_WEBSERVER_PORT}:${BBSIM_WEBSERVER_PORT} &
336 ${portFwdHandle}= Run Keyword If ${PORT_FORWARDING} Start Process ${cmd} shell=true
337 Set Suite Variable ${portFwdHandle}
338 Sleep 5s
339 FOR ${J} IN RANGE 0 ${num_olts}
340 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
341 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
342 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
343 Do ONU Upgrade Committed Abort Per OLT ${bbsim_pod} ${olt_serial_number}
344 List ONUs ${NAMESPACE} ${bbsim_pod}
345 END
346 # Additional Verification
347 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
348 Setup
349 Run Keyword If ${has_dataplane} Clean Up Linux
350 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
351
352Test ONU Upgrade Correct Indication Multiple Image Download
353 [Documentation] Validates the ONU Upgrade multiple Image Download will be indicated correctly,
354 ... In case of (re-) download the same image without aborting the cached one in openonu-adapter should taken,
355 ... no further download from server has executed. Check BBSIM server transfer image counter after further download,
356 ... counter should NOT be incremented.
357 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
358 ... Check [VOL-4320] for more details
359 [Tags] functional ONUUpgradeMultipleImageDownload
360 [Setup] Start Logging ONUUpgradeMultipleImageDownload
361 [Teardown] Run Keywords Run Keyword If ${portFwdHandle}!=None Terminate Process ${portFwdHandle} kill=true
362 ... AND Set Suite Variable ${portFwdHandle} None
363 ... AND Run Keyword If ${logging} Collect Logs
364 ... AND Delete All Devices and Verify
365 ... AND Restart And Check BBSIM ${NAMESPACE}
366 ... AND Stop Logging ONUUpgradeMultipleImageDownload
367 # Add OLT device
368 Setup
369 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
370 Run Keyword If ${has_dataplane} Clean Up Linux
371 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
372 # in case of bbsim is running in k8s port forwarding of WEBSERVER is needed
373 ${BBSIM_INSTANCE} ${BBSIM_WEBSERVER_PORT}= Run Keyword If '${image_url}'!='${EMPTY}' Get BBSIM Svc and Webserver Port
374 ${cmd} Catenate
375 ... kubectl port-forward --address 0.0.0.0 -n ${NAMESPACE} svc/${BBSIM_INSTANCE}
376 ... ${BBSIM_WEBSERVER_PORT}:${BBSIM_WEBSERVER_PORT} &
377 ${portFwdHandle}= Run Keyword If ${PORT_FORWARDING} Start Process ${cmd} shell=true
378 Set Suite Variable ${portFwdHandle}
379 Sleep 5s
380 FOR ${J} IN RANGE 0 ${num_olts}
381 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
382 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
383 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
384 Do ONU Upgrade Multiple Image Download Per OLT ${bbsim_pod} ${olt_serial_number}
385 List ONUs ${NAMESPACE} ${bbsim_pod}
386 END
387 # Additional Verification
388 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
389 Setup
390 Run Keyword If ${has_dataplane} Clean Up Linux
391 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
392
393Test ONU Upgrade Image Download Simultaneously
394 [Documentation] Validates the ONU Upgrade Image Download to all ONUs simultaneously.
395 ... Test case should executed in multiple ONU (OLT) environment!
396 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
397 ... Check [VOL-4320] for more details
398 [Tags] functionalMultipleONUs ONUUpgradeImageDownloadSimultaneously
399 [Setup] Start Logging ONUUpgradeImageDownloadSimultaneously
400 [Teardown] Run Keywords Run Keyword If ${portFwdHandle}!=None Terminate Process ${portFwdHandle} kill=true
401 ... AND Set Suite Variable ${portFwdHandle} None
402 ... AND Run Keyword If ${logging} Collect Logs
403 ... AND Delete All Devices and Verify
404 ... AND Restart And Check BBSIM ${NAMESPACE}
405 ... AND Stop Logging ONUUpgradeImageDownloadSimultaneously
406 # Add OLT device
407 Setup
408 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
409 Run Keyword If ${has_dataplane} Clean Up Linux
410 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
411 # in case of bbsim is running in k8s port forwarding of WEBSERVER is needed
412 ${BBSIM_INSTANCE} ${BBSIM_WEBSERVER_PORT}= Run Keyword If '${image_url}'!='${EMPTY}' Get BBSIM Svc and Webserver Port
413 ${cmd} Catenate
414 ... kubectl port-forward --address 0.0.0.0 -n ${NAMESPACE} svc/${BBSIM_INSTANCE}
415 ... ${BBSIM_WEBSERVER_PORT}:${BBSIM_WEBSERVER_PORT} &
416 ${portFwdHandle}= Run Keyword If ${PORT_FORWARDING} Start Process ${cmd} shell=true
417 Set Suite Variable ${portFwdHandle}
418 Sleep 5s
419 Do ONU Upgrade Image Download Simultaneously
420 # Additional Verification
421 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
422 Setup
423 Run Keyword If ${has_dataplane} Clean Up Linux
424 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
425
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000426*** Keywords ***
TorstenThiemef3e492c2021-11-08 15:25:48 +0000427Do ONU Upgrade All OLTs
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000428 [Documentation] This keyword performs the ONU Upgrade test on all OLTs
429 [Arguments] ${activate_on_success}=${image_activate_on_success} ${commit_on_success}=${image_commit_on_success}
430 # Add OLT device
431 Setup
432 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
433 Run Keyword If ${has_dataplane} Clean Up Linux
434 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
435 FOR ${J} IN RANGE 0 ${num_olts}
436 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
437 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
438 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000439 Do ONU Upgrade Per OLT ${bbsim_pod} ${olt_serial_number} ${activate_on_success} ${commit_on_success}
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000440 List ONUs ${NAMESPACE} ${bbsim_pod}
441 END
442 # Additional Verification
443 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
444 Setup
445 Run Keyword If ${has_dataplane} Clean Up Linux
446 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
447
TorstenThiemef3e492c2021-11-08 15:25:48 +0000448Do ONU Upgrade Per OLT
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000449 [Documentation] This keyword performs the ONU Upgrade test on single OLT
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000450 [Arguments] ${bbsim_pod} ${olt_serial_number} ${activate_on_success}=${image_activate_on_success}
451 ... ${commit_on_success}=${image_commit_on_success}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000452 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id}
Hardik Windlass17bd1142021-03-12 08:15:25 +0000453 FOR ${I} IN RANGE 0 ${num_all_onus}
454 ${src}= Set Variable ${hosts.src[${I}]}
455 ${dst}= Set Variable ${hosts.dst[${I}]}
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000456 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
Hardik Windlass17bd1142021-03-12 08:15:25 +0000457 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Hardik Windlassba1bd272021-06-22 08:29:33 +0000458 # Download Image
459 Download ONU Device Image ${image_version} ${image_url} ${image_vendor}
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000460 ... ${activate_on_success} ${commit_on_success}
Hardik Windlassba1bd272021-06-22 08:29:33 +0000461 ... ${image_crc} ${onu_device_id}
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000462 ${imageState}= Run Keyword If '${activate_on_success}'=='true' and '${commit_on_success}'=='false'
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000463 ... Set Variable IMAGE_ACTIVE
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000464 ... ELSE IF '${activate_on_success}'=='true' and '${commit_on_success}'=='true'
Hardik Windlassba1bd272021-06-22 08:29:33 +0000465 ... Set Variable IMAGE_COMMITTED
466 ... ELSE Set Variable IMAGE_INACTIVE
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000467 ${activated}= Set Variable If '${activate_on_success}'=='true' True False
468 ${committed}= Set Variable If '${activate_on_success}'=='true' and '${commit_on_success}'=='true'
Hardik Windlassba1bd272021-06-22 08:29:33 +0000469 ... True False
470 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
471 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR ${imageState}
472 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
473 ... ${image_version} ${committed} ${activated} True
474 # Activate Image
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000475 ${imageState}= Set Variable If '${commit_on_success}'=='true' IMAGE_COMMITTED IMAGE_ACTIVE
476 ${committed}= Set Variable If '${commit_on_success}'=='true' True False
477 Run Keyword If '${activate_on_success}'=='false' Run Keywords
478 ... Activate ONU Device Image ${image_version} ${commit_on_success} ${onu_device_id}
Hardik Windlassba1bd272021-06-22 08:29:33 +0000479 ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
480 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR ${imageState}
481 ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
482 ... ${image_version} ${committed} True True
483 # Commit Image
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000484 Run Keyword If '${commit_on_success}'=='false' Run Keywords
Hardik Windlassba1bd272021-06-22 08:29:33 +0000485 ... Commit ONU Device Image ${image_version} ${onu_device_id}
486 ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
487 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED
488 ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
489 ... ${image_version} True True True
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000490 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod}
491 ... ${src['onu']} software_image_committed
Hardik Windlass17bd1142021-03-12 08:15:25 +0000492 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
Andrea Campanellaf3b88f62021-10-01 18:43:03 +0200493 # to remove the image again from adapter, Multi-Onu tests could be restructured - not yet in focus
494 Remove Adapter Image ${image_version} ${onu_device_id}
Hardik Windlass17bd1142021-03-12 08:15:25 +0000495 END
Hardik Windlass17bd1142021-03-12 08:15:25 +0000496
TorstenThiemef3e492c2021-11-08 15:25:48 +0000497Do ONU Upgrade Download Failure Per OLT
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000498 [Documentation] This keyword performs the ONU Upgrade Dowload Failure test on single OLT
TorstenThieme7cb9de72021-08-24 09:40:57 +0000499 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
500 ... ${dwl_dwlstate}=DOWNLOAD_STARTED ${dwl_reason}=NO_ERROR ${dwl_imgstate}=IMAGE_UNKNOWN
501 ... ${dwlstate}=DOWNLOAD_SUCCEEDED ${reason}=NO_ERROR ${imgstate}=IMAGE_INACTIVE
TorstenThiemef3e492c2021-11-08 15:25:48 +0000502 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image INVALID_IMAGE ${onu_device_id}
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000503 FOR ${I} IN RANGE 0 ${num_all_onus}
504 ${src}= Set Variable ${hosts.src[${I}]}
505 ${dst}= Set Variable ${hosts.dst[${I}]}
506 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
507 ${onu_device_id}= Get Device ID From SN ${src['onu']}
508 # Download Image
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000509 Download ONU Device Image INVALID_IMAGE ${url} ${image_vendor}
TorstenThieme7cb9de72021-08-24 09:40:57 +0000510 ... ${image_activate_on_success} ${image_commit_on_success} ${image_crc} ${onu_device_id}
511 ... download_state=${dwl_dwlstate} expected_reason=${dwl_reason} image_state=${dwl_imgstate}
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000512 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status INVALID_IMAGE
TorstenThieme7cb9de72021-08-24 09:40:57 +0000513 ... ${onu_device_id} ${dwlstate} ${reason} ${imgstate}
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000514 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
Andrea Campanellaf3b88f62021-10-01 18:43:03 +0200515 # to remove the image again from adapter, Multi-Onu tests could be restructured - not yet in focus
516 Remove Adapter Image INVALID_IMAGE ${onu_device_id}
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000517 END
518
TorstenThiemef3e492c2021-11-08 15:25:48 +0000519Do ONU Upgrade Downloading Abort Per OLT
520 [Documentation] This keyword performs the ONU Upgrade Downloading Abort test on single OLT
TorstenThieme37165402021-09-03 11:39:40 +0000521 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000522 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id}
TorstenThieme37165402021-09-03 11:39:40 +0000523 FOR ${I} IN RANGE 0 ${num_all_onus}
524 ${src}= Set Variable ${hosts.src[${I}]}
525 ${dst}= Set Variable ${hosts.dst[${I}]}
526 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
527 ${onu_device_id}= Get Device ID From SN ${src['onu']}
528 # Download Image
529 Download ONU Device Image ${image_version} ${url} ${image_vendor}
530 ... ${image_activate_on_success} ${image_commit_on_success} ${image_crc} ${onu_device_id}
531 Abort ONU Device Image ${image_version} ${onu_device_id}
Andrea Campanellaf3b88f62021-10-01 18:43:03 +0200532 ... DOWNLOAD_STARTED CANCELLED_ON_REQUEST IMAGE_DOWNLOADING
TorstenThieme37165402021-09-03 11:39:40 +0000533 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
Andrea Campanellaf3b88f62021-10-01 18:43:03 +0200534 ... ${onu_device_id} DOWNLOAD_CANCELLED CANCELLED_ON_REQUEST IMAGE_UNKNOWN
TorstenThieme37165402021-09-03 11:39:40 +0000535 # !!! Expected is image is not visible in list !!!
536 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
TorstenThieme70790282021-11-19 10:26:25 +0000537 ... ${image_version} False False False image_should_not_in_list=True
TorstenThieme37165402021-09-03 11:39:40 +0000538 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
539 END
540
TorstenThiemef3e492c2021-11-08 15:25:48 +0000541Do ONU Upgrade Downloaded Abort Per OLT
542 [Documentation] This keyword performs the ONU Upgrade Downloaded Abort test on single OLT
TorstenThiemec96d0962021-09-10 10:01:39 +0000543 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
TorstenThiemef3e492c2021-11-08 15:25:48 +0000544 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id}
TorstenThiemec96d0962021-09-10 10:01:39 +0000545 FOR ${I} IN RANGE 0 ${num_all_onus}
546 ${src}= Set Variable ${hosts.src[${I}]}
547 ${dst}= Set Variable ${hosts.dst[${I}]}
548 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
549 ${onu_device_id}= Get Device ID From SN ${src['onu']}
550 # Download Image
551 Download ONU Device Image ${image_version} ${url} ${image_vendor}
552 ... false false ${image_crc} ${onu_device_id}
553 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
554 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE
TorstenThiemef3e492c2021-11-08 15:25:48 +0000555 Abort ONU Device Image ${image_version} ${onu_device_id}
556 ... DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_INACTIVE
557 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
558 ... ${onu_device_id} DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_INACTIVE
TorstenThiemef3e492c2021-11-08 15:25:48 +0000559 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
560 ... ${image_version} False False True
561 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
562 END
563
564Do ONU Upgrade Activating Abort Per OLT
565 [Documentation] This keyword performs the ONU Upgrade Activating Abort test on single OLT
566 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
567 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id}
568 FOR ${I} IN RANGE 0 ${num_all_onus}
569 ${src}= Set Variable ${hosts.src[${I}]}
570 ${dst}= Set Variable ${hosts.dst[${I}]}
571 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
572 ${onu_device_id}= Get Device ID From SN ${src['onu']}
573 # Download Image
574 Download ONU Device Image ${image_version} ${url} ${image_vendor}
575 ... false false ${image_crc} ${onu_device_id}
576 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
577 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE
578 Activate ONU Device Image ${image_version} false ${onu_device_id}
TorstenThiemec96d0962021-09-10 10:01:39 +0000579 Abort ONU Device Image ${image_version} ${onu_device_id}
Andrea Campanellaf3b88f62021-10-01 18:43:03 +0200580 ... DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVATING
TorstenThiemec96d0962021-09-10 10:01:39 +0000581 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
Andrea Campanellaf3b88f62021-10-01 18:43:03 +0200582 ... ${onu_device_id} DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVATION_ABORTED
TorstenThiemec96d0962021-09-10 10:01:39 +0000583 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
584 ... ${image_version} False True True
585 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
586 END
587
TorstenThiemef3e492c2021-11-08 15:25:48 +0000588Do ONU Upgrade Active Abort Per OLT
589 [Documentation] This keyword performs the ONU Upgrade Active Abort test on single OLT
590 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
591 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id}
592 FOR ${I} IN RANGE 0 ${num_all_onus}
593 ${src}= Set Variable ${hosts.src[${I}]}
594 ${dst}= Set Variable ${hosts.dst[${I}]}
595 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
596 ${onu_device_id}= Get Device ID From SN ${src['onu']}
597 # Download Image
598 Download ONU Device Image ${image_version} ${url} ${image_vendor}
599 ... false false ${image_crc} ${onu_device_id}
600 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
601 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE
602 Activate ONU Device Image ${image_version} false ${onu_device_id}
603 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
604 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_ACTIVE
605 Abort ONU Device Image ${image_version} ${onu_device_id}
606 ... DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVE
607 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
608 ... ${onu_device_id} DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVE
TorstenThiemef3e492c2021-11-08 15:25:48 +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
614Do ONU Upgrade Committed Abort Per OLT
615 [Documentation] This keyword performs the ONU Upgrade Committed 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 ${Images_Count_Start}= Get Images Count
624 # Download Image
625 Download ONU Device Image ${image_version} ${url} ${image_vendor}
626 ... false false ${image_crc} ${onu_device_id}
627 # After download of image, check image counter of BBSIM, has to be incremented by 2, because bbsim increments counter
628 # whenever openonu adapter touch the image, so one increment for check image is available and one for downloading
629 ${Images_Count_First}= Get Images Count
630 ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2
631 Should Be Equal as Integers ${Images_Count_First} ${Images_Count_Start} Count of image download not correct!
632 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
633 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE
634 Activate ONU Device Image ${image_version} false ${onu_device_id}
635 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
636 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_ACTIVE
637 Commit ONU Device Image ${image_version} ${onu_device_id}
638 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
639 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED
640 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
641 ... ${image_version} True True True
642 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod}
643 ... ${src['onu']} software_image_committed
644 Abort ONU Device Image ${image_version} ${onu_device_id}
645 ... DOWNLOAD_UNKNOWN NO_ERROR IMAGE_UNKNOWN
646 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
647 ... ${onu_device_id} DOWNLOAD_UNKNOWN NO_ERROR IMAGE_UNKNOWN
TorstenThiemef3e492c2021-11-08 15:25:48 +0000648 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
649 ... ${image_version} True True True
650 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
651 ${Images_Count_Intermediate}= Get Images Count
652 # Repeat download of aborted image, check image counter of BBSIM, has to be incremented by 2, because bbsim increments
653 # whenever openonu adapter touch the image, so one increment for check image is available and one for downloading
654 Download ONU Device Image ${image_version} ${url} ${image_vendor}
655 ... false false ${image_crc} ${onu_device_id}
656 ${Images_Count_End}= Get Images Count
657 ${Images_Count_Intermediate}= Evaluate ${Images_Count_Intermediate}+2
658 Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Intermediate} Count of image download not correct!
659 Remove Adapter Image ${image_version} ${onu_device_id}
660 END
661
662Do ONU Upgrade Multiple Image Download Per OLT
663 [Documentation] This keyword performs the ONU Upgrade Image Download test on single OLT
664 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
665 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id}
666 FOR ${I} IN RANGE 0 ${num_all_onus}
667 ${src}= Set Variable ${hosts.src[${I}]}
668 ${dst}= Set Variable ${hosts.dst[${I}]}
669 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
670 ${onu_device_id}= Get Device ID From SN ${src['onu']}
671 ${Images_Count_Start}= Get Images Count
672 # Download Image
673 Download ONU Device Image ${image_version} ${url} ${image_vendor}
674 ... true true ${image_crc} ${onu_device_id}
675 # After download of image, check image counter of BBSIM, has to be incremented by 2, because bbsim increments counter
676 # whenever openonu adapter touch the image, so one increment for check image is available and one for downloading
677 ${Images_Count_First}= Get Images Count
678 ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2
679 Should Be Equal as Integers ${Images_Count_First} ${Images_Count_Start} Count of image download not correct!
680 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
681 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED
682 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
683 ... ${image_version} True True True
684 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod}
685 ... ${src['onu']} software_image_committed
686 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
687 ${Images_Count_Intermediate}= Get Images Count
688 # Repeat download of same image, check image counter of BBSIM, has to be not incremented, because no download from
689 # server will be executed, the cached one from openonu-adapter will taken
690 Download ONU Device Image ${image_version} ${url} ${image_vendor}
691 ... false false ${image_crc} ${onu_device_id}
692 ${Images_Count_End}= Get Images Count
693 Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Intermediate} Count of image download not correct!
694 Remove Adapter Image ${image_version} ${onu_device_id}
695 END
696
697Do ONU Upgrade Image Download Simultaneously
698 [Documentation] This keyword performs the ONU Upgrade Image Download Simultaneously on all ONUs test
699 [Arguments] ${url}=${image_url}
700 [Teardown] Remove Adapter Image from ONUs ${image_version} ${list_onus}
701 # collect all ONU's device ids
702 ${list_onus} Create List
703 Build ONU Device Id List ${list_onus}
704 # prepare OLT-SN BBSIM-POD releation dictionary for later fast access
705 ${olt_bbsim_dict}= Create Dictionary
706 FOR ${J} IN RANGE 0 ${num_olts}
707 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
708 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
709 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
710 Set To Dictionary ${olt_bbsim_dict} ${olt_serial_number} ${bbsim_pod}
711 END
712 ${Images_Count_Start}= Get Images Count
713 # Download Image to all ONUs simultaneously
714 ${onu_device_ids} = Catenate @{list_onus}
715 Download ONU Device Image ${image_version} ${url} ${image_vendor}
716 ... true true ${image_crc} ${onu_device_ids}
717 # do all the check stuff
718 FOR ${onu_device_id} IN @{list_onus}
719 Log ${onu_device_id}
720 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
721 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED
722 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
723 ... ${image_version} True True True
724 END
725 # last but not least check bbsim
726 FOR ${I} IN RANGE 0 ${num_all_onus}
727 ${src}= Set Variable ${hosts.src[${I}]}
728 ${bbsim_pod}= Get From Dictionary ${olt_bbsim_dict} ${src['olt']}
729 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod}
730 ... ${src['onu']} software_image_committed
731 END
732 ${Images_Count_End}= Get Images Count
733 ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2
734 Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Start} Count of image download not correct!
735
TorstenThieme37165402021-09-03 11:39:40 +0000736Restart And Check BBSIM
737 [Documentation] This keyword restarts bbsim and waits for it to come up again
738 ... Following steps will be executed:
739 ... - restart bbsim adaptor
740 ... - check bbsim adaptor is ready again
741 [Arguments] ${namespace}
742 ${bbsim_apps} Create List bbsim
743 ${label_key} Set Variable app
744 ${bbsim_label_value} Set Variable bbsim
745 Restart Pod By Label ${namespace} ${label_key} ${bbsim_label_value}
746 Sleep 5s
747 Wait For Pods Ready ${namespace} ${bbsim_apps}
748
TorstenThiemef3e492c2021-11-08 15:25:48 +0000749Get BBSIM Svc and Webserver Port
750 [Documentation] This keyword gets bbsim instance and bbsim webserver port from image url
751 @{words}= Split String ${image_url} /
752 ${SvcAndPort} Set Variable @{words}[2]
753 ${bbsim_svc} ${webserver_port}= Split String ${SvcAndPort} : 1
754 ${svc_return} Set Variable If '${bbsim_svc}'!='${EMPTY}' ${bbsim_svc} ${BBSIM_INSTANCE}
755 ${port_return} Set Variable If '${webserver_port}'!='${EMPTY}' ${webserver_port} ${BBSIM_WEBSERVER_PORT}
756 [Return] ${svc_return} ${port_return}
757
Hardik Windlass17bd1142021-03-12 08:15:25 +0000758Setup Suite
759 [Documentation] Set up the test suite
TorstenThiemef3e492c2021-11-08 15:25:48 +0000760 Start Logging Setup or Teardown Setup-${SUITE NAME}
Hardik Windlass17bd1142021-03-12 08:15:25 +0000761 Common Test Suite Setup
TorstenThiemef3e492c2021-11-08 15:25:48 +0000762 Run Keyword If ${logging} Collect Logs
763 Stop Logging Setup or Teardown Setup-${SUITE NAME}
Hardik Windlass17bd1142021-03-12 08:15:25 +0000764
765Teardown Suite
766 [Documentation] Tear down steps for the suite
TorstenThiemef3e492c2021-11-08 15:25:48 +0000767 Start Logging Setup or Teardown Teardown-${SUITE NAME}
768 # stop port forwarding if still running
769 Run Keyword If ${portFwdHandle}!=None Terminate Process ${portFwdHandle} kill=true
Hardik Windlass17bd1142021-03-12 08:15:25 +0000770 Run Keyword If ${has_dataplane} Clean Up Linux
TorstenThiemef3e492c2021-11-08 15:25:48 +0000771 Run Keyword If ${logging} Collect Logs
772 Stop Logging Setup or Teardown Teardown-${SUITE NAME}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000773 Close All ONOS SSH Connections