blob: 0f985229b646002b0a46c51078f6c88977019045 [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}
537 ... ${image_version} False False True
538 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
559 # !!! Expected is image is not visible in list !!!
560 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
561 ... ${image_version} False False True
562 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
563 END
564
565Do ONU Upgrade Activating Abort Per OLT
566 [Documentation] This keyword performs the ONU Upgrade Activating Abort test on single OLT
567 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
568 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id}
569 FOR ${I} IN RANGE 0 ${num_all_onus}
570 ${src}= Set Variable ${hosts.src[${I}]}
571 ${dst}= Set Variable ${hosts.dst[${I}]}
572 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
573 ${onu_device_id}= Get Device ID From SN ${src['onu']}
574 # Download Image
575 Download ONU Device Image ${image_version} ${url} ${image_vendor}
576 ... false false ${image_crc} ${onu_device_id}
577 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
578 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE
579 Activate ONU Device Image ${image_version} false ${onu_device_id}
TorstenThiemec96d0962021-09-10 10:01:39 +0000580 Abort ONU Device Image ${image_version} ${onu_device_id}
Andrea Campanellaf3b88f62021-10-01 18:43:03 +0200581 ... DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVATING
TorstenThiemec96d0962021-09-10 10:01:39 +0000582 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
Andrea Campanellaf3b88f62021-10-01 18:43:03 +0200583 ... ${onu_device_id} DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVATION_ABORTED
TorstenThiemec96d0962021-09-10 10:01:39 +0000584 # !!! Expected is image is not visible in list !!!
585 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
586 ... ${image_version} False True True
587 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
588 END
589
TorstenThiemef3e492c2021-11-08 15:25:48 +0000590Do ONU Upgrade Active Abort Per OLT
591 [Documentation] This keyword performs the ONU Upgrade Active 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}
605 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
606 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_ACTIVE
607 Abort ONU Device Image ${image_version} ${onu_device_id}
608 ... DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVE
609 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
610 ... ${onu_device_id} DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVE
611 # !!! Expected is image is not visible in list !!!
612 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
613 ... ${image_version} False True True
614 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
615 END
616
617Do ONU Upgrade Committed Abort Per OLT
618 [Documentation] This keyword performs the ONU Upgrade Committed Abort test on single OLT
619 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
620 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id}
621 FOR ${I} IN RANGE 0 ${num_all_onus}
622 ${src}= Set Variable ${hosts.src[${I}]}
623 ${dst}= Set Variable ${hosts.dst[${I}]}
624 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
625 ${onu_device_id}= Get Device ID From SN ${src['onu']}
626 ${Images_Count_Start}= Get Images Count
627 # Download Image
628 Download ONU Device Image ${image_version} ${url} ${image_vendor}
629 ... false false ${image_crc} ${onu_device_id}
630 # After download of image, check image counter of BBSIM, has to be incremented by 2, because bbsim increments counter
631 # whenever openonu adapter touch the image, so one increment for check image is available and one for downloading
632 ${Images_Count_First}= Get Images Count
633 ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2
634 Should Be Equal as Integers ${Images_Count_First} ${Images_Count_Start} Count of image download not correct!
635 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
636 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE
637 Activate ONU Device Image ${image_version} false ${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_ACTIVE
640 Commit ONU Device Image ${image_version} ${onu_device_id}
641 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
642 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED
643 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
644 ... ${image_version} True True True
645 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod}
646 ... ${src['onu']} software_image_committed
647 Abort ONU Device Image ${image_version} ${onu_device_id}
648 ... DOWNLOAD_UNKNOWN NO_ERROR IMAGE_UNKNOWN
649 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
650 ... ${onu_device_id} DOWNLOAD_UNKNOWN NO_ERROR IMAGE_UNKNOWN
651 # !!! Expected is image is not visible in list !!!
652 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
653 ... ${image_version} True True True
654 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
655 ${Images_Count_Intermediate}= Get Images Count
656 # Repeat download of aborted image, check image counter of BBSIM, has to be incremented by 2, because bbsim increments
657 # whenever openonu adapter touch the image, so one increment for check image is available and one for downloading
658 Download ONU Device Image ${image_version} ${url} ${image_vendor}
659 ... false false ${image_crc} ${onu_device_id}
660 ${Images_Count_End}= Get Images Count
661 ${Images_Count_Intermediate}= Evaluate ${Images_Count_Intermediate}+2
662 Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Intermediate} Count of image download not correct!
663 Remove Adapter Image ${image_version} ${onu_device_id}
664 END
665
666Do ONU Upgrade Multiple Image Download Per OLT
667 [Documentation] This keyword performs the ONU Upgrade Image Download test on single OLT
668 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
669 [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id}
670 FOR ${I} IN RANGE 0 ${num_all_onus}
671 ${src}= Set Variable ${hosts.src[${I}]}
672 ${dst}= Set Variable ${hosts.dst[${I}]}
673 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
674 ${onu_device_id}= Get Device ID From SN ${src['onu']}
675 ${Images_Count_Start}= Get Images Count
676 # Download Image
677 Download ONU Device Image ${image_version} ${url} ${image_vendor}
678 ... true true ${image_crc} ${onu_device_id}
679 # After download of image, check image counter of BBSIM, has to be incremented by 2, because bbsim increments counter
680 # whenever openonu adapter touch the image, so one increment for check image is available and one for downloading
681 ${Images_Count_First}= Get Images Count
682 ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2
683 Should Be Equal as Integers ${Images_Count_First} ${Images_Count_Start} Count of image download not correct!
684 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
685 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED
686 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
687 ... ${image_version} True True True
688 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod}
689 ... ${src['onu']} software_image_committed
690 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
691 ${Images_Count_Intermediate}= Get Images Count
692 # Repeat download of same image, check image counter of BBSIM, has to be not incremented, because no download from
693 # server will be executed, the cached one from openonu-adapter will taken
694 Download ONU Device Image ${image_version} ${url} ${image_vendor}
695 ... false false ${image_crc} ${onu_device_id}
696 ${Images_Count_End}= Get Images Count
697 Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Intermediate} Count of image download not correct!
698 Remove Adapter Image ${image_version} ${onu_device_id}
699 END
700
701Do ONU Upgrade Image Download Simultaneously
702 [Documentation] This keyword performs the ONU Upgrade Image Download Simultaneously on all ONUs test
703 [Arguments] ${url}=${image_url}
704 [Teardown] Remove Adapter Image from ONUs ${image_version} ${list_onus}
705 # collect all ONU's device ids
706 ${list_onus} Create List
707 Build ONU Device Id List ${list_onus}
708 # prepare OLT-SN BBSIM-POD releation dictionary for later fast access
709 ${olt_bbsim_dict}= Create Dictionary
710 FOR ${J} IN RANGE 0 ${num_olts}
711 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
712 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
713 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
714 Set To Dictionary ${olt_bbsim_dict} ${olt_serial_number} ${bbsim_pod}
715 END
716 ${Images_Count_Start}= Get Images Count
717 # Download Image to all ONUs simultaneously
718 ${onu_device_ids} = Catenate @{list_onus}
719 Download ONU Device Image ${image_version} ${url} ${image_vendor}
720 ... true true ${image_crc} ${onu_device_ids}
721 # do all the check stuff
722 FOR ${onu_device_id} IN @{list_onus}
723 Log ${onu_device_id}
724 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
725 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED
726 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
727 ... ${image_version} True True True
728 END
729 # last but not least check bbsim
730 FOR ${I} IN RANGE 0 ${num_all_onus}
731 ${src}= Set Variable ${hosts.src[${I}]}
732 ${bbsim_pod}= Get From Dictionary ${olt_bbsim_dict} ${src['olt']}
733 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod}
734 ... ${src['onu']} software_image_committed
735 END
736 ${Images_Count_End}= Get Images Count
737 ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2
738 Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Start} Count of image download not correct!
739
TorstenThieme37165402021-09-03 11:39:40 +0000740Restart And Check BBSIM
741 [Documentation] This keyword restarts bbsim and waits for it to come up again
742 ... Following steps will be executed:
743 ... - restart bbsim adaptor
744 ... - check bbsim adaptor is ready again
745 [Arguments] ${namespace}
746 ${bbsim_apps} Create List bbsim
747 ${label_key} Set Variable app
748 ${bbsim_label_value} Set Variable bbsim
749 Restart Pod By Label ${namespace} ${label_key} ${bbsim_label_value}
750 Sleep 5s
751 Wait For Pods Ready ${namespace} ${bbsim_apps}
752
TorstenThiemef3e492c2021-11-08 15:25:48 +0000753Get BBSIM Svc and Webserver Port
754 [Documentation] This keyword gets bbsim instance and bbsim webserver port from image url
755 @{words}= Split String ${image_url} /
756 ${SvcAndPort} Set Variable @{words}[2]
757 ${bbsim_svc} ${webserver_port}= Split String ${SvcAndPort} : 1
758 ${svc_return} Set Variable If '${bbsim_svc}'!='${EMPTY}' ${bbsim_svc} ${BBSIM_INSTANCE}
759 ${port_return} Set Variable If '${webserver_port}'!='${EMPTY}' ${webserver_port} ${BBSIM_WEBSERVER_PORT}
760 [Return] ${svc_return} ${port_return}
761
Hardik Windlass17bd1142021-03-12 08:15:25 +0000762Setup Suite
763 [Documentation] Set up the test suite
TorstenThiemef3e492c2021-11-08 15:25:48 +0000764 Start Logging Setup or Teardown Setup-${SUITE NAME}
Hardik Windlass17bd1142021-03-12 08:15:25 +0000765 Common Test Suite Setup
TorstenThiemef3e492c2021-11-08 15:25:48 +0000766 Run Keyword If ${logging} Collect Logs
767 Stop Logging Setup or Teardown Setup-${SUITE NAME}
Hardik Windlass17bd1142021-03-12 08:15:25 +0000768
769Teardown Suite
770 [Documentation] Tear down steps for the suite
TorstenThiemef3e492c2021-11-08 15:25:48 +0000771 Start Logging Setup or Teardown Teardown-${SUITE NAME}
772 # stop port forwarding if still running
773 Run Keyword If ${portFwdHandle}!=None Terminate Process ${portFwdHandle} kill=true
Hardik Windlass17bd1142021-03-12 08:15:25 +0000774 Run Keyword If ${has_dataplane} Clean Up Linux
TorstenThiemef3e492c2021-11-08 15:25:48 +0000775 Run Keyword If ${logging} Collect Logs
776 Stop Logging Setup or Teardown Teardown-${SUITE NAME}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000777 Close All ONOS SSH Connections