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