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 |
| 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 Windlass | f0ce206 | 2021-07-23 11:04:39 +0000 | [diff] [blame] | 60 | # logging flag to enable Collect Logs, can be passed via the command line too |
| 61 | # example: -v logging:False |
| 62 | ${logging} True |
| 63 | |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 64 | # 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] | 65 | ${image_version} ${EMPTY} |
| 66 | # Example value: BBSM_IMG_00002 |
| 67 | ${image_url} ${EMPTY} |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 68 | # Example value: http://bbsim0:50074/images/software-image.img |
Hardik Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 69 | ${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 Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 76 | # Example value: 0 |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 77 | |
| 78 | *** Test Cases *** |
| 79 | Test 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 Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 84 | ... 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] | 85 | ... Check [VOL-3903] for more details |
| 86 | [Tags] functional ONUUpgrade |
| 87 | [Setup] Start Logging ONUUpgrade |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 88 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 89 | ... AND Delete All Devices and Verify |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 90 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 91 | ... AND Stop Logging ONUUpgrade |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 92 | Test ONU Upgrade All OLTs |
| 93 | |
| 94 | Test 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 |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 102 | [Tags] functional ONUUpgradeAllCombies |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 103 | [Setup] Start Logging ONUUpgradeAllCombies |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 104 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 105 | ... AND Delete All Devices and Verify |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 106 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 107 | ... AND Stop Logging ONUUpgradeAllCombies |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 108 | ${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 |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 116 | Restart And Check BBSIM ${NAMESPACE} |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 117 | END |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 118 | |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 119 | Test 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 |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 124 | [Tags] functional ONUUpgradeDownloadWrongUrl |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 125 | [Setup] Start Logging ONUUpgradeDownloadWrongUrl |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 126 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 127 | ... AND Delete All Devices and Verify |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 128 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 129 | ... AND Stop Logging ONUUpgradeDownloadWrongUrl |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 130 | # 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} |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 140 | ... 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 |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 143 | 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 | |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 151 | Test 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 |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 158 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 159 | ... AND Delete All Devices and Verify |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 160 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 161 | ... AND Stop Logging ONUUpgradeDownloadFailure |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 162 | # 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 |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 180 | |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 181 | Test 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 |
| 190 | ... AND Stop Logging ONUUpgradeDownloadAbort |
| 191 | # Add OLT device |
| 192 | Setup |
| 193 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 194 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 195 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 196 | FOR ${J} IN RANGE 0 ${num_olts} |
| 197 | ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn] |
| 198 | ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J} |
| 199 | ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel} |
| 200 | Test ONU Upgrade Download Abort Per OLT ${bbsim_pod} ${olt_serial_number} |
| 201 | List ONUs ${NAMESPACE} ${bbsim_pod} |
| 202 | END |
| 203 | # Additional Verification |
| 204 | Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify |
| 205 | Setup |
| 206 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 207 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 208 | |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 209 | |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 210 | *** Keywords *** |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 211 | Test ONU Upgrade All OLTs |
| 212 | [Documentation] This keyword performs the ONU Upgrade test on all OLTs |
| 213 | [Arguments] ${activate_on_success}=${image_activate_on_success} ${commit_on_success}=${image_commit_on_success} |
| 214 | # Add OLT device |
| 215 | Setup |
| 216 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 217 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 218 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 219 | FOR ${J} IN RANGE 0 ${num_olts} |
| 220 | ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn] |
| 221 | ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J} |
| 222 | ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel} |
| 223 | Test ONU Upgrade Per OLT ${bbsim_pod} ${olt_serial_number} ${activate_on_success} ${commit_on_success} |
| 224 | List ONUs ${NAMESPACE} ${bbsim_pod} |
| 225 | END |
| 226 | # Additional Verification |
| 227 | Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify |
| 228 | Setup |
| 229 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 230 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 231 | |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 232 | Test ONU Upgrade Per OLT |
| 233 | [Documentation] This keyword performs the ONU Upgrade test on single OLT |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 234 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${activate_on_success}=${image_activate_on_success} |
| 235 | ... ${commit_on_success}=${image_commit_on_success} |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 236 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 237 | ${src}= Set Variable ${hosts.src[${I}]} |
| 238 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 239 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 240 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
Hardik Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 241 | # Download Image |
| 242 | Download ONU Device Image ${image_version} ${image_url} ${image_vendor} |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 243 | ... ${activate_on_success} ${commit_on_success} |
Hardik Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 244 | ... ${image_crc} ${onu_device_id} |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 245 | ${imageState}= Run Keyword If '${activate_on_success}'=='true' and '${commit_on_success}'=='false' |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 246 | ... Set Variable IMAGE_ACTIVE |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 247 | ... ELSE IF '${activate_on_success}'=='true' and '${commit_on_success}'=='true' |
Hardik Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 248 | ... Set Variable IMAGE_COMMITTED |
| 249 | ... ELSE Set Variable IMAGE_INACTIVE |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 250 | ${activated}= Set Variable If '${activate_on_success}'=='true' True False |
| 251 | ${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] | 252 | ... True False |
| 253 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 254 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR ${imageState} |
| 255 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 256 | ... ${image_version} ${committed} ${activated} True |
| 257 | # Activate Image |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 258 | ${imageState}= Set Variable If '${commit_on_success}'=='true' IMAGE_COMMITTED IMAGE_ACTIVE |
| 259 | ${committed}= Set Variable If '${commit_on_success}'=='true' True False |
| 260 | Run Keyword If '${activate_on_success}'=='false' Run Keywords |
| 261 | ... Activate ONU Device Image ${image_version} ${commit_on_success} ${onu_device_id} |
Hardik Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 262 | ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 263 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR ${imageState} |
| 264 | ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 265 | ... ${image_version} ${committed} True True |
| 266 | # Commit Image |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 267 | Run Keyword If '${commit_on_success}'=='false' Run Keywords |
Hardik Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 268 | ... Commit ONU Device Image ${image_version} ${onu_device_id} |
| 269 | ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 270 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED |
| 271 | ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 272 | ... ${image_version} True True True |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 273 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod} |
| 274 | ... ${src['onu']} software_image_committed |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 275 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 276 | END |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 277 | |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 278 | Test ONU Upgrade Download Failure Per OLT |
| 279 | [Documentation] This keyword performs the ONU Upgrade Dowload Failure test on single OLT |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 280 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url} |
| 281 | ... ${dwl_dwlstate}=DOWNLOAD_STARTED ${dwl_reason}=NO_ERROR ${dwl_imgstate}=IMAGE_UNKNOWN |
| 282 | ... ${dwlstate}=DOWNLOAD_SUCCEEDED ${reason}=NO_ERROR ${imgstate}=IMAGE_INACTIVE |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 283 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 284 | ${src}= Set Variable ${hosts.src[${I}]} |
| 285 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 286 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
| 287 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 288 | # Download Image |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 289 | Download ONU Device Image INVALID_IMAGE ${url} ${image_vendor} |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 290 | ... ${image_activate_on_success} ${image_commit_on_success} ${image_crc} ${onu_device_id} |
| 291 | ... download_state=${dwl_dwlstate} expected_reason=${dwl_reason} image_state=${dwl_imgstate} |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 292 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status INVALID_IMAGE |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 293 | ... ${onu_device_id} ${dwlstate} ${reason} ${imgstate} |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 294 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 295 | END |
| 296 | |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 297 | Test ONU Upgrade Download Abort Per OLT |
| 298 | [Documentation] This keyword performs the ONU Upgrade Dowload Abort test on single OLT |
| 299 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url} |
| 300 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 301 | ${src}= Set Variable ${hosts.src[${I}]} |
| 302 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 303 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
| 304 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 305 | # Download Image |
| 306 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 307 | ... ${image_activate_on_success} ${image_commit_on_success} ${image_crc} ${onu_device_id} |
| 308 | Abort ONU Device Image ${image_version} ${onu_device_id} |
| 309 | ... DOWNLOAD_CANCELLED CANCELLED_ON_REQUEST IMAGE_DOWNLOADING |
| 310 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 311 | ... ${onu_device_id} DOWNLOAD_CANCELLED CANCELLED_ON_REQUEST IMAGE_DOWNLOADING |
| 312 | # !!! Expected is image is not visible in list !!! |
| 313 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 314 | ... ${image_version} False False True |
| 315 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 316 | END |
| 317 | |
| 318 | Restart And Check BBSIM |
| 319 | [Documentation] This keyword restarts bbsim and waits for it to come up again |
| 320 | ... Following steps will be executed: |
| 321 | ... - restart bbsim adaptor |
| 322 | ... - check bbsim adaptor is ready again |
| 323 | [Arguments] ${namespace} |
| 324 | ${bbsim_apps} Create List bbsim |
| 325 | ${label_key} Set Variable app |
| 326 | ${bbsim_label_value} Set Variable bbsim |
| 327 | Restart Pod By Label ${namespace} ${label_key} ${bbsim_label_value} |
| 328 | Sleep 5s |
| 329 | Wait For Pods Ready ${namespace} ${bbsim_apps} |
| 330 | |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 331 | Setup Suite |
| 332 | [Documentation] Set up the test suite |
| 333 | Common Test Suite Setup |
| 334 | |
| 335 | Teardown Suite |
| 336 | [Documentation] Tear down steps for the suite |
| 337 | Run Keyword If ${has_dataplane} Clean Up Linux |
TorstenThieme | 4e2168e | 2021-06-22 14:01:47 +0000 | [diff] [blame] | 338 | Close All ONOS SSH Connections |