blob: 8e04fa60e3185efdaa7937e52af54ea79349a41f [file] [log] [blame]
TorstenThieme440b7c02020-12-18 15:42:57 +00001# Copyright 2020 - 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
15*** Settings ***
TorstenThiemec3c23232021-01-13 13:06:31 +000016Documentation Test different Reconcile scenarios of ONU Go adapter with all three workflows ATT, DT and TT.
TorstenThieme440b7c02020-12-18 15:42:57 +000017... Hint: default timeout in BBSim to mimic OLT reboot is 60 seconds!
18... This behaviour of BBSim can be modified by 'oltRebootDelay: 60' in BBSim section of helm chart or
19... used values.yaml during 'voltha up'.
20Suite Setup Setup Suite
21Suite Teardown Teardown Suite
22Test Setup Setup
23Test Teardown Teardown
24Library Collections
25Library String
26Library OperatingSystem
27Library XML
28Library RequestsLibrary
29Library ../../libraries/DependencyLibrary.py
30Resource ../../libraries/onos.robot
31Resource ../../libraries/voltctl.robot
32Resource ../../libraries/voltha.robot
33Resource ../../libraries/utils.robot
34Resource ../../libraries/k8s.robot
35Resource ../../libraries/onu_utilities.robot
36Resource ../../variables/variables.robot
37
38*** Variables ***
Hardik Windlass4288c6a2021-09-28 07:22:06 +000039${NAMESPACE} voltha
40${INFRA_NAMESPACE} default
TorstenThieme440b7c02020-12-18 15:42:57 +000041${timeout} 60s
42${of_id} 0
43${logical_id} 0
44${has_dataplane} True
45${external_libs} True
46${teardown_device} True
47${scripts} ../../scripts
48# Per-test logging on failure is turned off by default; set this variable to enable
49${container_log_dir} ${None}
50# flag for first test, needed due default timeout in BBSim to mimic OLT reboot of 60 seconds
51${firsttest} True
TorstenThiemec3c23232021-01-13 13:06:31 +000052# determines the environment workflow: DT, TT or ATT (default)
53# example: -v workflow:DT
54${workflow} ATT
TorstenThieme47983692021-06-17 10:43:35 +000055# KV Store Prefix
56# example: -v kvstoreprefix:voltha_voltha
57${kvstoreprefix} voltha_voltha
TorstenThieme440b7c02020-12-18 15:42:57 +000058# flag debugmode is used, if true timeout calculation various, can be passed via the command line too
59# example: -v debugmode:True
60${debugmode} False
61# logging flag to enable Collect Logs, can be passed via the command line too
62# example: -v logging:True
63${logging} False
64# if True execution will be paused before clean up, only use in case of manual testing, do not use in ci pipeline!
65# example: -v pausebeforecleanup:True
66${pausebeforecleanup} False
67# if True some outputs to console are done during running tests e.g. long duration flow test
68# example: -v print2console:True
69${print2console} False
70# if True (hard) kill will be used to restart onu adapter, else (soft) restart mechanism of k8s will be used
71# example: -v usekill2restart:True
72${usekill2restart} False
TorstenThieme45071602021-03-16 12:14:37 +000073# if True etcd check will be executed in test case teardown, if False etcd check will be executed in suite teardown
74# example: -v etcdcheckintestteardown:False
75${etcdcheckintestteardown} True
TorstenThieme440b7c02020-12-18 15:42:57 +000076${data_dir} ../data
TorstenThieme70bc5262021-01-19 12:12:55 +000077${suppressaddsubscriber} True
TorstenThieme440b7c02020-12-18 15:42:57 +000078
Hardik Windlassb1bda362021-11-24 11:54:36 +000079# flag to choose the subscriber provisioning command type in ONOS
80# TT often provision a single services for a subscriber (eg: hsia, voip, ...) one after the other.
81# if set to True, command used is "volt-add-subscriber-unitag"
82# if set to False, comand used is "volt-add-subscriber-access"
83${unitag_sub} False
TorstenThieme440b7c02020-12-18 15:42:57 +000084
85*** Test Cases ***
86Reconcile In Starting-OpenOmci
87 [Documentation] Validates the Reconcile in Starting-OpenOmci
88 ... Reconcile test during starting-openomci in AT&T-workflow:
89 ... - create and enable one BBSIM-ONU (no MIB-template should be available in KV-store)
TorstenThiemec3c23232021-01-13 13:06:31 +000090 ... - wait for device reason starting-openomci
TorstenThieme440b7c02020-12-18 15:42:57 +000091 ... - kill the open-onu-adapter-go
TorstenThiemec3c23232021-01-13 13:06:31 +000092 ... - wait for open-onu-adapter-go to restart
93 ... - perform sanity test include add subscriber
TorstenThieme440b7c02020-12-18 15:42:57 +000094 ... - delete ONU and MIB-template in KV-store
95 [Tags] functionalOnuGo ReconcileStartingOpenOmciOnuGo
96 [Setup] Run Keywords Start Logging ReconcileStartingOpenOmciOnuGo
97 ... AND Setup Test
98 Run Keyword If ${has_dataplane} Clean Up Linux
TorstenThiemee9017be2021-03-05 16:59:31 +000099 Do Reconcile In Determined State starting-openomci
TorstenThieme373adfe2021-12-16 13:03:04 +0000100 [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console}
101 ... AND Run Keyword If ${logging} Get Logical Id of OLT
TorstenThieme3494ceb2021-07-19 09:47:24 +0000102 ... AND Run Keyword If ${logging} Collect Logs
TorstenThieme440b7c02020-12-18 15:42:57 +0000103 ... AND Teardown Test
104 ... AND Stop Logging ReconcileStartingOpenOmciOnuGo
105
106Reconcile In Initial-Mib-Downloaded
107 [Documentation] Validates the Reconcile in initial-mib-downloaded
108 ... Reconcile test during initial-mib-downloaded in AT&T-workflow:
109 ... - create and enable one BBSIM-ONU (no MIB-template should be available in KV-store)
TorstenThiemec3c23232021-01-13 13:06:31 +0000110 ... - wait for device reason initial-mib-downloaded
TorstenThieme440b7c02020-12-18 15:42:57 +0000111 ... - kill the open-onu-adapter-go
TorstenThiemec3c23232021-01-13 13:06:31 +0000112 ... - wait for open-onu-adapter-go to restart
113 ... - perform sanity test include add subscriber
TorstenThieme440b7c02020-12-18 15:42:57 +0000114 ... - delete ONU and MIB-template in KV-store
115 [Tags] functionalOnuGo ReconcileInitialMibDownloadedOnuGo
116 [Setup] Run Keywords Start Logging ReconcileInitialMibDownloadedOnuGo
117 ... AND Setup Test
118 Run Keyword If ${has_dataplane} Clean Up Linux
TorstenThiemee9017be2021-03-05 16:59:31 +0000119 Do Reconcile In Determined State initial-mib-downloaded
TorstenThieme373adfe2021-12-16 13:03:04 +0000120 [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console}
121 ... AND Run Keyword If ${logging} Get Logical Id of OLT
TorstenThieme3494ceb2021-07-19 09:47:24 +0000122 ... AND Run Keyword If ${logging} Collect Logs
TorstenThieme440b7c02020-12-18 15:42:57 +0000123 ... AND Teardown Test
124 ... AND Stop Logging ReconcileInitialMibDownloadedOnuGo
125
126Reconcile In Omci-Flows-Pushed
127 [Documentation] Validates the Reconcile in omci-flows-pushed
128 ... Former testcase: Reconcile Onu Device in Testsuite Voltha_ONUStateTest.robot
129 ... Reconcile test during omci-flows-pushed in AT&T-workflow:
130 ... - create and enable one BBSIM-ONU (no MIB-template should be available in KV-store)
TorstenThiemec3c23232021-01-13 13:06:31 +0000131 ... - perform sanity test include add subscriber
TorstenThieme440b7c02020-12-18 15:42:57 +0000132 ... - kill the open-onu-adapter-go
TorstenThiemec3c23232021-01-13 13:06:31 +0000133 ... - wait for open-onu-adapter-go to restart
134 ... - perform sanity test suppress add subscriber
TorstenThieme440b7c02020-12-18 15:42:57 +0000135 ... - disable onu device
TorstenThiemec3c23232021-01-13 13:06:31 +0000136 ... - wait for device corresponding onu reason e.g. tech-profile-config-delete-success
137 ... - check UNI-ports disabled in ONOS
TorstenThieme440b7c02020-12-18 15:42:57 +0000138 ... - enable onu device
TorstenThiemec3c23232021-01-13 13:06:31 +0000139 ... - perform sanity test suppress add subscriber
TorstenThieme440b7c02020-12-18 15:42:57 +0000140 ... - delete ONU and MIB-template in KV-store
141 [Tags] functionalOnuGo ReconcileOmciFlowsPushedOnuGo
142 [Setup] Run Keywords Start Logging ReconcileOmciFlowsPushedOnuGo
143 ... AND Setup Test
144 Run Keyword If ${has_dataplane} Clean Up Linux
TorstenThiemee9017be2021-03-05 16:59:31 +0000145 Do Reconcile In Omci-Flows-Pushed
TorstenThieme373adfe2021-12-16 13:03:04 +0000146 [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console}
147 ... AND Run Keyword If ${logging} Get Logical Id of OLT
TorstenThieme3494ceb2021-07-19 09:47:24 +0000148 ... AND Run Keyword If ${logging} Collect Logs
TorstenThieme440b7c02020-12-18 15:42:57 +0000149 ... AND Teardown Test
150 ... AND Stop Logging ReconcileOmciFlowsPushedOnuGo
151
152Reconcile For Disabled Onu Device
153 [Documentation] Validates the Reconcile for disabled Onu device
154 ... Reconcile test for disabled Onu device in AT&T-workflow:
155 ... - create and enable one BBSIM-ONU (no MIB-template should be available in KV-store)
TorstenThiemec3c23232021-01-13 13:06:31 +0000156 ... - perform sanity test include add subscriber
TorstenThieme440b7c02020-12-18 15:42:57 +0000157 ... - disable onu device
TorstenThiemec3c23232021-01-13 13:06:31 +0000158 ... - wait for device corresponding onu reason e.g. tech-profile-config-delete-success
159 ... - check UNI-ports disabled in ONOS
160 ... - kill the open-onu-adapter-go
161 ... - wait for open-onu-adapter-go to restart
162 ... - check device reason is still the same before restart
TorstenThieme440b7c02020-12-18 15:42:57 +0000163 ... - enable onu device
TorstenThiemec3c23232021-01-13 13:06:31 +0000164 ... - perform sanity test suppress add subscriber
TorstenThieme440b7c02020-12-18 15:42:57 +0000165 ... - delete ONU and MIB-template in KV-store
166 [Tags] functionalOnuGo ReconcileDisabledOnuDeviceOnuGo
167 [Setup] Run Keywords Start Logging ReconcileDisabledOnuDeviceOnuGo
168 ... AND Setup Test
169 Run Keyword If ${has_dataplane} Clean Up Linux
TorstenThiemee9017be2021-03-05 16:59:31 +0000170 Do Reconcile For Disabled Onu Device
TorstenThieme373adfe2021-12-16 13:03:04 +0000171 [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console}
172 ... AND Run Keyword If ${logging} Get Logical Id of OLT
TorstenThieme3494ceb2021-07-19 09:47:24 +0000173 ... AND Run Keyword If ${logging} Collect Logs
TorstenThieme440b7c02020-12-18 15:42:57 +0000174 ... AND Teardown Test
175 ... AND Stop Logging ReconcileDisabledOnuDeviceOnuGo
176
TorstenThieme712b2962021-11-17 14:16:15 +0000177Olt Deletion After Adapter Restart
178 [Documentation] Validates the OLT deletion after adapter restart
179 ... - prefered environment is two ONUs are active on each of two OLTs, but test works also with single ONU/OLT
180 ... - restart the ONU adapter preferred via "kubectl delete pod"
181 ... - delete one OLT immediately after the restart has been initiated
182 ... - wait until the restart of the ONU adapter and the reconcile processing are finished
183 ... - check whether the ONUs on the remaining OLT have been properly reconciled (if avaialable)
184 ... - check whether the ONUs at the deleted OLT have disappeared from the device list
185 ... - KV store data of these ONUs are deleted under:
186 ... - <kvStorePrefix>/openonu/<deviceId>
187 ... - <kvStorePrefix>/openonu/pm-data/<deviceId>
188 ... - check for not deleted device(s) reason is still the same before restart (if available)
189 ... - delete ONU and MIB-template in KV-store
190 ... Check [VOL-4443] for more details
191 [Tags] functionalOnuGo OltDeletionAfterAdapterRestartOnuGo
192 [Setup] Run Keywords Start Logging OltDeletionAfterAdapterRestartOnuGo
193 ... AND Setup Test
194 Run Keyword If ${has_dataplane} Clean Up Linux
195 Do Olt Deletion After Adapter Restart
TorstenThieme373adfe2021-12-16 13:03:04 +0000196 [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console}
197 ... AND Run Keyword If ${logging} Get Logical Id of OLT
TorstenThieme712b2962021-11-17 14:16:15 +0000198 ... AND Run Keyword If ${logging} Collect Logs
199 ... AND Teardown Test
200 ... AND Stop Logging OltDeletionAfterAdapterRestartOnuGo
201
TorstenThiemef7cd2be2021-12-06 14:30:11 +0000202Flow Deletion After Adapter Restart
203 [Documentation] Validates the flow(s) deletion after adapter restart
204 ... - perform sanity test include add subscriber
205 ... - restart the ONU adapter preferred via "kubectl delete pod"
206 ... - remove flow(s) from one ONU immediately after the restart has been initiated
207 ... - wait until the restart of the ONU adapter and the reconcile processing are finished
208 ... - check removed flow(s) from ONU
209 ... - check for not removed flows still the same before restart (if available)
210 [Tags] functionalOnuGo FlowDeletionAfterAdapterRestartOnuGo
211 [Setup] Run Keywords Start Logging FlowDeletionAfterAdapterRestartOnuGo
212 ... AND Setup Test
213 Run Keyword If ${has_dataplane} Clean Up Linux
214 Do Flow Deletion After Adapter Restart
TorstenThieme373adfe2021-12-16 13:03:04 +0000215 [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console}
216 ... AND Run Keyword If ${logging} Get Logical Id of OLT
TorstenThiemef7cd2be2021-12-06 14:30:11 +0000217 ... AND Run Keyword If ${logging} Collect Logs
218 ... AND Teardown Test
219 ... AND Stop Logging FlowDeletionAfterAdapterRestartOnuGo
220
TorstenThieme00fe8262022-01-19 10:43:07 +0000221Wrong MDS Counter After Adapter Restart
222 [Documentation] Validates wrong MDS Counter of ONU after adapter restart
223 ... - perform sanity test include add subscriber
224 ... - restart the ONU adapter preferred via "kubectl delete pod"
225 ... - manipulate MDS counter
226 ... - wait until the restart of the ONU adapter and the reconcile processing are finished
227 ... - check all ONUs come up to previous state
228 [Tags] functionalOnuGo WrongMDSCounterAfterAdapterRestartOnuGo
229 [Setup] Run Keywords Start Logging WrongMDSCounterAfterAdapterRestartOnuGo
230 ... AND Setup Test
231 Run Keyword If ${has_dataplane} Clean Up Linux
232 Do Wrong MDS Counter After Adapter Restart
233 [Teardown] Run Keywords Printout ONU Serial Number and Device Id print2console=${print2console}
234 ... AND Run Keyword If ${logging} Get Logical Id of OLT
235 ... AND Run Keyword If ${logging} Collect Logs
236 ... AND Teardown Test
237 ... AND Stop Logging WrongMDSCounterAfterAdapterRestartOnuGo
238
TorstenThieme440b7c02020-12-18 15:42:57 +0000239*** Keywords ***
240Setup Suite
241 [Documentation] Set up the test suite
Andrea Campanella82add372021-11-05 12:01:15 +0100242 Start Logging Setup or Teardown Setup-${SUITE NAME}
TorstenThieme440b7c02020-12-18 15:42:57 +0000243 ${LogInfo}= Catenate
244 ... \r\nPassed arguments:
245 ... debugmode:${debugmode}, logging:${logging}, pausebeforecleanup:${pausebeforecleanup},
TorstenThieme47983692021-06-17 10:43:35 +0000246 ... print2console:${print2console}, usekill2restart:${usekill2restart}, workflow:${workflow},
247 ... kvstoreprefix:${kvstoreprefix}
TorstenThieme440b7c02020-12-18 15:42:57 +0000248 Log ${LogInfo} console=yes
249 Common Test Suite Setup
TorstenThieme00fe8262022-01-19 10:43:07 +0000250 # set tech profiles
251 Run Keyword If ${unitag_sub} and "${workflow}"=="TT" Set Tech Profile TT-HSIA ${INFRA_NAMESPACE} 64
252 Run Keyword If ${unitag_sub} and "${workflow}"=="TT" Set Tech Profile TT-VoIP ${INFRA_NAMESPACE} 65
253 Run Keyword If ${unitag_sub} and "${workflow}"=="TT" Set Tech Profile TT-multi-uni-MCAST-AdditionalBW-None
254 ... ${INFRA_NAMESPACE} 66
TorstenThieme440b7c02020-12-18 15:42:57 +0000255 # delete etcd MIB Template Data
Hardik Windlass4288c6a2021-09-28 07:22:06 +0000256 Delete MIB Template Data ${INFRA_NAMESPACE}
TorstenThieme45071602021-03-16 12:14:37 +0000257 # delete etcd onu data
Hardik Windlass4288c6a2021-09-28 07:22:06 +0000258 Delete ONU Go Adapter ETCD Data namespace=${INFRA_NAMESPACE} validate=True
Andrea Campanella82add372021-11-05 12:01:15 +0100259 Run Keyword If ${logging} Collect Logs
260 Stop Logging Setup or Teardown Setup-${SUITE NAME}
TorstenThieme440b7c02020-12-18 15:42:57 +0000261
TorstenThieme70bc5262021-01-19 12:12:55 +0000262
TorstenThieme440b7c02020-12-18 15:42:57 +0000263Teardown Suite
264 [Documentation] Replaces the Suite Teardown in utils.robot.
265 ... Cleans up and checks all ONU ports disabled in ONOS.
266 ... Furthermore gives the possibility to pause the execution.
Andrea Campanella82add372021-11-05 12:01:15 +0100267 Start Logging Setup or Teardown Teardown-${SUITE NAME}
TorstenThieme440b7c02020-12-18 15:42:57 +0000268 Run Keyword If ${pausebeforecleanup} Import Library Dialogs
269 Run Keyword If ${pausebeforecleanup} Pause Execution Press OK to continue with clean up!
270 Run Keyword If ${pausebeforecleanup} Log Teardown will be continued... console=yes
271 Run Keyword If ${teardown_device} Delete All Devices and Verify
Hardik Windlass4288c6a2021-09-28 07:22:06 +0000272 Run Keyword If ${usekill2restart} Restart Pod By Label ${NAMESPACE} app adapter-open-onu
TorstenThieme45071602021-03-16 12:14:37 +0000273 Run Keyword Unless ${etcdcheckintestteardown} Wait Until Keyword Succeeds ${timeout} 1s
Hardik Windlass4288c6a2021-09-28 07:22:06 +0000274 ... Validate Onu Data In Etcd ${INFRA_NAMESPACE} 0 ${kvstoreprefix} without_pm_data=False
TorstenThieme731a7592021-07-01 14:26:54 +0000275 Wait for Ports in ONOS for all OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT} 0 BBSM ${timeout}
Andrea Campanella82add372021-11-05 12:01:15 +0100276 Run Keyword If ${logging} Collect Logs
277 Stop Logging Setup or Teardown Teardown-${SUITE NAME}
TorstenThieme440b7c02020-12-18 15:42:57 +0000278 Close All ONOS SSH Connections
TorstenThieme00fe8262022-01-19 10:43:07 +0000279 Set Suite Variable ${TechProfile} ${EMPTY}
280 Run Keyword If ${unitag_sub} and "${workflow}"=="TT" Remove Tech Profile ${INFRA_NAMESPACE} 64
281 Run Keyword If ${unitag_sub} and "${workflow}"=="TT" Remove Tech Profile ${INFRA_NAMESPACE} 65
282 Run Keyword If ${unitag_sub} and "${workflow}"=="TT" Remove Tech Profile ${INFRA_NAMESPACE} 66
TorstenThieme440b7c02020-12-18 15:42:57 +0000283
284Setup Test
285 [Documentation] Pre-test Setup
286 #test for empty device list
287 Test Empty Device List
288 Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s Openolt is Up
289 ... ${olt_ssh_ip} ${olt_user} ${olt_pass}
290 Run Keyword If ${has_dataplane} Sleep 60s
291 #restart open-onu pod to reset crash loop back off mechansim of kubenetes
TorstenThieme37165402021-09-03 11:39:40 +0000292 Run Keyword If "${firsttest}"=="False" and "${usekill2restart}"=="True"
Hardik Windlass4288c6a2021-09-28 07:22:06 +0000293 ... Restart Pod By Label ${NAMESPACE} app adapter-open-onu
TorstenThieme440b7c02020-12-18 15:42:57 +0000294 Run Keyword If "${firsttest}"=="False" Sleep 35s
295 ${firsttest} Set Variable False
296 Set Suite Variable ${firsttest}
297 # Create a list of olt ids (logical and device_id)
298 ${olt_ids} Create List
299 FOR ${I} IN RANGE 0 ${num_olts}
300 #create/preprovision device
Andrea Campanella3dcce272021-01-15 16:04:47 +0100301 ${olt_device_id}= Run Keyword If "${list_olts}[${I}][type]" == "${None}"
TorstenThieme44136642021-02-12 13:41:17 +0000302 ... Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport]
303 ... ELSE Create Device ${list_olts}[${I}][ip] ${list_olts}[${I}][oltport] ${list_olts}[${I}][type]
TorstenThieme440b7c02020-12-18 15:42:57 +0000304 ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn]
305 #validate olt states
306 Wait Until Keyword Succeeds ${timeout} 5s
Hardik Windlass8b446492021-06-10 06:25:23 +0000307 ... Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN ${olt_device_id} by_dev_id=True
TorstenThieme440b7c02020-12-18 15:42:57 +0000308 Sleep 5s
309 ${logical_id}= Get Logical Device ID From SN ${olt_serial_number}
310 ${olt} Create Dictionary device_id ${olt_device_id} logical_id ${logical_id}
311 ... of_id ${of_id} sn ${olt_serial_number}
312 Append To List ${olt_ids} ${olt}
313 END
314 Set Global Variable ${olt_ids}
315
316Teardown Test
317 [Documentation] Post-test Teardown
TorstenThieme45071602021-03-16 12:14:37 +0000318 Run Keyword If ${pausebeforecleanup} Import Library Dialogs
319 Run Keyword If ${pausebeforecleanup} Pause Execution Press OK to continue with clean up!
320 Run Keyword If ${pausebeforecleanup} Log Teardown will be continued... console=yes
TorstenThiemee9017be2021-03-05 16:59:31 +0000321 Run Keyword If ${teardown_device} Delete All Devices and Verify
TorstenThieme440b7c02020-12-18 15:42:57 +0000322 # delete etcd MIB Template Data
Matteo Scandolo6b524122021-10-22 14:34:29 -0700323 Delete MIB Template Data ${INFRA_NAMESPACE}
TorstenThiemeb355eb62021-03-09 14:04:55 +0000324 # check etcd data are empty
TorstenThieme45071602021-03-16 12:14:37 +0000325 Run Keyword If ${etcdcheckintestteardown} Wait Until Keyword Succeeds ${timeout} 1s
Hardik Windlass4288c6a2021-09-28 07:22:06 +0000326 ... Validate Onu Data In Etcd ${INFRA_NAMESPACE} 0 ${kvstoreprefix} without_pm_data=False
TorstenThieme440b7c02020-12-18 15:42:57 +0000327 Sleep 5s
328
329Do Reconcile In Determined State
330 [Documentation] This keyword reconciles ONU device when passed reason is reached and
331 ... check the state afterwards.
332 ... Following steps will be executed:
333 ... - enable OLT device
334 ... - wait for passed openonu reason
335 ... - restart openonu adaptor
TorstenThiemec3c23232021-01-13 13:06:31 +0000336 ... - perform sanity test include add subscriber
TorstenThieme440b7c02020-12-18 15:42:57 +0000337 [Arguments] ${expected_onu_reason}
TorstenThiemec3c23232021-01-13 13:06:31 +0000338 ${admin_state} ${oper_status} ${connect_status} ${onu_state_nb} ${onu_state}= Map State
339 ... ${expected_onu_reason}
340 Should Be True ${onu_state_nb}<=5
341 ... Wrong expected onu reason ${expected_onu_reason}, must be lower than 'omci-flows-pushed'!
TorstenThieme440b7c02020-12-18 15:42:57 +0000342 FOR ${I} IN RANGE 0 ${num_olts}
343 #get olt serial number
344 ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn]
345 #validate olt states
346 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
347 Enable Device ${olt_device_id}
348 END
349 Current State Test All Onus ${expected_onu_reason}
TorstenThieme96fe9ee2021-10-21 10:24:08 +0000350 Reconcile Onu Adapter ${NAMESPACE} ${usekill2restart} ACTIVE
TorstenThiemec3c23232021-01-13 13:06:31 +0000351 Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT
TorstenThieme136ebf72021-02-26 14:27:07 +0000352 ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT
TorstenThiemec3c23232021-01-13 13:06:31 +0000353 ... ELSE Perform Sanity Test
TorstenThieme440b7c02020-12-18 15:42:57 +0000354
355Do Reconcile For Disabled Onu Device
356 [Documentation] This keyword reconciles ONU device for a disabled onu device and
357 ... check the state afterwards.
358 ... Following steps will be executed:
359 ... - enable OLT device
TorstenThiemec3c23232021-01-13 13:06:31 +0000360 ... - perform sanity test include add subscriber
TorstenThieme440b7c02020-12-18 15:42:57 +0000361 ... - disable onu device
TorstenThiemec3c23232021-01-13 13:06:31 +0000362 ... - wait for corresponding openonu reason
TorstenThieme440b7c02020-12-18 15:42:57 +0000363 ... - check UNI-ports disabled in ONOS
364 ... - restart openonu adaptor
365 ... - check openonu adaptor is ready again
TorstenThiemec3c23232021-01-13 13:06:31 +0000366 ... - check device reason is still before restart
TorstenThieme440b7c02020-12-18 15:42:57 +0000367 ... - enable onu device
TorstenThiemec3c23232021-01-13 13:06:31 +0000368 ... - perform sanity test suppress add subscriber
TorstenThieme440b7c02020-12-18 15:42:57 +0000369 FOR ${I} IN RANGE 0 ${num_olts}
370 #get olt serial number
371 ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn]
372 #validate olt states
373 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
374 Enable Device ${olt_device_id}
375 END
TorstenThiemec3c23232021-01-13 13:06:31 +0000376 Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT
TorstenThieme136ebf72021-02-26 14:27:07 +0000377 ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT
TorstenThiemec3c23232021-01-13 13:06:31 +0000378 ... ELSE Perform Sanity Test
TorstenThieme440b7c02020-12-18 15:42:57 +0000379 Disable Onu Device
TorstenThieme0ec95eb2021-11-23 14:56:26 +0000380 Current State Test All Onus tech-profile-config-delete-success
TorstenThieme00fe8262022-01-19 10:43:07 +0000381 #check no port is enabled in ONOS
382 Wait for Ports in ONOS for all OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT} 0 BBSM
383 Wait for all ONU Ports in ONOS Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${unitag_sub}
384 # validate etcd data
385 ${List_ONU_Serial} Create List
386 Build ONU SN List ${List_ONU_Serial}
387 FOR ${onu_sn} IN @{List_ONU_Serial}
388 Wait Until Keyword Succeeds ${timeout} 2s Validate Tech Profiles and Flows in ETCD Data Per Onu
389 ... ${onu_sn} ${INFRA_NAMESPACE} ${kvstoreprefix} must_exist=False check_tcont_map_empty=True
TorstenThieme569ef452022-02-07 14:00:26 +0000390 ... check_default_flow_att=False
TorstenThieme00fe8262022-01-19 10:43:07 +0000391 END
TorstenThieme96fe9ee2021-10-21 10:24:08 +0000392 Reconcile Onu Adapter ${NAMESPACE} ${usekill2restart} UNKNOWN
TorstenThieme0ec95eb2021-11-23 14:56:26 +0000393 Current State Test All Onus tech-profile-config-delete-success
TorstenThieme00fe8262022-01-19 10:43:07 +0000394 Wait for all ONU Ports in ONOS Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${unitag_sub}
TorstenThieme440b7c02020-12-18 15:42:57 +0000395 Enable Onu Device
TorstenThieme70bc5262021-01-19 12:12:55 +0000396 Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT ${suppressaddsubscriber}
TorstenThieme136ebf72021-02-26 14:27:07 +0000397 ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT ${suppressaddsubscriber}
TorstenThieme70bc5262021-01-19 12:12:55 +0000398 ... ELSE Perform Sanity Test ${suppressaddsubscriber}
TorstenThieme440b7c02020-12-18 15:42:57 +0000399
400Do Reconcile In Omci-Flows-Pushed
401 [Documentation] This keyword reconciles ONU device in omci-flows-pushed and check the state afterwards.
402 ... Reconcile test during omci-flows-pushed in AT&T-workflow:
403 ... - create and enable one BBSIM-ONU (no MIB-template should be available in KV-store)
TorstenThiemec3c23232021-01-13 13:06:31 +0000404 ... - perform sanity test include add subscriber
TorstenThieme440b7c02020-12-18 15:42:57 +0000405 ... - kill the open-onu-adapter-go
TorstenThiemec3c23232021-01-13 13:06:31 +0000406 ... - wait for open-onu-adapter-go to restart
407 ... - perform sanity test suppress add subscriber
TorstenThieme440b7c02020-12-18 15:42:57 +0000408 ... - disable onu device
TorstenThiemec3c23232021-01-13 13:06:31 +0000409 ... - wait for corresponding device reason
410 ... - check UNI-ports disabled in ONOS
TorstenThieme440b7c02020-12-18 15:42:57 +0000411 ... - enable onu device
TorstenThiemec3c23232021-01-13 13:06:31 +0000412 ... - perform sanity test supress add subscriber
TorstenThieme440b7c02020-12-18 15:42:57 +0000413 FOR ${I} IN RANGE 0 ${num_olts}
414 #get olt serial number
415 ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn]
416 #validate olt states
417 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
418 Enable Device ${olt_device_id}
419 END
TorstenThiemec3c23232021-01-13 13:06:31 +0000420 Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT
TorstenThieme136ebf72021-02-26 14:27:07 +0000421 ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT
TorstenThiemec3c23232021-01-13 13:06:31 +0000422 ... ELSE Perform Sanity Test
TorstenThieme96fe9ee2021-10-21 10:24:08 +0000423 Reconcile Onu Adapter ${NAMESPACE} ${usekill2restart} ACTIVE
TorstenThieme70bc5262021-01-19 12:12:55 +0000424 Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT ${suppressaddsubscriber}
TorstenThieme136ebf72021-02-26 14:27:07 +0000425 ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT ${suppressaddsubscriber}
TorstenThieme70bc5262021-01-19 12:12:55 +0000426 ... ELSE Perform Sanity Test ${suppressaddsubscriber}
TorstenThieme440b7c02020-12-18 15:42:57 +0000427 Disable Onu Device
TorstenThieme0ec95eb2021-11-23 14:56:26 +0000428 Current State Test All Onus tech-profile-config-delete-success
TorstenThieme00fe8262022-01-19 10:43:07 +0000429 Wait for all ONU Ports in ONOS Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${unitag_sub}
TorstenThieme440b7c02020-12-18 15:42:57 +0000430 Enable Onu Device
TorstenThieme70bc5262021-01-19 12:12:55 +0000431 Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT ${suppressaddsubscriber}
TorstenThieme136ebf72021-02-26 14:27:07 +0000432 ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT ${suppressaddsubscriber}
TorstenThieme70bc5262021-01-19 12:12:55 +0000433 ... ELSE Perform Sanity Test ${suppressaddsubscriber}
TorstenThieme712b2962021-11-17 14:16:15 +0000434
435
436Do Olt Deletion After Adapter Restart
437 [Documentation] This keyword deletes OLT after adapter restart and checks deleted device(s) and data
438 ... - prefered environment is two ONUs are active on each of two OLTs, but test works also with single ONU/OLT
439 ... - restart the ONU adapter preferred via "kubectl delete pod"
440 ... - delete one OLT immediately after the restart has been initiated
441 ... - wait until the restart of the ONU adapter and the reconcile processing are finished
442 ... - check whether the ONUs on the remaining OLT have been properly reconciled (if avaialable)
443 ... - check whether the ONUs at the deleted OLT have disappeared from the device list
444 ... - KV store data of these ONUs are deleted under:
445 ... - <kvStorePrefix>/openonu/<deviceId>
446 ... - <kvStorePrefix>/openonu/pm-data/<deviceId>
447 ... - check for not deleted device(s) reason is still the same before restart (if available)
448 ... - delete ONU and MIB-template in KV-store
449 ... Check [VOL-4443] for more details
450 FOR ${I} IN RANGE 0 ${num_olts}
451 #get olt serial number
452 ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn]
453 #validate olt states
454 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
455 Enable Device ${olt_device_id}
456 END
TorstenThiemef7cd2be2021-12-06 14:30:11 +0000457 # bring all onus to active -> OMCI-Flows-Pushed
TorstenThieme712b2962021-11-17 14:16:15 +0000458 Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT
459 ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT
460 ... ELSE Perform Sanity Test
461 # OLT#1 will be deleted, get its SN
462 ${olt_to_be_deleted}= Set Variable ${olts[0]['serial']}
463 ${olt_to_be_deleted_device_id}= Get OLTDeviceID From OLT List ${olt_to_be_deleted}
464 # collect all ONU device ids belonging to OLT to be deleted
465 ${onu_device_id_list_should_be_deleted} Create List
466 Build ONU Device Id List ${onu_device_id_list_should_be_deleted} ${olt_to_be_deleted}
467 Log ${onu_device_id_list_should_be_deleted}
468 Reconcile Onu Adapter ${NAMESPACE} ${usekill2restart} ACTIVE ${olt_to_be_deleted}
469 # validate OLT and all corresponding ONUs are removed
470 Validate all ONUS for OLT Removed ${num_all_onus} ${hosts} ${olt_to_be_deleted} ${timeout}
471 Validate Device Removed ${olt_to_be_deleted}
472 # validate for alle removed ONUs KV store date deleted
473 FOR ${onu_device_id} IN @{onu_device_id_list_should_be_deleted}
474 Log ${onu_device_id}
475 Wait Until Keyword Succeeds ${timeout} 1s Validate Onu Data In Etcd Removed ${INFRA_NAMESPACE}
476 ... ${onu_device_id} ${kvstoreprefix} without_pm_data=False
477 END
478 FOR ${I} IN RANGE 0 ${num_all_onus}
479 ${src}= Set Variable ${hosts.src[${I}]}
480 Continue For Loop If "${olt_to_be_deleted}"=="${src['olt']}"
481 Current State Test omci-flows-pushed ${src['onu']}
482 END
TorstenThiemef7cd2be2021-12-06 14:30:11 +0000483
484Do Flow Deletion After Adapter Restart
485 [Documentation] This keyword removes flow(s) after adapter restart and checks removed flow(s)
486 ... - perform sanity test include add subscriber
487 ... - restart the ONU adapter preferred via "kubectl delete pod"
488 ... - remove flow(s) from one ONU immediately after the restart has been initiated
489 ... - wait until the restart of the ONU adapter and the reconcile processing are finished
490 ... - check removed flow(s) from ONU
491 ... - check for not removed flows still the same before restart (if available)
492 FOR ${I} IN RANGE 0 ${num_olts}
493 #get olt serial number
494 ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn]
495 #validate olt states
496 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
497 Enable Device ${olt_device_id}
498 END
499 # bring all onus to active -> OMCI-Flows-Pushed
500 Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT
501 ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT
502 ... ELSE Perform Sanity Test
503 # log ONOS flows before remove
504 ${flow}= Execute ONOS CLI Command use single connection
505 ... ${ONOS_SSH_IP} ${ONOS_SSH_PORT} flows -s any ${of_id}
506 Log ${flow}
507 # validate OLT flows before remove
508 ${onu_device_id_list} Create List
509 Build ONU Device Id List ${onu_device_id_list}
510 Log ${onu_device_id_list}
511 FOR ${onu_device_id} IN @{onu_device_id_list}
512 Log ${onu_device_id}
513 ${rc} ${output}= Run and Return Rc and Output
Andrea Campanella28989d12022-01-11 09:49:21 +0100514 ... voltctl -c ${VOLTCTL_CONFIG} device flows ${onu_device_id} -m 32MB -o json
TorstenThiemef7cd2be2021-12-06 14:30:11 +0000515 Should Be Equal As Integers ${rc} 0
516 ${jsondata}= To Json ${output}
517 Log ${jsondata}
518 END
519 # Collect data for remove flow(s)
520 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${hosts.src[0]['olt']}
TorstenThieme00fe8262022-01-19 10:43:07 +0000521 ${onu_sn}= Set Variable ${hosts.src[0]['onu']}
522 ${onu_port_list} Create List
523 FOR ${I} IN RANGE 0 ${num_all_onus}
524 ${src}= Set Variable ${hosts.src[${I}]}
525 Continue For Loop If "${onu_sn}"!="${src['onu']}"
526 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
527 ... ${of_id} ${src['uni_id']}
528 ${port_id}= Get Index From List ${onu_port_list} ${onu_port}
529 Continue For Loop If -1 != ${port_id}
530 Append To List ${onu_port_list} ${onu_port}
531 END
532 ${params_for_remove_flow}= Create Dictionary unitag=${unitag_sub} onu_sn=${onu_sn} of_id=${of_id}
533 ... onu_port=${onu_port_list[0]}
TorstenThiemef7cd2be2021-12-06 14:30:11 +0000534 # Collect number of flows for comparing after Reconcile
535 ${olt_flows_list} Create List
536 FOR ${I} IN RANGE 0 ${num_olts}
537 ${olt_of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${list_olts}[${I}][sn]
538 ${flows}= Count flows ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${olt_of_id} added
539 ${olt_flows}= Create Dictionary olt=${olt_of_id} flows=${flows}
540 Append To List ${olt_flows_list} ${olt_flows}
541 END
TorstenThieme00fe8262022-01-19 10:43:07 +0000542 ${flows_onu}= Set Variable 0
543 FOR ${onu_port} IN @{onu_port_list}
544 ${flows_onu_port}= Count flows ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} added ${onu_port}
545 ${flows_onu}= Evaluate ${flows_onu} + ${flows_onu_port}
546 END
TorstenThiemef7cd2be2021-12-06 14:30:11 +0000547 # Restart onu adapter with deleting flows from first onu
548 Reconcile Onu Adapter ${NAMESPACE} ${usekill2restart} ACTIVE flow_delete_params=${params_for_remove_flow}
549 # validate flows in ONOS after remove
550 ${flow}= Execute ONOS CLI Command use single connection
551 ... ${ONOS_SSH_IP} ${ONOS_SSH_PORT} flows -s any ${of_id}
552 Log ${flow}
553 ${expected_flows_onu}= Set Variable If "${workflow}"=="ATT" 1 0
TorstenThieme00fe8262022-01-19 10:43:07 +0000554 FOR ${onu_port} IN @{onu_port_list}
555 Wait Until Keyword Succeeds ${timeout} 2s Validate number of flows ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
556 ... ${expected_flows_onu} ${of_id} any ${onu_port}
557 END
TorstenThiemed6492882021-12-16 08:10:02 +0000558 ${flow}= Execute ONOS CLI Command use single connection
559 ... ${ONOS_SSH_IP} ${ONOS_SSH_PORT} flows -s any ${of_id}
560 Log ${flow}
TorstenThieme00fe8262022-01-19 10:43:07 +0000561 # Beside onu port specific flows additional flows deleted depending on workflow and number of onu ports
562 ${number_ports}= Get Length ${onu_port_list}
563 ${additional_flows_deleted}= Run Keyword If "${workflow}"=="DT" Set Variable ${number_ports}
564 ... ELSE IF "${workflow}"=="TT" Evaluate ${number_ports}*3
565 ... ELSE IF "${workflow}"=="ATT" Set Variable 0
566 ... ELSE Set Variable 0
TorstenThiemef7cd2be2021-12-06 14:30:11 +0000567 FOR ${I} IN RANGE 0 ${num_olts}
TorstenThiemef7cd2be2021-12-06 14:30:11 +0000568 ${expected_flows}= Run Keyword If "${of_id}"=="${olt_flows_list}[${I}][olt]"
569 ... Evaluate ${olt_flows_list}[${I}][flows]-${flows_onu}-${additional_flows_deleted}
570 ... ELSE Set Variable ${olt_flows_list}[${I}][flows]
TorstenThiemed6492882021-12-16 08:10:02 +0000571 Wait Until Keyword Succeeds ${timeout} 2s Validate ONOS Flows per OLT ${list_olts}[${I}][sn]
572 ... ${expected_flows}
TorstenThiemef7cd2be2021-12-06 14:30:11 +0000573 END
TorstenThiemed6492882021-12-16 08:10:02 +0000574 ${flow}= Execute ONOS CLI Command use single connection
575 ... ${ONOS_SSH_IP} ${ONOS_SSH_PORT} flows -s any ${of_id}
576 Log ${flow}
TorstenThiemef7cd2be2021-12-06 14:30:11 +0000577 # validate etcd data
578 ${List_ONU_Serial} Create List
579 Build ONU SN List ${List_ONU_Serial}
580 ${onu_sn_no_flows}= Set Variable ${hosts.src[0]['onu']}
581 FOR ${onu_sn} IN @{List_ONU_Serial}
582 ${must_exist}= Set Variable If "${onu_sn}"=="${onu_sn_no_flows}" False True
TorstenThiemed6492882021-12-16 08:10:02 +0000583 Wait Until Keyword Succeeds ${timeout} 2s Validate Tech Profiles and Flows in ETCD Data Per Onu
584 ... ${onu_sn} ${INFRA_NAMESPACE} ${kvstoreprefix} ${must_exist}
TorstenThiemef7cd2be2021-12-06 14:30:11 +0000585 END
586 ${onu_device_id_no_flows}= Get Device ID From SN ${hosts.src[0]['onu']}
587 FOR ${onu_device_id} IN @{onu_device_id_list}
588 Log ${onu_device_id}
589 ${must_exist}= Set Variable If "${onu_device_id}"=="${onu_device_id_no_flows}" False True
590 Validate OLT Flows Per Onu ${onu_device_id} ${must_exist}
591 END
TorstenThieme00fe8262022-01-19 10:43:07 +0000592
593Do Wrong MDS Counter After Adapter Restart
594 [Documentation] This keyword checks correct handling of a wrong MDS counter after adapter restart
595 ... - perform sanity test include add subscriber
596 ... - restart the ONU adapter preferred via "kubectl delete pod"
597 ... - manipulate MDS counter
598 ... - wait until the restart of the ONU adapter and the reconcile processing are finished
599 ... - check all ONUs come up to previous state
600 FOR ${I} IN RANGE 0 ${num_olts}
601 #get olt serial number
602 ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn]
603 #validate olt states
604 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
605 Enable Device ${olt_device_id}
606 END
607 Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT
608 ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT
609 ... ELSE Perform Sanity Test
610 Reconcile Onu Adapter ${NAMESPACE} ${usekill2restart} ACTIVE wrong_MDS_counter=True
611 Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT ${suppressaddsubscriber}
612 ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT ${suppressaddsubscriber}
613 ... ELSE Perform Sanity Test ${suppressaddsubscriber}
614 Disable Onu Device
615 Current State Test All Onus tech-profile-config-delete-success
616 Wait for all ONU Ports in ONOS Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${unitag_sub}
617 Enable Onu Device
618 Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT ${suppressaddsubscriber}
619 ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT ${suppressaddsubscriber}
620 ... ELSE Perform Sanity Test ${suppressaddsubscriber}