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