TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +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 | |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 15 | *** Settings *** |
TorstenThieme | 109683b | 2020-09-24 12:35:41 +0000 | [diff] [blame] | 16 | Documentation Test states of ONU Go adapter with ATT workflows only (not for DT/TT workflow!) |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 17 | Suite Setup Setup Suite |
| 18 | Suite Teardown Teardown Suite |
| 19 | Test Setup Setup |
| 20 | Test Teardown Teardown |
| 21 | Library Collections |
| 22 | Library String |
| 23 | Library OperatingSystem |
| 24 | Library XML |
| 25 | Library RequestsLibrary |
| 26 | Library ../../libraries/DependencyLibrary.py |
| 27 | Resource ../../libraries/onos.robot |
| 28 | Resource ../../libraries/voltctl.robot |
| 29 | Resource ../../libraries/voltha.robot |
| 30 | Resource ../../libraries/utils.robot |
| 31 | Resource ../../libraries/k8s.robot |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 32 | Resource ../../libraries/onu_utilities.robot |
TorstenThieme | fe7099e | 2021-01-29 08:41:04 +0000 | [diff] [blame] | 33 | Resource ../../libraries/bbsim.robot |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 34 | Resource ../../variables/variables.robot |
| 35 | |
| 36 | *** Variables *** |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 37 | ${NAMESPACE} voltha |
| 38 | ${INFRA_NAMESPACE} default |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 39 | ${timeout} 60s |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 40 | ${of_id} 0 |
| 41 | ${logical_id} 0 |
| 42 | ${has_dataplane} True |
| 43 | ${external_libs} True |
| 44 | ${teardown_device} True |
| 45 | ${scripts} ../../scripts |
| 46 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 47 | ${container_log_dir} ${None} |
TorstenThieme | 3385cdc | 2021-02-04 13:50:50 +0000 | [diff] [blame] | 48 | # KV Store Prefix |
Andrea Campanella | 388cd87 | 2022-02-10 09:11:39 +0100 | [diff] [blame] | 49 | # example: -v kvstoreprefix:voltha/voltha_voltha |
| 50 | ${kvstoreprefix} voltha/voltha_voltha |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 51 | # state to test variable, can be passed via the command line too, valid values: 1-6 |
| 52 | # 1 -> activating-onu |
| 53 | # 2 -> starting-openomci |
| 54 | # 3 -> discovery-mibsync-complete |
| 55 | # 4 -> initial-mib-downloaded |
| 56 | # 5 -> tech-profile-config-download-success |
| 57 | # 6 -> omci-flows-pushed |
TorstenThieme | 87cd620 | 2020-09-09 10:01:28 +0000 | [diff] [blame] | 58 | # example: -v state2test:5 |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 59 | # example: -v state2test:omci-flows-pushed |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 60 | ${state2test} 6 |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 61 | # test mode variable, can be passed via the command line too, valid values: SingleState, Up2State, SingleStateTime |
TorstenThieme | 87cd620 | 2020-09-09 10:01:28 +0000 | [diff] [blame] | 62 | # example: -v testmode:SingleStateTime |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 63 | ${testmode} SingleState |
TorstenThieme | 87cd620 | 2020-09-09 10:01:28 +0000 | [diff] [blame] | 64 | # used tech profile, can be passed via the command line too, valid values: default (=1T1GEM), 1T4GEM, 1T8GEM |
| 65 | # example: -v techprofile:1T4GEM |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 66 | ${techprofile} default |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 67 | # flag debugmode is used, if true timeout calculation various, can be passed via the command line too |
TorstenThieme | 87cd620 | 2020-09-09 10:01:28 +0000 | [diff] [blame] | 68 | # example: -v debugmode:True |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 69 | ${debugmode} False |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 70 | # logging flag to enable Collect Logs, can be passed via the command line too |
TorstenThieme | 87cd620 | 2020-09-09 10:01:28 +0000 | [diff] [blame] | 71 | # example: -v logging:True |
TorstenThieme | 5e324e4 | 2020-07-27 09:36:16 +0000 | [diff] [blame] | 72 | ${logging} False |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 73 | # if True execution will be paused before clean up, only use in case of manual testing, do not use in ci pipeline! |
TorstenThieme | 87cd620 | 2020-09-09 10:01:28 +0000 | [diff] [blame] | 74 | # example: -v pausebeforecleanup:True |
TorstenThieme | b41007d | 2020-06-22 12:14:12 +0000 | [diff] [blame] | 75 | ${pausebeforecleanup} False |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 76 | # if True some outputs to console are done during running tests e.g. long duration flow test |
| 77 | # example: -v print2console:True |
| 78 | ${print2console} False |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 79 | ${data_dir} ../data |
| 80 | |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 81 | # flag to choose the subscriber provisioning command type in ONOS |
| 82 | # TT often provision a single services for a subscriber (eg: hsia, voip, ...) one after the other. |
| 83 | # if set to True, command used is "volt-add-subscriber-unitag" |
| 84 | # if set to False, comand used is "volt-add-subscriber-access" |
| 85 | ${unitag_sub} False |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 86 | |
| 87 | *** Test Cases *** |
| 88 | ONU State Test |
| 89 | [Documentation] Validates the ONU Go adapter states |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 90 | [Tags] sanityOnuGo StateTestOnuGo |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 91 | [Setup] Run Keywords Start Logging ONUStateTest |
| 92 | ... AND Setup Test |
| 93 | Run Keyword If ${has_dataplane} Clean Up Linux |
TorstenThieme | fd7e7ba | 2020-11-06 13:57:57 +0000 | [diff] [blame] | 94 | FOR ${I} IN RANGE 0 ${num_olts} |
| 95 | #get olt serial number |
| 96 | ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn] |
| 97 | #validate olt states |
| 98 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 99 | Enable Device ${olt_device_id} |
| 100 | END |
TorstenThieme | 94e4ae4 | 2020-05-18 13:01:42 +0000 | [diff] [blame] | 101 | ${timeStart} = Get Current Date |
| 102 | Set Global Variable ${timeStart} |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 103 | Run Keyword If "${testmode}"=="SingleState" Do ONU Single State Test |
| 104 | ... ELSE IF "${testmode}"=="Up2State" Do ONU Up To State Test |
TorstenThieme | 94e4ae4 | 2020-05-18 13:01:42 +0000 | [diff] [blame] | 105 | ... ELSE IF "${testmode}"=="SingleStateTime" Do ONU Single State Test Time |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 106 | ... ELSE Fail The testmode (${testmode}) is not valid! |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame] | 107 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console} |
| 108 | ... AND Run Keyword If ${logging} Get Logical Id of OLT |
TorstenThieme | 3494ceb | 2021-07-19 09:47:24 +0000 | [diff] [blame] | 109 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 110 | ... AND Stop Logging ONUStateTest |
| 111 | |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 112 | Check Loaded Tech Profile |
| 113 | [Documentation] Validates the loaded Tech Profile |
| 114 | ... Assuming that ONU State Test was executed where all the ONUs are reached the expected state! |
| 115 | ... Check will be executed only the reached ONU state is 5 (tech-profile-config-download-success) or higher |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 116 | [Tags] functionalOnuGo CheckTechProfileOnuGo |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 117 | [Setup] Start Logging ONUCheckTechProfile |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 118 | Run Keyword If '${onu_state}'=='tech-profile-config-download-success' or '${onu_state}'=='omci-flows-pushed' |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 119 | ... Do Check Tech Profile ${INFRA_NAMESPACE} |
TorstenThieme | 5a205ba | 2020-09-29 08:08:29 +0000 | [diff] [blame] | 120 | ... ELSE Pass Execution ${skip_message} skipped |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame] | 121 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console} |
| 122 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 123 | ... AND Stop Logging ONUCheckTechProfile |
| 124 | |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 125 | Onu Port Check |
TorstenThieme | 87cd620 | 2020-09-09 10:01:28 +0000 | [diff] [blame] | 126 | [Documentation] Validates that all the UNI ports show up in ONOS |
TorstenThieme | 0095868 | 2020-06-19 11:29:31 +0000 | [diff] [blame] | 127 | ... Assuming that ONU State Test was executed where all the ONUs are reached the expected state! |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 128 | [Tags] functionalOnuGo PortTestOnuGo |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 129 | [Setup] Start Logging ONUPortTest |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 130 | Run Keyword If '${onu_state}'=='tech-profile-config-download-success' or '${onu_state}'=='omci-flows-pushed' |
| 131 | ... Do Onu Port Check |
| 132 | ... ELSE Pass Execution ${skip_message} skipped |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame] | 133 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console} |
| 134 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 135 | ... AND Stop Logging ONUPortTest |
| 136 | |
TorstenThieme | 17756ea | 2020-11-11 14:09:47 +0000 | [diff] [blame] | 137 | Onu Etcd Data Check |
| 138 | [Documentation] Validates ONU data stored in ETCD |
| 139 | ... Assuming that ONU State Test was executed where all the ONUs are reached the expected state! |
| 140 | [Tags] functionalOnuGo EtcdDataOnuGo |
| 141 | [Setup] Start Logging ONUEtcdDataTest |
| 142 | Run Keyword If '${onu_state}'=='tech-profile-config-download-success' or '${onu_state}'=='omci-flows-pushed' |
| 143 | ... Do Onu Etcd Data Check |
| 144 | ... ELSE Pass Execution ${skip_message} skipped |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame] | 145 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console} |
| 146 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | 17756ea | 2020-11-11 14:09:47 +0000 | [diff] [blame] | 147 | ... AND Stop Logging ONUEtcdDataTest |
| 148 | |
TorstenThieme | 109683b | 2020-09-24 12:35:41 +0000 | [diff] [blame] | 149 | Onu Flow Check |
| 150 | [Documentation] Validates the onu flows in ONOS and Voltha |
| 151 | ... Assuming that ONU State Test was executed where all the ONUs are reached the expected state! |
mpagenko | c2e7ba5 | 2020-11-12 13:50:57 +0000 | [diff] [blame] | 152 | [Tags] functionalOnuGo FlowTestOnuGo |
TorstenThieme | 109683b | 2020-09-24 12:35:41 +0000 | [diff] [blame] | 153 | [Setup] Start Logging ONUFlowTest |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 154 | Run Keyword If '${onu_state}'=='omci-flows-pushed' Do Onu Flow Check |
TorstenThieme | 5a205ba | 2020-09-29 08:08:29 +0000 | [diff] [blame] | 155 | ... ELSE Pass Execution ${skip_message} skipped |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame] | 156 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console} |
| 157 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | 109683b | 2020-09-24 12:35:41 +0000 | [diff] [blame] | 158 | ... AND Stop Logging ONUFlowTest |
| 159 | |
TorstenThieme | e3841a0 | 2020-09-23 08:20:43 +0000 | [diff] [blame] | 160 | Disable Enable Onu Device |
| 161 | [Documentation] Disables/enables ONU Device and check states |
| 162 | ... Assuming that ONU State Test was executed where all the ONUs are reached the expected state! |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 163 | [Tags] functionalOnuGo DisableEnableOnuGo |
TorstenThieme | e3841a0 | 2020-09-23 08:20:43 +0000 | [diff] [blame] | 164 | [Setup] Start Logging DisableEnableONUDevice |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 165 | Run Keyword If '${onu_state}'=='tech-profile-config-download-success' or '${onu_state}'=='omci-flows-pushed' |
| 166 | ... Do Disable Enable Onu Test |
TorstenThieme | 5a205ba | 2020-09-29 08:08:29 +0000 | [diff] [blame] | 167 | ... ELSE Pass Execution ${skip_message} skipped |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame] | 168 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console} |
| 169 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | e3841a0 | 2020-09-23 08:20:43 +0000 | [diff] [blame] | 170 | ... AND Stop Logging DisableEnableONUDevice |
| 171 | |
TorstenThieme | 5ca1dd1 | 2020-10-16 08:42:16 +0000 | [diff] [blame] | 172 | Power Off Power On Onu Device |
| 173 | [Documentation] Power off and Power on of all ONU Devices and check state |
| 174 | ... Assuming that ONU State Test was executed where all the ONUs are reached the expected state! |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 175 | [Tags] functionalOnuGo PowerOffPowerOnOnuGo |
TorstenThieme | 5ca1dd1 | 2020-10-16 08:42:16 +0000 | [diff] [blame] | 176 | [Setup] Start Logging PowerOffPowerOnONUDevice |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 177 | Run Keyword If '${onu_state}'=='tech-profile-config-download-success' or '${onu_state}'=='omci-flows-pushed' |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 178 | ... Do Power Off Power On Onu Device ${NAMESPACE} |
TorstenThieme | 5ca1dd1 | 2020-10-16 08:42:16 +0000 | [diff] [blame] | 179 | ... ELSE Pass Execution ${skip_message} skipped |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame] | 180 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console} |
| 181 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | 5ca1dd1 | 2020-10-16 08:42:16 +0000 | [diff] [blame] | 182 | ... AND Stop Logging PowerOffPowerOnONUDevice |
| 183 | |
TorstenThieme | 1fbe808 | 2020-10-21 13:27:59 +0000 | [diff] [blame] | 184 | Soft Reboot Onu Device |
| 185 | [Documentation] Reboots softly all ONU Devices and check state |
| 186 | ... Assuming that ONU State Test was executed where all the ONUs are reached the expected state! |
| 187 | [Tags] functionalOnuGo SoftRebootOnuGo |
| 188 | [Setup] Start Logging SoftRebootONUDevice |
| 189 | Run Keyword If '${onu_state}'=='tech-profile-config-download-success' or '${onu_state}'=='omci-flows-pushed' |
| 190 | ... Do Soft Reboot Onu Device |
| 191 | ... ELSE Pass Execution ${skip_message} skipped |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame] | 192 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console} |
| 193 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | 1fbe808 | 2020-10-21 13:27:59 +0000 | [diff] [blame] | 194 | ... AND Stop Logging SoftRebootONUDevice |
| 195 | |
TorstenThieme | a8bcec7 | 2022-06-13 12:01:30 +0000 | [diff] [blame] | 196 | Check Onu Model |
| 197 | [Documentation] Checks onu model of all ONU Devices |
| 198 | ... Assuming that ONU State Test was executed where all the ONUs are reached the expected state! |
| 199 | [Tags] functionalOnuGo CheckModelOnuGo |
| 200 | [Setup] Start Logging CheckModelOnuGo |
| 201 | Run Keyword If '${onu_state}'=='tech-profile-config-download-success' or '${onu_state}'=='omci-flows-pushed' |
| 202 | ... Do Check Onu Model |
| 203 | ... ELSE Pass Execution ${skip_message} skipped |
| 204 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console} |
| 205 | ... AND Run Keyword If ${logging} Collect Logs |
| 206 | ... AND Stop Logging CheckModelOnuGo |
| 207 | |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 208 | *** Keywords *** |
| 209 | Setup Suite |
| 210 | [Documentation] Set up the test suite |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 211 | Start Logging Setup or Teardown Setup-${SUITE NAME} |
TorstenThieme | 87cd620 | 2020-09-09 10:01:28 +0000 | [diff] [blame] | 212 | ${LogInfo}= Catenate |
| 213 | ... \r\nPassed arguments: |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 214 | ... state2test:${state2test}, testmode:${testmode}, techprofile:${techprofile}, |
TorstenThieme | 015d5c0 | 2020-09-11 09:53:34 +0000 | [diff] [blame] | 215 | ... debugmode:${debugmode}, logging:${logging}, pausebeforecleanup:${pausebeforecleanup}, |
TorstenThieme | 4798369 | 2021-06-17 10:43:35 +0000 | [diff] [blame] | 216 | ... print2console:${print2console}, kvstoreprefix:${kvstoreprefix} |
TorstenThieme | 87cd620 | 2020-09-09 10:01:28 +0000 | [diff] [blame] | 217 | Log ${LogInfo} console=yes |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 218 | Common Test Suite Setup |
TorstenThieme | 5a205ba | 2020-09-29 08:08:29 +0000 | [diff] [blame] | 219 | # prepare skip message in yellow for console log |
| 220 | ${skip}= Evaluate "\\033[33mSKIP\\033[0m" |
| 221 | ${skipped}= Evaluate "\\033[33m${SPACE*14} ===> Test case above was skipped! <=== ${SPACE*15}\\033[0m" |
| 222 | ${skip_message} Catenate ${skipped} | ${skip} | |
| 223 | Set Suite Variable ${skip_message} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 224 | ${all_onu_timeout}= Run Keyword If ${num_all_onus}>4 Calculate Timeout ${timeout} |
| 225 | ... ELSE Set Variable ${timeout} |
| 226 | Set Suite Variable ${all_onu_timeout} |
TorstenThieme | 1488d77 | 2020-09-28 10:52:43 +0000 | [diff] [blame] | 227 | ${techprofile}= Set Variable If "${techprofile}"=="1T1GEM" default ${techprofile} |
TorstenThieme | 7385005 | 2020-12-10 12:43:28 +0000 | [diff] [blame] | 228 | Set Suite Variable ${techprofile} |
TorstenThieme | 87cd620 | 2020-09-09 10:01:28 +0000 | [diff] [blame] | 229 | Run Keyword If "${techprofile}"=="default" Log To Console \nTechProfile:default (1T1GEM) |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 230 | ... ELSE IF "${techprofile}"=="1T4GEM" Set Tech Profile 1T4GEM ${INFRA_NAMESPACE} |
| 231 | ... ELSE IF "${techprofile}"=="1T8GEM" Set Tech Profile 1T8GEM ${INFRA_NAMESPACE} |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 232 | ... ELSE Fail The TechProfile (${techprofile}) is not valid! |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 233 | # map the passed onu state to reached and make it visible for test suite |
| 234 | ${admin_state} ${oper_status} ${connect_status} ${onu_state_nb} ${onu_state}= |
| 235 | ... Map State ${state2test} |
| 236 | Set Suite Variable ${admin_state} |
| 237 | Set Suite Variable ${oper_status} |
| 238 | Set Suite Variable ${connect_status} |
| 239 | Set Suite Variable ${onu_state_nb} |
| 240 | Set Suite Variable ${onu_state} |
TorstenThieme | 5ca1dd1 | 2020-10-16 08:42:16 +0000 | [diff] [blame] | 241 | # delete etcd MIB Template Data |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 242 | Delete MIB Template Data ${INFRA_NAMESPACE} |
TorstenThieme | 4507160 | 2021-03-16 12:14:37 +0000 | [diff] [blame] | 243 | # delete etcd onu data |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 244 | Delete ONU Go Adapter ETCD Data namespace=${INFRA_NAMESPACE} validate=True |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 245 | Run Keyword If ${logging} Collect Logs |
| 246 | Stop Logging Setup or Teardown Setup-${SUITE NAME} |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 247 | |
TorstenThieme | b41007d | 2020-06-22 12:14:12 +0000 | [diff] [blame] | 248 | Teardown Suite |
| 249 | [Documentation] Replaces the Suite Teardown in utils.robot. |
| 250 | ... Cleans up and checks all ONU ports disabled in ONOS. |
| 251 | ... Furthermore gives the possibility to pause the execution. |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 252 | Start Logging Setup or Teardown Teardown-${SUITE NAME} |
TorstenThieme | b41007d | 2020-06-22 12:14:12 +0000 | [diff] [blame] | 253 | Run Keyword If ${pausebeforecleanup} Import Library Dialogs |
| 254 | Run Keyword If ${pausebeforecleanup} Pause Execution Press OK to continue with clean up! |
TorstenThieme | 87cd620 | 2020-09-09 10:01:28 +0000 | [diff] [blame] | 255 | Run Keyword If ${pausebeforecleanup} Log Teardown will be continued... console=yes |
TorstenThieme | b41007d | 2020-06-22 12:14:12 +0000 | [diff] [blame] | 256 | Run Keyword If ${teardown_device} Delete All Devices and Verify |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 257 | Wait Until Keyword Succeeds ${timeout} 1s Validate Onu Data In Etcd ${INFRA_NAMESPACE} 0 ${kvstoreprefix} |
| 258 | ... without_pm_data=False |
TorstenThieme | 731a759 | 2021-07-01 14:26:54 +0000 | [diff] [blame] | 259 | 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] | 260 | Run Keyword If ${logging} Collect Logs |
| 261 | Stop Logging Setup or Teardown Teardown-${SUITE NAME} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 262 | Close All ONOS SSH Connections |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 263 | Remove Tech Profile ${INFRA_NAMESPACE} |
TorstenThieme | b41007d | 2020-06-22 12:14:12 +0000 | [diff] [blame] | 264 | |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 265 | Setup Test |
| 266 | [Documentation] Pre-test Setup |
| 267 | #test for empty device list |
| 268 | Test Empty Device List |
| 269 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s Openolt is Up |
Suchitra Vemuri | b7253a5 | 2020-07-14 22:35:17 -0700 | [diff] [blame] | 270 | ... ${olt_ssh_ip} ${olt_user} ${olt_pass} |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 271 | Run Keyword If ${has_dataplane} Sleep 60s |
TorstenThieme | fd7e7ba | 2020-11-06 13:57:57 +0000 | [diff] [blame] | 272 | # Create a list of olt ids (logical and device_id) |
| 273 | ${olt_ids} Create List |
| 274 | FOR ${I} IN RANGE 0 ${num_olts} |
| 275 | #create/preprovision device |
Andrea Campanella | 3dcce27 | 2021-01-15 16:04:47 +0100 | [diff] [blame] | 276 | ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}" |
TorstenThieme | 4413664 | 2021-02-12 13:41:17 +0000 | [diff] [blame] | 277 | ... Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport] |
| 278 | ... ELSE Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport] ${list_olts}[${I}][type] |
TorstenThieme | fd7e7ba | 2020-11-06 13:57:57 +0000 | [diff] [blame] | 279 | ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn] |
| 280 | #validate olt states |
| 281 | Wait Until Keyword Succeeds ${timeout} 5s |
Hardik Windlass | 8b44649 | 2021-06-10 06:25:23 +0000 | [diff] [blame] | 282 | ... Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN ${olt_device_id} by_dev_id=True |
TorstenThieme | fd7e7ba | 2020-11-06 13:57:57 +0000 | [diff] [blame] | 283 | Sleep 5s |
| 284 | ${logical_id}= Get Logical Device ID From SN ${olt_serial_number} |
| 285 | ${olt} Create Dictionary device_id ${olt_device_id} logical_id ${logical_id} |
| 286 | ... of_id ${of_id} sn ${olt_serial_number} |
| 287 | Append To List ${olt_ids} ${olt} |
| 288 | END |
| 289 | Set Global Variable ${olt_ids} |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 290 | |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 291 | Do ONU Up To State Test |
| 292 | [Documentation] This keyword performs Up2State Test |
| 293 | ... All states up to the passed have to be checked |
TorstenThieme | fd7e7ba | 2020-11-06 13:57:57 +0000 | [diff] [blame] | 294 | FOR ${I} IN RANGE 0 ${num_all_onus} |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 295 | ${src}= Set Variable ${hosts.src[${I}]} |
| 296 | ${dst}= Set Variable ${hosts.dst[${I}]} |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 297 | Run Keyword If ${onu_state_nb}>=1 |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 298 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${all_onu_timeout} 50ms |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 299 | ... Validate Device ENABLED ACTIVATING REACHABLE |
| 300 | ... ${src['onu']} onu=True onu_reason=activating-onu |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 301 | Run Keyword If ${onu_state_nb}>=2 |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 302 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${all_onu_timeout} 50ms |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 303 | ... Validate Device ENABLED ACTIVATING REACHABLE |
| 304 | ... ${src['onu']} onu=True onu_reason=starting-openomci |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 305 | Run Keyword If ${onu_state_nb}>=3 |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 306 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${all_onu_timeout} 50ms |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 307 | ... Validate Device ENABLED ACTIVATING REACHABLE |
| 308 | ... ${src['onu']} onu=True onu_reason=discovery-mibsync-complete |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 309 | Run Keyword If ${onu_state_nb}>=4 |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 310 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${all_onu_timeout} 50ms |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 311 | ... Validate Device ENABLED ACTIVE REACHABLE |
| 312 | ... ${src['onu']} onu=True onu_reason=initial-mib-downloaded |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 313 | Run Keyword If ${onu_state_nb}>=5 |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 314 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${all_onu_timeout} 50ms |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 315 | ... Validate Device ENABLED ACTIVE REACHABLE |
| 316 | ... ${src['onu']} onu=True onu_reason=tech-profile-config-download-success |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 317 | Run Keyword If ${onu_state_nb}>=6 |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 318 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${all_onu_timeout} 50ms |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 319 | ... Validate Device ENABLED ACTIVE REACHABLE |
| 320 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 321 | END |
| 322 | |
| 323 | Do ONU Single State Test |
| 324 | [Documentation] This keyword performs SingleState Test |
| 325 | ... Only the passed state has to be checked |
TorstenThieme | fd7e7ba | 2020-11-06 13:57:57 +0000 | [diff] [blame] | 326 | FOR ${I} IN RANGE 0 ${num_all_onus} |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 327 | ${src}= Set Variable ${hosts.src[${I}]} |
| 328 | ${dst}= Set Variable ${hosts.dst[${I}]} |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 329 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${all_onu_timeout} 50ms |
TorstenThieme | 015d5c0 | 2020-09-11 09:53:34 +0000 | [diff] [blame] | 330 | ... Validate Device ${admin_state} ${oper_status} ${connect_status} |
| 331 | ... ${src['onu']} onu=True onu_reason=${onu_state} |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 332 | END |
| 333 | |
TorstenThieme | 94e4ae4 | 2020-05-18 13:01:42 +0000 | [diff] [blame] | 334 | Do ONU Single State Test Time |
| 335 | [Documentation] This keyword performs SingleState Test with calculate running time |
| 336 | ... Only the passed state has to be checked and the duration each single onu adapter needed |
| 337 | ... will be calculated and printed out |
TorstenThieme | 17becfc | 2020-10-08 09:46:27 +0000 | [diff] [blame] | 338 | #${ListfinishedONUs} Create List |
| 339 | #Set Global Variable ${ListfinishedONUs} |
TorstenThieme | 94e4ae4 | 2020-05-18 13:01:42 +0000 | [diff] [blame] | 340 | Create File ONU_Startup_Time.txt This file contains the startup times of all ONUs. |
| 341 | ${list_onus} Create List |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 342 | Build ONU SN List ${list_onus} |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 343 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${all_onu_timeout} 50ms |
TorstenThieme | 9949b17 | 2020-06-16 10:00:15 +0000 | [diff] [blame] | 344 | ... Validate ONU Devices MIB State With Duration |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 345 | ... ${onu_state} ${list_onus} ${timeStart} print2console=${print2console} |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 346 | ... output_file=ONU_Startup_Time.txt |
TorstenThieme | 94e4ae4 | 2020-05-18 13:01:42 +0000 | [diff] [blame] | 347 | |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 348 | Do Onu Port Check |
TorstenThieme | 0095868 | 2020-06-19 11:29:31 +0000 | [diff] [blame] | 349 | [Documentation] Check that all the UNI ports show up in ONOS |
TorstenThieme | 731a759 | 2021-07-01 14:26:54 +0000 | [diff] [blame] | 350 | Wait for Ports in ONOS for all OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${num_all_onus} BBSM ${timeout} |
TorstenThieme | 9949b17 | 2020-06-16 10:00:15 +0000 | [diff] [blame] | 351 | |
TorstenThieme | 17756ea | 2020-11-11 14:09:47 +0000 | [diff] [blame] | 352 | Do Onu Etcd Data Check |
| 353 | [Documentation] Check Onu data stored in etcd |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 354 | Validate Onu Data In Etcd namespace=${INFRA_NAMESPACE} defaultkvstoreprefix=${kvstoreprefix} |
TorstenThieme | 17756ea | 2020-11-11 14:09:47 +0000 | [diff] [blame] | 355 | |
TorstenThieme | 109683b | 2020-09-24 12:35:41 +0000 | [diff] [blame] | 356 | Do Onu Flow Check |
TorstenThieme | 52ef839 | 2020-11-10 13:42:26 +0000 | [diff] [blame] | 357 | [Documentation] This keyword iterate all OLTs and performs Do Onu Flow Checks Per OLT |
| 358 | # Check and store vlan rules |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 359 | ${firstvlanrules}= Run Keyword And Continue On Failure Validate Vlan Rules In Etcd ${INFRA_NAMESPACE} |
TorstenThieme | 3385cdc | 2021-02-04 13:50:50 +0000 | [diff] [blame] | 360 | ... defaultkvstoreprefix=${kvstoreprefix} |
TorstenThieme | fd7e7ba | 2020-11-06 13:57:57 +0000 | [diff] [blame] | 361 | FOR ${J} IN RANGE 0 ${num_olts} |
| 362 | ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn] |
TorstenThieme | fd7e7ba | 2020-11-06 13:57:57 +0000 | [diff] [blame] | 363 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 364 | ... ${olt_serial_number} |
TorstenThieme | a7315f1 | 2021-07-23 11:56:34 +0000 | [diff] [blame] | 365 | Do Onu Subscriber Add Per OLT ${of_id} ${olt_serial_number} ${print2console} |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 366 | END |
| 367 | FOR ${J} IN RANGE 0 ${num_olts} |
| 368 | ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn] |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 369 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 370 | ... ${olt_serial_number} |
| 371 | Set Global Variable ${of_id} |
TorstenThieme | dda3765 | 2021-11-11 16:22:05 +0000 | [diff] [blame] | 372 | ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s Get NNI Port in ONOS ${of_id} |
TorstenThieme | fd7e7ba | 2020-11-06 13:57:57 +0000 | [diff] [blame] | 373 | # Verify Default Meter in ONOS (valid only for ATT) |
TorstenThieme | a7315f1 | 2021-07-23 11:56:34 +0000 | [diff] [blame] | 374 | Do Onu Flow Check Per OLT ${of_id} ${nni_port} ${olt_serial_number} ${print2console} |
TorstenThieme | fd7e7ba | 2020-11-06 13:57:57 +0000 | [diff] [blame] | 375 | END |
TorstenThieme | 52ef839 | 2020-11-10 13:42:26 +0000 | [diff] [blame] | 376 | #log flows for verification |
TorstenThieme | 4e2168e | 2021-06-22 14:01:47 +0000 | [diff] [blame] | 377 | ${flowsresult}= Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT} flows -s |
TorstenThieme | 52ef839 | 2020-11-10 13:42:26 +0000 | [diff] [blame] | 378 | log ${flowsresult} |
| 379 | #check for previous state is kept (normally omci-flows-pushed) |
| 380 | Sleep 10s |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 381 | Run Keyword And Continue On Failure Current State Test All Onus ${state2test} |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 382 | ${secondvlanrules}= Run Keyword And Continue On Failure Validate Vlan Rules In Etcd namespace=${INFRA_NAMESPACE} |
| 383 | ... nbofcookieslice=3 prevvlanrules=${firstvlanrules} defaultkvstoreprefix=${kvstoreprefix} |
TorstenThieme | 52ef839 | 2020-11-10 13:42:26 +0000 | [diff] [blame] | 384 | FOR ${J} IN RANGE 0 ${num_olts} |
| 385 | ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn] |
TorstenThieme | 52ef839 | 2020-11-10 13:42:26 +0000 | [diff] [blame] | 386 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 387 | ... ${olt_serial_number} |
TorstenThieme | a7315f1 | 2021-07-23 11:56:34 +0000 | [diff] [blame] | 388 | Do Onu Subscriber Remove Per OLT ${of_id} ${olt_serial_number} ${print2console} |
TorstenThieme | 52ef839 | 2020-11-10 13:42:26 +0000 | [diff] [blame] | 389 | END |
| 390 | #check for previous state is kept (normally omci-flows-pushed) |
| 391 | Sleep 10s |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 392 | Run Keyword If ${print2console} Log \r\nStart State Test All Onus. console=yes |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 393 | Run Keyword And Continue On Failure Current State Test All Onus ${state2test} |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 394 | Run Keyword If ${print2console} Log \r\nFinished State Test All Onus. console=yes |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 395 | Run Keyword And Continue On Failure Validate Vlan Rules In Etcd namespace=${INFRA_NAMESPACE} |
| 396 | ... prevvlanrules=${firstvlanrules} |
TorstenThieme | 3385cdc | 2021-02-04 13:50:50 +0000 | [diff] [blame] | 397 | ... setvidequal=True defaultkvstoreprefix=${kvstoreprefix} |
TorstenThieme | fd7e7ba | 2020-11-06 13:57:57 +0000 | [diff] [blame] | 398 | |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 399 | Do Check Tech Profile |
| 400 | [Documentation] This keyword checks the loaded TechProfile |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 401 | [Arguments] ${namespace}=default |
Andrea Campanella | 60dde30 | 2020-09-09 18:42:56 +0200 | [diff] [blame] | 402 | ${podname}= Set Variable etcd |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 403 | ${commandget} Catenate |
TorstenThieme | 2980d8c | 2021-06-24 10:11:48 +0000 | [diff] [blame] | 404 | ... /bin/sh -c 'ETCDCTL_API=3 etcdctl get --prefix service/voltha/technology_profiles/XGS-PON/64' |
Holger Hildebrandt | 2314774 | 2020-11-16 10:13:21 +0000 | [diff] [blame] | 405 | ${result}= Exec Pod In Kube ${namespace} ${podname} ${commandget} |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 406 | ${num_gem_ports}= Set Variable 1 |
| 407 | ${num_gem_ports}= Set Variable If |
| 408 | ... "${techprofile}"=="default" 1 |
| 409 | ... "${techprofile}"=="1T4GEM" 4 |
| 410 | ... "${techprofile}"=="1T8GEM" 8 |
TorstenThieme | 9362c73 | 2021-06-25 08:25:51 +0000 | [diff] [blame] | 411 | ${length}= Get Length ${result} |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 412 | @{resultList} Split String ${result} separator=, |
| 413 | ${num_of_count_matches}= Get Match Count ${resultList} "num_gem_ports": ${num_gem_ports} |
| 414 | ... whitespace_insensitive=True |
TorstenThieme | 9362c73 | 2021-06-25 08:25:51 +0000 | [diff] [blame] | 415 | # In case of default tech profile (1T1GEM) no file have to exist, so no entry will be found, but in case of a file is |
| 416 | # available corresponding entry has to be found! |
| 417 | ${num_of_expected_matches}= Set Variable If "${techprofile}"!="default" or ${length}>0 1 0 |
TorstenThieme | a022194 | 2020-12-09 11:35:03 +0000 | [diff] [blame] | 418 | Should Be Equal As Integers ${num_of_expected_matches} ${num_of_count_matches} |
TorstenThieme | 2980d8c | 2021-06-24 10:11:48 +0000 | [diff] [blame] | 419 | ... TechProfile (${TechProfile}) not loaded correctly: found(${num_of_count_matches}) expected(${num_of_expected_matches}) |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 420 | Validate Resource Instances Used Gem Ports ${num_gem_ports} namespace=${namespace} |
| 421 | ... defaultkvstoreprefix=${kvstoreprefix} |
TorstenThieme | 015d5c0 | 2020-09-11 09:53:34 +0000 | [diff] [blame] | 422 | |
| 423 | Do Disable Enable Onu Test |
| 424 | [Documentation] This keyword disables/enables all onus and checks the states. |
TorstenThieme | 1fbe808 | 2020-10-21 13:27:59 +0000 | [diff] [blame] | 425 | [Arguments] ${state2check}=${state2test} ${checkstatebeforedisable}=True |
TorstenThieme | fd7e7ba | 2020-11-06 13:57:57 +0000 | [diff] [blame] | 426 | ... ${state2checkafterdisable}=tech-profile-config-delete-success |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 427 | Run Keyword If ${checkstatebeforedisable} Current State Test All Onus ${state2check} |
| 428 | Disable Onu Device |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 429 | ${alternative_onu_reason}= Set Variable If |
| 430 | ... '${state2checkafterdisable}'=='tech-profile-config-delete-success' omci-flows-deleted |
| 431 | ... '${state2checkafterdisable}'=='omci-admin-lock' tech-profile-config-delete-success ${EMPTY} |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 432 | ${alternativeonustates}= Create List ${alternative_onu_reason} |
| 433 | Current State Test All Onus ${state2checkafterdisable} alternativeonustate=${alternativeonustates} |
TorstenThieme | 17becfc | 2020-10-08 09:46:27 +0000 | [diff] [blame] | 434 | Log Ports |
| 435 | #check no port is enabled in ONOS |
TorstenThieme | 731a759 | 2021-07-01 14:26:54 +0000 | [diff] [blame] | 436 | Wait for Ports in ONOS for all OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT} 0 BBSM |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 437 | Enable Onu Device |
| 438 | Current State Test All Onus ${state2check} |
TorstenThieme | 17becfc | 2020-10-08 09:46:27 +0000 | [diff] [blame] | 439 | Log Ports onlyenabled=True |
| 440 | #check that all the UNI ports show up in ONOS again |
TorstenThieme | 731a759 | 2021-07-01 14:26:54 +0000 | [diff] [blame] | 441 | Wait for Ports in ONOS for all OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${num_all_onus} BBSM |
TorstenThieme | 015d5c0 | 2020-09-11 09:53:34 +0000 | [diff] [blame] | 442 | |
TorstenThieme | 5ca1dd1 | 2020-10-16 08:42:16 +0000 | [diff] [blame] | 443 | Do Power Off Power On Onu Device |
| 444 | [Documentation] This keyword power off/on all onus and checks the states. |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 445 | [Arguments] ${namespace}=voltha |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 446 | Power Off ONU Device ${namespace} |
TorstenThieme | 5ca1dd1 | 2020-10-16 08:42:16 +0000 | [diff] [blame] | 447 | Sleep 5s |
Andrea Campanella | a9b59b4 | 2021-09-21 16:13:17 +0000 | [diff] [blame] | 448 | ${alternativeonustates}= Create List omci-flows-deleted |
| 449 | Current State Test All Onus tech-profile-config-delete-success |
TorstenThieme | c3c2323 | 2021-01-13 13:06:31 +0000 | [diff] [blame] | 450 | ... ENABLED DISCOVERED UNREACHABLE alternativeonustate=${alternativeonustates} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 451 | Power On ONU Device ${namespace} |
| 452 | Current State Test All Onus ${state2test} |
TorstenThieme | 5ca1dd1 | 2020-10-16 08:42:16 +0000 | [diff] [blame] | 453 | |
TorstenThieme | 1fbe808 | 2020-10-21 13:27:59 +0000 | [diff] [blame] | 454 | Do Soft Reboot Onu Device |
| 455 | [Documentation] This keyword reboots softly all onus and checks the states. |
TorstenThieme | f78a9d8 | 2021-03-05 13:42:09 +0000 | [diff] [blame] | 456 | ${device_list}= Set Variable ${EMPTY} |
TorstenThieme | fd7e7ba | 2020-11-06 13:57:57 +0000 | [diff] [blame] | 457 | FOR ${I} IN RANGE 0 ${num_all_onus} |
TorstenThieme | 1fbe808 | 2020-10-21 13:27:59 +0000 | [diff] [blame] | 458 | ${src}= Set Variable ${hosts.src[${I}]} |
| 459 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
TorstenThieme | f78a9d8 | 2021-03-05 13:42:09 +0000 | [diff] [blame] | 460 | ${device_list}= Catenate ${device_list} ${onu_device_id} |
TorstenThieme | 1fbe808 | 2020-10-21 13:27:59 +0000 | [diff] [blame] | 461 | END |
TorstenThieme | f78a9d8 | 2021-03-05 13:42:09 +0000 | [diff] [blame] | 462 | Reboot ONU ${device_list} False |
TorstenThieme | 3d8dd39 | 2021-07-29 11:17:50 +0000 | [diff] [blame] | 463 | ${alternativeonustates}= Create List stopping-openomci rebooting |
TorstenThieme | 6cc4376 | 2021-03-03 10:20:16 +0000 | [diff] [blame] | 464 | Current State Test All Onus omci-flows-deleted |
Matteo Scandolo | c14525a | 2021-02-02 08:34:43 -0800 | [diff] [blame] | 465 | ... ENABLED DISCOVERED UNREACHABLE alternativeonustate=${alternativeonustates} |
TorstenThieme | 7385005 | 2020-12-10 12:43:28 +0000 | [diff] [blame] | 466 | Sleep 5s |
TorstenThieme | 6cc4376 | 2021-03-03 10:20:16 +0000 | [diff] [blame] | 467 | Current State Test All Onus omci-flows-pushed |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 468 | Do Onu Port Check |
TorstenThieme | a8bcec7 | 2022-06-13 12:01:30 +0000 | [diff] [blame] | 469 | |
| 470 | Do Check Onu Model |
| 471 | [Documentation] This keyword checks onu model of all onus. |
| 472 | ${list_onus} Create List |
| 473 | Build ONU SN List ${list_onus} |
| 474 | ${onu_model}= Set Variable v0.0.1 |
| 475 | ${onu_vendor}= Set Variable BBSM |
| 476 | ${onu_vendor_id}= Set Variable BBSM |
| 477 | Validate ONU Model ${list_onus} ${onu_model} ${onu_vendor} ${onu_vendor_id} |