blob: dd60016ee07cd962908163978350f96906cd8bb1 [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
Hardik Windlass4288c6a2021-09-28 07:22:06 +000044${INFRA_NAMESPACE} default
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +000045# 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 Vemuri21fa8c72021-03-08 16:34:25 -080048${timeout} 540s
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +000049${of_id} 0
50${logical_id} 0
Suchitra Vemuri2fa9bba2020-01-22 17:38:48 -080051${has_dataplane} True
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +000052${teardown_device} False
53${scripts} ../../scripts
Hardik Windlasscbcca312020-04-20 21:46:11 +053054${workflow} ATT
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +000055
Andy Bavierabeba262020-02-07 16:22:16 -070056# Per-test logging on failure is turned off by default; set this variable to enable
57${container_log_dir} ${None}
58
Matteo Scandoloda1c64b2021-07-20 10:14:49 -070059# logging flag to enable Collect Logs, can be passed via the command line too
60# example: -v logging:False
61${logging} True
62
Gayathri.Selvanee4a91b2020-01-17 06:49:53 +000063*** Test Cases ***
64Adding 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 Vemuri9a6dd6d2020-02-28 17:46:26 -080066 ... VOL-2405 VOL-2406
67 [Tags] AddSameOLT functional released
Andy Baviere187eda2020-04-20 15:00:02 -070068 [Setup] Start Logging AddSameOLT
Andy Bavier4a8450e2020-02-04 08:58:37 -070069 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -070070 ... AND Stop Logging AddSameOLT
Suchitra Vemurif7a033c2020-02-26 17:22:41 -080071 # Add OLT device
Suchitra Vemurie9c79bf2020-02-26 23:11:39 -080072 #setup
Andy Bavierc1904dc2020-03-20 11:39:15 -070073 Delete All Devices and Verify
Suchitra Vemuri736d35f2020-08-06 16:28:35 -070074 # Wait for the OLT to be reachable
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080075 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 Vemuri09f878d2021-02-10 18:19:04 -080080 ${olt_port}= Get From Dictionary ${list_olts}[${I}] oltport
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080081 ${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 Campanella3dcce272021-01-15 16:04:47 +010085 ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}"
Suchitra Vemuri09f878d2021-02-10 18:19:04 -080086 ... Create Device ${olt_ip} ${olt_port}
87 ... ELSE Create Device ${olt_ip} ${olt_port} ${list_olts}[${I}][type]
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080088 Set Suite Variable ${olt_device_id}
89 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN
Hardik Windlass8b446492021-06-10 06:25:23 +000090 ... ${olt_device_id} by_dev_id=True
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080091 ${rc} ${output}= Run and Return Rc and Output
Suchitra Vemuri09f878d2021-02-10 18:19:04 -080092 ... voltctl -c ${VOLTCTL_CONFIG} device create -t openolt -H ${olt_ip}:${olt_port}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -080093 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 Vemuri09f878d2021-02-10 18:19:04 -0800100 ... voltctl -c ${VOLTCTL_CONFIG} device create -t openolt -H ${olt_ip}:${olt_port}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800101 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.Selvan3dfe6c22020-01-27 13:08:55 +0000106
Gayathri.Selvan967f5a52020-02-12 06:58:38 +0000107Test 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.Selvan3dfe6c22020-01-27 13:08:55 +0000109 ... command and ensure that error message is shown.
Suchitra Vemuria7dae322020-02-19 22:38:18 -0800110 ... VOL-2412-2413
111 [Tags] functional DisableEnableInvalidDevice released
Andy Baviere187eda2020-04-20 15:00:02 -0700112 [Setup] Start Logging DisableInvalidDevice
Andy Bavier4a8450e2020-02-04 08:58:37 -0700113 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700114 ... AND Stop Logging DisableInvalidDevice
Matteo Scandolo5899be12020-11-11 15:38:07 -0800115 ${rc} ${output}= Run and Return Rc and Output voltctl -c ${VOLTCTL_CONFIG} device list -o json
Gayathri.Selvan3dfe6c22020-01-27 13:08:55 +0000116 Should Be Equal As Integers ${rc} 0
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
130 List Should Not Contain Value ${ids} ${fakeDeviceId}
131 #Disable fake device id
Matteo Scandolo5899be12020-11-11 15:38:07 -0800132 ${rc} ${output}= Run and Return Rc and Output voltctl -c ${VOLTCTL_CONFIG} device disable ${fakeDeviceId}
Suchitra Vemuria7e8ad22020-02-11 18:02:40 -0800133 Should Contain ${output} Error while disabling '${fakeDeviceId}'
Gayathri.Selvan967f5a52020-02-12 06:58:38 +0000134 #Disable device for VOL-2413
135 Disable Device ${device_id}
136 #Enable fake device id
Matteo Scandolo5899be12020-11-11 15:38:07 -0800137 ${rc} ${output}= Run and Return Rc and Output voltctl -c ${VOLTCTL_CONFIG} device enable ${fakeDeviceId}
Gayathri.Selvan967f5a52020-02-12 06:58:38 +0000138 Should Contain ${output} Error while enabling '${fakeDeviceId}'
suraj gourbaee2c62020-02-03 10:21:32 +0000139
140Check 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 Vemuri9a6dd6d2020-02-28 17:46:26 -0800144 ... VOL-2411
Hardik Windlasscbcca312020-04-20 21:46:11 +0530145 #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 -0800146 [Tags] functional DeleteBeforeDisableCheck notready
Andy Baviere187eda2020-04-20 15:00:02 -0700147 [Setup] Start Logging DeleteBeforeDisableCheck
Andy Bavier4a8450e2020-02-04 08:58:37 -0700148 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700149 ... AND Stop Logging DeleteBeforeDisableCheck
suraj gourbaee2c62020-02-03 10:21:32 +0000150 #validate olt states
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800151 Run Keyword If ${has_dataplane} Clean Up Linux
152 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800153 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 Scandolo5899be12020-11-11 15:38:07 -0800162 ${rc} ${output}= Run and Return Rc and Output voltctl -c ${VOLTCTL_CONFIG} device delete ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800163 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 gourbaee2c62020-02-03 10:21:32 +0000172 ${src}= Set Variable ${hosts.src[${I}]}
173 ${dst}= Set Variable ${hosts.dst[${I}]}
174 ${onu_device_id}= Get Device ID From SN ${src['onu']}
175 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
176 ... ENABLED ACTIVE REACHABLE
177 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
Matteo Scandolo5899be12020-11-11 15:38:07 -0800178 ${rc} ${output}= Run and Return Rc and Output voltctl -c ${VOLTCTL_CONFIG} device delete ${onu_device_id}
suraj gourbaee2c62020-02-03 10:21:32 +0000179 Log ${output}
180 Should Contain ${output} expected-admin-state:DISABLED
181 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
182 ... ENABLED ACTIVE REACHABLE
183 ... ${src['onu']} onu=True onu_reason=omci-flows-pushed
184 END
suraj gourb3160412020-02-04 06:11:31 +0000185
186Check disabling of pre-provisioned OLT before enabling
187 [Documentation] Create OLT, disable same OLT, check error message and validates ONU
Suchitra Vemuri9a6dd6d2020-02-28 17:46:26 -0800188 ... VOL-2414
189 [Tags] functional DisablePreprovisionedOLTCheck
Andy Baviere187eda2020-04-20 15:00:02 -0700190 [Setup] Run Keywords Start Logging DisablePreprovisionedOLTCheck
Andy Bavierde53a1f2020-03-25 14:53:56 -0700191 ... AND Delete All Devices and Verify
Andy Bavier4a8450e2020-02-04 08:58:37 -0700192 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700193 ... AND Stop Logging DisablePreprovisionedOLTCheck
Andy Bavierde53a1f2020-03-25 14:53:56 -0700194 Sleep 180s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800195 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 Vemuri09f878d2021-02-10 18:19:04 -0800200 ${olt_port}= Get From Dictionary ${list_olts}[${I}] oltport
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800201 ${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 Campanella3dcce272021-01-15 16:04:47 +0100204 ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}"
Suchitra Vemuri09f878d2021-02-10 18:19:04 -0800205 ... Create Device ${olt_ip} ${olt_port}
206 ... ELSE Create Device ${olt_ip} ${olt_port} ${list_olts}[${I}][type]
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800207 Set Suite Variable ${olt_device_id}
208 #validate olt states
209 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN
Hardik Windlass8b446492021-06-10 06:25:23 +0000210 ... UNKNOWN ${olt_device_id} by_dev_id=True
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800211 #Try disabling pre-provisioned OLT
212 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800213 ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800214 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 Windlasscbcca312020-04-20 21:46:11 +0530224 ${onu_reason}= Set Variable If '${workflow}' == 'DT' initial-mib-downloaded omci-flows-pushed
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800225 FOR ${I} IN RANGE 0 ${num_all_onus}
suraj gourb3160412020-02-04 06:11:31 +0000226 ${src}= Set Variable ${hosts.src[${I}]}
227 ${dst}= Set Variable ${hosts.dst[${I}]}
228 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
229 ... ENABLED ACTIVE REACHABLE
Hardik Windlasscbcca312020-04-20 21:46:11 +0530230 ... ${src['onu']} onu=True onu_reason=${onu_reason}
suraj gourb3160412020-02-04 06:11:31 +0000231 END
Hema526eceb2020-02-04 13:11:40 +0530232
233Disable 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 Vemuri5f66f422020-03-02 16:43:49 -0800236 ... VOL-2418
237 [Tags] functional DisableDelete_LogicalDevice
Andy Baviere187eda2020-04-20 15:00:02 -0700238 [Setup] Run Keywords Start Logging DisableDelete_LogicalDevice
Andy Bavierde53a1f2020-03-25 14:53:56 -0700239 ... AND Delete All Devices and Verify
Andy Bavier4a8450e2020-02-04 08:58:37 -0700240 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700241 ... AND Stop Logging DisableDelete_LogicalDevice
Hema526eceb2020-02-04 13:11:40 +0530242 Run Keyword If ${has_dataplane} Sleep 180s
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800243 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 Vemuri09f878d2021-02-10 18:19:04 -0800248 ${olt_port}= Get From Dictionary ${list_olts}[${I}] oltport
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800249 ${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 Campanella3dcce272021-01-15 16:04:47 +0100252 ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}"
Suchitra Vemuri09f878d2021-02-10 18:19:04 -0800253 ... Create Device ${olt_ip} ${olt_port}
254 ... ELSE Create Device ${olt_ip} ${olt_port} ${list_olts}[${I}][type]
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800255 Set Suite Variable ${olt_device_id}
256 #validate olt states
257 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN
Hardik Windlass8b446492021-06-10 06:25:23 +0000258 ... UNKNOWN ${olt_device_id} by_dev_id=True
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800259 #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 Scandolo5899be12020-11-11 15:38:07 -0800265 ... voltctl -c ${VOLTCTL_CONFIG} logicaldevice list
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800266 Should Be Equal As Integers ${rc} 0
267 Log ${output}
268 ${logical_id}= Get Logical Device ID From SN ${olt_serial_number}
269 Should Not Be Empty ${logical_id}
270 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800271 ... voltctl -c ${VOLTCTL_CONFIG} logicaldevice disable ${logical_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800272 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 Scandolo5899be12020-11-11 15:38:07 -0800276 ... voltctl -c ${VOLTCTL_CONFIG} logicaldevice delete ${logical_id}
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800277 Should Not Be Equal As Integers ${rc} 0
278 Log ${output1}
279 Should Contain '${output1}' Unknown command
280 END
suraj goura4166222020-02-03 12:09:11 +0000281
282Check logical device creation and deletion
283 [Documentation] Deletes all devices, checks logical device, creates devices again and checks
284 ... logical device, flows, ports
Suchitra Vemuri5f66f422020-03-02 16:43:49 -0800285 ... VOL-2416 VOL-2417
286 [Tags] functional LogicalDeviceCheck
Andy Baviere187eda2020-04-20 15:00:02 -0700287 [Setup] Start Logging LogicalDeviceCheck
Andy Bavier4a8450e2020-02-04 08:58:37 -0700288 [Teardown] Run Keywords Collect Logs
Andy Bavierabeba262020-02-07 16:22:16 -0700289 ... AND Stop Logging LogicalDeviceCheck
Andy Bavierde53a1f2020-03-25 14:53:56 -0700290 Delete All Devices and Verify
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800291 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 Vemuri09f878d2021-02-10 18:19:04 -0800296 ${olt_port}= Get From Dictionary ${list_olts}[${I}] oltport
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800297 ${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}
300 Should Be Empty ${logical_id}
301 Run Keyword If ${has_dataplane} Sleep 180s
302 ... ELSE Sleep 10s
Andrea Campanella3dcce272021-01-15 16:04:47 +0100303 ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}"
Suchitra Vemuri09f878d2021-02-10 18:19:04 -0800304 ... Create Device ${olt_ip} ${olt_port}
305 ... ELSE Create Device ${olt_ip} ${olt_port} ${list_olts}[${I}][type]
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800306 Set Suite Variable ${olt_device_id}
307 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN
Hardik Windlass8b446492021-06-10 06:25:23 +0000308 ... UNKNOWN ${olt_device_id} by_dev_id=True
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800309 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}
313 Should Not Be Empty ${logical_id}
314 ${rc} ${output}= Run and Return Rc and Output
Matteo Scandolo5899be12020-11-11 15:38:07 -0800315 ... voltctl -c ${VOLTCTL_CONFIG} logicaldevice list
Suchitra Vemuria6879aa2020-11-03 11:03:11 -0800316 Should Be Equal As Integers ${rc} 0
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 Vemuria6879aa2020-11-03 11:03:11 -0800322 END
Suchitra Vemurie9c79bf2020-02-26 23:11:39 -0800323
324*** Keywords ***
325Setup Suite
326 [Documentation] Set up the test suite
327 Common Test Suite Setup
328
Suchitra Vemuri32dea012020-07-08 16:40:06 -0700329Teardown Suite
330 [Documentation] Teardown suite
331 Run Keyword If ${has_dataplane} Clean Up Linux
Suchitra Vemuri1d8e8172020-06-17 17:43:56 -0700332 #Restore all ONUs
333# Run Keyword If ${has_dataplane} RestoreONUs ${num_onus}
TorstenThieme4e2168e2021-06-22 14:01:47 +0000334 Close All ONOS SSH Connections