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