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 | |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +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 |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 103 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 104 | ... AND Delete All Devices and Verify |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 105 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 106 | ... AND Stop Logging ONUUpgrade |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 107 | Do ONU Upgrade All OLTs |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 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 |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 117 | [Tags] functional ONUUpgradeAllCombies |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 118 | [Setup] Start Logging ONUUpgradeAllCombies |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 119 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 120 | ... AND Delete All Devices and Verify |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 121 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 122 | ... AND Stop Logging ONUUpgradeAllCombies |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 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} |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 129 | Do ONU Upgrade All OLTs ${item['activate']} ${item['commit']} |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 130 | Delete All Devices and Verify |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 131 | Restart And Check BBSIM ${NAMESPACE} |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 132 | END |
Hardik Windlass | c310c7c | 2021-03-25 13:16:59 +0000 | [diff] [blame] | 133 | |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 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 |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 139 | [Tags] functional ONUUpgradeDownloadWrongUrl |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 140 | [Setup] Start Logging ONUUpgradeDownloadWrongUrl |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 141 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 142 | ... AND Delete All Devices and Verify |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 143 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 144 | ... AND Stop Logging ONUUpgradeDownloadWrongUrl |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +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 |
| 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 | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 154 | Do ONU Upgrade Download Failure Per OLT ${bbsim_pod} ${olt_serial_number} |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 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 |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +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 | 7cb9de7 | 2021-08-24 09:40:57 +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 |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 173 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 174 | ... AND Delete All Devices and Verify |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 175 | ... AND Restart And Check BBSIM ${NAMESPACE} |
| 176 | ... AND Stop Logging ONUUpgradeDownloadFailure |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 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} |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 186 | Do ONU Upgrade Download Failure Per OLT ${bbsim_pod} ${olt_serial_number} |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 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 |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 195 | |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 196 | Test ONU Upgrade Correct Indication of Downloading Abort |
| 197 | [Documentation] Validates the ONU Upgrade downloading abort will be indicated correctly and |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 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 |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 201 | [Tags] functional ONUUpgradeDownloadingAbort |
| 202 | [Setup] Start Logging ONUUpgradeDownloadingAbort |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 203 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 204 | ... AND Delete All Devices and Verify |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 205 | ... AND Restart And Check BBSIM ${NAMESPACE} |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 206 | ... AND Stop Logging ONUUpgradeDownloadingAbort |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 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} |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 216 | Do ONU Upgrade Downloading Abort Per OLT ${bbsim_pod} ${olt_serial_number} |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 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 | |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 225 | Test ONU Upgrade Correct Indication of Downloaded Abort |
| 226 | [Documentation] Validates the ONU Upgrade downloaded abort will be indicated correctly and |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 227 | ... doesn't affect the system functionality |
| 228 | ... Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 229 | ... Check [VOL-4320] for more details |
| 230 | [Tags] functional ONUUpgradeDownloadedAbort |
| 231 | [Setup] Start Logging ONUUpgradeDownloadedAbort |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 232 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 233 | ... AND Delete All Devices and Verify |
| 234 | ... AND Restart And Check BBSIM ${NAMESPACE} |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 235 | ... AND Stop Logging ONUUpgradeDownloadedAbort |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 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} |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 245 | Do ONU Upgrade Downloaded Abort Per OLT ${bbsim_pod} ${olt_serial_number} |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 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 |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 253 | |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 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 | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 427 | Do ONU Upgrade All OLTs |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 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} |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 439 | Do ONU Upgrade Per OLT ${bbsim_pod} ${olt_serial_number} ${activate_on_success} ${commit_on_success} |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 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 | |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 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 | 9cf8bd5 | 2021-07-29 10:53:55 +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} |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 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 | 9cf8bd5 | 2021-07-29 10:53:55 +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 | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 462 | ${imageState}= Run Keyword If '${activate_on_success}'=='true' and '${commit_on_success}'=='false' |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 463 | ... Set Variable IMAGE_ACTIVE |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 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 | 9cf8bd5 | 2021-07-29 10:53:55 +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 | 9cf8bd5 | 2021-07-29 10:53:55 +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 | 9cf8bd5 | 2021-07-29 10:53:55 +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} |
Andrea Campanella | f3b88f6 | 2021-10-01 18:43:03 +0200 | [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 | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 497 | Do ONU Upgrade Download Failure Per OLT |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 498 | [Documentation] This keyword performs the ONU Upgrade Dowload Failure test on single OLT |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 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 |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 502 | [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image INVALID_IMAGE ${onu_device_id} |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 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 |
TorstenThieme | 9cf8bd5 | 2021-07-29 10:53:55 +0000 | [diff] [blame] | 509 | Download ONU Device Image INVALID_IMAGE ${url} ${image_vendor} |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 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} |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 512 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status INVALID_IMAGE |
TorstenThieme | 7cb9de7 | 2021-08-24 09:40:57 +0000 | [diff] [blame] | 513 | ... ${onu_device_id} ${dwlstate} ${reason} ${imgstate} |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 514 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
Andrea Campanella | f3b88f6 | 2021-10-01 18:43:03 +0200 | [diff] [blame] | 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} |
TorstenThieme | eb2440e | 2021-07-20 10:45:05 +0000 | [diff] [blame] | 517 | END |
| 518 | |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 519 | Do ONU Upgrade Downloading Abort Per OLT |
| 520 | [Documentation] This keyword performs the ONU Upgrade Downloading Abort test on single OLT |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 521 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url} |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 522 | [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id} |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 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} |
Andrea Campanella | f3b88f6 | 2021-10-01 18:43:03 +0200 | [diff] [blame] | 532 | ... DOWNLOAD_STARTED CANCELLED_ON_REQUEST IMAGE_DOWNLOADING |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 533 | 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] | 534 | ... ${onu_device_id} DOWNLOAD_CANCELLED CANCELLED_ON_REQUEST IMAGE_UNKNOWN |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 535 | # !!! Expected is image is not visible in list !!! |
| 536 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
TorstenThieme | 7079028 | 2021-11-19 10:26:25 +0000 | [diff] [blame] | 537 | ... ${image_version} False False False image_should_not_in_list=True |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 538 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 539 | END |
| 540 | |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 541 | Do ONU Upgrade Downloaded Abort Per OLT |
| 542 | [Documentation] This keyword performs the ONU Upgrade Downloaded Abort test on single OLT |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 543 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url} |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 544 | [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id} |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 545 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 546 | ${src}= Set Variable ${hosts.src[${I}]} |
| 547 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 548 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
| 549 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 550 | # Download Image |
| 551 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 552 | ... false false ${image_crc} ${onu_device_id} |
| 553 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 554 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 555 | Abort ONU Device Image ${image_version} ${onu_device_id} |
| 556 | ... DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_INACTIVE |
| 557 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 558 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_INACTIVE |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 559 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 560 | ... ${image_version} False False True |
| 561 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 562 | END |
| 563 | |
| 564 | Do ONU Upgrade Activating Abort Per OLT |
| 565 | [Documentation] This keyword performs the ONU Upgrade Activating Abort test on single OLT |
| 566 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url} |
| 567 | [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id} |
| 568 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 569 | ${src}= Set Variable ${hosts.src[${I}]} |
| 570 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 571 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
| 572 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 573 | # Download Image |
| 574 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 575 | ... false false ${image_crc} ${onu_device_id} |
| 576 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 577 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE |
| 578 | Activate ONU Device Image ${image_version} false ${onu_device_id} |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 579 | Abort ONU Device Image ${image_version} ${onu_device_id} |
Andrea Campanella | f3b88f6 | 2021-10-01 18:43:03 +0200 | [diff] [blame] | 580 | ... DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVATING |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 581 | 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] | 582 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVATION_ABORTED |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 583 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 584 | ... ${image_version} False True True |
| 585 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 586 | END |
| 587 | |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 588 | Do ONU Upgrade Active Abort Per OLT |
| 589 | [Documentation] This keyword performs the ONU Upgrade Active Abort test on single OLT |
| 590 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url} |
| 591 | [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id} |
| 592 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 593 | ${src}= Set Variable ${hosts.src[${I}]} |
| 594 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 595 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
| 596 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 597 | # Download Image |
| 598 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 599 | ... false false ${image_crc} ${onu_device_id} |
| 600 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 601 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE |
| 602 | Activate ONU Device Image ${image_version} false ${onu_device_id} |
| 603 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 604 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_ACTIVE |
| 605 | Abort ONU Device Image ${image_version} ${onu_device_id} |
| 606 | ... DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVE |
| 607 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 608 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVE |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 609 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 610 | ... ${image_version} False True True |
| 611 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 612 | END |
| 613 | |
| 614 | Do ONU Upgrade Committed Abort Per OLT |
| 615 | [Documentation] This keyword performs the ONU Upgrade Committed Abort test on single OLT |
| 616 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url} |
| 617 | [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id} |
| 618 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 619 | ${src}= Set Variable ${hosts.src[${I}]} |
| 620 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 621 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
| 622 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 623 | ${Images_Count_Start}= Get Images Count |
| 624 | # Download Image |
| 625 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 626 | ... false false ${image_crc} ${onu_device_id} |
| 627 | # After download of image, check image counter of BBSIM, has to be incremented by 2, because bbsim increments counter |
| 628 | # whenever openonu adapter touch the image, so one increment for check image is available and one for downloading |
| 629 | ${Images_Count_First}= Get Images Count |
| 630 | ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2 |
| 631 | Should Be Equal as Integers ${Images_Count_First} ${Images_Count_Start} Count of image download not correct! |
| 632 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 633 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE |
| 634 | Activate ONU Device Image ${image_version} false ${onu_device_id} |
| 635 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 636 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_ACTIVE |
| 637 | Commit ONU Device Image ${image_version} ${onu_device_id} |
| 638 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 639 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED |
| 640 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 641 | ... ${image_version} True True True |
| 642 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod} |
| 643 | ... ${src['onu']} software_image_committed |
| 644 | Abort ONU Device Image ${image_version} ${onu_device_id} |
| 645 | ... DOWNLOAD_UNKNOWN NO_ERROR IMAGE_UNKNOWN |
| 646 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 647 | ... ${onu_device_id} DOWNLOAD_UNKNOWN NO_ERROR IMAGE_UNKNOWN |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 648 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 649 | ... ${image_version} True True True |
| 650 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 651 | ${Images_Count_Intermediate}= Get Images Count |
| 652 | # Repeat download of aborted image, check image counter of BBSIM, has to be incremented by 2, because bbsim increments |
| 653 | # whenever openonu adapter touch the image, so one increment for check image is available and one for downloading |
| 654 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 655 | ... false false ${image_crc} ${onu_device_id} |
| 656 | ${Images_Count_End}= Get Images Count |
| 657 | ${Images_Count_Intermediate}= Evaluate ${Images_Count_Intermediate}+2 |
| 658 | Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Intermediate} Count of image download not correct! |
| 659 | Remove Adapter Image ${image_version} ${onu_device_id} |
| 660 | END |
| 661 | |
| 662 | Do ONU Upgrade Multiple Image Download Per OLT |
| 663 | [Documentation] This keyword performs the ONU Upgrade Image Download test on single OLT |
| 664 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url} |
| 665 | [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id} |
| 666 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 667 | ${src}= Set Variable ${hosts.src[${I}]} |
| 668 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 669 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
| 670 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 671 | ${Images_Count_Start}= Get Images Count |
| 672 | # Download Image |
| 673 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 674 | ... true true ${image_crc} ${onu_device_id} |
| 675 | # After download of image, check image counter of BBSIM, has to be incremented by 2, because bbsim increments counter |
| 676 | # whenever openonu adapter touch the image, so one increment for check image is available and one for downloading |
| 677 | ${Images_Count_First}= Get Images Count |
| 678 | ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2 |
| 679 | Should Be Equal as Integers ${Images_Count_First} ${Images_Count_Start} Count of image download not correct! |
| 680 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 681 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED |
| 682 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 683 | ... ${image_version} True True True |
| 684 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod} |
| 685 | ... ${src['onu']} software_image_committed |
| 686 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 687 | ${Images_Count_Intermediate}= Get Images Count |
| 688 | # Repeat download of same image, check image counter of BBSIM, has to be not incremented, because no download from |
| 689 | # server will be executed, the cached one from openonu-adapter will taken |
| 690 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 691 | ... false false ${image_crc} ${onu_device_id} |
| 692 | ${Images_Count_End}= Get Images Count |
| 693 | Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Intermediate} Count of image download not correct! |
| 694 | Remove Adapter Image ${image_version} ${onu_device_id} |
| 695 | END |
| 696 | |
| 697 | Do ONU Upgrade Image Download Simultaneously |
| 698 | [Documentation] This keyword performs the ONU Upgrade Image Download Simultaneously on all ONUs test |
| 699 | [Arguments] ${url}=${image_url} |
| 700 | [Teardown] Remove Adapter Image from ONUs ${image_version} ${list_onus} |
| 701 | # collect all ONU's device ids |
| 702 | ${list_onus} Create List |
| 703 | Build ONU Device Id List ${list_onus} |
| 704 | # prepare OLT-SN BBSIM-POD releation dictionary for later fast access |
| 705 | ${olt_bbsim_dict}= Create Dictionary |
| 706 | FOR ${J} IN RANGE 0 ${num_olts} |
| 707 | ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn] |
| 708 | ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J} |
| 709 | ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel} |
| 710 | Set To Dictionary ${olt_bbsim_dict} ${olt_serial_number} ${bbsim_pod} |
| 711 | END |
| 712 | ${Images_Count_Start}= Get Images Count |
| 713 | # Download Image to all ONUs simultaneously |
| 714 | ${onu_device_ids} = Catenate @{list_onus} |
| 715 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 716 | ... true true ${image_crc} ${onu_device_ids} |
| 717 | # do all the check stuff |
| 718 | FOR ${onu_device_id} IN @{list_onus} |
| 719 | Log ${onu_device_id} |
| 720 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 721 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED |
| 722 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 723 | ... ${image_version} True True True |
| 724 | END |
| 725 | # last but not least check bbsim |
| 726 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 727 | ${src}= Set Variable ${hosts.src[${I}]} |
| 728 | ${bbsim_pod}= Get From Dictionary ${olt_bbsim_dict} ${src['olt']} |
| 729 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod} |
| 730 | ... ${src['onu']} software_image_committed |
| 731 | END |
| 732 | ${Images_Count_End}= Get Images Count |
| 733 | ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2 |
| 734 | Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Start} Count of image download not correct! |
| 735 | |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 736 | Restart And Check BBSIM |
| 737 | [Documentation] This keyword restarts bbsim and waits for it to come up again |
| 738 | ... Following steps will be executed: |
| 739 | ... - restart bbsim adaptor |
| 740 | ... - check bbsim adaptor is ready again |
| 741 | [Arguments] ${namespace} |
| 742 | ${bbsim_apps} Create List bbsim |
| 743 | ${label_key} Set Variable app |
| 744 | ${bbsim_label_value} Set Variable bbsim |
| 745 | Restart Pod By Label ${namespace} ${label_key} ${bbsim_label_value} |
| 746 | Sleep 5s |
| 747 | Wait For Pods Ready ${namespace} ${bbsim_apps} |
| 748 | |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 749 | Get BBSIM Svc and Webserver Port |
| 750 | [Documentation] This keyword gets bbsim instance and bbsim webserver port from image url |
| 751 | @{words}= Split String ${image_url} / |
| 752 | ${SvcAndPort} Set Variable @{words}[2] |
| 753 | ${bbsim_svc} ${webserver_port}= Split String ${SvcAndPort} : 1 |
| 754 | ${svc_return} Set Variable If '${bbsim_svc}'!='${EMPTY}' ${bbsim_svc} ${BBSIM_INSTANCE} |
| 755 | ${port_return} Set Variable If '${webserver_port}'!='${EMPTY}' ${webserver_port} ${BBSIM_WEBSERVER_PORT} |
| 756 | [Return] ${svc_return} ${port_return} |
| 757 | |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 758 | Setup Suite |
| 759 | [Documentation] Set up the test suite |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 760 | Start Logging Setup or Teardown Setup-${SUITE NAME} |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 761 | Common Test Suite Setup |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 762 | Run Keyword If ${logging} Collect Logs |
| 763 | Stop Logging Setup or Teardown Setup-${SUITE NAME} |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 764 | |
| 765 | Teardown Suite |
| 766 | [Documentation] Tear down steps for the suite |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 767 | Start Logging Setup or Teardown Teardown-${SUITE NAME} |
| 768 | # stop port forwarding if still running |
| 769 | Run Keyword If ${portFwdHandle}!=None Terminate Process ${portFwdHandle} kill=true |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 770 | Run Keyword If ${has_dataplane} Clean Up Linux |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame] | 771 | Run Keyword If ${logging} Collect Logs |
| 772 | Stop Logging Setup or Teardown Teardown-${SUITE NAME} |
TorstenThieme | 4e2168e | 2021-06-22 14:01:47 +0000 | [diff] [blame] | 773 | Close All ONOS SSH Connections |