Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 1 | # Copyright 2017 - 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 | # FIXME Can we use the same test against BBSim and Hardware? |
| 15 | |
| 16 | *** Settings *** |
| 17 | Documentation Test various end-to-end scenarios |
| 18 | Suite Setup Common Test Suite Setup |
| 19 | Test Setup Setup |
| 20 | Test Teardown Teardown |
Suchitra Vemuri | 32dea01 | 2020-07-08 16:40:06 -0700 | [diff] [blame] | 21 | Suite Teardown Teardown Suite |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 22 | Library Collections |
| 23 | Library String |
| 24 | Library OperatingSystem |
| 25 | Library XML |
| 26 | Library RequestsLibrary |
| 27 | Library ../../libraries/DependencyLibrary.py |
| 28 | Resource ../../libraries/onos.robot |
| 29 | Resource ../../libraries/voltctl.robot |
| 30 | Resource ../../libraries/voltha.robot |
| 31 | Resource ../../libraries/utils.robot |
| 32 | Resource ../../libraries/k8s.robot |
| 33 | Resource ../../variables/variables.robot |
| 34 | |
| 35 | *** Variables *** |
| 36 | ${POD_NAME} flex-ocp-cord |
| 37 | ${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 38 | ${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs |
| 39 | #${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 40 | ${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml |
| 41 | ${HELM_CHARTS_DIR} ~/helm-charts |
| 42 | ${VOLTHA_POD_NUM} 8 |
| 43 | ${NAMESPACE} voltha |
| 44 | # For below variable value, using deployment name as using grep for |
| 45 | # parsing radius pod name, we can also use full radius pod name |
| 46 | ${RESTART_POD_NAME} radius |
Suchitra Vemuri | 21fa8c7 | 2021-03-08 16:34:25 -0800 | [diff] [blame] | 47 | ${timeout} 540s |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 48 | ${of_id} 0 |
| 49 | ${logical_id} 0 |
Suchitra Vemuri | 2fa9bba | 2020-01-22 17:38:48 -0800 | [diff] [blame] | 50 | ${has_dataplane} True |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 51 | ${teardown_device} False |
| 52 | ${scripts} ../../scripts |
Hardik Windlass | cbcca31 | 2020-04-20 21:46:11 +0530 | [diff] [blame] | 53 | ${workflow} ATT |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 54 | |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 55 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 56 | ${container_log_dir} ${None} |
| 57 | |
Hardik Windlass | d8ecbef | 2021-10-19 06:12:16 +0000 | [diff] [blame^] | 58 | # logging flag to enable Voltha Components Logging, can be passed via the command line too |
| 59 | # example: -v logging:False |
| 60 | ${logging} True |
| 61 | |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 62 | *** Test Cases *** |
| 63 | Adding the same OLT before and after enabling the device |
| 64 | [Documentation] Create OLT, Create the same OLT again and Check for the Error message |
Suchitra Vemuri | 9a6dd6d | 2020-02-28 17:46:26 -0800 | [diff] [blame] | 65 | ... VOL-2405 VOL-2406 |
| 66 | [Tags] AddSameOLT functional released |
Andy Bavier | e187eda | 2020-04-20 15:00:02 -0700 | [diff] [blame] | 67 | [Setup] Start Logging AddSameOLT |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 68 | [Teardown] Run Keywords Collect Logs |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 69 | ... AND Stop Logging AddSameOLT |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 70 | # Add OLT device |
Suchitra Vemuri | e9c79bf | 2020-02-26 23:11:39 -0800 | [diff] [blame] | 71 | #setup |
Andy Bavier | c1904dc | 2020-03-20 11:39:15 -0700 | [diff] [blame] | 72 | Delete All Devices and Verify |
Suchitra Vemuri | 736d35f | 2020-08-06 16:28:35 -0700 | [diff] [blame] | 73 | # Wait for the OLT to be reachable |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 74 | FOR ${I} IN RANGE 0 ${olt_count} |
| 75 | ${olt_user}= Get From Dictionary ${list_olts}[${I}] user |
| 76 | ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass |
| 77 | ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship |
| 78 | ${olt_ip}= Get From Dictionary ${list_olts}[${I}] ip |
Suchitra Vemuri | 09f878d | 2021-02-10 18:19:04 -0800 | [diff] [blame] | 79 | ${olt_port}= Get From Dictionary ${list_olts}[${I}] oltport |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 80 | ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn |
| 81 | #${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 82 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s |
| 83 | ... Check Remote System Reachability True ${olt_ssh_ip} |
Andrea Campanella | 3dcce27 | 2021-01-15 16:04:47 +0100 | [diff] [blame] | 84 | ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}" |
Suchitra Vemuri | 09f878d | 2021-02-10 18:19:04 -0800 | [diff] [blame] | 85 | ... Create Device ${olt_ip} ${olt_port} |
| 86 | ... ELSE Create Device ${olt_ip} ${olt_port} ${list_olts}[${I}][type] |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 87 | Set Suite Variable ${olt_device_id} |
| 88 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN |
Hardik Windlass | 8b44649 | 2021-06-10 06:25:23 +0000 | [diff] [blame] | 89 | ... ${olt_device_id} by_dev_id=True |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 90 | ${rc} ${output}= Run and Return Rc and Output |
Suchitra Vemuri | 09f878d | 2021-02-10 18:19:04 -0800 | [diff] [blame] | 91 | ... voltctl -c ${VOLTCTL_CONFIG} device create -t openolt -H ${olt_ip}:${olt_port} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 92 | Should Not Be Equal As Integers ${rc} 0 |
| 93 | Should Contain ${output} device is already pre-provisioned ignore_case=True |
| 94 | #Enable the created OLT device |
| 95 | Enable Device ${olt_device_id} |
| 96 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE |
| 97 | ... ${olt_serial_number} |
| 98 | ${rc} ${output}= Run and Return Rc and Output |
Suchitra Vemuri | 09f878d | 2021-02-10 18:19:04 -0800 | [diff] [blame] | 99 | ... voltctl -c ${VOLTCTL_CONFIG} device create -t openolt -H ${olt_ip}:${olt_port} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 100 | Should Not Be Equal As Integers ${rc} 0 |
| 101 | Log ${output} |
| 102 | Should Contain ${output} device is already pre-provisioned ignore_case=True |
| 103 | Log "This OLT is added already and enabled" |
| 104 | END |
Gayathri.Selvan | 3dfe6c2 | 2020-01-27 13:08:55 +0000 | [diff] [blame] | 105 | |
Gayathri.Selvan | 967f5a5 | 2020-02-12 06:58:38 +0000 | [diff] [blame] | 106 | Test Disable or Enable different device id which is not in the device list |
| 107 | [Documentation] Disable or Enable a device id which is not listed in the voltctl device list |
Gayathri.Selvan | 3dfe6c2 | 2020-01-27 13:08:55 +0000 | [diff] [blame] | 108 | ... command and ensure that error message is shown. |
Suchitra Vemuri | a7dae32 | 2020-02-19 22:38:18 -0800 | [diff] [blame] | 109 | ... VOL-2412-2413 |
| 110 | [Tags] functional DisableEnableInvalidDevice released |
Andy Bavier | e187eda | 2020-04-20 15:00:02 -0700 | [diff] [blame] | 111 | [Setup] Start Logging DisableInvalidDevice |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 112 | [Teardown] Run Keywords Collect Logs |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 113 | ... AND Stop Logging DisableInvalidDevice |
Matteo Scandolo | 5899be1 | 2020-11-11 15:38:07 -0800 | [diff] [blame] | 114 | ${rc} ${output}= Run and Return Rc and Output voltctl -c ${VOLTCTL_CONFIG} device list -o json |
Gayathri.Selvan | 3dfe6c2 | 2020-01-27 13:08:55 +0000 | [diff] [blame] | 115 | Should Be Equal As Integers ${rc} 0 |
| 116 | ${jsondata}= To Json ${output} |
| 117 | Log ${jsondata} |
| 118 | ${length}= Get Length ${jsondata} |
| 119 | @{ids}= Create List |
| 120 | FOR ${INDEX} IN RANGE 0 ${length} |
| 121 | ${value}= Get From List ${jsondata} ${INDEX} |
| 122 | ${device_id}= Get From Dictionary ${value} id |
| 123 | Append To List ${ids} ${device_id} |
| 124 | END |
| 125 | #Create a new fake device id |
| 126 | ${fakeDeviceId} Replace String Using Regexp ${device_id} \\d\\d xx count=1 |
| 127 | Log ${fakeDeviceId} |
| 128 | #Ensure that the new id created is not in the device id list |
| 129 | List Should Not Contain Value ${ids} ${fakeDeviceId} |
| 130 | #Disable fake device id |
Matteo Scandolo | 5899be1 | 2020-11-11 15:38:07 -0800 | [diff] [blame] | 131 | ${rc} ${output}= Run and Return Rc and Output voltctl -c ${VOLTCTL_CONFIG} device disable ${fakeDeviceId} |
Suchitra Vemuri | a7e8ad2 | 2020-02-11 18:02:40 -0800 | [diff] [blame] | 132 | Should Contain ${output} Error while disabling '${fakeDeviceId}' |
Gayathri.Selvan | 967f5a5 | 2020-02-12 06:58:38 +0000 | [diff] [blame] | 133 | #Disable device for VOL-2413 |
| 134 | Disable Device ${device_id} |
| 135 | #Enable fake device id |
Matteo Scandolo | 5899be1 | 2020-11-11 15:38:07 -0800 | [diff] [blame] | 136 | ${rc} ${output}= Run and Return Rc and Output voltctl -c ${VOLTCTL_CONFIG} device enable ${fakeDeviceId} |
Gayathri.Selvan | 967f5a5 | 2020-02-12 06:58:38 +0000 | [diff] [blame] | 137 | Should Contain ${output} Error while enabling '${fakeDeviceId}' |
suraj gour | baee2c6 | 2020-02-03 10:21:32 +0000 | [diff] [blame] | 138 | |
| 139 | Check deletion of OLT/ONU before disabling |
| 140 | [Documentation] Try deleting OL/ONU before disabling and check error message |
| 141 | ... Assuming devices are already created, up and running fine; test1 or sanity was |
| 142 | ... executed where all the ONUs are authenticated/DHCP/pingable |
Suchitra Vemuri | 9a6dd6d | 2020-02-28 17:46:26 -0800 | [diff] [blame] | 143 | ... VOL-2411 |
Hardik Windlass | cbcca31 | 2020-04-20 21:46:11 +0530 | [diff] [blame] | 144 | #TODO: If this TC gets updated in future, To add support for DT workflow as well (refer JIRA: VOL-2945) |
Suchitra Vemuri | 9a6dd6d | 2020-02-28 17:46:26 -0800 | [diff] [blame] | 145 | [Tags] functional DeleteBeforeDisableCheck notready |
Andy Bavier | e187eda | 2020-04-20 15:00:02 -0700 | [diff] [blame] | 146 | [Setup] Start Logging DeleteBeforeDisableCheck |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 147 | [Teardown] Run Keywords Collect Logs |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 148 | ... AND Stop Logging DeleteBeforeDisableCheck |
suraj gour | baee2c6 | 2020-02-03 10:21:32 +0000 | [diff] [blame] | 149 | #validate olt states |
Suchitra Vemuri | 9a6dd6d | 2020-02-28 17:46:26 -0800 | [diff] [blame] | 150 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 151 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 152 | FOR ${I} IN RANGE 0 ${olt_count} |
| 153 | ${olt_user}= Get From Dictionary ${list_olts}[${I}] user |
| 154 | ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass |
| 155 | ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship |
| 156 | ${olt_ip}= Get From Dictionary ${list_olts}[${I}] ip |
| 157 | ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn |
| 158 | #${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 159 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE |
| 160 | ... REACHABLE ${olt_serial_number} |
Matteo Scandolo | 5899be1 | 2020-11-11 15:38:07 -0800 | [diff] [blame] | 161 | ${rc} ${output}= Run and Return Rc and Output voltctl -c ${VOLTCTL_CONFIG} device delete ${olt_device_id} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 162 | Log ${output} |
| 163 | Should Contain ${output} expected-admin-state:DISABLED |
| 164 | Wait Until Keyword Succeeds ${timeout} 5s |
| 165 | ... Validate OLT Device ENABLED ACTIVE REACHABLE ${olt_serial_number} |
| 166 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 167 | ... ${olt_serial_number} |
| 168 | Set Global Variable ${of_id} |
| 169 | END |
| 170 | FOR ${I} IN RANGE 0 ${num_all_onus} |
suraj gour | baee2c6 | 2020-02-03 10:21:32 +0000 | [diff] [blame] | 171 | ${src}= Set Variable ${hosts.src[${I}]} |
| 172 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 173 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 174 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 175 | ... ENABLED ACTIVE REACHABLE |
| 176 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
Matteo Scandolo | 5899be1 | 2020-11-11 15:38:07 -0800 | [diff] [blame] | 177 | ${rc} ${output}= Run and Return Rc and Output voltctl -c ${VOLTCTL_CONFIG} device delete ${onu_device_id} |
suraj gour | baee2c6 | 2020-02-03 10:21:32 +0000 | [diff] [blame] | 178 | Log ${output} |
| 179 | Should Contain ${output} expected-admin-state:DISABLED |
| 180 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 181 | ... ENABLED ACTIVE REACHABLE |
| 182 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 183 | END |
suraj gour | b316041 | 2020-02-04 06:11:31 +0000 | [diff] [blame] | 184 | |
| 185 | Check disabling of pre-provisioned OLT before enabling |
| 186 | [Documentation] Create OLT, disable same OLT, check error message and validates ONU |
Suchitra Vemuri | 9a6dd6d | 2020-02-28 17:46:26 -0800 | [diff] [blame] | 187 | ... VOL-2414 |
| 188 | [Tags] functional DisablePreprovisionedOLTCheck |
Andy Bavier | e187eda | 2020-04-20 15:00:02 -0700 | [diff] [blame] | 189 | [Setup] Run Keywords Start Logging DisablePreprovisionedOLTCheck |
Andy Bavier | de53a1f | 2020-03-25 14:53:56 -0700 | [diff] [blame] | 190 | ... AND Delete All Devices and Verify |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 191 | [Teardown] Run Keywords Collect Logs |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 192 | ... AND Stop Logging DisablePreprovisionedOLTCheck |
Andy Bavier | de53a1f | 2020-03-25 14:53:56 -0700 | [diff] [blame] | 193 | Sleep 180s |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 194 | FOR ${I} IN RANGE 0 ${olt_count} |
| 195 | ${olt_user}= Get From Dictionary ${list_olts}[${I}] user |
| 196 | ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass |
| 197 | ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship |
| 198 | ${olt_ip}= Get From Dictionary ${list_olts}[${I}] ip |
Suchitra Vemuri | 09f878d | 2021-02-10 18:19:04 -0800 | [diff] [blame] | 199 | ${olt_port}= Get From Dictionary ${list_olts}[${I}] oltport |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 200 | ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn |
| 201 | #${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 202 | #create/preprovision device |
Andrea Campanella | 3dcce27 | 2021-01-15 16:04:47 +0100 | [diff] [blame] | 203 | ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}" |
Suchitra Vemuri | 09f878d | 2021-02-10 18:19:04 -0800 | [diff] [blame] | 204 | ... Create Device ${olt_ip} ${olt_port} |
| 205 | ... ELSE Create Device ${olt_ip} ${olt_port} ${list_olts}[${I}][type] |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 206 | Set Suite Variable ${olt_device_id} |
| 207 | #validate olt states |
| 208 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN |
Hardik Windlass | 8b44649 | 2021-06-10 06:25:23 +0000 | [diff] [blame] | 209 | ... UNKNOWN ${olt_device_id} by_dev_id=True |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 210 | #Try disabling pre-provisioned OLT |
| 211 | ${rc} ${output}= Run and Return Rc and Output |
Matteo Scandolo | 5899be1 | 2020-11-11 15:38:07 -0800 | [diff] [blame] | 212 | ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 213 | Should Not Be Equal As Integers ${rc} 0 |
| 214 | Log ${output} |
| 215 | Should Contain ${output} invalid-admin-state:PREPROVISIONED |
| 216 | #Enable OLT |
| 217 | Enable Device ${olt_device_id} |
| 218 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE |
| 219 | ... ${olt_serial_number} |
| 220 | ${logical_id}= Get Logical Device ID From SN ${olt_serial_number} |
| 221 | Set Suite Variable ${logical_id} |
| 222 | END |
Hardik Windlass | cbcca31 | 2020-04-20 21:46:11 +0530 | [diff] [blame] | 223 | ${onu_reason}= Set Variable If '${workflow}' == 'DT' initial-mib-downloaded omci-flows-pushed |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 224 | FOR ${I} IN RANGE 0 ${num_all_onus} |
suraj gour | b316041 | 2020-02-04 06:11:31 +0000 | [diff] [blame] | 225 | ${src}= Set Variable ${hosts.src[${I}]} |
| 226 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 227 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 228 | ... ENABLED ACTIVE REACHABLE |
Hardik Windlass | cbcca31 | 2020-04-20 21:46:11 +0530 | [diff] [blame] | 229 | ... ${src['onu']} onu=True onu_reason=${onu_reason} |
suraj gour | b316041 | 2020-02-04 06:11:31 +0000 | [diff] [blame] | 230 | END |
Hema | 526eceb | 2020-02-04 13:11:40 +0530 | [diff] [blame] | 231 | |
| 232 | Disable and Delete the logical device directly |
| 233 | [Documentation] Disable and delete the logical device directly is not possible |
| 234 | ... since it is allowed only through OLT device deletion. |
Suchitra Vemuri | 5f66f42 | 2020-03-02 16:43:49 -0800 | [diff] [blame] | 235 | ... VOL-2418 |
| 236 | [Tags] functional DisableDelete_LogicalDevice |
Andy Bavier | e187eda | 2020-04-20 15:00:02 -0700 | [diff] [blame] | 237 | [Setup] Run Keywords Start Logging DisableDelete_LogicalDevice |
Andy Bavier | de53a1f | 2020-03-25 14:53:56 -0700 | [diff] [blame] | 238 | ... AND Delete All Devices and Verify |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 239 | [Teardown] Run Keywords Collect Logs |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 240 | ... AND Stop Logging DisableDelete_LogicalDevice |
Hema | 526eceb | 2020-02-04 13:11:40 +0530 | [diff] [blame] | 241 | Run Keyword If ${has_dataplane} Sleep 180s |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 242 | FOR ${I} IN RANGE 0 ${olt_count} |
| 243 | ${olt_user}= Get From Dictionary ${list_olts}[${I}] user |
| 244 | ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass |
| 245 | ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship |
| 246 | ${olt_ip}= Get From Dictionary ${list_olts}[${I}] ip |
Suchitra Vemuri | 09f878d | 2021-02-10 18:19:04 -0800 | [diff] [blame] | 247 | ${olt_port}= Get From Dictionary ${list_olts}[${I}] oltport |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 248 | ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn |
| 249 | #${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 250 | #create/preprovision OLT device |
Andrea Campanella | 3dcce27 | 2021-01-15 16:04:47 +0100 | [diff] [blame] | 251 | ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}" |
Suchitra Vemuri | 09f878d | 2021-02-10 18:19:04 -0800 | [diff] [blame] | 252 | ... Create Device ${olt_ip} ${olt_port} |
| 253 | ... ELSE Create Device ${olt_ip} ${olt_port} ${list_olts}[${I}][type] |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 254 | Set Suite Variable ${olt_device_id} |
| 255 | #validate olt states |
| 256 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN |
Hardik Windlass | 8b44649 | 2021-06-10 06:25:23 +0000 | [diff] [blame] | 257 | ... UNKNOWN ${olt_device_id} by_dev_id=True |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 258 | #Enable the created OLT device |
| 259 | Enable Device ${olt_device_id} |
| 260 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE |
| 261 | ... REACHABLE ${olt_serial_number} |
| 262 | #Check whether logical devices are also created |
| 263 | ${rc} ${output}= Run and Return Rc and Output |
Matteo Scandolo | 5899be1 | 2020-11-11 15:38:07 -0800 | [diff] [blame] | 264 | ... voltctl -c ${VOLTCTL_CONFIG} logicaldevice list |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 265 | Should Be Equal As Integers ${rc} 0 |
| 266 | Log ${output} |
| 267 | ${logical_id}= Get Logical Device ID From SN ${olt_serial_number} |
| 268 | Should Not Be Empty ${logical_id} |
| 269 | ${rc} ${output}= Run and Return Rc and Output |
Matteo Scandolo | 5899be1 | 2020-11-11 15:38:07 -0800 | [diff] [blame] | 270 | ... voltctl -c ${VOLTCTL_CONFIG} logicaldevice disable ${logical_id} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 271 | Should Not Be Equal As Integers ${rc} 0 |
| 272 | Log ${output} |
| 273 | Should Contain '${output}' Unknown command |
| 274 | ${rc} ${output1}= Run and Return Rc and Output |
Matteo Scandolo | 5899be1 | 2020-11-11 15:38:07 -0800 | [diff] [blame] | 275 | ... voltctl -c ${VOLTCTL_CONFIG} logicaldevice delete ${logical_id} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 276 | Should Not Be Equal As Integers ${rc} 0 |
| 277 | Log ${output1} |
| 278 | Should Contain '${output1}' Unknown command |
| 279 | END |
suraj gour | a416622 | 2020-02-03 12:09:11 +0000 | [diff] [blame] | 280 | |
| 281 | Check logical device creation and deletion |
| 282 | [Documentation] Deletes all devices, checks logical device, creates devices again and checks |
| 283 | ... logical device, flows, ports |
Suchitra Vemuri | 5f66f42 | 2020-03-02 16:43:49 -0800 | [diff] [blame] | 284 | ... VOL-2416 VOL-2417 |
| 285 | [Tags] functional LogicalDeviceCheck |
Andy Bavier | e187eda | 2020-04-20 15:00:02 -0700 | [diff] [blame] | 286 | [Setup] Start Logging LogicalDeviceCheck |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 287 | [Teardown] Run Keywords Collect Logs |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 288 | ... AND Stop Logging LogicalDeviceCheck |
Andy Bavier | de53a1f | 2020-03-25 14:53:56 -0700 | [diff] [blame] | 289 | Delete All Devices and Verify |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 290 | FOR ${I} IN RANGE 0 ${olt_count} |
| 291 | ${olt_user}= Get From Dictionary ${list_olts}[${I}] user |
| 292 | ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass |
| 293 | ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship |
| 294 | ${olt_ip}= Get From Dictionary ${list_olts}[${I}] ip |
Suchitra Vemuri | 09f878d | 2021-02-10 18:19:04 -0800 | [diff] [blame] | 295 | ${olt_port}= Get From Dictionary ${list_olts}[${I}] oltport |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 296 | ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn |
| 297 | #${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 298 | ${logical_id}= Get Logical Device ID From SN ${olt_serial_number} |
| 299 | Should Be Empty ${logical_id} |
| 300 | Run Keyword If ${has_dataplane} Sleep 180s |
| 301 | ... ELSE Sleep 10s |
Andrea Campanella | 3dcce27 | 2021-01-15 16:04:47 +0100 | [diff] [blame] | 302 | ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}" |
Suchitra Vemuri | 09f878d | 2021-02-10 18:19:04 -0800 | [diff] [blame] | 303 | ... Create Device ${olt_ip} ${olt_port} |
| 304 | ... ELSE Create Device ${olt_ip} ${olt_port} ${list_olts}[${I}][type] |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 305 | Set Suite Variable ${olt_device_id} |
| 306 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN |
Hardik Windlass | 8b44649 | 2021-06-10 06:25:23 +0000 | [diff] [blame] | 307 | ... UNKNOWN ${olt_device_id} by_dev_id=True |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 308 | Enable Device ${olt_device_id} |
| 309 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE |
| 310 | ... ${olt_serial_number} |
| 311 | ${logical_id}= Get Logical Device ID From SN ${olt_serial_number} |
| 312 | Should Not Be Empty ${logical_id} |
| 313 | ${rc} ${output}= Run and Return Rc and Output |
Matteo Scandolo | 5899be1 | 2020-11-11 15:38:07 -0800 | [diff] [blame] | 314 | ... voltctl -c ${VOLTCTL_CONFIG} logicaldevice list |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 315 | Should Be Equal As Integers ${rc} 0 |
| 316 | Log ${output} |
| 317 | Should Contain ${output} ${olt_device_id} |
| 318 | Set Suite Variable ${logical_id} |
| 319 | Wait Until Keyword Succeeds ${timeout} 5s Validate Logical Device Ports ${logical_id} |
| 320 | Wait Until Keyword Succeeds ${timeout} 5s Validate Logical Device Flows ${logical_id} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 321 | END |
Suchitra Vemuri | e9c79bf | 2020-02-26 23:11:39 -0800 | [diff] [blame] | 322 | |
| 323 | *** Keywords *** |
| 324 | Setup Suite |
| 325 | [Documentation] Set up the test suite |
| 326 | Common Test Suite Setup |
| 327 | |
Suchitra Vemuri | 32dea01 | 2020-07-08 16:40:06 -0700 | [diff] [blame] | 328 | Teardown Suite |
| 329 | [Documentation] Teardown suite |
| 330 | Run Keyword If ${has_dataplane} Clean Up Linux |
Suchitra Vemuri | 1d8e817 | 2020-06-17 17:43:56 -0700 | [diff] [blame] | 331 | #Restore all ONUs |
| 332 | # Run Keyword If ${has_dataplane} RestoreONUs ${num_onus} |
TorstenThieme | 4e2168e | 2021-06-22 14:01:47 +0000 | [diff] [blame] | 333 | Close All ONOS SSH Connections |