Joey Armstrong | 9fadcbe | 2024-01-17 19:00:37 -0500 | [diff] [blame] | 1 | # Copyright 2020-2024 Open Networking Foundation (ONF) and the ONF Contributors |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 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 | ... Hint: default timeout in BBSim to mimic OLT reboot is 60 seconds! |
| 18 | ... This behaviour of BBSim can be modified by 'oltRebootDelay: 60' in BBSim section of helm chart or |
| 19 | ... used values.yaml during 'voltha up'. |
| 20 | Suite Setup Setup Suite |
| 21 | Suite Teardown Teardown Suite |
| 22 | Test Setup Setup |
| 23 | Test Teardown Teardown |
| 24 | Library Collections |
| 25 | Library String |
| 26 | Library OperatingSystem |
| 27 | Library XML |
| 28 | Library RequestsLibrary |
| 29 | Library ../../libraries/DependencyLibrary.py |
| 30 | Resource ../../libraries/onos.robot |
| 31 | Resource ../../libraries/voltctl.robot |
| 32 | Resource ../../libraries/voltha.robot |
| 33 | Resource ../../libraries/utils.robot |
| 34 | Resource ../../libraries/k8s.robot |
| 35 | Resource ../../libraries/onu_utilities.robot |
| 36 | Resource ../../variables/variables.robot |
| 37 | |
| 38 | *** Variables *** |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 39 | ${NAMESPACE} voltha |
| 40 | ${INFRA_NAMESPACE} default |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 41 | ${timeout} 60s |
| 42 | ${of_id} 0 |
| 43 | ${logical_id} 0 |
| 44 | ${has_dataplane} True |
| 45 | ${external_libs} True |
| 46 | ${teardown_device} True |
| 47 | ${scripts} ../../scripts |
| 48 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 49 | ${container_log_dir} ${None} |
| 50 | # flag for first test, needed due default timeout in BBSim to mimic OLT reboot of 60 seconds |
| 51 | ${firsttest} True |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 52 | # determines the environment workflow: DT, TT or ATT (default) |
| 53 | # example: -v workflow:DT |
| 54 | ${workflow} ATT |
TorstenThieme | 4798369 | 2021-06-17 10:43:35 +0000 | [diff] [blame] | 55 | # KV Store Prefix |
Andrea Campanella | 388cd87 | 2022-02-10 09:11:39 +0100 | [diff] [blame] | 56 | # example: -v kvstoreprefix:voltha/voltha_voltha |
| 57 | ${kvstoreprefix} voltha/voltha_voltha |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 58 | # flag debugmode is used, if true timeout calculation various, can be passed via the command line too |
| 59 | # example: -v debugmode:True |
| 60 | ${debugmode} False |
| 61 | # logging flag to enable Collect Logs, can be passed via the command line too |
| 62 | # example: -v logging:True |
| 63 | ${logging} False |
| 64 | # if True execution will be paused before clean up, only use in case of manual testing, do not use in ci pipeline! |
| 65 | # example: -v pausebeforecleanup:True |
| 66 | ${pausebeforecleanup} False |
| 67 | # if True some outputs to console are done during running tests e.g. long duration flow test |
| 68 | # example: -v print2console:True |
| 69 | ${print2console} False |
| 70 | # if True (hard) kill will be used to restart onu adapter, else (soft) restart mechanism of k8s will be used |
| 71 | # example: -v usekill2restart:True |
| 72 | ${usekill2restart} False |
TorstenThieme | 4507160 | 2021-03-16 12:14:37 +0000 | [diff] [blame] | 73 | # if True etcd check will be executed in test case teardown, if False etcd check will be executed in suite teardown |
| 74 | # example: -v etcdcheckintestteardown:False |
| 75 | ${etcdcheckintestteardown} True |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 76 | ${data_dir} ../data |
TorstenThieme | 70bc526 | 2021-01-19 12:12:55 +0000 | [diff] [blame] | 77 | ${suppressaddsubscriber} True |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 78 | |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 79 | # flag to choose the subscriber provisioning command type in ONOS |
| 80 | # TT often provision a single services for a subscriber (eg: hsia, voip, ...) one after the other. |
| 81 | # if set to True, command used is "volt-add-subscriber-unitag" |
| 82 | # if set to False, comand used is "volt-add-subscriber-access" |
| 83 | ${unitag_sub} False |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 84 | |
| 85 | *** Test Cases *** |
| 86 | Reconcile In Starting-OpenOmci |
| 87 | [Documentation] Validates the Reconcile in Starting-OpenOmci |
| 88 | ... Reconcile test during “starting-openomci” in AT&T-workflow: |
| 89 | ... - 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] | 90 | ... - wait for device reason “starting-openomci” |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 91 | ... - kill the open-onu-adapter-go |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 92 | ... - wait for open-onu-adapter-go to restart |
| 93 | ... - perform sanity test include add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 94 | ... - delete ONU and MIB-template in KV-store |
| 95 | [Tags] functionalOnuGo ReconcileStartingOpenOmciOnuGo |
| 96 | [Setup] Run Keywords Start Logging ReconcileStartingOpenOmciOnuGo |
| 97 | ... AND Setup Test |
| 98 | Run Keyword If ${has_dataplane} Clean Up Linux |
TorstenThieme | e9017be | 2021-03-05 16:59:31 +0000 | [diff] [blame] | 99 | Do Reconcile In Determined State starting-openomci |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame] | 100 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console} |
| 101 | ... AND Run Keyword If ${logging} Get Logical Id of OLT |
TorstenThieme | 3494ceb | 2021-07-19 09:47:24 +0000 | [diff] [blame] | 102 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 103 | ... AND Teardown Test |
| 104 | ... AND Stop Logging ReconcileStartingOpenOmciOnuGo |
| 105 | |
| 106 | Reconcile In Initial-Mib-Downloaded |
| 107 | [Documentation] Validates the Reconcile in initial-mib-downloaded |
| 108 | ... Reconcile test during “initial-mib-downloaded” in AT&T-workflow: |
| 109 | ... - 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] | 110 | ... - wait for device reason “initial-mib-downloaded” |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 111 | ... - kill the open-onu-adapter-go |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 112 | ... - wait for open-onu-adapter-go to restart |
| 113 | ... - perform sanity test include add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 114 | ... - delete ONU and MIB-template in KV-store |
| 115 | [Tags] functionalOnuGo ReconcileInitialMibDownloadedOnuGo |
| 116 | [Setup] Run Keywords Start Logging ReconcileInitialMibDownloadedOnuGo |
| 117 | ... AND Setup Test |
| 118 | Run Keyword If ${has_dataplane} Clean Up Linux |
TorstenThieme | e9017be | 2021-03-05 16:59:31 +0000 | [diff] [blame] | 119 | Do Reconcile In Determined State initial-mib-downloaded |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame] | 120 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console} |
| 121 | ... AND Run Keyword If ${logging} Get Logical Id of OLT |
TorstenThieme | 3494ceb | 2021-07-19 09:47:24 +0000 | [diff] [blame] | 122 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 123 | ... AND Teardown Test |
| 124 | ... AND Stop Logging ReconcileInitialMibDownloadedOnuGo |
| 125 | |
| 126 | Reconcile In Omci-Flows-Pushed |
| 127 | [Documentation] Validates the Reconcile in omci-flows-pushed |
| 128 | ... Former testcase: Reconcile Onu Device in Testsuite Voltha_ONUStateTest.robot |
| 129 | ... Reconcile test during “omci-flows-pushed” in AT&T-workflow: |
| 130 | ... - 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] | 131 | ... - perform sanity test include add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 132 | ... - kill the open-onu-adapter-go |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 133 | ... - wait for open-onu-adapter-go to restart |
| 134 | ... - perform sanity test suppress add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 135 | ... - disable onu device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 136 | ... - wait for device corresponding onu reason e.g. “tech-profile-config-delete-success” |
| 137 | ... - check UNI-ports disabled in ONOS |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 138 | ... - enable onu device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 139 | ... - perform sanity test suppress add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 140 | ... - delete ONU and MIB-template in KV-store |
| 141 | [Tags] functionalOnuGo ReconcileOmciFlowsPushedOnuGo |
| 142 | [Setup] Run Keywords Start Logging ReconcileOmciFlowsPushedOnuGo |
| 143 | ... AND Setup Test |
| 144 | Run Keyword If ${has_dataplane} Clean Up Linux |
TorstenThieme | e9017be | 2021-03-05 16:59:31 +0000 | [diff] [blame] | 145 | Do Reconcile In Omci-Flows-Pushed |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame] | 146 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console} |
| 147 | ... AND Run Keyword If ${logging} Get Logical Id of OLT |
TorstenThieme | 3494ceb | 2021-07-19 09:47:24 +0000 | [diff] [blame] | 148 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 149 | ... AND Teardown Test |
| 150 | ... AND Stop Logging ReconcileOmciFlowsPushedOnuGo |
| 151 | |
| 152 | Reconcile For Disabled Onu Device |
| 153 | [Documentation] Validates the Reconcile for disabled Onu device |
| 154 | ... Reconcile test for disabled Onu device in AT&T-workflow: |
| 155 | ... - 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] | 156 | ... - perform sanity test include add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 157 | ... - disable onu device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 158 | ... - wait for device corresponding onu reason e.g. “tech-profile-config-delete-success” |
| 159 | ... - check UNI-ports disabled in ONOS |
| 160 | ... - kill the open-onu-adapter-go |
| 161 | ... - wait for open-onu-adapter-go to restart |
| 162 | ... - check device reason is still the same before restart |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 163 | ... - enable onu device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 164 | ... - perform sanity test suppress add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 165 | ... - delete ONU and MIB-template in KV-store |
| 166 | [Tags] functionalOnuGo ReconcileDisabledOnuDeviceOnuGo |
| 167 | [Setup] Run Keywords Start Logging ReconcileDisabledOnuDeviceOnuGo |
| 168 | ... AND Setup Test |
| 169 | Run Keyword If ${has_dataplane} Clean Up Linux |
TorstenThieme | e9017be | 2021-03-05 16:59:31 +0000 | [diff] [blame] | 170 | Do Reconcile For Disabled Onu Device |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame] | 171 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console} |
| 172 | ... AND Run Keyword If ${logging} Get Logical Id of OLT |
TorstenThieme | 3494ceb | 2021-07-19 09:47:24 +0000 | [diff] [blame] | 173 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 174 | ... AND Teardown Test |
| 175 | ... AND Stop Logging ReconcileDisabledOnuDeviceOnuGo |
| 176 | |
TorstenThieme | 712b296 | 2021-11-17 14:16:15 +0000 | [diff] [blame] | 177 | Olt Deletion After Adapter Restart |
| 178 | [Documentation] Validates the OLT deletion after adapter restart |
| 179 | ... - prefered environment is two ONUs are active on each of two OLTs, but test works also with single ONU/OLT |
| 180 | ... - restart the ONU adapter preferred via "kubectl delete pod" |
| 181 | ... - delete one OLT immediately after the restart has been initiated |
| 182 | ... - wait until the restart of the ONU adapter and the reconcile processing are finished |
| 183 | ... - check whether the ONUs on the remaining OLT have been properly reconciled (if avaialable) |
| 184 | ... - check whether the ONUs at the deleted OLT have disappeared from the device list |
| 185 | ... - KV store data of these ONUs are deleted under: |
| 186 | ... - <kvStorePrefix>/openonu/<deviceId> |
| 187 | ... - <kvStorePrefix>/openonu/pm-data/<deviceId> |
| 188 | ... - check for not deleted device(s) reason is still the same before restart (if available) |
| 189 | ... - delete ONU and MIB-template in KV-store |
| 190 | ... Check [VOL-4443] for more details |
| 191 | [Tags] functionalOnuGo OltDeletionAfterAdapterRestartOnuGo |
| 192 | [Setup] Run Keywords Start Logging OltDeletionAfterAdapterRestartOnuGo |
| 193 | ... AND Setup Test |
| 194 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 195 | Do Olt Deletion After Adapter Restart |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame] | 196 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console} |
| 197 | ... AND Run Keyword If ${logging} Get Logical Id of OLT |
TorstenThieme | 712b296 | 2021-11-17 14:16:15 +0000 | [diff] [blame] | 198 | ... AND Run Keyword If ${logging} Collect Logs |
| 199 | ... AND Teardown Test |
| 200 | ... AND Stop Logging OltDeletionAfterAdapterRestartOnuGo |
| 201 | |
TorstenThieme | f7cd2be | 2021-12-06 14:30:11 +0000 | [diff] [blame] | 202 | Flow Deletion After Adapter Restart |
| 203 | [Documentation] Validates the flow(s) deletion after adapter restart |
| 204 | ... - perform sanity test include add subscriber |
| 205 | ... - restart the ONU adapter preferred via "kubectl delete pod" |
| 206 | ... - remove flow(s) from one ONU immediately after the restart has been initiated |
| 207 | ... - wait until the restart of the ONU adapter and the reconcile processing are finished |
| 208 | ... - check removed flow(s) from ONU |
| 209 | ... - check for not removed flows still the same before restart (if available) |
| 210 | [Tags] functionalOnuGo FlowDeletionAfterAdapterRestartOnuGo |
| 211 | [Setup] Run Keywords Start Logging FlowDeletionAfterAdapterRestartOnuGo |
| 212 | ... AND Setup Test |
| 213 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 214 | Do Flow Deletion After Adapter Restart |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame] | 215 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console} |
| 216 | ... AND Run Keyword If ${logging} Get Logical Id of OLT |
TorstenThieme | f7cd2be | 2021-12-06 14:30:11 +0000 | [diff] [blame] | 217 | ... AND Run Keyword If ${logging} Collect Logs |
| 218 | ... AND Teardown Test |
| 219 | ... AND Stop Logging FlowDeletionAfterAdapterRestartOnuGo |
| 220 | |
TorstenThieme | 00fe826 | 2022-01-19 10:43:07 +0000 | [diff] [blame] | 221 | Wrong MDS Counter After Adapter Restart |
| 222 | [Documentation] Validates wrong MDS Counter of ONU after adapter restart |
| 223 | ... - perform sanity test include add subscriber |
| 224 | ... - restart the ONU adapter preferred via "kubectl delete pod" |
| 225 | ... - manipulate MDS counter |
| 226 | ... - wait until the restart of the ONU adapter and the reconcile processing are finished |
| 227 | ... - check all ONUs come up to previous state |
| 228 | [Tags] functionalOnuGo WrongMDSCounterAfterAdapterRestartOnuGo |
| 229 | [Setup] Run Keywords Start Logging WrongMDSCounterAfterAdapterRestartOnuGo |
| 230 | ... AND Setup Test |
| 231 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 232 | Do Wrong MDS Counter After Adapter Restart |
| 233 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console} |
| 234 | ... AND Run Keyword If ${logging} Get Logical Id of OLT |
| 235 | ... AND Run Keyword If ${logging} Collect Logs |
| 236 | ... AND Teardown Test |
| 237 | ... AND Stop Logging WrongMDSCounterAfterAdapterRestartOnuGo |
| 238 | |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 239 | *** Keywords *** |
| 240 | Setup Suite |
| 241 | [Documentation] Set up the test suite |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 242 | Start Logging Setup or Teardown Setup-${SUITE NAME} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 243 | ${LogInfo}= Catenate |
| 244 | ... \r\nPassed arguments: |
| 245 | ... debugmode:${debugmode}, logging:${logging}, pausebeforecleanup:${pausebeforecleanup}, |
TorstenThieme | 4798369 | 2021-06-17 10:43:35 +0000 | [diff] [blame] | 246 | ... print2console:${print2console}, usekill2restart:${usekill2restart}, workflow:${workflow}, |
| 247 | ... kvstoreprefix:${kvstoreprefix} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 248 | Log ${LogInfo} console=yes |
| 249 | Common Test Suite Setup |
TorstenThieme | 00fe826 | 2022-01-19 10:43:07 +0000 | [diff] [blame] | 250 | # set tech profiles |
TorstenThieme | 6ab9950 | 2022-02-07 15:00:59 +0000 | [diff] [blame] | 251 | ${preload_tech_profile}= Set Variable If ${unitag_sub} and "${workflow}"=="TT" and not ${has_dataplane} True False |
| 252 | Set Suite Variable ${preload_tech_profile} |
| 253 | Run Keyword If ${preload_tech_profile} Set Tech Profile TT-HSIA ${INFRA_NAMESPACE} 64 |
| 254 | Run Keyword If ${preload_tech_profile} Set Tech Profile TT-VoIP ${INFRA_NAMESPACE} 65 |
| 255 | Run Keyword If ${preload_tech_profile} Set Tech Profile TT-multi-uni-MCAST-AdditionalBW-None ${INFRA_NAMESPACE} 66 |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 256 | # delete etcd MIB Template Data |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 257 | Delete MIB Template Data ${INFRA_NAMESPACE} |
TorstenThieme | 4507160 | 2021-03-16 12:14:37 +0000 | [diff] [blame] | 258 | # delete etcd onu data |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 259 | Delete ONU Go Adapter ETCD Data namespace=${INFRA_NAMESPACE} validate=True |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 260 | Run Keyword If ${logging} Collect Logs |
| 261 | Stop Logging Setup or Teardown Setup-${SUITE NAME} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 262 | |
TorstenThieme | 70bc526 | 2021-01-19 12:12:55 +0000 | [diff] [blame] | 263 | |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 264 | Teardown Suite |
| 265 | [Documentation] Replaces the Suite Teardown in utils.robot. |
| 266 | ... Cleans up and checks all ONU ports disabled in ONOS. |
| 267 | ... Furthermore gives the possibility to pause the execution. |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 268 | Start Logging Setup or Teardown Teardown-${SUITE NAME} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 269 | Run Keyword If ${pausebeforecleanup} Import Library Dialogs |
| 270 | Run Keyword If ${pausebeforecleanup} Pause Execution Press OK to continue with clean up! |
| 271 | Run Keyword If ${pausebeforecleanup} Log Teardown will be continued... console=yes |
| 272 | Run Keyword If ${teardown_device} Delete All Devices and Verify |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 273 | Run Keyword If ${usekill2restart} Restart Pod By Label ${NAMESPACE} app adapter-open-onu |
TorstenThieme | 4507160 | 2021-03-16 12:14:37 +0000 | [diff] [blame] | 274 | Run Keyword Unless ${etcdcheckintestteardown} Wait Until Keyword Succeeds ${timeout} 1s |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 275 | ... Validate Onu Data In Etcd ${INFRA_NAMESPACE} 0 ${kvstoreprefix} without_pm_data=False |
TorstenThieme | 731a759 | 2021-07-01 14:26:54 +0000 | [diff] [blame] | 276 | 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] | 277 | Run Keyword If ${logging} Collect Logs |
| 278 | Stop Logging Setup or Teardown Teardown-${SUITE NAME} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 279 | Close All ONOS SSH Connections |
TorstenThieme | 00fe826 | 2022-01-19 10:43:07 +0000 | [diff] [blame] | 280 | Set Suite Variable ${TechProfile} ${EMPTY} |
TorstenThieme | 6ab9950 | 2022-02-07 15:00:59 +0000 | [diff] [blame] | 281 | Run Keyword If ${preload_tech_profile} Remove Tech Profile ${INFRA_NAMESPACE} 64 |
| 282 | Run Keyword If ${preload_tech_profile} Remove Tech Profile ${INFRA_NAMESPACE} 65 |
| 283 | Run Keyword If ${preload_tech_profile} Remove Tech Profile ${INFRA_NAMESPACE} 66 |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 284 | |
| 285 | Setup Test |
| 286 | [Documentation] Pre-test Setup |
| 287 | #test for empty device list |
| 288 | Test Empty Device List |
| 289 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s Openolt is Up |
| 290 | ... ${olt_ssh_ip} ${olt_user} ${olt_pass} |
| 291 | Run Keyword If ${has_dataplane} Sleep 60s |
| 292 | #restart open-onu pod to reset crash loop back off mechansim of kubenetes |
TorstenThieme | 3716540 | 2021-09-03 11:39:40 +0000 | [diff] [blame] | 293 | Run Keyword If "${firsttest}"=="False" and "${usekill2restart}"=="True" |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 294 | ... Restart Pod By Label ${NAMESPACE} app adapter-open-onu |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 295 | Run Keyword If "${firsttest}"=="False" Sleep 35s |
| 296 | ${firsttest} Set Variable False |
| 297 | Set Suite Variable ${firsttest} |
| 298 | # Create a list of olt ids (logical and device_id) |
| 299 | ${olt_ids} Create List |
| 300 | FOR ${I} IN RANGE 0 ${num_olts} |
| 301 | #create/preprovision device |
Andrea Campanella | 3dcce27 | 2021-01-15 16:04:47 +0100 | [diff] [blame] | 302 | ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}" |
TorstenThieme | 4413664 | 2021-02-12 13:41:17 +0000 | [diff] [blame] | 303 | ... Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport] |
| 304 | ... 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] | 305 | ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn] |
| 306 | #validate olt states |
| 307 | Wait Until Keyword Succeeds ${timeout} 5s |
Hardik Windlass | 8b44649 | 2021-06-10 06:25:23 +0000 | [diff] [blame] | 308 | ... Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN ${olt_device_id} by_dev_id=True |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 309 | Sleep 5s |
| 310 | ${logical_id}= Get Logical Device ID From SN ${olt_serial_number} |
| 311 | ${olt} Create Dictionary device_id ${olt_device_id} logical_id ${logical_id} |
| 312 | ... of_id ${of_id} sn ${olt_serial_number} |
| 313 | Append To List ${olt_ids} ${olt} |
| 314 | END |
| 315 | Set Global Variable ${olt_ids} |
| 316 | |
| 317 | Teardown Test |
| 318 | [Documentation] Post-test Teardown |
TorstenThieme | 4507160 | 2021-03-16 12:14:37 +0000 | [diff] [blame] | 319 | Run Keyword If ${pausebeforecleanup} Import Library Dialogs |
| 320 | Run Keyword If ${pausebeforecleanup} Pause Execution Press OK to continue with clean up! |
| 321 | Run Keyword If ${pausebeforecleanup} Log Teardown will be continued... console=yes |
TorstenThieme | e9017be | 2021-03-05 16:59:31 +0000 | [diff] [blame] | 322 | Run Keyword If ${teardown_device} Delete All Devices and Verify |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 323 | # delete etcd MIB Template Data |
Matteo Scandolo | 6b52412 | 2021-10-22 14:34:29 -0700 | [diff] [blame] | 324 | Delete MIB Template Data ${INFRA_NAMESPACE} |
TorstenThieme | b355eb6 | 2021-03-09 14:04:55 +0000 | [diff] [blame] | 325 | # check etcd data are empty |
TorstenThieme | 4507160 | 2021-03-16 12:14:37 +0000 | [diff] [blame] | 326 | Run Keyword If ${etcdcheckintestteardown} Wait Until Keyword Succeeds ${timeout} 1s |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 327 | ... Validate Onu Data In Etcd ${INFRA_NAMESPACE} 0 ${kvstoreprefix} without_pm_data=False |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 328 | Sleep 5s |
| 329 | |
| 330 | Do Reconcile In Determined State |
| 331 | [Documentation] This keyword reconciles ONU device when passed reason is reached and |
| 332 | ... check the state afterwards. |
| 333 | ... Following steps will be executed: |
| 334 | ... - enable OLT device |
| 335 | ... - wait for passed openonu reason |
| 336 | ... - restart openonu adaptor |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 337 | ... - perform sanity test include add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 338 | [Arguments] ${expected_onu_reason} |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 339 | ${admin_state} ${oper_status} ${connect_status} ${onu_state_nb} ${onu_state}= Map State |
| 340 | ... ${expected_onu_reason} |
| 341 | Should Be True ${onu_state_nb}<=5 |
| 342 | ... 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] | 343 | FOR ${I} IN RANGE 0 ${num_olts} |
| 344 | #get olt serial number |
| 345 | ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn] |
| 346 | #validate olt states |
| 347 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 348 | Enable Device ${olt_device_id} |
| 349 | END |
| 350 | Current State Test All Onus ${expected_onu_reason} |
TorstenThieme | 96fe9ee | 2021-10-21 10:24:08 +0000 | [diff] [blame] | 351 | Reconcile Onu Adapter ${NAMESPACE} ${usekill2restart} ACTIVE |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 352 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 353 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 354 | ... ELSE Perform Sanity Test |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 355 | |
| 356 | Do Reconcile For Disabled Onu Device |
| 357 | [Documentation] This keyword reconciles ONU device for a disabled onu device and |
| 358 | ... check the state afterwards. |
| 359 | ... Following steps will be executed: |
| 360 | ... - enable OLT device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 361 | ... - perform sanity test include add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 362 | ... - disable onu device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 363 | ... - wait for corresponding openonu reason |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 364 | ... - check UNI-ports disabled in ONOS |
| 365 | ... - restart openonu adaptor |
| 366 | ... - check openonu adaptor is ready again |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 367 | ... - check device reason is still before restart |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 368 | ... - enable onu device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 369 | ... - perform sanity test suppress add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 370 | FOR ${I} IN RANGE 0 ${num_olts} |
| 371 | #get olt serial number |
| 372 | ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn] |
| 373 | #validate olt states |
| 374 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 375 | Enable Device ${olt_device_id} |
| 376 | END |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 377 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 378 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 379 | ... ELSE Perform Sanity Test |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 380 | Disable Onu Device |
Andrea Campanella | 753510e | 2022-04-28 23:26:27 +0200 | [diff] [blame] | 381 | Run Keyword If "${workflow}"=="DT" Current State Test All Onus omci-admin-lock |
TorstenThieme | 20e1627 | 2022-07-13 06:51:18 +0000 | [diff] [blame] | 382 | ... ELSE IF "${workflow}"=="TT" Current State Test All Onus tech-profile-config-delete-success |
| 383 | ... ELSE Current State Test All Onus tech-profile-config-delete-success |
TorstenThieme | 00fe826 | 2022-01-19 10:43:07 +0000 | [diff] [blame] | 384 | #check no port is enabled in ONOS |
| 385 | Wait for Ports in ONOS for all OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT} 0 BBSM |
| 386 | Wait for all ONU Ports in ONOS Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${unitag_sub} |
| 387 | # validate etcd data |
| 388 | ${List_ONU_Serial} Create List |
| 389 | Build ONU SN List ${List_ONU_Serial} |
TorstenThieme | 20e1627 | 2022-07-13 06:51:18 +0000 | [diff] [blame] | 390 | ${must_exist}= Set Variable If "${workflow}"=="DT" True False |
| 391 | ${check_empty}= Set Variable If "${workflow}"=="DT" False True |
TorstenThieme | 00fe826 | 2022-01-19 10:43:07 +0000 | [diff] [blame] | 392 | FOR ${onu_sn} IN @{List_ONU_Serial} |
| 393 | Wait Until Keyword Succeeds ${timeout} 2s Validate Tech Profiles and Flows in ETCD Data Per Onu |
TorstenThieme | 20e1627 | 2022-07-13 06:51:18 +0000 | [diff] [blame] | 394 | ... ${onu_sn} ${INFRA_NAMESPACE} ${kvstoreprefix} must_exist=${must_exist} check_tcont_map_empty=${check_empty} |
TorstenThieme | 569ef45 | 2022-02-07 14:00:26 +0000 | [diff] [blame] | 395 | ... check_default_flow_att=False |
TorstenThieme | 00fe826 | 2022-01-19 10:43:07 +0000 | [diff] [blame] | 396 | END |
TorstenThieme | 96fe9ee | 2021-10-21 10:24:08 +0000 | [diff] [blame] | 397 | Reconcile Onu Adapter ${NAMESPACE} ${usekill2restart} UNKNOWN |
Andrea Campanella | 753510e | 2022-04-28 23:26:27 +0200 | [diff] [blame] | 398 | Run Keyword If "${workflow}"=="DT" Current State Test All Onus omci-admin-lock |
TorstenThieme | 20e1627 | 2022-07-13 06:51:18 +0000 | [diff] [blame] | 399 | ... ELSE IF "${workflow}"=="TT" Current State Test All Onus tech-profile-config-delete-success |
| 400 | ... ELSE Current State Test All Onus tech-profile-config-delete-success |
TorstenThieme | 00fe826 | 2022-01-19 10:43:07 +0000 | [diff] [blame] | 401 | Wait for all ONU Ports in ONOS Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${unitag_sub} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 402 | Enable Onu Device |
TorstenThieme | 70bc526 | 2021-01-19 12:12:55 +0000 | [diff] [blame] | 403 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT ${suppressaddsubscriber} |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 404 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT ${suppressaddsubscriber} |
TorstenThieme | 70bc526 | 2021-01-19 12:12:55 +0000 | [diff] [blame] | 405 | ... ELSE Perform Sanity Test ${suppressaddsubscriber} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 406 | |
| 407 | Do Reconcile In Omci-Flows-Pushed |
| 408 | [Documentation] This keyword reconciles ONU device in omci-flows-pushed and check the state afterwards. |
| 409 | ... Reconcile test during “omci-flows-pushed” in AT&T-workflow: |
| 410 | ... - 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] | 411 | ... - perform sanity test include add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 412 | ... - kill the open-onu-adapter-go |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 413 | ... - wait for open-onu-adapter-go to restart |
| 414 | ... - perform sanity test suppress add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 415 | ... - disable onu device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 416 | ... - wait for corresponding device reason |
| 417 | ... - check UNI-ports disabled in ONOS |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 418 | ... - enable onu device |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 419 | ... - perform sanity test supress add subscriber |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 420 | FOR ${I} IN RANGE 0 ${num_olts} |
| 421 | #get olt serial number |
| 422 | ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn] |
| 423 | #validate olt states |
| 424 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 425 | Enable Device ${olt_device_id} |
| 426 | END |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 427 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 428 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 429 | ... ELSE Perform Sanity Test |
TorstenThieme | 96fe9ee | 2021-10-21 10:24:08 +0000 | [diff] [blame] | 430 | Reconcile Onu Adapter ${NAMESPACE} ${usekill2restart} ACTIVE |
TorstenThieme | 70bc526 | 2021-01-19 12:12:55 +0000 | [diff] [blame] | 431 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT ${suppressaddsubscriber} |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 432 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT ${suppressaddsubscriber} |
TorstenThieme | 70bc526 | 2021-01-19 12:12:55 +0000 | [diff] [blame] | 433 | ... ELSE Perform Sanity Test ${suppressaddsubscriber} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 434 | Disable Onu Device |
Andrea Campanella | 753510e | 2022-04-28 23:26:27 +0200 | [diff] [blame] | 435 | Run Keyword If "${workflow}"=="DT" Current State Test All Onus omci-admin-lock |
TorstenThieme | 20e1627 | 2022-07-13 06:51:18 +0000 | [diff] [blame] | 436 | ... ELSE IF "${workflow}"=="TT" Current State Test All Onus tech-profile-config-delete-success |
| 437 | ... ELSE Current State Test All Onus tech-profile-config-delete-success |
TorstenThieme | 00fe826 | 2022-01-19 10:43:07 +0000 | [diff] [blame] | 438 | Wait for all ONU Ports in ONOS Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${unitag_sub} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 439 | Enable Onu Device |
TorstenThieme | 70bc526 | 2021-01-19 12:12:55 +0000 | [diff] [blame] | 440 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT ${suppressaddsubscriber} |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 441 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT ${suppressaddsubscriber} |
TorstenThieme | 70bc526 | 2021-01-19 12:12:55 +0000 | [diff] [blame] | 442 | ... ELSE Perform Sanity Test ${suppressaddsubscriber} |
TorstenThieme | 712b296 | 2021-11-17 14:16:15 +0000 | [diff] [blame] | 443 | |
| 444 | |
| 445 | Do Olt Deletion After Adapter Restart |
| 446 | [Documentation] This keyword deletes OLT after adapter restart and checks deleted device(s) and data |
| 447 | ... - prefered environment is two ONUs are active on each of two OLTs, but test works also with single ONU/OLT |
| 448 | ... - restart the ONU adapter preferred via "kubectl delete pod" |
| 449 | ... - delete one OLT immediately after the restart has been initiated |
| 450 | ... - wait until the restart of the ONU adapter and the reconcile processing are finished |
| 451 | ... - check whether the ONUs on the remaining OLT have been properly reconciled (if avaialable) |
| 452 | ... - check whether the ONUs at the deleted OLT have disappeared from the device list |
| 453 | ... - KV store data of these ONUs are deleted under: |
| 454 | ... - <kvStorePrefix>/openonu/<deviceId> |
| 455 | ... - <kvStorePrefix>/openonu/pm-data/<deviceId> |
| 456 | ... - check for not deleted device(s) reason is still the same before restart (if available) |
| 457 | ... - delete ONU and MIB-template in KV-store |
| 458 | ... Check [VOL-4443] for more details |
| 459 | FOR ${I} IN RANGE 0 ${num_olts} |
| 460 | #get olt serial number |
| 461 | ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn] |
| 462 | #validate olt states |
| 463 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 464 | Enable Device ${olt_device_id} |
| 465 | END |
TorstenThieme | f7cd2be | 2021-12-06 14:30:11 +0000 | [diff] [blame] | 466 | # bring all onus to active -> OMCI-Flows-Pushed |
TorstenThieme | 712b296 | 2021-11-17 14:16:15 +0000 | [diff] [blame] | 467 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT |
| 468 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT |
| 469 | ... ELSE Perform Sanity Test |
| 470 | # OLT#1 will be deleted, get its SN |
| 471 | ${olt_to_be_deleted}= Set Variable ${olts[0]['serial']} |
| 472 | ${olt_to_be_deleted_device_id}= Get OLTDeviceID From OLT List ${olt_to_be_deleted} |
| 473 | # collect all ONU device ids belonging to OLT to be deleted |
| 474 | ${onu_device_id_list_should_be_deleted} Create List |
| 475 | Build ONU Device Id List ${onu_device_id_list_should_be_deleted} ${olt_to_be_deleted} |
| 476 | Log ${onu_device_id_list_should_be_deleted} |
| 477 | Reconcile Onu Adapter ${NAMESPACE} ${usekill2restart} ACTIVE ${olt_to_be_deleted} |
| 478 | # validate OLT and all corresponding ONUs are removed |
| 479 | Validate all ONUS for OLT Removed ${num_all_onus} ${hosts} ${olt_to_be_deleted} ${timeout} |
| 480 | Validate Device Removed ${olt_to_be_deleted} |
| 481 | # validate for alle removed ONUs KV store date deleted |
| 482 | FOR ${onu_device_id} IN @{onu_device_id_list_should_be_deleted} |
| 483 | Log ${onu_device_id} |
| 484 | Wait Until Keyword Succeeds ${timeout} 1s Validate Onu Data In Etcd Removed ${INFRA_NAMESPACE} |
| 485 | ... ${onu_device_id} ${kvstoreprefix} without_pm_data=False |
| 486 | END |
| 487 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 488 | ${src}= Set Variable ${hosts.src[${I}]} |
| 489 | Continue For Loop If "${olt_to_be_deleted}"=="${src['olt']}" |
| 490 | Current State Test omci-flows-pushed ${src['onu']} |
| 491 | END |
TorstenThieme | f7cd2be | 2021-12-06 14:30:11 +0000 | [diff] [blame] | 492 | |
| 493 | Do Flow Deletion After Adapter Restart |
| 494 | [Documentation] This keyword removes flow(s) after adapter restart and checks removed flow(s) |
| 495 | ... - perform sanity test include add subscriber |
| 496 | ... - restart the ONU adapter preferred via "kubectl delete pod" |
| 497 | ... - remove flow(s) from one ONU immediately after the restart has been initiated |
| 498 | ... - wait until the restart of the ONU adapter and the reconcile processing are finished |
| 499 | ... - check removed flow(s) from ONU |
| 500 | ... - check for not removed flows still the same before restart (if available) |
| 501 | FOR ${I} IN RANGE 0 ${num_olts} |
| 502 | #get olt serial number |
| 503 | ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn] |
| 504 | #validate olt states |
| 505 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 506 | Enable Device ${olt_device_id} |
| 507 | END |
| 508 | # bring all onus to active -> OMCI-Flows-Pushed |
| 509 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT |
| 510 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT |
| 511 | ... ELSE Perform Sanity Test |
| 512 | # log ONOS flows before remove |
| 513 | ${flow}= Execute ONOS CLI Command use single connection |
| 514 | ... ${ONOS_SSH_IP} ${ONOS_SSH_PORT} flows -s any ${of_id} |
| 515 | Log ${flow} |
| 516 | # validate OLT flows before remove |
| 517 | ${onu_device_id_list} Create List |
| 518 | Build ONU Device Id List ${onu_device_id_list} |
| 519 | Log ${onu_device_id_list} |
| 520 | FOR ${onu_device_id} IN @{onu_device_id_list} |
| 521 | Log ${onu_device_id} |
| 522 | ${rc} ${output}= Run and Return Rc and Output |
Andrea Campanella | 28989d1 | 2022-01-11 09:49:21 +0100 | [diff] [blame] | 523 | ... voltctl -c ${VOLTCTL_CONFIG} device flows ${onu_device_id} -m 32MB -o json |
TorstenThieme | f7cd2be | 2021-12-06 14:30:11 +0000 | [diff] [blame] | 524 | Should Be Equal As Integers ${rc} 0 |
| 525 | ${jsondata}= To Json ${output} |
| 526 | Log ${jsondata} |
| 527 | END |
| 528 | # Collect data for remove flow(s) |
| 529 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${hosts.src[0]['olt']} |
TorstenThieme | 00fe826 | 2022-01-19 10:43:07 +0000 | [diff] [blame] | 530 | ${onu_sn}= Set Variable ${hosts.src[0]['onu']} |
| 531 | ${onu_port_list} Create List |
| 532 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 533 | ${src}= Set Variable ${hosts.src[${I}]} |
| 534 | Continue For Loop If "${onu_sn}"!="${src['onu']}" |
| 535 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 536 | ... ${of_id} ${src['uni_id']} |
| 537 | ${port_id}= Get Index From List ${onu_port_list} ${onu_port} |
| 538 | Continue For Loop If -1 != ${port_id} |
| 539 | Append To List ${onu_port_list} ${onu_port} |
| 540 | END |
| 541 | ${params_for_remove_flow}= Create Dictionary unitag=${unitag_sub} onu_sn=${onu_sn} of_id=${of_id} |
| 542 | ... onu_port=${onu_port_list[0]} |
TorstenThieme | f7cd2be | 2021-12-06 14:30:11 +0000 | [diff] [blame] | 543 | # Collect number of flows for comparing after Reconcile |
| 544 | ${olt_flows_list} Create List |
| 545 | FOR ${I} IN RANGE 0 ${num_olts} |
| 546 | ${olt_of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${list_olts}[${I}][sn] |
| 547 | ${flows}= Count flows ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${olt_of_id} added |
| 548 | ${olt_flows}= Create Dictionary olt=${olt_of_id} flows=${flows} |
| 549 | Append To List ${olt_flows_list} ${olt_flows} |
| 550 | END |
TorstenThieme | 00fe826 | 2022-01-19 10:43:07 +0000 | [diff] [blame] | 551 | ${flows_onu}= Set Variable 0 |
| 552 | FOR ${onu_port} IN @{onu_port_list} |
| 553 | ${flows_onu_port}= Count flows ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} added ${onu_port} |
| 554 | ${flows_onu}= Evaluate ${flows_onu} + ${flows_onu_port} |
| 555 | END |
TorstenThieme | f7cd2be | 2021-12-06 14:30:11 +0000 | [diff] [blame] | 556 | # Restart onu adapter with deleting flows from first onu |
| 557 | Reconcile Onu Adapter ${NAMESPACE} ${usekill2restart} ACTIVE flow_delete_params=${params_for_remove_flow} |
| 558 | # validate flows in ONOS after remove |
| 559 | ${flow}= Execute ONOS CLI Command use single connection |
| 560 | ... ${ONOS_SSH_IP} ${ONOS_SSH_PORT} flows -s any ${of_id} |
| 561 | Log ${flow} |
| 562 | ${expected_flows_onu}= Set Variable If "${workflow}"=="ATT" 1 0 |
TorstenThieme | 00fe826 | 2022-01-19 10:43:07 +0000 | [diff] [blame] | 563 | FOR ${onu_port} IN @{onu_port_list} |
| 564 | Wait Until Keyword Succeeds ${timeout} 2s Validate number of flows ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 565 | ... ${expected_flows_onu} ${of_id} any ${onu_port} |
| 566 | END |
TorstenThieme | d649288 | 2021-12-16 08:10:02 +0000 | [diff] [blame] | 567 | ${flow}= Execute ONOS CLI Command use single connection |
| 568 | ... ${ONOS_SSH_IP} ${ONOS_SSH_PORT} flows -s any ${of_id} |
| 569 | Log ${flow} |
TorstenThieme | 00fe826 | 2022-01-19 10:43:07 +0000 | [diff] [blame] | 570 | # Beside onu port specific flows additional flows deleted depending on workflow and number of onu ports |
| 571 | ${number_ports}= Get Length ${onu_port_list} |
| 572 | ${additional_flows_deleted}= Run Keyword If "${workflow}"=="DT" Set Variable ${number_ports} |
| 573 | ... ELSE IF "${workflow}"=="TT" Evaluate ${number_ports}*3 |
| 574 | ... ELSE IF "${workflow}"=="ATT" Set Variable 0 |
| 575 | ... ELSE Set Variable 0 |
TorstenThieme | f7cd2be | 2021-12-06 14:30:11 +0000 | [diff] [blame] | 576 | FOR ${I} IN RANGE 0 ${num_olts} |
TorstenThieme | f7cd2be | 2021-12-06 14:30:11 +0000 | [diff] [blame] | 577 | ${expected_flows}= Run Keyword If "${of_id}"=="${olt_flows_list}[${I}][olt]" |
| 578 | ... Evaluate ${olt_flows_list}[${I}][flows]-${flows_onu}-${additional_flows_deleted} |
| 579 | ... ELSE Set Variable ${olt_flows_list}[${I}][flows] |
TorstenThieme | d649288 | 2021-12-16 08:10:02 +0000 | [diff] [blame] | 580 | Wait Until Keyword Succeeds ${timeout} 2s Validate ONOS Flows per OLT ${list_olts}[${I}][sn] |
| 581 | ... ${expected_flows} |
TorstenThieme | f7cd2be | 2021-12-06 14:30:11 +0000 | [diff] [blame] | 582 | END |
TorstenThieme | d649288 | 2021-12-16 08:10:02 +0000 | [diff] [blame] | 583 | ${flow}= Execute ONOS CLI Command use single connection |
| 584 | ... ${ONOS_SSH_IP} ${ONOS_SSH_PORT} flows -s any ${of_id} |
| 585 | Log ${flow} |
TorstenThieme | f7cd2be | 2021-12-06 14:30:11 +0000 | [diff] [blame] | 586 | # validate etcd data |
| 587 | ${List_ONU_Serial} Create List |
| 588 | Build ONU SN List ${List_ONU_Serial} |
| 589 | ${onu_sn_no_flows}= Set Variable ${hosts.src[0]['onu']} |
| 590 | FOR ${onu_sn} IN @{List_ONU_Serial} |
| 591 | ${must_exist}= Set Variable If "${onu_sn}"=="${onu_sn_no_flows}" False True |
TorstenThieme | d649288 | 2021-12-16 08:10:02 +0000 | [diff] [blame] | 592 | Wait Until Keyword Succeeds ${timeout} 2s Validate Tech Profiles and Flows in ETCD Data Per Onu |
| 593 | ... ${onu_sn} ${INFRA_NAMESPACE} ${kvstoreprefix} ${must_exist} |
TorstenThieme | f7cd2be | 2021-12-06 14:30:11 +0000 | [diff] [blame] | 594 | END |
| 595 | ${onu_device_id_no_flows}= Get Device ID From SN ${hosts.src[0]['onu']} |
| 596 | FOR ${onu_device_id} IN @{onu_device_id_list} |
| 597 | Log ${onu_device_id} |
| 598 | ${must_exist}= Set Variable If "${onu_device_id}"=="${onu_device_id_no_flows}" False True |
| 599 | Validate OLT Flows Per Onu ${onu_device_id} ${must_exist} |
| 600 | END |
TorstenThieme | 00fe826 | 2022-01-19 10:43:07 +0000 | [diff] [blame] | 601 | |
| 602 | Do Wrong MDS Counter After Adapter Restart |
| 603 | [Documentation] This keyword checks correct handling of a wrong MDS counter after adapter restart |
| 604 | ... - perform sanity test include add subscriber |
| 605 | ... - restart the ONU adapter preferred via "kubectl delete pod" |
| 606 | ... - manipulate MDS counter |
| 607 | ... - wait until the restart of the ONU adapter and the reconcile processing are finished |
| 608 | ... - check all ONUs come up to previous state |
| 609 | FOR ${I} IN RANGE 0 ${num_olts} |
| 610 | #get olt serial number |
| 611 | ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn] |
| 612 | #validate olt states |
| 613 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 614 | Enable Device ${olt_device_id} |
| 615 | END |
| 616 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT |
| 617 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT |
| 618 | ... ELSE Perform Sanity Test |
| 619 | Reconcile Onu Adapter ${NAMESPACE} ${usekill2restart} ACTIVE wrong_MDS_counter=True |
| 620 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT ${suppressaddsubscriber} |
| 621 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT ${suppressaddsubscriber} |
| 622 | ... ELSE Perform Sanity Test ${suppressaddsubscriber} |
| 623 | Disable Onu Device |
TorstenThieme | acc9126 | 2022-05-05 10:38:56 +0000 | [diff] [blame] | 624 | Run Keyword If "${workflow}"=="DT" Current State Test All Onus omci-admin-lock |
TorstenThieme | 20e1627 | 2022-07-13 06:51:18 +0000 | [diff] [blame] | 625 | ... ELSE IF "${workflow}"=="TT" Current State Test All Onus tech-profile-config-delete-success |
| 626 | ... ELSE Current State Test All Onus tech-profile-config-delete-success |
TorstenThieme | 00fe826 | 2022-01-19 10:43:07 +0000 | [diff] [blame] | 627 | Wait for all ONU Ports in ONOS Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${unitag_sub} |
| 628 | Enable Onu Device |
| 629 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT ${suppressaddsubscriber} |
| 630 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT ${suppressaddsubscriber} |
| 631 | ... ELSE Perform Sanity Test ${suppressaddsubscriber} |