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 | 4288c6a | 2021-09-28 07:22:06 +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 | f0ce206 | 2021-07-23 11:04:39 +0000 | [diff] [blame] | 61 | # logging flag to enable Collect Logs, 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 | |
| 79 | *** Test Cases *** |
| 80 | Test ONU Upgrade |
| 81 | [Documentation] Validates the ONU Upgrade doesn't affect the system functionality |
| 82 | ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable |
| 83 | ... Requirement: Pass image details in following parameters in the robot command |
| 84 | ... 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] | 85 | ... 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] | 86 | ... Check [VOL-3903] for more details |
| 87 | [Tags] functional ONUUpgrade |
| 88 | [Setup] Start Logging ONUUpgrade |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 89 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 90 | ... AND Delete All Devices and Verify |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 91 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 92 | ... AND Stop Logging ONUUpgrade |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 93 | Test ONU Upgrade All OLTs |
| 94 | |
| 95 | Test ONU Upgrade All Activate and Commit Combinations |
| 96 | [Documentation] Validates the ONU Upgrade doesn't affect the system functionality by use all combinations of |
| 97 | ... flags activate_on_success and commit_on_success |
| 98 | ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable |
| 99 | ... Requirement: Pass image details in following parameters in the robot command |
| 100 | ... onu_image_name, onu_image_url, onu_image_version, onu_image_crc, onu_image_local_dir |
| 101 | ... Note: The TC expects the image url and other parameters to be common for all ONUs on all BBSim |
| 102 | ... Check [VOL-4250] for more details |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 103 | [Tags] functional ONUUpgradeAllCombies |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 104 | [Setup] Start Logging ONUUpgradeAllCombies |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 105 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 106 | ... AND Delete All Devices and Verify |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 107 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 108 | ... AND Stop Logging ONUUpgradeAllCombies |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 109 | ${false_false}= Create Dictionary activate false commit false |
| 110 | ${true_false}= Create Dictionary activate true commit false |
| 111 | ${false_true}= Create Dictionary activate false commit true |
| 112 | ${true_true}= Create Dictionary activate true commit true |
| 113 | ${flag_list}= Create List ${false_false} ${true_false} ${false_true} ${true_true} |
| 114 | FOR ${item} IN @{flag_list} |
| 115 | Test ONU Upgrade All OLTs ${item['activate']} ${item['commit']} |
| 116 | Delete All Devices and Verify |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 117 | Restart And Check BBSIM ${NAMESPACE} |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 118 | END |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 119 | |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 120 | Test ONU Upgrade Correct Indication of Download Wrong Url |
| 121 | [Documentation] Validates the ONU Upgrade download from wrong URL failure will be indicated correctly |
| 122 | ... and doesn't affect the system functionality |
| 123 | ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable |
| 124 | ... Check [VOL-4257] for more details |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 125 | [Tags] functional ONUUpgradeDownloadWrongUrl |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 126 | [Setup] Start Logging ONUUpgradeDownloadWrongUrl |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 127 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 128 | ... AND Delete All Devices and Verify |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 129 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 130 | ... AND Stop Logging ONUUpgradeDownloadWrongUrl |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 131 | # Add OLT device |
| 132 | Setup |
| 133 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 134 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 135 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 136 | FOR ${J} IN RANGE 0 ${num_olts} |
| 137 | ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn] |
| 138 | ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J} |
| 139 | ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel} |
| 140 | Test ONU Upgrade Download Failure Per OLT ${bbsim_pod} ${olt_serial_number} |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 141 | ... url=http://bbsim0:50074/images/wrong-image.img$ |
| 142 | ... dwl_dwlstate=DOWNLOAD_FAILED dwl_reason=INVALID_URL dwl_imgstate=IMAGE_UNKNOWN |
| 143 | ... dwlstate=DOWNLOAD_UNKNOWN reason=NO_ERROR imgstate=IMAGE_UNKNOWN |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 144 | List ONUs ${NAMESPACE} ${bbsim_pod} |
| 145 | END |
| 146 | # Additional Verification |
| 147 | Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify |
| 148 | Setup |
| 149 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 150 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 151 | |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 152 | Test ONU Upgrade Correct Indication of Download Failure |
| 153 | [Documentation] Validates the ONU Upgrade download failure will be indicated correctly and |
| 154 | ... doesn't affect the system functionality |
| 155 | ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable |
| 156 | ... Check [VOL-3935] for more details |
| 157 | [Tags] functional ONUUpgradeDownloadFailure |
| 158 | [Setup] Start Logging ONUUpgradeDownloadFailure |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 159 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 160 | ... AND Delete All Devices and Verify |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 161 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 162 | ... AND Stop Logging ONUUpgradeDownloadFailure |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 163 | # Add OLT device |
| 164 | Setup |
| 165 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 166 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 167 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 168 | FOR ${J} IN RANGE 0 ${num_olts} |
| 169 | ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn] |
| 170 | ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J} |
| 171 | ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel} |
| 172 | Test ONU Upgrade Download Failure Per OLT ${bbsim_pod} ${olt_serial_number} |
| 173 | ... dwlstate=DOWNLOAD_FAILED reason=CANCELLED_ON_ONU_STATE imgstate=IMAGE_UNKNOWN |
| 174 | List ONUs ${NAMESPACE} ${bbsim_pod} |
| 175 | END |
| 176 | # Additional Verification |
| 177 | Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify |
| 178 | Setup |
| 179 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 180 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 181 | |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 182 | Test ONU Upgrade Correct Indication of Download Abort |
| 183 | [Documentation] Validates the ONU Upgrade download abort will be indicated correctly and |
| 184 | ... doesn't affect the system functionality |
| 185 | ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable |
| 186 | ... Check [VOL-4318] for more details |
| 187 | [Tags] functional ONUUpgradeDownloadAbort |
| 188 | [Setup] Start Logging ONUUpgradeDownloadAbort |
| 189 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 190 | ... AND Delete All Devices and Verify |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 191 | ... AND Restart And Check BBSIM ${NAMESPACE} |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 192 | ... AND Stop Logging ONUUpgradeDownloadAbort |
| 193 | # Add OLT device |
| 194 | Setup |
| 195 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 196 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 197 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 198 | FOR ${J} IN RANGE 0 ${num_olts} |
| 199 | ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn] |
| 200 | ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J} |
| 201 | ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel} |
| 202 | Test ONU Upgrade Download Abort Per OLT ${bbsim_pod} ${olt_serial_number} |
| 203 | List ONUs ${NAMESPACE} ${bbsim_pod} |
| 204 | END |
| 205 | # Additional Verification |
| 206 | Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify |
| 207 | Setup |
| 208 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 209 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 210 | |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 211 | Test ONU Upgrade Correct Indication of Activate Abort |
| 212 | [Documentation] Validates the ONU Upgrade activate abort will be indicated correctly and |
| 213 | ... doesn't affect the system functionality |
| 214 | ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable |
| 215 | ... Check [VOL-4319] for more details |
| 216 | [Tags] functional ONUUpgradeActivateAbort |
| 217 | [Setup] Start Logging ONUUpgradeActivateAbort |
| 218 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 219 | ... AND Delete All Devices and Verify |
| 220 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 221 | ... AND Stop Logging ONUUpgradeActivateAbort |
| 222 | # Add OLT device |
| 223 | Setup |
| 224 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 225 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 226 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 227 | FOR ${J} IN RANGE 0 ${num_olts} |
| 228 | ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn] |
| 229 | ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J} |
| 230 | ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel} |
| 231 | Test ONU Upgrade Activate Abort Per OLT ${bbsim_pod} ${olt_serial_number} |
| 232 | List ONUs ${NAMESPACE} ${bbsim_pod} |
| 233 | END |
| 234 | # Additional Verification |
| 235 | Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify |
| 236 | Setup |
| 237 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 238 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 239 | |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 240 | *** Keywords *** |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 241 | Test ONU Upgrade All OLTs |
| 242 | [Documentation] This keyword performs the ONU Upgrade test on all OLTs |
| 243 | [Arguments] ${activate_on_success}=${image_activate_on_success} ${commit_on_success}=${image_commit_on_success} |
| 244 | # Add OLT device |
| 245 | Setup |
| 246 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 247 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 248 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 249 | FOR ${J} IN RANGE 0 ${num_olts} |
| 250 | ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn] |
| 251 | ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J} |
| 252 | ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel} |
| 253 | Test ONU Upgrade Per OLT ${bbsim_pod} ${olt_serial_number} ${activate_on_success} ${commit_on_success} |
| 254 | List ONUs ${NAMESPACE} ${bbsim_pod} |
| 255 | END |
| 256 | # Additional Verification |
| 257 | Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify |
| 258 | Setup |
| 259 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 260 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 261 | |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 262 | Test ONU Upgrade Per OLT |
| 263 | [Documentation] This keyword performs the ONU Upgrade test on single OLT |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 264 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${activate_on_success}=${image_activate_on_success} |
| 265 | ... ${commit_on_success}=${image_commit_on_success} |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 266 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 267 | ${src}= Set Variable ${hosts.src[${I}]} |
| 268 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 269 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 270 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
Hardik Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 271 | # Download Image |
| 272 | Download ONU Device Image ${image_version} ${image_url} ${image_vendor} |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 273 | ... ${activate_on_success} ${commit_on_success} |
Hardik Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 274 | ... ${image_crc} ${onu_device_id} |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 275 | ${imageState}= Run Keyword If '${activate_on_success}'=='true' and '${commit_on_success}'=='false' |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 276 | ... Set Variable IMAGE_ACTIVE |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 277 | ... ELSE IF '${activate_on_success}'=='true' and '${commit_on_success}'=='true' |
Hardik Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 278 | ... Set Variable IMAGE_COMMITTED |
| 279 | ... ELSE Set Variable IMAGE_INACTIVE |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 280 | ${activated}= Set Variable If '${activate_on_success}'=='true' True False |
| 281 | ${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] | 282 | ... True False |
| 283 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 284 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR ${imageState} |
| 285 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 286 | ... ${image_version} ${committed} ${activated} True |
| 287 | # Activate Image |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 288 | ${imageState}= Set Variable If '${commit_on_success}'=='true' IMAGE_COMMITTED IMAGE_ACTIVE |
| 289 | ${committed}= Set Variable If '${commit_on_success}'=='true' True False |
| 290 | Run Keyword If '${activate_on_success}'=='false' Run Keywords |
| 291 | ... Activate ONU Device Image ${image_version} ${commit_on_success} ${onu_device_id} |
Hardik Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 292 | ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 293 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR ${imageState} |
| 294 | ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 295 | ... ${image_version} ${committed} True True |
| 296 | # Commit Image |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 297 | Run Keyword If '${commit_on_success}'=='false' Run Keywords |
Hardik Windlass | ba1bd27 | 2021-06-22 08:29:33 +0000 | [diff] [blame] | 298 | ... Commit ONU Device Image ${image_version} ${onu_device_id} |
| 299 | ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 300 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED |
| 301 | ... AND Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 302 | ... ${image_version} True True True |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 303 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod} |
| 304 | ... ${src['onu']} software_image_committed |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 305 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
Andrea Campanella | f3b88f6 | 2021-10-01 18:43:03 +0200 | [diff] [blame] | 306 | # to remove the image again from adapter, Multi-Onu tests could be restructured - not yet in focus |
| 307 | Remove Adapter Image ${image_version} ${onu_device_id} |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 308 | END |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 309 | |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 310 | Test ONU Upgrade Download Failure Per OLT |
| 311 | [Documentation] This keyword performs the ONU Upgrade Dowload Failure test on single OLT |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 312 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url} |
| 313 | ... ${dwl_dwlstate}=DOWNLOAD_STARTED ${dwl_reason}=NO_ERROR ${dwl_imgstate}=IMAGE_UNKNOWN |
| 314 | ... ${dwlstate}=DOWNLOAD_SUCCEEDED ${reason}=NO_ERROR ${imgstate}=IMAGE_INACTIVE |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 315 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 316 | ${src}= Set Variable ${hosts.src[${I}]} |
| 317 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 318 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
| 319 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 320 | # Download Image |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 321 | Download ONU Device Image INVALID_IMAGE ${url} ${image_vendor} |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 322 | ... ${image_activate_on_success} ${image_commit_on_success} ${image_crc} ${onu_device_id} |
| 323 | ... download_state=${dwl_dwlstate} expected_reason=${dwl_reason} image_state=${dwl_imgstate} |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 324 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status INVALID_IMAGE |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 325 | ... ${onu_device_id} ${dwlstate} ${reason} ${imgstate} |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 326 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
Andrea Campanella | f3b88f6 | 2021-10-01 18:43:03 +0200 | [diff] [blame] | 327 | # to remove the image again from adapter, Multi-Onu tests could be restructured - not yet in focus |
| 328 | Remove Adapter Image INVALID_IMAGE ${onu_device_id} |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 329 | END |
| 330 | |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 331 | Test ONU Upgrade Download Abort Per OLT |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 332 | [Documentation] This keyword performs the ONU Upgrade Download Abort test on single OLT |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 333 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url} |
| 334 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 335 | ${src}= Set Variable ${hosts.src[${I}]} |
| 336 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 337 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
| 338 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 339 | # Download Image |
| 340 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 341 | ... ${image_activate_on_success} ${image_commit_on_success} ${image_crc} ${onu_device_id} |
| 342 | Abort ONU Device Image ${image_version} ${onu_device_id} |
Andrea Campanella | f3b88f6 | 2021-10-01 18:43:03 +0200 | [diff] [blame] | 343 | ... DOWNLOAD_STARTED CANCELLED_ON_REQUEST IMAGE_DOWNLOADING |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 344 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
Andrea Campanella | f3b88f6 | 2021-10-01 18:43:03 +0200 | [diff] [blame] | 345 | ... ${onu_device_id} DOWNLOAD_CANCELLED CANCELLED_ON_REQUEST IMAGE_UNKNOWN |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 346 | # !!! Expected is image is not visible in list !!! |
| 347 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 348 | ... ${image_version} False False True |
| 349 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 350 | END |
| 351 | |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 352 | Test ONU Upgrade Activate Abort Per OLT |
| 353 | [Documentation] This keyword performs the ONU Upgrade Activate Abort test on single OLT |
| 354 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url} |
| 355 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 356 | ${src}= Set Variable ${hosts.src[${I}]} |
| 357 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 358 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
| 359 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 360 | # Download Image |
| 361 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 362 | ... false false ${image_crc} ${onu_device_id} |
| 363 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 364 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE |
| 365 | Activate ONU Device Image ${image_version} true ${onu_device_id} |
| 366 | Abort ONU Device Image ${image_version} ${onu_device_id} |
Andrea Campanella | f3b88f6 | 2021-10-01 18:43:03 +0200 | [diff] [blame] | 367 | ... DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVATING |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 368 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
Andrea Campanella | f3b88f6 | 2021-10-01 18:43:03 +0200 | [diff] [blame] | 369 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVATION_ABORTED |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 370 | # !!! Expected is image is not visible in list !!! |
| 371 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 372 | ... ${image_version} False True True |
| 373 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 374 | END |
| 375 | |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 376 | Restart And Check BBSIM |
| 377 | [Documentation] This keyword restarts bbsim and waits for it to come up again |
| 378 | ... Following steps will be executed: |
| 379 | ... - restart bbsim adaptor |
| 380 | ... - check bbsim adaptor is ready again |
| 381 | [Arguments] ${namespace} |
| 382 | ${bbsim_apps} Create List bbsim |
| 383 | ${label_key} Set Variable app |
| 384 | ${bbsim_label_value} Set Variable bbsim |
| 385 | Restart Pod By Label ${namespace} ${label_key} ${bbsim_label_value} |
| 386 | Sleep 5s |
| 387 | Wait For Pods Ready ${namespace} ${bbsim_apps} |
| 388 | |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 389 | Setup Suite |
| 390 | [Documentation] Set up the test suite |
| 391 | Common Test Suite Setup |
| 392 | |
| 393 | Teardown Suite |
| 394 | [Documentation] Tear down steps for the suite |
| 395 | Run Keyword If ${has_dataplane} Clean Up Linux |
TorstenThieme | 4e2168e | 2021-06-22 14:01:47 +0000 | [diff] [blame] | 396 | Close All ONOS SSH Connections |