blob: e6911b2408361636bf18c955f64b1bcbfc6574f6 [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
45# For below variable value, using deployment name as using grep for
46# parsing radius pod name, we can also use full radius pod name
47${RESTART_POD_NAME} radius
48${timeout} 60s
49${of_id} 0
50${logical_id} 0
51${has_dataplane} True
52${teardown_device} False
53${scripts} ../../scripts
54
55# Per-test logging on failure is turned off by default; set this variable to enable
56${container_log_dir} ${None}
57
58${suppressaddsubscriber} True
59
Hardik Windlassf0ce2062021-07-23 11:04:39 +000060# logging flag to enable Collect Logs, can be passed via the command line too
61# example: -v logging:False
62${logging} True
63
Hardik Windlass17bd1142021-03-12 08:15:25 +000064# ONU Image to test for Upgrade needs to be passed in the following format:
Hardik Windlassba1bd272021-06-22 08:29:33 +000065${image_version} ${EMPTY}
66# Example value: BBSM_IMG_00002
67${image_url} ${EMPTY}
Hardik Windlass17bd1142021-03-12 08:15:25 +000068# Example value: http://bbsim0:50074/images/software-image.img
Hardik Windlassba1bd272021-06-22 08:29:33 +000069${image_vendor} ${EMPTY}
70# Example value: BBSM
71${image_activate_on_success} ${EMPTY}
72# Example value: false
73${image_commit_on_success} ${EMPTY}
74# Example value: false
75${image_crc} ${EMPTY}
Hardik Windlass17bd1142021-03-12 08:15:25 +000076# Example value: 0
Hardik Windlass17bd1142021-03-12 08:15:25 +000077
78*** Test Cases ***
79Test ONU Upgrade
80 [Documentation] Validates the ONU Upgrade doesn't affect the system functionality
81 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
82 ... Requirement: Pass image details in following parameters in the robot command
83 ... onu_image_name, onu_image_url, onu_image_version, onu_image_crc, onu_image_local_dir
Hardik Windlassc310c7c2021-03-25 13:16:59 +000084 ... 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 +000085 ... Check [VOL-3903] for more details
86 [Tags] functional ONUUpgrade
87 [Setup] Start Logging ONUUpgrade
TorstenThieme37165402021-09-03 11:39:40 +000088 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
Hardik Windlass17bd1142021-03-12 08:15:25 +000089 ... AND Delete All Devices and Verify
TorstenThieme37165402021-09-03 11:39:40 +000090 ... AND Restart And Check BBSIM ${NAMESPACE}
91 ... AND Stop Logging ONUUpgrade
TorstenThieme9cf8bd52021-07-29 10:53:55 +000092 Test ONU Upgrade All OLTs
93
94Test ONU Upgrade All Activate and Commit Combinations
95 [Documentation] Validates the ONU Upgrade doesn't affect the system functionality by use all combinations of
96 ... flags activate_on_success and commit_on_success
97 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
98 ... Requirement: Pass image details in following parameters in the robot command
99 ... onu_image_name, onu_image_url, onu_image_version, onu_image_crc, onu_image_local_dir
100 ... Note: The TC expects the image url and other parameters to be common for all ONUs on all BBSim
101 ... Check [VOL-4250] for more details
TorstenThieme37165402021-09-03 11:39:40 +0000102 [Tags] functional ONUUpgradeAllCombies
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000103 [Setup] Start Logging ONUUpgradeAllCombies
TorstenThieme37165402021-09-03 11:39:40 +0000104 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000105 ... AND Delete All Devices and Verify
TorstenThieme37165402021-09-03 11:39:40 +0000106 ... AND Restart And Check BBSIM ${NAMESPACE}
107 ... AND Stop Logging ONUUpgradeAllCombies
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000108 ${false_false}= Create Dictionary activate false commit false
109 ${true_false}= Create Dictionary activate true commit false
110 ${false_true}= Create Dictionary activate false commit true
111 ${true_true}= Create Dictionary activate true commit true
112 ${flag_list}= Create List ${false_false} ${true_false} ${false_true} ${true_true}
113 FOR ${item} IN @{flag_list}
114 Test ONU Upgrade All OLTs ${item['activate']} ${item['commit']}
115 Delete All Devices and Verify
TorstenThieme37165402021-09-03 11:39:40 +0000116 Restart And Check BBSIM ${NAMESPACE}
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000117 END
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000118
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000119Test ONU Upgrade Correct Indication of Download Wrong Url
120 [Documentation] Validates the ONU Upgrade download from wrong URL failure will be indicated correctly
121 ... and doesn't affect the system functionality
122 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
123 ... Check [VOL-4257] for more details
TorstenThieme7cb9de72021-08-24 09:40:57 +0000124 [Tags] functional ONUUpgradeDownloadWrongUrl
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000125 [Setup] Start Logging ONUUpgradeDownloadWrongUrl
TorstenThieme37165402021-09-03 11:39:40 +0000126 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000127 ... AND Delete All Devices and Verify
TorstenThieme37165402021-09-03 11:39:40 +0000128 ... AND Restart And Check BBSIM ${NAMESPACE}
129 ... AND Stop Logging ONUUpgradeDownloadWrongUrl
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000130 # Add OLT device
131 Setup
132 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
133 Run Keyword If ${has_dataplane} Clean Up Linux
134 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
135 FOR ${J} IN RANGE 0 ${num_olts}
136 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
137 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
138 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
139 Test ONU Upgrade Download Failure Per OLT ${bbsim_pod} ${olt_serial_number}
TorstenThieme7cb9de72021-08-24 09:40:57 +0000140 ... url=http://bbsim0:50074/images/wrong-image.img$
141 ... dwl_dwlstate=DOWNLOAD_FAILED dwl_reason=INVALID_URL dwl_imgstate=IMAGE_UNKNOWN
142 ... dwlstate=DOWNLOAD_UNKNOWN reason=NO_ERROR imgstate=IMAGE_UNKNOWN
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000143 List ONUs ${NAMESPACE} ${bbsim_pod}
144 END
145 # Additional Verification
146 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
147 Setup
148 Run Keyword If ${has_dataplane} Clean Up Linux
149 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
150
TorstenThieme7cb9de72021-08-24 09:40:57 +0000151Test ONU Upgrade Correct Indication of Download Failure
152 [Documentation] Validates the ONU Upgrade download failure will be indicated correctly and
153 ... doesn't affect the system functionality
154 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
155 ... Check [VOL-3935] for more details
156 [Tags] functional ONUUpgradeDownloadFailure
157 [Setup] Start Logging ONUUpgradeDownloadFailure
TorstenThieme37165402021-09-03 11:39:40 +0000158 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
TorstenThieme7cb9de72021-08-24 09:40:57 +0000159 ... AND Delete All Devices and Verify
TorstenThieme37165402021-09-03 11:39:40 +0000160 ... AND Restart And Check BBSIM ${NAMESPACE}
161 ... AND Stop Logging ONUUpgradeDownloadFailure
TorstenThieme7cb9de72021-08-24 09:40:57 +0000162 # Add OLT device
163 Setup
164 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
165 Run Keyword If ${has_dataplane} Clean Up Linux
166 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
167 FOR ${J} IN RANGE 0 ${num_olts}
168 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
169 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
170 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
171 Test ONU Upgrade Download Failure Per OLT ${bbsim_pod} ${olt_serial_number}
172 ... dwlstate=DOWNLOAD_FAILED reason=CANCELLED_ON_ONU_STATE imgstate=IMAGE_UNKNOWN
173 List ONUs ${NAMESPACE} ${bbsim_pod}
174 END
175 # Additional Verification
176 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
177 Setup
178 Run Keyword If ${has_dataplane} Clean Up Linux
179 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000180
TorstenThieme37165402021-09-03 11:39:40 +0000181Test ONU Upgrade Correct Indication of Download Abort
182 [Documentation] Validates the ONU Upgrade download abort will be indicated correctly and
183 ... doesn't affect the system functionality
184 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
185 ... Check [VOL-4318] for more details
186 [Tags] functional ONUUpgradeDownloadAbort
187 [Setup] Start Logging ONUUpgradeDownloadAbort
188 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
189 ... AND Delete All Devices and Verify
TorstenThiemec96d0962021-09-10 10:01:39 +0000190 ... AND Restart And Check BBSIM ${NAMESPACE}
TorstenThieme37165402021-09-03 11:39:40 +0000191 ... AND Stop Logging ONUUpgradeDownloadAbort
192 # Add OLT device
193 Setup
194 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
195 Run Keyword If ${has_dataplane} Clean Up Linux
196 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
197 FOR ${J} IN RANGE 0 ${num_olts}
198 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
199 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
200 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
201 Test ONU Upgrade Download Abort Per OLT ${bbsim_pod} ${olt_serial_number}
202 List ONUs ${NAMESPACE} ${bbsim_pod}
203 END
204 # Additional Verification
205 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
206 Setup
207 Run Keyword If ${has_dataplane} Clean Up Linux
208 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
209
TorstenThiemec96d0962021-09-10 10:01:39 +0000210Test ONU Upgrade Correct Indication of Activate Abort
211 [Documentation] Validates the ONU Upgrade activate abort will be indicated correctly and
212 ... doesn't affect the system functionality
213 ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
214 ... Check [VOL-4319] for more details
215 [Tags] functional ONUUpgradeActivateAbort
216 [Setup] Start Logging ONUUpgradeActivateAbort
217 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
218 ... AND Delete All Devices and Verify
219 ... AND Restart And Check BBSIM ${NAMESPACE}
220 ... AND Stop Logging ONUUpgradeActivateAbort
221 # Add OLT device
222 Setup
223 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
224 Run Keyword If ${has_dataplane} Clean Up Linux
225 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
226 FOR ${J} IN RANGE 0 ${num_olts}
227 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
228 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
229 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
230 Test ONU Upgrade Activate Abort Per OLT ${bbsim_pod} ${olt_serial_number}
231 List ONUs ${NAMESPACE} ${bbsim_pod}
232 END
233 # Additional Verification
234 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
235 Setup
236 Run Keyword If ${has_dataplane} Clean Up Linux
237 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000238
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000239*** Keywords ***
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000240Test ONU Upgrade All OLTs
241 [Documentation] This keyword performs the ONU Upgrade test on all OLTs
242 [Arguments] ${activate_on_success}=${image_activate_on_success} ${commit_on_success}=${image_commit_on_success}
243 # Add OLT device
244 Setup
245 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
246 Run Keyword If ${has_dataplane} Clean Up Linux
247 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
248 FOR ${J} IN RANGE 0 ${num_olts}
249 ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn]
250 ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
251 ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
252 Test ONU Upgrade Per OLT ${bbsim_pod} ${olt_serial_number} ${activate_on_success} ${commit_on_success}
253 List ONUs ${NAMESPACE} ${bbsim_pod}
254 END
255 # Additional Verification
256 Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
257 Setup
258 Run Keyword If ${has_dataplane} Clean Up Linux
259 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
260
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000261Test ONU Upgrade Per OLT
262 [Documentation] This keyword performs the ONU Upgrade test on single OLT
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000263 [Arguments] ${bbsim_pod} ${olt_serial_number} ${activate_on_success}=${image_activate_on_success}
264 ... ${commit_on_success}=${image_commit_on_success}
Hardik Windlass17bd1142021-03-12 08:15:25 +0000265 FOR ${I} IN RANGE 0 ${num_all_onus}
266 ${src}= Set Variable ${hosts.src[${I}]}
267 ${dst}= Set Variable ${hosts.dst[${I}]}
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000268 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
Hardik Windlass17bd1142021-03-12 08:15:25 +0000269 ${onu_device_id}= Get Device ID From SN ${src['onu']}
Hardik Windlassba1bd272021-06-22 08:29:33 +0000270 # Download Image
271 Download ONU Device Image ${image_version} ${image_url} ${image_vendor}
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000272 ... ${activate_on_success} ${commit_on_success}
Hardik Windlassba1bd272021-06-22 08:29:33 +0000273 ... ${image_crc} ${onu_device_id}
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000274 ${imageState}= Run Keyword If '${activate_on_success}'=='true' and '${commit_on_success}'=='false'
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000275 ... Set Variable IMAGE_ACTIVE
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000276 ... ELSE IF '${activate_on_success}'=='true' and '${commit_on_success}'=='true'
Hardik Windlassba1bd272021-06-22 08:29:33 +0000277 ... Set Variable IMAGE_COMMITTED
278 ... ELSE Set Variable IMAGE_INACTIVE
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000279 ${activated}= Set Variable If '${activate_on_success}'=='true' True False
280 ${committed}= Set Variable If '${activate_on_success}'=='true' and '${commit_on_success}'=='true'
Hardik Windlassba1bd272021-06-22 08:29:33 +0000281 ... True False
282 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
283 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR ${imageState}
284 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
285 ... ${image_version} ${committed} ${activated} True
286 # Activate Image
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000287 ${imageState}= Set Variable If '${commit_on_success}'=='true' IMAGE_COMMITTED IMAGE_ACTIVE
288 ${committed}= Set Variable If '${commit_on_success}'=='true' True False
289 Run Keyword If '${activate_on_success}'=='false' Run Keywords
290 ... Activate ONU Device Image ${image_version} ${commit_on_success} ${onu_device_id}
Hardik Windlassba1bd272021-06-22 08:29:33 +0000291 ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
292 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR ${imageState}
293 ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
294 ... ${image_version} ${committed} True True
295 # Commit Image
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000296 Run Keyword If '${commit_on_success}'=='false' Run Keywords
Hardik Windlassba1bd272021-06-22 08:29:33 +0000297 ... Commit ONU Device Image ${image_version} ${onu_device_id}
298 ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
299 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED
300 ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
301 ... ${image_version} True True True
Hardik Windlassc310c7c2021-03-25 13:16:59 +0000302 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod}
303 ... ${src['onu']} software_image_committed
Hardik Windlass17bd1142021-03-12 08:15:25 +0000304 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
305 END
Hardik Windlass17bd1142021-03-12 08:15:25 +0000306
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000307Test ONU Upgrade Download Failure Per OLT
308 [Documentation] This keyword performs the ONU Upgrade Dowload Failure test on single OLT
TorstenThieme7cb9de72021-08-24 09:40:57 +0000309 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
310 ... ${dwl_dwlstate}=DOWNLOAD_STARTED ${dwl_reason}=NO_ERROR ${dwl_imgstate}=IMAGE_UNKNOWN
311 ... ${dwlstate}=DOWNLOAD_SUCCEEDED ${reason}=NO_ERROR ${imgstate}=IMAGE_INACTIVE
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000312 FOR ${I} IN RANGE 0 ${num_all_onus}
313 ${src}= Set Variable ${hosts.src[${I}]}
314 ${dst}= Set Variable ${hosts.dst[${I}]}
315 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
316 ${onu_device_id}= Get Device ID From SN ${src['onu']}
317 # Download Image
TorstenThieme9cf8bd52021-07-29 10:53:55 +0000318 Download ONU Device Image INVALID_IMAGE ${url} ${image_vendor}
TorstenThieme7cb9de72021-08-24 09:40:57 +0000319 ... ${image_activate_on_success} ${image_commit_on_success} ${image_crc} ${onu_device_id}
320 ... download_state=${dwl_dwlstate} expected_reason=${dwl_reason} image_state=${dwl_imgstate}
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000321 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status INVALID_IMAGE
TorstenThieme7cb9de72021-08-24 09:40:57 +0000322 ... ${onu_device_id} ${dwlstate} ${reason} ${imgstate}
TorstenThiemeeb2440e2021-07-20 10:45:05 +0000323 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
324 END
325
TorstenThieme37165402021-09-03 11:39:40 +0000326Test ONU Upgrade Download Abort Per OLT
TorstenThiemec96d0962021-09-10 10:01:39 +0000327 [Documentation] This keyword performs the ONU Upgrade Download Abort test on single OLT
TorstenThieme37165402021-09-03 11:39:40 +0000328 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
329 FOR ${I} IN RANGE 0 ${num_all_onus}
330 ${src}= Set Variable ${hosts.src[${I}]}
331 ${dst}= Set Variable ${hosts.dst[${I}]}
332 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
333 ${onu_device_id}= Get Device ID From SN ${src['onu']}
334 # Download Image
335 Download ONU Device Image ${image_version} ${url} ${image_vendor}
336 ... ${image_activate_on_success} ${image_commit_on_success} ${image_crc} ${onu_device_id}
337 Abort ONU Device Image ${image_version} ${onu_device_id}
338 ... DOWNLOAD_CANCELLED CANCELLED_ON_REQUEST IMAGE_DOWNLOADING
339 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
340 ... ${onu_device_id} DOWNLOAD_CANCELLED CANCELLED_ON_REQUEST IMAGE_DOWNLOADING
341 # !!! Expected is image is not visible in list !!!
342 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
343 ... ${image_version} False False True
344 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
345 END
346
TorstenThiemec96d0962021-09-10 10:01:39 +0000347Test ONU Upgrade Activate Abort Per OLT
348 [Documentation] This keyword performs the ONU Upgrade Activate Abort test on single OLT
349 [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url}
350 FOR ${I} IN RANGE 0 ${num_all_onus}
351 ${src}= Set Variable ${hosts.src[${I}]}
352 ${dst}= Set Variable ${hosts.dst[${I}]}
353 Continue For Loop If "${olt_serial_number}"!="${src['olt']}"
354 ${onu_device_id}= Get Device ID From SN ${src['onu']}
355 # Download Image
356 Download ONU Device Image ${image_version} ${url} ${image_vendor}
357 ... false false ${image_crc} ${onu_device_id}
358 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
359 ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE
360 Activate ONU Device Image ${image_version} true ${onu_device_id}
361 Abort ONU Device Image ${image_version} ${onu_device_id}
362 ... DOWNLOAD_CANCELLED CANCELLED_ON_REQUEST IMAGE_ACTIVATING
363 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version}
364 ... ${onu_device_id} DOWNLOAD_CANCELLED CANCELLED_ON_REQUEST IMAGE_ACTIVATING
365 # !!! Expected is image is not visible in list !!!
366 Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id}
367 ... ${image_version} False True True
368 Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber}
369 END
370
TorstenThieme37165402021-09-03 11:39:40 +0000371Restart And Check BBSIM
372 [Documentation] This keyword restarts bbsim and waits for it to come up again
373 ... Following steps will be executed:
374 ... - restart bbsim adaptor
375 ... - check bbsim adaptor is ready again
376 [Arguments] ${namespace}
377 ${bbsim_apps} Create List bbsim
378 ${label_key} Set Variable app
379 ${bbsim_label_value} Set Variable bbsim
380 Restart Pod By Label ${namespace} ${label_key} ${bbsim_label_value}
381 Sleep 5s
382 Wait For Pods Ready ${namespace} ${bbsim_apps}
383
Hardik Windlass17bd1142021-03-12 08:15:25 +0000384Setup Suite
385 [Documentation] Set up the test suite
386 Common Test Suite Setup
387
388Teardown Suite
389 [Documentation] Tear down steps for the suite
390 Run Keyword If ${has_dataplane} Clean Up Linux
TorstenThieme4e2168e2021-06-22 14:01:47 +0000391 Close All ONOS SSH Connections