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} |
| 537 | ... ${image_version} False False True |
| 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 |
| 559 | # !!! Expected is image is not visible in list !!! |
| 560 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 561 | ... ${image_version} False False True |
| 562 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 563 | END |
| 564 | |
| 565 | Do ONU Upgrade Activating Abort Per OLT |
| 566 | [Documentation] This keyword performs the ONU Upgrade Activating Abort test on single OLT |
| 567 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url} |
| 568 | [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id} |
| 569 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 570 | ${src}= Set Variable ${hosts.src[${I}]} |
| 571 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 572 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
| 573 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 574 | # Download Image |
| 575 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 576 | ... false false ${image_crc} ${onu_device_id} |
| 577 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 578 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE |
| 579 | Activate ONU Device Image ${image_version} false ${onu_device_id} |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 580 | Abort ONU Device Image ${image_version} ${onu_device_id} |
Andrea Campanella | f3b88f6 | 2021-10-01 18:43:03 +0200 | [diff] [blame] | 581 | ... DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVATING |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 582 | 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] | 583 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVATION_ABORTED |
TorstenThieme | c96d096 | 2021-09-10 10:01:39 +0000 | [diff] [blame] | 584 | # !!! Expected is image is not visible in list !!! |
| 585 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 586 | ... ${image_version} False True True |
| 587 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 588 | END |
| 589 | |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame^] | 590 | Do ONU Upgrade Active Abort Per OLT |
| 591 | [Documentation] This keyword performs the ONU Upgrade Active Abort test on single OLT |
| 592 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url} |
| 593 | [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id} |
| 594 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 595 | ${src}= Set Variable ${hosts.src[${I}]} |
| 596 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 597 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
| 598 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 599 | # Download Image |
| 600 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 601 | ... false false ${image_crc} ${onu_device_id} |
| 602 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 603 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE |
| 604 | Activate ONU Device Image ${image_version} false ${onu_device_id} |
| 605 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 606 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_ACTIVE |
| 607 | Abort ONU Device Image ${image_version} ${onu_device_id} |
| 608 | ... DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVE |
| 609 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 610 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED CANCELLED_ON_REQUEST IMAGE_ACTIVE |
| 611 | # !!! Expected is image is not visible in list !!! |
| 612 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 613 | ... ${image_version} False True True |
| 614 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 615 | END |
| 616 | |
| 617 | Do ONU Upgrade Committed Abort Per OLT |
| 618 | [Documentation] This keyword performs the ONU Upgrade Committed Abort test on single OLT |
| 619 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url} |
| 620 | [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id} |
| 621 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 622 | ${src}= Set Variable ${hosts.src[${I}]} |
| 623 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 624 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
| 625 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 626 | ${Images_Count_Start}= Get Images Count |
| 627 | # Download Image |
| 628 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 629 | ... false false ${image_crc} ${onu_device_id} |
| 630 | # After download of image, check image counter of BBSIM, has to be incremented by 2, because bbsim increments counter |
| 631 | # whenever openonu adapter touch the image, so one increment for check image is available and one for downloading |
| 632 | ${Images_Count_First}= Get Images Count |
| 633 | ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2 |
| 634 | Should Be Equal as Integers ${Images_Count_First} ${Images_Count_Start} Count of image download not correct! |
| 635 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 636 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_INACTIVE |
| 637 | Activate ONU Device Image ${image_version} false ${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_ACTIVE |
| 640 | Commit ONU Device Image ${image_version} ${onu_device_id} |
| 641 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 642 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED |
| 643 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 644 | ... ${image_version} True True True |
| 645 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod} |
| 646 | ... ${src['onu']} software_image_committed |
| 647 | Abort ONU Device Image ${image_version} ${onu_device_id} |
| 648 | ... DOWNLOAD_UNKNOWN NO_ERROR IMAGE_UNKNOWN |
| 649 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 650 | ... ${onu_device_id} DOWNLOAD_UNKNOWN NO_ERROR IMAGE_UNKNOWN |
| 651 | # !!! Expected is image is not visible in list !!! |
| 652 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 653 | ... ${image_version} True True True |
| 654 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 655 | ${Images_Count_Intermediate}= Get Images Count |
| 656 | # Repeat download of aborted image, check image counter of BBSIM, has to be incremented by 2, because bbsim increments |
| 657 | # whenever openonu adapter touch the image, so one increment for check image is available and one for downloading |
| 658 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 659 | ... false false ${image_crc} ${onu_device_id} |
| 660 | ${Images_Count_End}= Get Images Count |
| 661 | ${Images_Count_Intermediate}= Evaluate ${Images_Count_Intermediate}+2 |
| 662 | Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Intermediate} Count of image download not correct! |
| 663 | Remove Adapter Image ${image_version} ${onu_device_id} |
| 664 | END |
| 665 | |
| 666 | Do ONU Upgrade Multiple Image Download Per OLT |
| 667 | [Documentation] This keyword performs the ONU Upgrade Image Download test on single OLT |
| 668 | [Arguments] ${bbsim_pod} ${olt_serial_number} ${url}=${image_url} |
| 669 | [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id} |
| 670 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 671 | ${src}= Set Variable ${hosts.src[${I}]} |
| 672 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 673 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
| 674 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 675 | ${Images_Count_Start}= Get Images Count |
| 676 | # Download Image |
| 677 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 678 | ... true true ${image_crc} ${onu_device_id} |
| 679 | # After download of image, check image counter of BBSIM, has to be incremented by 2, because bbsim increments counter |
| 680 | # whenever openonu adapter touch the image, so one increment for check image is available and one for downloading |
| 681 | ${Images_Count_First}= Get Images Count |
| 682 | ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2 |
| 683 | Should Be Equal as Integers ${Images_Count_First} ${Images_Count_Start} Count of image download not correct! |
| 684 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 685 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED |
| 686 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 687 | ... ${image_version} True True True |
| 688 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod} |
| 689 | ... ${src['onu']} software_image_committed |
| 690 | Wait Until Keyword Succeeds ${timeout} 5s Perform Sanity Test ${suppressaddsubscriber} |
| 691 | ${Images_Count_Intermediate}= Get Images Count |
| 692 | # Repeat download of same image, check image counter of BBSIM, has to be not incremented, because no download from |
| 693 | # server will be executed, the cached one from openonu-adapter will taken |
| 694 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 695 | ... false false ${image_crc} ${onu_device_id} |
| 696 | ${Images_Count_End}= Get Images Count |
| 697 | Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Intermediate} Count of image download not correct! |
| 698 | Remove Adapter Image ${image_version} ${onu_device_id} |
| 699 | END |
| 700 | |
| 701 | Do ONU Upgrade Image Download Simultaneously |
| 702 | [Documentation] This keyword performs the ONU Upgrade Image Download Simultaneously on all ONUs test |
| 703 | [Arguments] ${url}=${image_url} |
| 704 | [Teardown] Remove Adapter Image from ONUs ${image_version} ${list_onus} |
| 705 | # collect all ONU's device ids |
| 706 | ${list_onus} Create List |
| 707 | Build ONU Device Id List ${list_onus} |
| 708 | # prepare OLT-SN BBSIM-POD releation dictionary for later fast access |
| 709 | ${olt_bbsim_dict}= Create Dictionary |
| 710 | FOR ${J} IN RANGE 0 ${num_olts} |
| 711 | ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn] |
| 712 | ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J} |
| 713 | ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel} |
| 714 | Set To Dictionary ${olt_bbsim_dict} ${olt_serial_number} ${bbsim_pod} |
| 715 | END |
| 716 | ${Images_Count_Start}= Get Images Count |
| 717 | # Download Image to all ONUs simultaneously |
| 718 | ${onu_device_ids} = Catenate @{list_onus} |
| 719 | Download ONU Device Image ${image_version} ${url} ${image_vendor} |
| 720 | ... true true ${image_crc} ${onu_device_ids} |
| 721 | # do all the check stuff |
| 722 | FOR ${onu_device_id} IN @{list_onus} |
| 723 | Log ${onu_device_id} |
| 724 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image Status ${image_version} |
| 725 | ... ${onu_device_id} DOWNLOAD_SUCCEEDED NO_ERROR IMAGE_COMMITTED |
| 726 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image List ${onu_device_id} |
| 727 | ... ${image_version} True True True |
| 728 | END |
| 729 | # last but not least check bbsim |
| 730 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 731 | ${src}= Set Variable ${hosts.src[${I}]} |
| 732 | ${bbsim_pod}= Get From Dictionary ${olt_bbsim_dict} ${src['olt']} |
| 733 | Wait Until Keyword Succeeds ${timeout} 2s Verify ONU Device Image On BBSim ${NAMESPACE} ${bbsim_pod} |
| 734 | ... ${src['onu']} software_image_committed |
| 735 | END |
| 736 | ${Images_Count_End}= Get Images Count |
| 737 | ${Images_Count_Start}= Evaluate ${Images_Count_Start}+2 |
| 738 | Should Be Equal as Integers ${Images_Count_End} ${Images_Count_Start} Count of image download not correct! |
| 739 | |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 740 | Restart And Check BBSIM |
| 741 | [Documentation] This keyword restarts bbsim and waits for it to come up again |
| 742 | ... Following steps will be executed: |
| 743 | ... - restart bbsim adaptor |
| 744 | ... - check bbsim adaptor is ready again |
| 745 | [Arguments] ${namespace} |
| 746 | ${bbsim_apps} Create List bbsim |
| 747 | ${label_key} Set Variable app |
| 748 | ${bbsim_label_value} Set Variable bbsim |
| 749 | Restart Pod By Label ${namespace} ${label_key} ${bbsim_label_value} |
| 750 | Sleep 5s |
| 751 | Wait For Pods Ready ${namespace} ${bbsim_apps} |
| 752 | |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame^] | 753 | Get BBSIM Svc and Webserver Port |
| 754 | [Documentation] This keyword gets bbsim instance and bbsim webserver port from image url |
| 755 | @{words}= Split String ${image_url} / |
| 756 | ${SvcAndPort} Set Variable @{words}[2] |
| 757 | ${bbsim_svc} ${webserver_port}= Split String ${SvcAndPort} : 1 |
| 758 | ${svc_return} Set Variable If '${bbsim_svc}'!='${EMPTY}' ${bbsim_svc} ${BBSIM_INSTANCE} |
| 759 | ${port_return} Set Variable If '${webserver_port}'!='${EMPTY}' ${webserver_port} ${BBSIM_WEBSERVER_PORT} |
| 760 | [Return] ${svc_return} ${port_return} |
| 761 | |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 762 | Setup Suite |
| 763 | [Documentation] Set up the test suite |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame^] | 764 | Start Logging Setup or Teardown Setup-${SUITE NAME} |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 765 | Common Test Suite Setup |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame^] | 766 | Run Keyword If ${logging} Collect Logs |
| 767 | Stop Logging Setup or Teardown Setup-${SUITE NAME} |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 768 | |
| 769 | Teardown Suite |
| 770 | [Documentation] Tear down steps for the suite |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame^] | 771 | Start Logging Setup or Teardown Teardown-${SUITE NAME} |
| 772 | # stop port forwarding if still running |
| 773 | Run Keyword If ${portFwdHandle}!=None Terminate Process ${portFwdHandle} kill=true |
Hardik Windlass | 17bd114 | 2021-03-12 08:15:25 +0000 | [diff] [blame] | 774 | Run Keyword If ${has_dataplane} Clean Up Linux |
TorstenThieme | f3e492c | 2021-11-08 15:25:48 +0000 | [diff] [blame^] | 775 | Run Keyword If ${logging} Collect Logs |
| 776 | Stop Logging Setup or Teardown Teardown-${SUITE NAME} |
TorstenThieme | 4e2168e | 2021-06-22 14:01:47 +0000 | [diff] [blame] | 777 | Close All ONOS SSH Connections |