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