TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 1 | # Copyright 2020 - 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 | |
| 15 | *** Settings *** |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 16 | Documentation Test different Reconcile scenarios of ONU Go adapter with all three workflows ATT, DT and TT. |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 17 | ... Test suite is dedicated for only one ONU! Run robot with bbsim-kind.yaml only! |
| 18 | ... Not for DT/TT workflow! |
| 19 | ... Hint: default timeout in BBSim to mimic OLT reboot is 60 seconds! |
| 20 | ... This behaviour of BBSim can be modified by 'oltRebootDelay: 60' in BBSim section of helm chart or |
| 21 | ... used values.yaml during 'voltha up'. |
| 22 | Suite Setup Setup Suite |
| 23 | Suite Teardown Teardown Suite |
| 24 | Test Setup Setup |
| 25 | Test Teardown Teardown |
| 26 | Library Collections |
| 27 | Library String |
| 28 | Library OperatingSystem |
| 29 | Library XML |
| 30 | Library RequestsLibrary |
| 31 | Library ../../libraries/DependencyLibrary.py |
| 32 | Resource ../../libraries/onos.robot |
| 33 | Resource ../../libraries/voltctl.robot |
| 34 | Resource ../../libraries/voltha.robot |
| 35 | Resource ../../libraries/utils.robot |
| 36 | Resource ../../libraries/k8s.robot |
| 37 | Resource ../../libraries/onu_utilities.robot |
| 38 | Resource ../../variables/variables.robot |
| 39 | |
| 40 | *** Variables *** |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 41 | ${NAMESPACE} voltha |
| 42 | ${INFRA_NAMESPACE} default |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 43 | ${timeout} 60s |
| 44 | ${of_id} 0 |
| 45 | ${logical_id} 0 |
| 46 | ${has_dataplane} True |
| 47 | ${external_libs} True |
| 48 | ${teardown_device} True |
| 49 | ${scripts} ../../scripts |
| 50 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 51 | ${container_log_dir} ${None} |
| 52 | # flag for first test, needed due default timeout in BBSim to mimic OLT reboot of 60 seconds |
| 53 | ${firsttest} True |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 54 | # determines the environment workflow: DT, TT or ATT (default) |
| 55 | # example: -v workflow:DT |
| 56 | ${workflow} ATT |
TorstenThieme | 4798369 | 2021-06-17 10:43:35 +0000 | [diff] [blame] | 57 | # KV Store Prefix |
| 58 | # example: -v kvstoreprefix:voltha_voltha |
| 59 | ${kvstoreprefix} voltha_voltha |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 60 | # flag debugmode is used, if true timeout calculation various, can be passed via the command line too |
| 61 | # example: -v debugmode:True |
| 62 | ${debugmode} False |
| 63 | # logging flag to enable Collect Logs, can be passed via the command line too |
| 64 | # example: -v logging:True |
| 65 | ${logging} False |
| 66 | # if True execution will be paused before clean up, only use in case of manual testing, do not use in ci pipeline! |
| 67 | # example: -v pausebeforecleanup:True |
| 68 | ${pausebeforecleanup} False |
| 69 | # if True some outputs to console are done during running tests e.g. long duration flow test |
| 70 | # example: -v print2console:True |
| 71 | ${print2console} False |
| 72 | # if True (hard) kill will be used to restart onu adapter, else (soft) restart mechanism of k8s will be used |
| 73 | # example: -v usekill2restart:True |
| 74 | ${usekill2restart} False |
TorstenThieme | 4507160 | 2021-03-16 12:14:37 +0000 | [diff] [blame] | 75 | # if True etcd check will be executed in test case teardown, if False etcd check will be executed in suite teardown |
| 76 | # example: -v etcdcheckintestteardown:False |
| 77 | ${etcdcheckintestteardown} True |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 78 | ${data_dir} ../data |
TorstenThieme | 70bc526 | 2021-01-19 12:12:55 +0000 | [diff] [blame] | 79 | ${suppressaddsubscriber} True |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 80 | |
| 81 | |
| 82 | *** Test Cases *** |
| 83 | Reconcile In Starting-OpenOmci |
| 84 | [Documentation] Validates the Reconcile in Starting-OpenOmci |
| 85 | ... Reconcile test during “starting-openomci” in AT&T-workflow: |
| 86 | ... - create and enable one BBSIM-ONU (no MIB-template should be available in KV-store) |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 87 | ... - wait for device reason “starting-openomci” |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 88 | ... - kill the open-onu-adapter-go |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 89 | ... - wait for open-onu-adapter-go to restart |
| 90 | ... - perform sanity test include add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 91 | ... - delete ONU and MIB-template in KV-store |
| 92 | [Tags] functionalOnuGo ReconcileStartingOpenOmciOnuGo |
| 93 | [Setup] Run Keywords Start Logging ReconcileStartingOpenOmciOnuGo |
| 94 | ... AND Setup Test |
| 95 | Run Keyword If ${has_dataplane} Clean Up Linux |
TorstenThieme | e9017be | 2021-03-05 16:59:31 +0000 | [diff] [blame] | 96 | Do Reconcile In Determined State starting-openomci |
TorstenThieme | 3494ceb | 2021-07-19 09:47:24 +0000 | [diff] [blame] | 97 | [Teardown] Run Keywords Run Keyword If ${logging} Get Logical Id of OLT |
| 98 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 99 | ... AND Teardown Test |
| 100 | ... AND Stop Logging ReconcileStartingOpenOmciOnuGo |
| 101 | |
| 102 | Reconcile In Initial-Mib-Downloaded |
| 103 | [Documentation] Validates the Reconcile in initial-mib-downloaded |
| 104 | ... Reconcile test during “initial-mib-downloaded” in AT&T-workflow: |
| 105 | ... - create and enable one BBSIM-ONU (no MIB-template should be available in KV-store) |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 106 | ... - wait for device reason “initial-mib-downloaded” |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 107 | ... - kill the open-onu-adapter-go |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 108 | ... - wait for open-onu-adapter-go to restart |
| 109 | ... - perform sanity test include add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 110 | ... - delete ONU and MIB-template in KV-store |
| 111 | [Tags] functionalOnuGo ReconcileInitialMibDownloadedOnuGo |
| 112 | [Setup] Run Keywords Start Logging ReconcileInitialMibDownloadedOnuGo |
| 113 | ... AND Setup Test |
| 114 | Run Keyword If ${has_dataplane} Clean Up Linux |
TorstenThieme | e9017be | 2021-03-05 16:59:31 +0000 | [diff] [blame] | 115 | Do Reconcile In Determined State initial-mib-downloaded |
TorstenThieme | 3494ceb | 2021-07-19 09:47:24 +0000 | [diff] [blame] | 116 | [Teardown] Run Keywords Run Keyword If ${logging} Get Logical Id of OLT |
| 117 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 118 | ... AND Teardown Test |
| 119 | ... AND Stop Logging ReconcileInitialMibDownloadedOnuGo |
| 120 | |
| 121 | Reconcile In Omci-Flows-Pushed |
| 122 | [Documentation] Validates the Reconcile in omci-flows-pushed |
| 123 | ... Former testcase: Reconcile Onu Device in Testsuite Voltha_ONUStateTest.robot |
| 124 | ... Reconcile test during “omci-flows-pushed” in AT&T-workflow: |
| 125 | ... - create and enable one BBSIM-ONU (no MIB-template should be available in KV-store) |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 126 | ... - perform sanity test include add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 127 | ... - kill the open-onu-adapter-go |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 128 | ... - wait for open-onu-adapter-go to restart |
| 129 | ... - perform sanity test suppress add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 130 | ... - disable onu device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 131 | ... - wait for device corresponding onu reason e.g. “tech-profile-config-delete-success” |
| 132 | ... - check UNI-ports disabled in ONOS |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 133 | ... - enable onu device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 134 | ... - perform sanity test suppress add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 135 | ... - delete ONU and MIB-template in KV-store |
| 136 | [Tags] functionalOnuGo ReconcileOmciFlowsPushedOnuGo |
| 137 | [Setup] Run Keywords Start Logging ReconcileOmciFlowsPushedOnuGo |
| 138 | ... AND Setup Test |
| 139 | Run Keyword If ${has_dataplane} Clean Up Linux |
TorstenThieme | e9017be | 2021-03-05 16:59:31 +0000 | [diff] [blame] | 140 | Do Reconcile In Omci-Flows-Pushed |
TorstenThieme | 3494ceb | 2021-07-19 09:47:24 +0000 | [diff] [blame] | 141 | [Teardown] Run Keywords Run Keyword If ${logging} Get Logical Id of OLT |
| 142 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 143 | ... AND Teardown Test |
| 144 | ... AND Stop Logging ReconcileOmciFlowsPushedOnuGo |
| 145 | |
| 146 | Reconcile For Disabled Onu Device |
| 147 | [Documentation] Validates the Reconcile for disabled Onu device |
| 148 | ... Reconcile test for disabled Onu device in AT&T-workflow: |
| 149 | ... - create and enable one BBSIM-ONU (no MIB-template should be available in KV-store) |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 150 | ... - perform sanity test include add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 151 | ... - disable onu device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 152 | ... - wait for device corresponding onu reason e.g. “tech-profile-config-delete-success” |
| 153 | ... - check UNI-ports disabled in ONOS |
| 154 | ... - kill the open-onu-adapter-go |
| 155 | ... - wait for open-onu-adapter-go to restart |
| 156 | ... - check device reason is still the same before restart |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 157 | ... - enable onu device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 158 | ... - perform sanity test suppress add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 159 | ... - delete ONU and MIB-template in KV-store |
| 160 | [Tags] functionalOnuGo ReconcileDisabledOnuDeviceOnuGo |
| 161 | [Setup] Run Keywords Start Logging ReconcileDisabledOnuDeviceOnuGo |
| 162 | ... AND Setup Test |
| 163 | Run Keyword If ${has_dataplane} Clean Up Linux |
TorstenThieme | e9017be | 2021-03-05 16:59:31 +0000 | [diff] [blame] | 164 | Do Reconcile For Disabled Onu Device |
TorstenThieme | 3494ceb | 2021-07-19 09:47:24 +0000 | [diff] [blame] | 165 | [Teardown] Run Keywords Run Keyword If ${logging} Get Logical Id of OLT |
| 166 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 167 | ... AND Teardown Test |
| 168 | ... AND Stop Logging ReconcileDisabledOnuDeviceOnuGo |
| 169 | |
TorstenThieme | 712b296 | 2021-11-17 14:16:15 +0000 | [diff] [blame] | 170 | Olt Deletion After Adapter Restart |
| 171 | [Documentation] Validates the OLT deletion after adapter restart |
| 172 | ... - prefered environment is two ONUs are active on each of two OLTs, but test works also with single ONU/OLT |
| 173 | ... - restart the ONU adapter preferred via "kubectl delete pod" |
| 174 | ... - delete one OLT immediately after the restart has been initiated |
| 175 | ... - wait until the restart of the ONU adapter and the reconcile processing are finished |
| 176 | ... - check whether the ONUs on the remaining OLT have been properly reconciled (if avaialable) |
| 177 | ... - check whether the ONUs at the deleted OLT have disappeared from the device list |
| 178 | ... - KV store data of these ONUs are deleted under: |
| 179 | ... - <kvStorePrefix>/openonu/<deviceId> |
| 180 | ... - <kvStorePrefix>/openonu/pm-data/<deviceId> |
| 181 | ... - check for not deleted device(s) reason is still the same before restart (if available) |
| 182 | ... - delete ONU and MIB-template in KV-store |
| 183 | ... Check [VOL-4443] for more details |
| 184 | [Tags] functionalOnuGo OltDeletionAfterAdapterRestartOnuGo |
| 185 | [Setup] Run Keywords Start Logging OltDeletionAfterAdapterRestartOnuGo |
| 186 | ... AND Setup Test |
| 187 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 188 | Do Olt Deletion After Adapter Restart |
| 189 | [Teardown] Run Keywords Run Keyword If ${logging} Get Logical Id of OLT |
| 190 | ... AND Run Keyword If ${logging} Collect Logs |
| 191 | ... AND Teardown Test |
| 192 | ... AND Stop Logging OltDeletionAfterAdapterRestartOnuGo |
| 193 | |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 194 | *** Keywords *** |
| 195 | Setup Suite |
| 196 | [Documentation] Set up the test suite |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 197 | Start Logging Setup or Teardown Setup-${SUITE NAME} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 198 | ${LogInfo}= Catenate |
| 199 | ... \r\nPassed arguments: |
| 200 | ... debugmode:${debugmode}, logging:${logging}, pausebeforecleanup:${pausebeforecleanup}, |
TorstenThieme | 4798369 | 2021-06-17 10:43:35 +0000 | [diff] [blame] | 201 | ... print2console:${print2console}, usekill2restart:${usekill2restart}, workflow:${workflow}, |
| 202 | ... kvstoreprefix:${kvstoreprefix} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 203 | Log ${LogInfo} console=yes |
| 204 | Common Test Suite Setup |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 205 | # delete etcd MIB Template Data |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 206 | Delete MIB Template Data ${INFRA_NAMESPACE} |
TorstenThieme | 4507160 | 2021-03-16 12:14:37 +0000 | [diff] [blame] | 207 | # delete etcd onu data |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 208 | Delete ONU Go Adapter ETCD Data namespace=${INFRA_NAMESPACE} validate=True |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 209 | Run Keyword If ${logging} Collect Logs |
| 210 | Stop Logging Setup or Teardown Setup-${SUITE NAME} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 211 | |
TorstenThieme | 70bc526 | 2021-01-19 12:12:55 +0000 | [diff] [blame] | 212 | |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 213 | Teardown Suite |
| 214 | [Documentation] Replaces the Suite Teardown in utils.robot. |
| 215 | ... Cleans up and checks all ONU ports disabled in ONOS. |
| 216 | ... Furthermore gives the possibility to pause the execution. |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 217 | Start Logging Setup or Teardown Teardown-${SUITE NAME} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 218 | Run Keyword If ${pausebeforecleanup} Import Library Dialogs |
| 219 | Run Keyword If ${pausebeforecleanup} Pause Execution Press OK to continue with clean up! |
| 220 | Run Keyword If ${pausebeforecleanup} Log Teardown will be continued... console=yes |
| 221 | Run Keyword If ${teardown_device} Delete All Devices and Verify |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 222 | Run Keyword If ${usekill2restart} Restart Pod By Label ${NAMESPACE} app adapter-open-onu |
TorstenThieme | 4507160 | 2021-03-16 12:14:37 +0000 | [diff] [blame] | 223 | Run Keyword Unless ${etcdcheckintestteardown} Wait Until Keyword Succeeds ${timeout} 1s |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 224 | ... Validate Onu Data In Etcd ${INFRA_NAMESPACE} 0 ${kvstoreprefix} without_pm_data=False |
TorstenThieme | 731a759 | 2021-07-01 14:26:54 +0000 | [diff] [blame] | 225 | Wait for Ports in ONOS for all OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT} 0 BBSM ${timeout} |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 226 | Run Keyword If ${logging} Collect Logs |
| 227 | Stop Logging Setup or Teardown Teardown-${SUITE NAME} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 228 | Close All ONOS SSH Connections |
| 229 | |
| 230 | Setup Test |
| 231 | [Documentation] Pre-test Setup |
| 232 | #test for empty device list |
| 233 | Test Empty Device List |
| 234 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s Openolt is Up |
| 235 | ... ${olt_ssh_ip} ${olt_user} ${olt_pass} |
| 236 | Run Keyword If ${has_dataplane} Sleep 60s |
| 237 | #restart open-onu pod to reset crash loop back off mechansim of kubenetes |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 238 | Run Keyword If "${firsttest}"=="False" and "${usekill2restart}"=="True" |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 239 | ... Restart Pod By Label ${NAMESPACE} app adapter-open-onu |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 240 | Run Keyword If "${firsttest}"=="False" Sleep 35s |
| 241 | ${firsttest} Set Variable False |
| 242 | Set Suite Variable ${firsttest} |
| 243 | # Create a list of olt ids (logical and device_id) |
| 244 | ${olt_ids} Create List |
| 245 | FOR ${I} IN RANGE 0 ${num_olts} |
| 246 | #create/preprovision device |
Andrea Campanella | 3dcce27 | 2021-01-15 16:04:47 +0100 | [diff] [blame] | 247 | ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}" |
TorstenThieme | 4413664 | 2021-02-12 13:41:17 +0000 | [diff] [blame] | 248 | ... Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport] |
| 249 | ... ELSE Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport] ${list_olts}[${I}][type] |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 250 | ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn] |
| 251 | #validate olt states |
| 252 | Wait Until Keyword Succeeds ${timeout} 5s |
Hardik Windlass | 8b44649 | 2021-06-10 06:25:23 +0000 | [diff] [blame] | 253 | ... Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN ${olt_device_id} by_dev_id=True |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 254 | Sleep 5s |
| 255 | ${logical_id}= Get Logical Device ID From SN ${olt_serial_number} |
| 256 | ${olt} Create Dictionary device_id ${olt_device_id} logical_id ${logical_id} |
| 257 | ... of_id ${of_id} sn ${olt_serial_number} |
| 258 | Append To List ${olt_ids} ${olt} |
| 259 | END |
| 260 | Set Global Variable ${olt_ids} |
| 261 | |
| 262 | Teardown Test |
| 263 | [Documentation] Post-test Teardown |
TorstenThieme | 4507160 | 2021-03-16 12:14:37 +0000 | [diff] [blame] | 264 | Run Keyword If ${pausebeforecleanup} Import Library Dialogs |
| 265 | Run Keyword If ${pausebeforecleanup} Pause Execution Press OK to continue with clean up! |
| 266 | Run Keyword If ${pausebeforecleanup} Log Teardown will be continued... console=yes |
TorstenThieme | e9017be | 2021-03-05 16:59:31 +0000 | [diff] [blame] | 267 | Run Keyword If ${teardown_device} Delete All Devices and Verify |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 268 | # delete etcd MIB Template Data |
Matteo Scandolo | 6b52412 | 2021-10-22 14:34:29 -0700 | [diff] [blame] | 269 | Delete MIB Template Data ${INFRA_NAMESPACE} |
TorstenThieme | b355eb6 | 2021-03-09 14:04:55 +0000 | [diff] [blame] | 270 | # check etcd data are empty |
TorstenThieme | 4507160 | 2021-03-16 12:14:37 +0000 | [diff] [blame] | 271 | Run Keyword If ${etcdcheckintestteardown} Wait Until Keyword Succeeds ${timeout} 1s |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 272 | ... Validate Onu Data In Etcd ${INFRA_NAMESPACE} 0 ${kvstoreprefix} without_pm_data=False |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 273 | Sleep 5s |
| 274 | |
| 275 | Do Reconcile In Determined State |
| 276 | [Documentation] This keyword reconciles ONU device when passed reason is reached and |
| 277 | ... check the state afterwards. |
| 278 | ... Following steps will be executed: |
| 279 | ... - enable OLT device |
| 280 | ... - wait for passed openonu reason |
| 281 | ... - restart openonu adaptor |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 282 | ... - perform sanity test include add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 283 | [Arguments] ${expected_onu_reason} |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 284 | ${admin_state} ${oper_status} ${connect_status} ${onu_state_nb} ${onu_state}= Map State |
| 285 | ... ${expected_onu_reason} |
| 286 | Should Be True ${onu_state_nb}<=5 |
| 287 | ... Wrong expected onu reason ${expected_onu_reason}, must be lower than 'omci-flows-pushed'! |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 288 | FOR ${I} IN RANGE 0 ${num_olts} |
| 289 | #get olt serial number |
| 290 | ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn] |
| 291 | #validate olt states |
| 292 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 293 | Enable Device ${olt_device_id} |
| 294 | END |
| 295 | Current State Test All Onus ${expected_onu_reason} |
TorstenThieme | 96fe9ee | 2021-10-21 10:24:08 +0000 | [diff] [blame] | 296 | Reconcile Onu Adapter ${NAMESPACE} ${usekill2restart} ACTIVE |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 297 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 298 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 299 | ... ELSE Perform Sanity Test |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 300 | |
| 301 | Do Reconcile For Disabled Onu Device |
| 302 | [Documentation] This keyword reconciles ONU device for a disabled onu device and |
| 303 | ... check the state afterwards. |
| 304 | ... Following steps will be executed: |
| 305 | ... - enable OLT device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 306 | ... - perform sanity test include add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 307 | ... - disable onu device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 308 | ... - wait for corresponding openonu reason |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 309 | ... - check UNI-ports disabled in ONOS |
| 310 | ... - restart openonu adaptor |
| 311 | ... - check openonu adaptor is ready again |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 312 | ... - check device reason is still before restart |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 313 | ... - enable onu device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 314 | ... - perform sanity test suppress add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 315 | FOR ${I} IN RANGE 0 ${num_olts} |
| 316 | #get olt serial number |
| 317 | ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn] |
| 318 | #validate olt states |
| 319 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 320 | Enable Device ${olt_device_id} |
| 321 | END |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 322 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 323 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 324 | ... ELSE Perform Sanity Test |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 325 | Disable Onu Device |
TorstenThieme | 0ec95eb | 2021-11-23 14:56:26 +0000 | [diff] [blame] | 326 | Current State Test All Onus tech-profile-config-delete-success |
TorstenThieme | 96fe9ee | 2021-10-21 10:24:08 +0000 | [diff] [blame] | 327 | Reconcile Onu Adapter ${NAMESPACE} ${usekill2restart} UNKNOWN |
TorstenThieme | 0ec95eb | 2021-11-23 14:56:26 +0000 | [diff] [blame] | 328 | Current State Test All Onus tech-profile-config-delete-success |
TorstenThieme | 731a759 | 2021-07-01 14:26:54 +0000 | [diff] [blame] | 329 | Wait for all ONU Ports in ONOS Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 330 | Enable Onu Device |
TorstenThieme | 70bc526 | 2021-01-19 12:12:55 +0000 | [diff] [blame] | 331 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT ${suppressaddsubscriber} |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 332 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT ${suppressaddsubscriber} |
TorstenThieme | 70bc526 | 2021-01-19 12:12:55 +0000 | [diff] [blame] | 333 | ... ELSE Perform Sanity Test ${suppressaddsubscriber} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 334 | |
| 335 | Do Reconcile In Omci-Flows-Pushed |
| 336 | [Documentation] This keyword reconciles ONU device in omci-flows-pushed and check the state afterwards. |
| 337 | ... Reconcile test during “omci-flows-pushed” in AT&T-workflow: |
| 338 | ... - create and enable one BBSIM-ONU (no MIB-template should be available in KV-store) |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 339 | ... - perform sanity test include add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 340 | ... - kill the open-onu-adapter-go |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 341 | ... - wait for open-onu-adapter-go to restart |
| 342 | ... - perform sanity test suppress add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 343 | ... - disable onu device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 344 | ... - wait for corresponding device reason |
| 345 | ... - check UNI-ports disabled in ONOS |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 346 | ... - enable onu device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 347 | ... - perform sanity test supress add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 348 | FOR ${I} IN RANGE 0 ${num_olts} |
| 349 | #get olt serial number |
| 350 | ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn] |
| 351 | #validate olt states |
| 352 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 353 | Enable Device ${olt_device_id} |
| 354 | END |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 355 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 356 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 357 | ... ELSE Perform Sanity Test |
TorstenThieme | 96fe9ee | 2021-10-21 10:24:08 +0000 | [diff] [blame] | 358 | Reconcile Onu Adapter ${NAMESPACE} ${usekill2restart} ACTIVE |
TorstenThieme | 70bc526 | 2021-01-19 12:12:55 +0000 | [diff] [blame] | 359 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT ${suppressaddsubscriber} |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 360 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT ${suppressaddsubscriber} |
TorstenThieme | 70bc526 | 2021-01-19 12:12:55 +0000 | [diff] [blame] | 361 | ... ELSE Perform Sanity Test ${suppressaddsubscriber} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 362 | Disable Onu Device |
TorstenThieme | 0ec95eb | 2021-11-23 14:56:26 +0000 | [diff] [blame] | 363 | Current State Test All Onus tech-profile-config-delete-success |
TorstenThieme | 731a759 | 2021-07-01 14:26:54 +0000 | [diff] [blame] | 364 | Wait for all ONU Ports in ONOS Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 365 | Enable Onu Device |
TorstenThieme | 70bc526 | 2021-01-19 12:12:55 +0000 | [diff] [blame] | 366 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT ${suppressaddsubscriber} |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 367 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT ${suppressaddsubscriber} |
TorstenThieme | 70bc526 | 2021-01-19 12:12:55 +0000 | [diff] [blame] | 368 | ... ELSE Perform Sanity Test ${suppressaddsubscriber} |
TorstenThieme | 712b296 | 2021-11-17 14:16:15 +0000 | [diff] [blame] | 369 | |
| 370 | |
| 371 | Do Olt Deletion After Adapter Restart |
| 372 | [Documentation] This keyword deletes OLT after adapter restart and checks deleted device(s) and data |
| 373 | ... - prefered environment is two ONUs are active on each of two OLTs, but test works also with single ONU/OLT |
| 374 | ... - restart the ONU adapter preferred via "kubectl delete pod" |
| 375 | ... - delete one OLT immediately after the restart has been initiated |
| 376 | ... - wait until the restart of the ONU adapter and the reconcile processing are finished |
| 377 | ... - check whether the ONUs on the remaining OLT have been properly reconciled (if avaialable) |
| 378 | ... - check whether the ONUs at the deleted OLT have disappeared from the device list |
| 379 | ... - KV store data of these ONUs are deleted under: |
| 380 | ... - <kvStorePrefix>/openonu/<deviceId> |
| 381 | ... - <kvStorePrefix>/openonu/pm-data/<deviceId> |
| 382 | ... - check for not deleted device(s) reason is still the same before restart (if available) |
| 383 | ... - delete ONU and MIB-template in KV-store |
| 384 | ... Check [VOL-4443] for more details |
| 385 | FOR ${I} IN RANGE 0 ${num_olts} |
| 386 | #get olt serial number |
| 387 | ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn] |
| 388 | #validate olt states |
| 389 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 390 | Enable Device ${olt_device_id} |
| 391 | END |
| 392 | # bring all onus to activ -> OMCI-Flows-Pushed |
| 393 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT |
| 394 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT |
| 395 | ... ELSE Perform Sanity Test |
| 396 | # OLT#1 will be deleted, get its SN |
| 397 | ${olt_to_be_deleted}= Set Variable ${olts[0]['serial']} |
| 398 | ${olt_to_be_deleted_device_id}= Get OLTDeviceID From OLT List ${olt_to_be_deleted} |
| 399 | # collect all ONU device ids belonging to OLT to be deleted |
| 400 | ${onu_device_id_list_should_be_deleted} Create List |
| 401 | Build ONU Device Id List ${onu_device_id_list_should_be_deleted} ${olt_to_be_deleted} |
| 402 | Log ${onu_device_id_list_should_be_deleted} |
| 403 | Reconcile Onu Adapter ${NAMESPACE} ${usekill2restart} ACTIVE ${olt_to_be_deleted} |
| 404 | # validate OLT and all corresponding ONUs are removed |
| 405 | Validate all ONUS for OLT Removed ${num_all_onus} ${hosts} ${olt_to_be_deleted} ${timeout} |
| 406 | Validate Device Removed ${olt_to_be_deleted} |
| 407 | # validate for alle removed ONUs KV store date deleted |
| 408 | FOR ${onu_device_id} IN @{onu_device_id_list_should_be_deleted} |
| 409 | Log ${onu_device_id} |
| 410 | Wait Until Keyword Succeeds ${timeout} 1s Validate Onu Data In Etcd Removed ${INFRA_NAMESPACE} |
| 411 | ... ${onu_device_id} ${kvstoreprefix} without_pm_data=False |
| 412 | END |
| 413 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 414 | ${src}= Set Variable ${hosts.src[${I}]} |
| 415 | Continue For Loop If "${olt_to_be_deleted}"=="${src['olt']}" |
| 416 | Current State Test omci-flows-pushed ${src['onu']} |
| 417 | END |