Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 1 | # 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 *** |
| 17 | Documentation Tests ONU Software Upgrade |
| 18 | Suite Setup Setup Suite |
| 19 | Test Setup Setup |
| 20 | Test Teardown Teardown |
| 21 | Suite Teardown Teardown Suite |
| 22 | Library Collections |
| 23 | Library String |
| 24 | Library OperatingSystem |
| 25 | Library XML |
| 26 | Library RequestsLibrary |
| 27 | Library ../../libraries/DependencyLibrary.py |
| 28 | Resource ../../libraries/onos.robot |
| 29 | Resource ../../libraries/voltctl.robot |
| 30 | Resource ../../libraries/voltha.robot |
| 31 | Resource ../../libraries/utils.robot |
| 32 | Resource ../../libraries/k8s.robot |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 33 | Resource ../../libraries/bbsim.robot |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 34 | Resource ../../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 Windlass | a9b3826 | 2021-10-27 08:14:22 +0000 | [diff] [blame] | 45 | ${INFRA_NAMESPACE} default |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 46 | # 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 Windlass | d8ecbef | 2021-10-19 06:12:16 +0000 | [diff] [blame] | 61 | # logging flag to enable Voltha Components Logging, can be passed via the command line too |
| 62 | # example: -v logging:False |
| 63 | ${logging} True |
| 64 | |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 65 | # ONU Image to test for Upgrade needs to be passed in the following format: |
Hardik Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 66 | ${image_version} ${EMPTY} |
| 67 | # Example value: BBSM_IMG_00002 |
| 68 | ${image_url} ${EMPTY} |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 69 | # Example value: http://bbsim0:50074/images/software-image.img |
Hardik Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 70 | ${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 Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 77 | # Example value: 0 |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 78 | |
TorstenThieme | ceb9a20 | 2022-03-04 08:27:54 +0000 | [diff] [blame] | 79 | # 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 Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 93 | *** Test Cases *** |
| 94 | Test 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 Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 99 | ... Note: The TC expects the image url and other parameters to be common for all ONUs on all BBSim |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 100 | ... Check [VOL-3903] for more details |
| 101 | [Tags] functional ONUUpgrade |
| 102 | [Setup] Start Logging ONUUpgrade |
| 103 | [Teardown] Run Keywords Collect Logs |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 104 | ... AND Delete All Devices and Verify |
TorstenThieme | ceb9a20 | 2022-03-04 08:27:54 +0000 | [diff] [blame] | 105 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 106 | ... AND Stop Logging ONUUpgrade |
| 107 | Do ONU Upgrade All OLTs |
| 108 | |
| 109 | Test 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 |
| 117 | [Tags] functional ONUUpgradeAllCombies |
| 118 | [Setup] Start Logging ONUUpgradeAllCombies |
| 119 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 120 | ... AND Delete All Devices and Verify |
| 121 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 122 | ... AND Stop Logging ONUUpgradeAllCombies |
| 123 | ${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} |
| 129 | Do ONU Upgrade All OLTs ${item['activate']} ${item['commit']} |
| 130 | Delete All Devices and Verify |
| 131 | Restart And Check BBSIM ${NAMESPACE} |
| 132 | END |
| 133 | |
| 134 | Test 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 |
| 139 | [Tags] functional ONUUpgradeDownloadWrongUrl |
| 140 | [Setup] Start Logging ONUUpgradeDownloadWrongUrl |
| 141 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 142 | ... AND Delete All Devices and Verify |
| 143 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 144 | ... AND Stop Logging ONUUpgradeDownloadWrongUrl |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 145 | # 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 |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 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} |
TorstenThieme | ceb9a20 | 2022-03-04 08:27:54 +0000 | [diff] [blame] | 154 | Do ONU Upgrade Download Failure Per OLT ${bbsim_pod} ${olt_serial_number} |
| 155 | ... 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 |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 158 | 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 | |
TorstenThieme | ceb9a20 | 2022-03-04 08:27:54 +0000 | [diff] [blame] | 166 | Test 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 |
| 173 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 174 | ... AND Delete All Devices and Verify |
| 175 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 176 | ... AND Stop Logging ONUUpgradeDownloadFailure |
| 177 | # 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} |
| 186 | Do ONU Upgrade Download Failure Per OLT ${bbsim_pod} ${olt_serial_number} |
| 187 | ... 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 |
| 195 | |
| 196 | Test ONU Upgrade Correct Indication of Downloading Abort |
| 197 | [Documentation] Validates the ONU Upgrade downloading abort will be indicated correctly and |
| 198 | ... 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 |
| 201 | [Tags] functional ONUUpgradeDownloadingAbort |
| 202 | [Setup] Start Logging ONUUpgradeDownloadingAbort |
| 203 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 204 | ... AND Delete All Devices and Verify |
| 205 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 206 | ... AND Stop Logging ONUUpgradeDownloadingAbort |
| 207 | # 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} |
| 216 | Do ONU Upgrade Downloading Abort Per OLT ${bbsim_pod} ${olt_serial_number} |
| 217 | 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 | |
| 225 | Test ONU Upgrade Correct Indication of Downloaded Abort |
| 226 | [Documentation] Validates the ONU Upgrade downloaded abort will be indicated correctly and |
| 227 | ... doesn't affect the system functionality |
| 228 | ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable |
| 229 | ... Check [VOL-4320] for more details |
| 230 | [Tags] functional ONUUpgradeDownloadedAbort |
| 231 | [Setup] Start Logging ONUUpgradeDownloadedAbort |
| 232 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 233 | ... AND Delete All Devices and Verify |
| 234 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 235 | ... AND Stop Logging ONUUpgradeDownloadedAbort |
| 236 | # 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} |
| 245 | Do ONU Upgrade Downloaded Abort Per OLT ${bbsim_pod} ${olt_serial_number} |
| 246 | 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 |
| 253 | |
| 254 | Test 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 | |
| 283 | Test 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 | |
| 312 | Test 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 | |
| 352 | Test 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 | |
| 393 | Test 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 Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 426 | *** Keywords *** |
TorstenThieme | ceb9a20 | 2022-03-04 08:27:54 +0000 | [diff] [blame] | 427 | Do ONU Upgrade All OLTs |
| 428 | [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} |
| 439 | Do ONU Upgrade Per OLT ${bbsim_pod} ${olt_serial_number} ${activate_on_success} ${commit_on_success} |
| 440 | 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 | |
| 448 | Do ONU Upgrade Per OLT |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 449 | [Documentation] This keyword performs the ONU Upgrade test on single OLT |
TorstenThieme | ceb9a20 | 2022-03-04 08:27:54 +0000 | [diff] [blame] | 450 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${activate_on_success}=${image_activate_on_success} |
| 451 | ... ${commit_on_success}=${image_commit_on_success} |
| 452 | [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id} |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 453 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 454 | ${src}= Set Variable ${hosts.src[${I}]} |
| 455 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 456 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 457 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
Hardik Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 458 | # Download Image |
| 459 | Download ONU Device Image ${image_version} ${image_url} ${image_vendor} |
TorstenThieme | ceb9a20 | 2022-03-04 08:27:54 +0000 | [diff] [blame] | 460 | ... ${activate_on_success} ${commit_on_success} |
Hardik Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 461 | ... ${image_crc} ${onu_device_id} |
TorstenThieme | ceb9a20 | 2022-03-04 08:27:54 +0000 | [diff] [blame] | 462 | ${imageState}= Run Keyword If '${activate_on_success}'=='true' and '${commit_on_success}'=='false' |
| 463 | ... Set Variable IMAGE_ACTIVE |
| 464 | ... ELSE IF '${activate_on_success}'=='true' and '${commit_on_success}'=='true' |
Hardik Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 465 | ... Set Variable IMAGE_COMMITTED |
| 466 | ... ELSE Set Variable IMAGE_INACTIVE |
TorstenThieme | ceb9a20 | 2022-03-04 08:27:54 +0000 | [diff] [blame] | 467 | ${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 Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 469 | ... 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 |
TorstenThieme | ceb9a20 | 2022-03-04 08:27:54 +0000 | [diff] [blame] | 475 | ${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 Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 479 | ... 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 |
TorstenThieme | ceb9a20 | 2022-03-04 08:27:54 +0000 | [diff] [blame] | 484 | Run Keyword If '${commit_on_success}'=='false' Run Keywords |
Hardik Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 485 | ... 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 Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 490 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod} |
| 491 | ... ${src['onu']} software_image_committed |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 492 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
TorstenThieme | ceb9a20 | 2022-03-04 08:27:54 +0000 | [diff] [blame] | 493 | # 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 Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 495 | END |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 496 | |
TorstenThieme | ceb9a20 | 2022-03-04 08:27:54 +0000 | [diff] [blame] | 497 | Do ONU Upgrade Download Failure Per OLT |
| 498 | [Documentation] This keyword performs the ONU Upgrade Dowload Failure test on single OLT |
| 499 | [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 |
| 502 | [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image INVALID_IMAGE ${onu_device_id} |
| 503 | 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 |
| 509 | Download ONU Device Image INVALID_IMAGE ${url} ${image_vendor} |
| 510 | ... ${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} |
| 512 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status INVALID_IMAGE |
| 513 | ... ${onu_device_id} ${dwlstate} ${reason} ${imgstate} |
| 514 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 515 | # 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} |
| 517 | END |
| 518 | |
| 519 | Do ONU Upgrade Downloading Abort Per OLT |
| 520 | [Documentation] This keyword performs the ONU Upgrade Downloading Abort test on single OLT |
| 521 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url} |
| 522 | [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id} |
| 523 | 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} |
| 532 | ... DOWNLOAD_STARTED CANCELLED_ON_REQUEST IMAGE_DOWNLOADING |
| 533 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 534 | ... ${onu_device_id} DOWNLOAD_CANCELLED CANCELLED_ON_REQUEST IMAGE_UNKNOWN |
| 535 | # !!! Expected is image is not visible in list !!! |
| 536 | # Uncomment next lines in case of backporting of VOL-4302 (BBSIM) |
| 537 | # Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 538 | # ... ${image_version} False False False image_should_not_in_list=True |
| 539 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 540 | END |
| 541 | |
| 542 | Do ONU Upgrade Downloaded Abort Per OLT |
| 543 | [Documentation] This keyword performs the ONU Upgrade Downloaded Abort test on single OLT |
| 544 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url} |
| 545 | [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id} |
| 546 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 547 | ${src}= Set Variable ${hosts.src[${I}]} |
| 548 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 549 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
| 550 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 551 | # Download Image |
| 552 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 553 | ... false false ${image_crc} ${onu_device_id} |
| 554 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 555 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE |
| 556 | Abort ONU Device Image ${image_version} ${onu_device_id} |
| 557 | ... DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_INACTIVE |
| 558 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 559 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_INACTIVE |
| 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 | |
| 565 | Do 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} |
| 580 | Abort ONU Device Image ${image_version} ${onu_device_id} |
| 581 | ... DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVATING |
| 582 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 583 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVATION_ABORTED |
| 584 | # Uncomment next lines in case of backporting of VOL-4302 (BBSIM) |
| 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 | |
| 590 | Do 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 | # Uncomment next lines in case of backporting of VOL-4302 (BBSIM) |
| 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 | |
| 617 | Do 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 | # Uncomment next commented lines in case of backporting HTML request in BBSIM |
| 627 | # ${Images_Count_Start}= Get Images Count |
| 628 | # Download Image |
| 629 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 630 | ... false false ${image_crc} ${onu_device_id} |
| 631 | # After download of image, check image counter of BBSIM, has to be incremented by 2, because bbsim increments counter |
| 632 | # whenever openonu adapter touch the image, so one increment for check image is available and one for downloading |
| 633 | # ${Images_Count_First}= Get Images Count |
| 634 | # ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2 |
| 635 | # Should Be Equal as Integers ${Images_Count_First} ${Images_Count_Start} Count of image download not correct! |
| 636 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 637 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE |
| 638 | Activate ONU Device Image ${image_version} false ${onu_device_id} |
| 639 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 640 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_ACTIVE |
| 641 | Commit ONU Device Image ${image_version} ${onu_device_id} |
| 642 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 643 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED |
| 644 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 645 | ... ${image_version} True True True |
| 646 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod} |
| 647 | ... ${src['onu']} software_image_committed |
| 648 | Abort ONU Device Image ${image_version} ${onu_device_id} |
| 649 | ... DOWNLOAD_UNKNOWN NO_ERROR IMAGE_UNKNOWN |
| 650 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 651 | ... ${onu_device_id} DOWNLOAD_UNKNOWN NO_ERROR IMAGE_UNKNOWN |
| 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 | |
| 666 | Do 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 | # Uncomment next commented lines in case of backporting HTML request in BBSIM |
| 676 | # ${Images_Count_Start}= Get Images Count |
| 677 | # Download Image |
| 678 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 679 | ... true true ${image_crc} ${onu_device_id} |
| 680 | # After download of image, check image counter of BBSIM, has to be incremented by 2, because bbsim increments counter |
| 681 | # whenever openonu adapter touch the image, so one increment for check image is available and one for downloading |
| 682 | # ${Images_Count_First}= Get Images Count |
| 683 | # ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2 |
| 684 | # Should Be Equal as Integers ${Images_Count_First} ${Images_Count_Start} Count of image download not correct! |
| 685 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 686 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED |
| 687 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 688 | ... ${image_version} True True True |
| 689 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod} |
| 690 | ... ${src['onu']} software_image_committed |
| 691 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 692 | # ${Images_Count_Intermediate}= Get Images Count |
| 693 | # Repeat download of same image, check image counter of BBSIM, has to be not incremented, because no download from |
| 694 | # server will be executed, the cached one from openonu-adapter will taken |
| 695 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 696 | ... false false ${image_crc} ${onu_device_id} |
| 697 | # ${Images_Count_End}= Get Images Count |
| 698 | # Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Intermediate} Count of image download not correct! |
| 699 | Remove Adapter Image ${image_version} ${onu_device_id} |
| 700 | END |
| 701 | |
| 702 | Do ONU Upgrade Image Download Simultaneously |
| 703 | [Documentation] This keyword performs the ONU Upgrade Image Download Simultaneously on all ONUs test |
| 704 | [Arguments] ${url}=${image_url} |
| 705 | [Teardown] Remove Adapter Image from ONUs ${image_version} ${list_onus} |
| 706 | # collect all ONU's device ids |
| 707 | ${list_onus} Create List |
| 708 | Build ONU Device Id List ${list_onus} |
| 709 | # prepare OLT-SN BBSIM-POD releation dictionary for later fast access |
| 710 | ${olt_bbsim_dict}= Create Dictionary |
| 711 | FOR ${J} IN RANGE 0 ${num_olts} |
| 712 | ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn] |
| 713 | ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J} |
| 714 | ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel} |
| 715 | Set To Dictionary ${olt_bbsim_dict} ${olt_serial_number} ${bbsim_pod} |
| 716 | END |
| 717 | # Uncomment next commented lines in case of backporting HTML request in BBSIM |
| 718 | # ${Images_Count_Start}= Get Images Count |
| 719 | # Download Image to all ONUs simultaneously |
| 720 | ${onu_device_ids} = Catenate @{list_onus} |
| 721 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 722 | ... true true ${image_crc} ${onu_device_ids} |
| 723 | # do all the check stuff |
| 724 | FOR ${onu_device_id} IN @{list_onus} |
| 725 | Log ${onu_device_id} |
| 726 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 727 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED |
| 728 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 729 | ... ${image_version} True True True |
| 730 | END |
| 731 | # last but not least check bbsim |
| 732 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 733 | ${src}= Set Variable ${hosts.src[${I}]} |
| 734 | ${bbsim_pod}= Get From Dictionary ${olt_bbsim_dict} ${src['olt']} |
| 735 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod} |
| 736 | ... ${src['onu']} software_image_committed |
| 737 | END |
| 738 | # ${Images_Count_End}= Get Images Count |
| 739 | # ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2 |
| 740 | # Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Start} Count of image download not correct! |
| 741 | |
| 742 | Restart And Check BBSIM |
| 743 | [Documentation] This keyword restarts bbsim and waits for it to come up again |
| 744 | ... Following steps will be executed: |
| 745 | ... - restart bbsim adaptor |
| 746 | ... - check bbsim adaptor is ready again |
| 747 | [Arguments] ${namespace} |
| 748 | ${bbsim_apps} Create List bbsim |
| 749 | ${label_key} Set Variable app |
| 750 | ${bbsim_label_value} Set Variable bbsim |
| 751 | Restart Pod By Label ${namespace} ${label_key} ${bbsim_label_value} |
| 752 | Sleep 5s |
| 753 | Wait For Pods Ready ${namespace} ${bbsim_apps} |
| 754 | |
| 755 | Get BBSIM Svc and Webserver Port |
| 756 | [Documentation] This keyword gets bbsim instance and bbsim webserver port from image url |
| 757 | @{words}= Split String ${image_url} / |
| 758 | ${SvcAndPort} Set Variable @{words}[2] |
| 759 | ${bbsim_svc} ${webserver_port}= Split String ${SvcAndPort} : 1 |
| 760 | ${svc_return} Set Variable If '${bbsim_svc}'!='${EMPTY}' ${bbsim_svc} ${BBSIM_INSTANCE} |
| 761 | ${port_return} Set Variable If '${webserver_port}'!='${EMPTY}' ${webserver_port} ${BBSIM_WEBSERVER_PORT} |
| 762 | [Return] ${svc_return} ${port_return} |
| 763 | |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 764 | Setup Suite |
| 765 | [Documentation] Set up the test suite |
| 766 | Common Test Suite Setup |
| 767 | |
| 768 | Teardown Suite |
| 769 | [Documentation] Tear down steps for the suite |
| 770 | Run Keyword If ${has_dataplane} Clean Up Linux |
TorstenThieme | 4e2168e | 2021-06-22 14:01:47 +0000 | [diff] [blame] | 771 | Close All ONOS SSH Connections |