blob: be8bae1d465efa0f2efa27893a3df9423b78e1c4 [file] [log] [blame]
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +00001# 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 ***
17Documentation Test various end-to-end scenarios
18Suite Setup Common Test Suite Setup
19Test Setup Setup
20Test Teardown Teardown
Suchitra Vemuri32dea012020-07-08 16:40:06 -070021Suite Teardown Teardown Suite
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +000022Library Collections
23Library String
24Library OperatingSystem
25Library XML
26Library RequestsLibrary
27Library ../../libraries/DependencyLibrary.py
28Resource ../../libraries/onos.robot
29Resource ../../libraries/voltctl.robot
30Resource ../../libraries/voltha.robot
31Resource ../../libraries/utils.robot
32Resource ../../libraries/k8s.robot
33Resource ../../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 Vemuri21fa8c72021-03-08 16:34:25 -080047${timeout} 540s
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +000048${of_id} 0
49${logical_id} 0
Suchitra Vemuri2fa9bba2020-01-22 17:38:48 -080050${has_dataplane} True
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +000051${teardown_device} False
52${scripts} ../../scripts
Hardik Windlasscbcca312020-04-20 21:46:11 +053053${workflow} ATT
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +000054
Andy Bavierabeba262020-02-07 16:22:16 -070055# Per-test logging on failure is turned off by default; set this variable to enable
56${container_log_dir} ${None}
57
Matteo Scandoloda1c64b2021-07-20 10:14:49 -070058# logging flag to enable Collect Logs, can be passed via the command line too
59# example: -v logging:False
60${logging} True
61
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +000062*** Test Cases ***
63Adding 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 Vemuri9a6dd6d2020-02-28 17:46:26 -080065 ... VOL-2405 VOL-2406
66 [Tags] AddSameOLT functional released
Andy Baviere187eda2020-04-20 15:00:02 -070067 [Setup] Start Logging AddSameOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -070068 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -070069 ... AND Stop Logging AddSameOLT
Suchitra Vemurif7a033c2020-02-26 17:22:41 -080070 # Add OLT device
Suchitra Vemurie9c79bf2020-02-26 23:11:39 -080071 #setup
Andy Bavierc1904dc2020-03-20 11:39:15 -070072 Delete All Devices and Verify
Suchitra Vemuri736d35f2020-08-06 16:28:35 -070073 # Wait for the OLT to be reachable
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080074 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 Vemuri09f878d2021-02-10 18:19:04 -080079 ${olt_port}= Get From Dictionary ${list_olts}[${I}] oltport
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080080 ${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 Campanella3dcce272021-01-15 16:04:47 +010084 ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}"
Suchitra Vemuri09f878d2021-02-10 18:19:04 -080085 ... Create Device ${olt_ip} ${olt_port}
86 ... ELSE Create Device ${olt_ip} ${olt_port} ${list_olts}[${I}][type]
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080087 Set Suite Variable ${olt_device_id}
88 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN
Hardik Windlass8b446492021-06-10 06:25:23 +000089 ... ${olt_device_id} by_dev_id=True
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080090 ${rc} ${output}= Run and Return Rc and Output
Suchitra Vemuri09f878d2021-02-10 18:19:04 -080091 ... voltctl -c ${VOLTCTL_CONFIG} device create -t openolt -H ${olt_ip}:${olt_port}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080092 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 Vemuri09f878d2021-02-10 18:19:04 -080099 ... voltctl -c ${VOLTCTL_CONFIG} device create -t openolt -H ${olt_ip}:${olt_port}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800100 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.Selvan3dfe6c22020-01-27 13:08:55 +0000105
Gayathri.Selvan967f5a52020-02-12 06:58:38 +0000106Test 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.Selvan3dfe6c22020-01-27 13:08:55 +0000108 ... command and ensure that error message is shown.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800109 ... VOL-2412-2413
110 [Tags] functional DisableEnableInvalidDevice released
Andy Baviere187eda2020-04-20 15:00:02 -0700111 [Setup] Start Logging DisableInvalidDevice
Andy Bavier4a8450e2020-02-04 08:58:37 -0700112 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700113 ... AND Stop Logging DisableInvalidDevice
Matteo Scandolo5899be12020-11-11 15:38:07 -0800114 ${rc} ${output}= Run and Return Rc and Output voltctl -c ${VOLTCTL_CONFIG} device list -o json
Gayathri.Selvan3dfe6c22020-01-27 13:08:55 +0000115 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 Scandolo5899be12020-11-11 15:38:07 -0800131 ${rc} ${output}= Run and Return Rc and Output voltctl -c ${VOLTCTL_CONFIG} device disable ${fakeDeviceId}
Suchitra Vemuria7e8ad22020-02-11 18:02:40 -0800132 Should Contain ${output} Error while disabling '${fakeDeviceId}'
Gayathri.Selvan967f5a52020-02-12 06:58:38 +0000133 #Disable device for VOL-2413
134 Disable Device ${device_id}
135 #Enable fake device id
Matteo Scandolo5899be12020-11-11 15:38:07 -0800136 ${rc} ${output}= Run and Return Rc and Output voltctl -c ${VOLTCTL_CONFIG} device enable ${fakeDeviceId}
Gayathri.Selvan967f5a52020-02-12 06:58:38 +0000137 Should Contain ${output} Error while enabling '${fakeDeviceId}'
suraj gourbaee2c62020-02-03 10:21:32 +0000138
139Check 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 Vemuri9a6dd6d2020-02-28 17:46:26 -0800143 ... VOL-2411
Hardik Windlasscbcca312020-04-20 21:46:11 +0530144 #TODO: If this TC gets updated in future, To add support for DT workflow as well (refer JIRA: VOL-2945)
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800145 [Tags] functional DeleteBeforeDisableCheck notready
Andy Baviere187eda2020-04-20 15:00:02 -0700146 [Setup] Start Logging DeleteBeforeDisableCheck
Andy Bavier4a8450e2020-02-04 08:58:37 -0700147 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700148 ... AND Stop Logging DeleteBeforeDisableCheck
suraj gourbaee2c62020-02-03 10:21:32 +0000149 #validate olt states
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800150 Run Keyword If ${has_dataplane} Clean Up Linux
151 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800152 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 Scandolo5899be12020-11-11 15:38:07 -0800161 ${rc} ${output}= Run and Return Rc and Output voltctl -c ${VOLTCTL_CONFIG} device delete ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800162 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 gourbaee2c62020-02-03 10:21:32 +0000171 ${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 Scandolo5899be12020-11-11 15:38:07 -0800177 ${rc} ${output}= Run and Return Rc and Output voltctl -c ${VOLTCTL_CONFIG} device delete ${onu_device_id}
suraj gourbaee2c62020-02-03 10:21:32 +0000178 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 gourb3160412020-02-04 06:11:31 +0000184
185Check disabling of pre-provisioned OLT before enabling
186 [Documentation] Create OLT, disable same OLT, check error message and validates ONU
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800187 ... VOL-2414
188 [Tags] functional DisablePreprovisionedOLTCheck
Andy Baviere187eda2020-04-20 15:00:02 -0700189 [Setup] Run Keywords Start Logging DisablePreprovisionedOLTCheck
Andy Bavierde53a1f2020-03-25 14:53:56 -0700190 ... AND Delete All Devices and Verify
Andy Bavier4a8450e2020-02-04 08:58:37 -0700191 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700192 ... AND Stop Logging DisablePreprovisionedOLTCheck
Andy Bavierde53a1f2020-03-25 14:53:56 -0700193 Sleep 180s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800194 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 Vemuri09f878d2021-02-10 18:19:04 -0800199 ${olt_port}= Get From Dictionary ${list_olts}[${I}] oltport
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800200 ${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 Campanella3dcce272021-01-15 16:04:47 +0100203 ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}"
Suchitra Vemuri09f878d2021-02-10 18:19:04 -0800204 ... Create Device ${olt_ip} ${olt_port}
205 ... ELSE Create Device ${olt_ip} ${olt_port} ${list_olts}[${I}][type]
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800206 Set Suite Variable ${olt_device_id}
207 #validate olt states
208 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN
Hardik Windlass8b446492021-06-10 06:25:23 +0000209 ... UNKNOWN ${olt_device_id} by_dev_id=True
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800210 #Try disabling pre-provisioned OLT
211 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800212 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800213 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 Windlasscbcca312020-04-20 21:46:11 +0530223 ${onu_reason}= Set Variable If '${workflow}' == 'DT' initial-mib-downloaded omci-flows-pushed
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800224 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gourb3160412020-02-04 06:11:31 +0000225 ${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 Windlasscbcca312020-04-20 21:46:11 +0530229 ... ${src['onu']} onu=True onu_reason=${onu_reason}
suraj gourb3160412020-02-04 06:11:31 +0000230 END
Hema526eceb2020-02-04 13:11:40 +0530231
232Disable 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 Vemuri5f66f422020-03-02 16:43:49 -0800235 ... VOL-2418
236 [Tags] functional DisableDelete_LogicalDevice
Andy Baviere187eda2020-04-20 15:00:02 -0700237 [Setup] Run Keywords Start Logging DisableDelete_LogicalDevice
Andy Bavierde53a1f2020-03-25 14:53:56 -0700238 ... AND Delete All Devices and Verify
Andy Bavier4a8450e2020-02-04 08:58:37 -0700239 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700240 ... AND Stop Logging DisableDelete_LogicalDevice
Hema526eceb2020-02-04 13:11:40 +0530241 Run Keyword If ${has_dataplane} Sleep 180s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800242 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 Vemuri09f878d2021-02-10 18:19:04 -0800247 ${olt_port}= Get From Dictionary ${list_olts}[${I}] oltport
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800248 ${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 Campanella3dcce272021-01-15 16:04:47 +0100251 ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}"
Suchitra Vemuri09f878d2021-02-10 18:19:04 -0800252 ... Create Device ${olt_ip} ${olt_port}
253 ... ELSE Create Device ${olt_ip} ${olt_port} ${list_olts}[${I}][type]
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800254 Set Suite Variable ${olt_device_id}
255 #validate olt states
256 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN
Hardik Windlass8b446492021-06-10 06:25:23 +0000257 ... UNKNOWN ${olt_device_id} by_dev_id=True
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800258 #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 Scandolo5899be12020-11-11 15:38:07 -0800264 ... voltctl -c ${VOLTCTL_CONFIG} logicaldevice list
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800265 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 Scandolo5899be12020-11-11 15:38:07 -0800270 ... voltctl -c ${VOLTCTL_CONFIG} logicaldevice disable ${logical_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800271 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 Scandolo5899be12020-11-11 15:38:07 -0800275 ... voltctl -c ${VOLTCTL_CONFIG} logicaldevice delete ${logical_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800276 Should Not Be Equal As Integers ${rc} 0
277 Log ${output1}
278 Should Contain '${output1}' Unknown command
279 END
suraj goura4166222020-02-03 12:09:11 +0000280
281Check logical device creation and deletion
282 [Documentation] Deletes all devices, checks logical device, creates devices again and checks
283 ... logical device, flows, ports
Suchitra Vemuri5f66f422020-03-02 16:43:49 -0800284 ... VOL-2416 VOL-2417
285 [Tags] functional LogicalDeviceCheck
Andy Baviere187eda2020-04-20 15:00:02 -0700286 [Setup] Start Logging LogicalDeviceCheck
Andy Bavier4a8450e2020-02-04 08:58:37 -0700287 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700288 ... AND Stop Logging LogicalDeviceCheck
Andy Bavierde53a1f2020-03-25 14:53:56 -0700289 Delete All Devices and Verify
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800290 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 Vemuri09f878d2021-02-10 18:19:04 -0800295 ${olt_port}= Get From Dictionary ${list_olts}[${I}] oltport
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800296 ${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 Campanella3dcce272021-01-15 16:04:47 +0100302 ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}"
Suchitra Vemuri09f878d2021-02-10 18:19:04 -0800303 ... Create Device ${olt_ip} ${olt_port}
304 ... ELSE Create Device ${olt_ip} ${olt_port} ${list_olts}[${I}][type]
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800305 Set Suite Variable ${olt_device_id}
306 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN
Hardik Windlass8b446492021-06-10 06:25:23 +0000307 ... UNKNOWN ${olt_device_id} by_dev_id=True
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800308 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 Scandolo5899be12020-11-11 15:38:07 -0800314 ... voltctl -c ${VOLTCTL_CONFIG} logicaldevice list
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800315 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 Vemuria6879aa2020-11-03 11:03:11 -0800321 END
Suchitra Vemurie9c79bf2020-02-26 23:11:39 -0800322
323*** Keywords ***
324Setup Suite
325 [Documentation] Set up the test suite
326 Common Test Suite Setup
327
Suchitra Vemuri32dea012020-07-08 16:40:06 -0700328Teardown Suite
329 [Documentation] Teardown suite
330 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700331 #Restore all ONUs
332# Run Keyword If ${has_dataplane} RestoreONUs ${num_onus}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000333 Close All ONOS SSH Connections