blob: 92a8c1e752ff6e8d041de63522ce8892769f016c [file] [log] [blame]
Vijaybc331e22020-02-27 04:17:37 -06001*** Settings ***
2
Sushil Singh8d420bf2021-09-06 08:27:41 -05003Documentation Test lock management feature of management console on BMC.
Vijaybc331e22020-02-27 04:17:37 -06004
Sushil Singh8d420bf2021-09-06 08:27:41 -05005Resource ../../lib/resource.robot
6Resource ../../lib/openbmc_ffdc.robot
7Resource ../../lib/bmc_redfish_utils.robot
8Resource ../../lib/external_intf/management_console_utils.robot
9Resource ../../lib/rest_response_code.robot
10Library ../../lib/bmc_network_utils.py
Vijaybc331e22020-02-27 04:17:37 -060011
Sushil Singh8d420bf2021-09-06 08:27:41 -050012Suite Setup Run Keyword And Ignore Error Delete All Redfish Sessions
13Suite Teardown Run Keyword And Ignore Error Delete All Redfish Sessions
14Test Setup Printn
15Test Teardown FFDC On Test Case Fail
Vijaybc331e22020-02-27 04:17:37 -060016
17*** Variables ***
18
Sushil Singh8d420bf2021-09-06 08:27:41 -050019${BAD_REQUEST} Bad Request
20&{default_trans_id} TransactionID=${1}
Vijaybc331e22020-02-27 04:17:37 -060021
22*** Test Cases ***
23
Sushil Singhd03f2ce2020-09-17 08:54:41 -050024Acquire Read Write Lock
Vijaybc331e22020-02-27 04:17:37 -060025 [Documentation] Acquire and release different read locks.
Sushil Singhd03f2ce2020-09-17 08:54:41 -050026 [Tags] Acquire_Read_Write_Lock
27 [Template] Acquire Lock On Resource
Vijaybc331e22020-02-27 04:17:37 -060028
Sushil Singhd03f2ce2020-09-17 08:54:41 -050029 # client_id lock_type reboot_flag
30 HMCID-01 ReadCase1 False
31 HMCID-01 ReadCase2 False
32 HMCID-01 ReadCase3 False
33 HMCID-01 WriteCase1 False
34 HMCID-01 WriteCase2 False
35 HMCID-01 WriteCase3 False
Vijaybc331e22020-02-27 04:17:37 -060036
37
Sushil Singhd8bf1422021-09-06 05:19:09 -050038Verify Lock Is Not Persistent On BMC Reboot
39 [Documentation] Acquire lock and after reboot the locks are removed as no persistency
40 ... maintained.
41 [Tags] Verify_Lock_Is_Not_Persistent_On_BMC_Reboot
Sushil Singhd03f2ce2020-09-17 08:54:41 -050042 [Template] Acquire Lock On Resource
Vijaybc331e22020-02-27 04:17:37 -060043
Sushil Singhd03f2ce2020-09-17 08:54:41 -050044 # client_id lock_type reboot_flag
45 HMCID-01 ReadCase1 True
46 HMCID-01 ReadCase2 True
47 HMCID-01 ReadCase3 True
48 HMCID-01 WriteCase1 True
49 HMCID-01 WriteCase2 True
50 HMCID-01 WriteCase3 True
Vijaybc331e22020-02-27 04:17:37 -060051
52
Sushil Singh8d420bf2021-09-06 08:27:41 -050053Check After Reboot Transaction ID Set To Default
54 [Documentation] After reboot, the transaction id starts with default i.e. 1,
George Keishing7fd1ac02021-09-23 08:10:33 -050055 ... if any lock is acquired.
Sushil Singh8d420bf2021-09-06 08:27:41 -050056 [Tags] Check_After_Reboot_Transaction_ID_Set_To_Default
57 [Template] Verify Acquire And Release Lock In Loop
58
59 # client_id lock_type reboot_flag
60 HMCID-01 ReadCase1 True
61 HMCID-01 WriteCase1 True
62
63
Sushil Singhd03f2ce2020-09-17 08:54:41 -050064Acquire Read Lock On Read Lock
65 [Documentation] Acquire read lock on another read lock.
66 [Tags] Acquire_Read_Lock_On_Read_Lock
67 [Template] Acquire Lock On Another Lock
Vijaybc331e22020-02-27 04:17:37 -060068
Sushil Singhd03f2ce2020-09-17 08:54:41 -050069 # client_id
70 HMCID-01
Vijaybc331e22020-02-27 04:17:37 -060071
72
Sushil Singhd03f2ce2020-09-17 08:54:41 -050073Fail To Acquire Lock On Another Lock
74 [Documentation] Fail to acquire another lock.
75 [Tags] Fail_To_Acquire_Lock_On_Another_Lock
76 [Template] Verify Acquire Lock Fails On Another Lock
Vijay85610ee2020-04-03 05:30:28 -050077
Sushil Singhd03f2ce2020-09-17 08:54:41 -050078 # client_id lock_type
Sushil Singh5d059942021-09-27 08:41:38 -050079 HMCID-01 ReadCase7,WriteCase6
80 HMCID-01 WriteCase6,WriteCase6
81 HMCID-01 WriteCase6,ReadCase7
George Keishing566daaf2020-07-02 06:18:50 -050082
83
Sushil Singhe33c6e62020-09-29 06:34:35 -050084Acquire Lock After Reboot
85 [Documentation] Acquire and release read and write locks after reboot.
86 [Tags] Acquire_Lock_After_Reboot
87 [Template] Verify Acquire Lock After Reboot
88
89 # client_id lock_type
90 HMCID-01 ReadCase1
91 HMCID-01 ReadCase2
92 HMCID-01 ReadCase3
93 HMCID-01 WriteCase1
94 HMCID-01 WriteCase2
95 HMCID-01 WriteCase3
96
97
Sushil Singhd03f2ce2020-09-17 08:54:41 -050098Acquire And Release Lock In Loop
99 [Documentation] Acquire and release read, write locks in loop.
100 [Tags] Acquire_And_Release_Lock_In_Loop
101 [Template] Verify Acquire And Release Lock In Loop
George Keishing566daaf2020-07-02 06:18:50 -0500102
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500103 # client_id lock_type
104 HMCID-01 ReadCase1
105 HMCID-01 ReadCase2
106 HMCID-01 ReadCase3
107 HMCID-01 WriteCase1
108 HMCID-01 WriteCase2
109 HMCID-01 WriteCase3
Vijay85610ee2020-04-03 05:30:28 -0500110
111
Sushil Singh977f8f52020-11-20 06:32:50 -0600112Fail To Acquire Read And Write In Single Request
113 [Documentation] Fail to acquire read and write lock in single request.
114 [Tags] Fail_To_Acquire_Read_And_Write_In_Single_Request
115 [Template] Verify Fail To Acquire Read And Write In Single Request
116
117 # client_id lock_type
118 HMCID-01 ReadCase1,WriteCase1
119 HMCID-01 WriteCase1,ReadCase1
120
121
Sushil Singhdf390b62021-01-19 00:50:05 -0600122Acquire Multiple Lock Request At CEC Level
123 [Documentation] Acquire write lock on read lock under CEC level.
124 [Tags] Acquire_Multiple_Lock_Request_At_CEC_Level
125 [Template] Verify Acquire Multiple Lock Request At CEC Level
126
127 # client_id lock_type
128 HMCID-01 ReadCase4,WriteCase4
129 HMCID-01 WriteCase5,ReadCase5
130 HMCID-01 ReadCase6,WriteCase6
131 HMCID-01 WriteCase7,ReadCase7
132
133
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500134Verify Release Of Valid Locks
135 [Documentation] Release all valid locks.
136 [Tags] Verify_Release_Of_Valid_Locks
137 [Template] Acquire And Release Multiple Locks
Vijayafdd2a12020-04-09 02:03:20 -0500138
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500139 # client_id lock_type release_lock_type
140 HMCID-01 ReadCase1,ReadCase1,ReadCase1 Transaction
141 HMCID-02 ReadCase1,ReadCase1,ReadCase1 Session
Vijayafdd2a12020-04-09 02:03:20 -0500142
143
susilsi794116c62021-03-04 07:57:51 -0600144Release Lock When Session Deleted
145 [Documentation] Release lock when session gets deleted.
146 [Tags] Release_Lock_When_Session_Deleted
147 [Template] Verify Release Lock When Session Deleted
148
149 # client_id lock_type
150 HMCID-01 ReadCase1
151 HMCID-01 WriteCase1
152
153
Sushil Singh59011d02021-01-27 23:00:20 -0600154Fail To Release Lock With Invalid TransactionID
155 [Documentation] Fail to release lock with invalid transaction id.
156 [Tags] Fail_To_Release_Lock_With_Invalid_TransactionID
157 [Template] Verify Fail To Release Lock With Invalid TransactionID
158
susilsi743b0c062021-03-02 04:24:19 -0600159 # client_id lock_type release_lock_type
160 HMCID-01 ReadCase1 Transaction
161 HMCID-01 WriteCase1 Transaction
Sushil Singh59011d02021-01-27 23:00:20 -0600162
163
Sushil Singh1b590532021-01-20 05:13:54 -0600164Fail To Release Multiple Lock With Invalid TransactionID
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500165 [Documentation] Release in-valid lock result in fail.
Sushil Singh1b590532021-01-20 05:13:54 -0600166 [Tags] Fail_To_Release_Multiple_Lock_With_Invalid_TransactionID
167 [Template] Verify Fail To Release Multiple Lock With Invalid TransactionID
Vijayafdd2a12020-04-09 02:03:20 -0500168
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500169 # client_id lock_type release_lock_type
170 HMCID-01 ReadCase1,ReadCase1,ReadCase1 Transaction
171 12345 ReadCase2,ReadCase2,ReadCase2 Transaction
172 HMCID ReadCase3,ReadCase3,ReadCase3 Transaction
Vijayafdd2a12020-04-09 02:03:20 -0500173
174
Sushil Singh8bee3582021-01-27 23:46:48 -0600175Fail To Release Multiple Lock With Valid And Invalid TransactionID
George Keishing96143832021-03-23 07:55:08 -0500176 [Documentation] Release multiple lock with valid and invalid transaction.
Sushil Singh8bee3582021-01-27 23:46:48 -0600177 [Tags] Fail_To_Release_Multiple_Lock_With_Valid_And_Invalid_TransactionID
178 [Template] Verify Fail To Release Multiple Lock With Valid And Invalid TransactionID
179
180 # client_id lock_type release_lock_type
181 HMCID-01 ReadCase1,ReadCase1 Transaction
182
183
susilsi71d7b9962021-03-02 03:06:18 -0600184Fail To Release Lock With String As TransactionID Data Type
185 [Documentation] Fail to release lock with string as transaction id data type.
186 [Tags] Fail_To_Release_Lock_With_String_As_TransactionID_Data_Type
187 [Template] Verify Fail To Release Lock With TransactionID As String Type
188
189 # client_id lock_type release_lock_type
190 HMCID-01 ReadCase1 Transaction
191 HMCID-01 WriteCase1 Transaction
192
193
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500194Fail To Release Lock For Another Session
195 [Documentation] Failed to release locks from another session.
196 [Tags] Fail_To_Release_Lock_For_Another_Session
197 [Template] Verify Fail To Release Lock For Another Session
Vijayafdd2a12020-04-09 02:03:20 -0500198
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500199 # client_id lock_type
200 HMCID-01,HMCID-02 ReadCase1,ReadCase1
Vijayafdd2a12020-04-09 02:03:20 -0500201
202
Sushil Singhe33c6e62020-09-29 06:34:35 -0500203Test Invalid Resource ID Data Type Locking
204 [Documentation] Failed to acquire lock for invalid resource id data type.
205 [Tags] Test_Invalid_Resource_ID_Data_Type_Locking
206 [Template] Verify Fail To Acquire Lock For Invalid Resource ID Data Type
207
208 # client_id lock_type
209 HMCID-01 ReadCase1
210 HMCID-01 ReadCase2
211 HMCID-01 ReadCase3
212 HMCID-01 WriteCase1
213 HMCID-01 WriteCase2
214 HMCID-01 WriteCase3
215
216
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500217Fail To Acquire Lock For Invalid Lock Type
218 [Documentation] Failed to acquire read, write lock for invalid lock data passed.
219 [Tags] Fail_To_Acquire_Lock_For_Invalid_Lock_Type
220 [Template] Verify Fail To Acquire Lock For Invalid Lock Data
Vijayafdd2a12020-04-09 02:03:20 -0500221
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500222 # client_id lock_type message
223 HMCID-01 ReadCase1 ${BAD_REQUEST}
224 HMCID-01 ReadCase2 ${BAD_REQUEST}
225 HMCID-01 ReadCase3 ${BAD_REQUEST}
226 HMCID-01 ReadCase4 ${BAD_REQUEST}
227 HMCID-01 ReadCase5 ${BAD_REQUEST}
228 HMCID-01 WriteCase1 ${BAD_REQUEST}
229 HMCID-01 WriteCase2 ${BAD_REQUEST}
230 HMCID-01 WriteCase3 ${BAD_REQUEST}
231 HMCID-01 WriteCase4 ${BAD_REQUEST}
232 HMCID-01 WriteCase5 ${BAD_REQUEST}
Vijayafdd2a12020-04-09 02:03:20 -0500233
Vijayafdd2a12020-04-09 02:03:20 -0500234
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500235Fail To Acquire Lock For Invalid Lock Flag
236 [Documentation] Failed to acquire read write lock for invalid lock flag passed.
237 [Tags] Fail_To_Acquire_Lock_For_Invalid_Lock_Flag
238 [Template] Verify Fail To Acquire Lock For Invalid Lock Data
Vijayafdd2a12020-04-09 02:03:20 -0500239
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500240 # client_id lock_type message
241 HMCID-01 ReadCase6 ${BAD_REQUEST}
242 HMCID-01 ReadCase7 ${BAD_REQUEST}
243 HMCID-01 ReadCase8 ${BAD_REQUEST}
244 HMCID-01 ReadCase9 ${BAD_REQUEST}
245 HMCID-01 ReadCase10 ${BAD_REQUEST}
246 HMCID-01 ReadCase11 ${BAD_REQUEST}
247 HMCID-01 WriteCase6 ${BAD_REQUEST}
248 HMCID-01 WriteCase7 ${BAD_REQUEST}
249 HMCID-01 WriteCase8 ${BAD_REQUEST}
250 HMCID-01 WriteCase9 ${BAD_REQUEST}
251 HMCID-01 WriteCase10 ${BAD_REQUEST}
252 HMCID-01 WriteCase11 ${BAD_REQUEST}
Vijayafdd2a12020-04-09 02:03:20 -0500253
Vijayafdd2a12020-04-09 02:03:20 -0500254
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500255Fail To Acquire Lock For Invalid Segment Flag
256 [Documentation] Failed to acquire read write lock for invalid segment flag passed.
257 [Tags] Fail_To_Acquire_Lock_For_Invalid_Segment_Flag
258 [Template] Verify Fail To Acquire Lock For Invalid Lock Data
259
260 # client_id lock_type message
261 HMCID-01 ReadCase12 ${BAD_REQUEST}
262 HMCID-01 ReadCase13 ${BAD_REQUEST}
263 HMCID-01 ReadCase14 ${BAD_REQUEST}
264 HMCID-01 WriteCase12 ${BAD_REQUEST}
265 HMCID-01 WriteCase13 ${BAD_REQUEST}
266 HMCID-01 WriteCase14 ${BAD_REQUEST}
Vijayafdd2a12020-04-09 02:03:20 -0500267
Sushil Singhbace3002020-10-08 08:12:58 -0500268
Sushil Singh3b3a7ec2020-11-23 03:54:06 -0600269Fail To Acquire Lock For Invalid Segment Data Type Flag
270 [Documentation] Failed to acquire read write lock for invalid segment flag passed.
271 [Tags] Fail_To_Acquire_Lock_For_Invalid_Segment_Data_Type_Flag
272 [Template] Verify Fail To Acquire Lock For Invalid Lock Data
273
274 # client_id lock_type message
275 HMCID-01 ReadCase15 ${EMPTY}
276 HMCID-01 ReadCase16 ${EMPTY}
277 HMCID-01 ReadCase17 ${EMPTY}
278 HMCID-01 ReadCase18 ${EMPTY}
279 HMCID-01 WriteCase15 ${EMPTY}
280 HMCID-01 WriteCase16 ${EMPTY}
281 HMCID-01 WriteCase17 ${EMPTY}
282 HMCID-01 WriteCase18 ${EMPTY}
283
284
Sushil Singhbace3002020-10-08 08:12:58 -0500285Get Empty Lock Records For Session Where No Locks Acquired
286 [Documentation] If session does not acquire locks then get lock should return
287 ... empty lock records.
288 [Tags] Get_Empty_Lock_Records_For_Session_Where_No_Locks_Acquired
289 [Template] Verify No Locks Records For Session With No Acquired Lock
290
291 # client_id
292 HMCID-01
293
Sushil Singh728ef9c2020-10-28 04:25:39 -0500294
Sushil Singhf9a536c2020-11-09 07:33:17 -0600295Get Lock Records Empty For Invalid Session
296 [Documentation] Record of lock list is empty for invalid session.
297 [Tags] Get_Lock_Records_Empty_For_Invalid_Session
298 [Template] Verify Empty Lock Records For Invalid Session
299
300 # client_id
301 HMCID-01
302
303
Sushil Singh728ef9c2020-10-28 04:25:39 -0500304Get Lock Records For Multiple Session
305 [Documentation] Get lock records of multiple session.
306 [Tags] Get_Lock_Records_For_Multiple_Session
307 [Template] Verify Lock Records Of Multiple Session
308
309 # client_ids lock_type
310 HMCID-01,HMCID-02 ReadCase1,ReadCase1
311
312
Sushil Singhf9a536c2020-11-09 07:33:17 -0600313Get Lock Records For Multiple Invalid Session
314 [Documentation] Record of lock list is empty for list of invalid session.
315 [Tags] Get_Lock_Records_For_Multiple_Invalid_Session
316 [Template] Verify Lock Records For Multiple Invalid Session
317
318 # client_id
319 HMCID-01
320
Sushil Singh11949a22020-11-13 06:12:16 -0600321
322Get Lock Records For Multiple Invalid And Valid Session
323 [Documentation] Get record of lock from invalid and valid session.
324 [Tags] Get_Lock_Records_For_Multiple_Invalid_And_Valid_Session
325 [Template] Verify Lock Records For Multiple Invalid And Valid Session
326
327 # client_id lock_type
328 HMCID-01,HMCID-02 ReadCase1
329
Vijaybc331e22020-02-27 04:17:37 -0600330*** Keywords ***
331
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500332Create Redfish Session With ClientID
333 [Documentation] Create redifish session with client id.
334 [Arguments] ${client_id}
Vijay85610ee2020-04-03 05:30:28 -0500335
336 # Description of argument(s):
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500337 # client_id This client id can contain string value
338 # (e.g. 12345, "HMCID").
Vijay85610ee2020-04-03 05:30:28 -0500339
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500340 ${session_info}= Create Dictionary
341 ${session}= Redfish Login kwargs= "Oem":{"OpenBMC" : {"ClientID":"${client_id}"}}
Vijay85610ee2020-04-03 05:30:28 -0500342
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500343 Set To Dictionary ${session_info} SessionIDs ${session['Id']}
344 Set To Dictionary ${session_info} ClientID ${session["Oem"]["OpenBMC"]["ClientID"]}
Vijay85610ee2020-04-03 05:30:28 -0500345
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500346 [Return] ${session_info}
Vijay85610ee2020-04-03 05:30:28 -0500347
348
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500349RW General Dictionary
George Keishing16b3c7b2021-01-28 09:23:37 -0600350 [Documentation] Create dictionary of lock request.
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500351 [Arguments] ${read_case} ${res_id}
Vijaybc331e22020-02-27 04:17:37 -0600352
353 # Description of argument(s):
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500354 # read_case Read or Write lock type.
355 # res_id Resource id.
Vijaybc331e22020-02-27 04:17:37 -0600356
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500357 ${request_dict}= Create Dictionary
George Keishing566daaf2020-07-02 06:18:50 -0500358
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500359 FOR ${key} IN @{read_case.keys()}
360 Set To Dictionary ${request_dict} LockType ${key}
361 Set To Dictionary ${request_dict} SegmentFlags ${read_case["${key}"]}
362 END
Vijaybc331e22020-02-27 04:17:37 -0600363
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500364 Set To Dictionary ${request_dict} ResourceID ${res_id}
365
366 [Return] ${request_dict}
Vijaybc331e22020-02-27 04:17:37 -0600367
368
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500369Return Description Of Response
370 [Documentation] Return description of REST response.
Vijaybc331e22020-02-27 04:17:37 -0600371 [Arguments] ${resp_text}
372
373 # Description of argument(s):
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500374 # resp_text REST response body.
Vijaybc331e22020-02-27 04:17:37 -0600375
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500376 # resp_text after successful partition file upload looks like:
377 # {
378 # "Description": "File Created"
379 # }
Vijaybc331e22020-02-27 04:17:37 -0600380
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500381 ${message}= Evaluate json.loads('''${resp_text}''') json
382
383 [Return] ${message}
Vijaybc331e22020-02-27 04:17:37 -0600384
385
Sushil Singha7d71f02020-11-02 05:24:22 -0600386Verify Redfish Session Deleted
387 [Documentation] Verify the redfish session is deleted.
388 [Arguments] ${session_info}
389
390 # Description of argument(s):
391 # session_info Session information are stored in dictionary.
392
393 # ${session_info} = {
394 # 'SessionIDs': 'XXXXXXXXX',
395 # 'ClientID': 'XXXXXX',
396 # 'SessionToken': 'XXXXXXXXX',
397 # 'SessionResp': session response from redfish login
398 # }
399
400 # SessionIDs : Session IDs
401 # ClientID : Client ID
402 # SessionToken : Session token
403 # SessionResp : Response of creating an redfish login session
404
405 ${sessions}= Redfish.Get Properties /redfish/v1/SessionService/Sessions
406
407 FOR ${session} IN @{sessions['Members']}
Sushil Singh8a3efe72021-08-26 08:16:41 -0500408 Should Not Be Equal As Strings
409 ... session ['/redfish/v1/SessionService/Sessions/${session_info["SessionIDs"]}']
Sushil Singha7d71f02020-11-02 05:24:22 -0600410 END
411
412
413Verify Redfish List Of Session Deleted
414 [Documentation] Verify all the list of redfish session is deleted.
415 [Arguments] ${session_info_list}
416
417 # Description of argument(s):
418 # session_info_list List contains individual session record are stored in dictionary.
419
420 # ${session_info_list} = [{
421 # 'SessionIDs': 'XXXXXXXXX',
422 # 'ClientID': 'XXXXXX',
423 # 'SessionToken': 'XXXXXXXXX',
424 # 'SessionResp': session response from redfish login
425 # }]
426
427 # SessionIDs : Session IDs
428 # ClientID : Client ID
429 # SessionToken : Session token
430 # SessionResp : Response of creating an redfish login session
431
432 FOR ${session_record} IN @{session_info_list}
433 Verify Redfish Session Deleted ${session_record}
434 END
435
436
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500437Redfish Post Acquire Lock
438 [Documentation] Acquire and release lock.
439 [Arguments] ${lock_type} ${status_code}=${HTTP_OK}
Vijaybc331e22020-02-27 04:17:37 -0600440
441 # Description of argument(s):
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500442 # lock_type Read lock or Write lock.
443 # status_code HTTP status code.
Vijaybc331e22020-02-27 04:17:37 -0600444
Sushil Singhe33c6e62020-09-29 06:34:35 -0500445 ${lock_dict_param}= Form Data To Acquire Lock ${lock_type}
Sushil Singh8a3efe72021-08-26 08:16:41 -0500446 ${resp}= Redfish Post Request
447 ... /ibm/v1/HMC/LockService/Actions/LockService.AcquireLock data=${lock_dict_param}
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500448 Should Be Equal As Strings ${resp.status_code} ${status_code}
Sushil Singhdf390b62021-01-19 00:50:05 -0600449
450 Run Keyword If ${status_code} == ${HTTP_BAD_REQUEST}
451 ... Valid Value ${BAD_REQUEST} ['${resp.content}']
452 ... ELSE
453 ... Run Keyword And Return Return Description Of Response ${resp.content}
Vijaybc331e22020-02-27 04:17:37 -0600454
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500455 [Return] ${resp}
Vijaybc331e22020-02-27 04:17:37 -0600456
457
Sushil Singh977f8f52020-11-20 06:32:50 -0600458Redfish Post Acquire List Lock
459 [Documentation] Acquire and release lock.
460 [Arguments] ${lock_type} ${status_code}=${HTTP_OK}
461
462 # Description of argument(s):
463 # lock_type Read lock or Write lock.
464 # status_code HTTP status code.
465
466 ${lock_dict_param}= Create Data To Acquire List Of Lock ${lock_type}
Sushil Singh8a3efe72021-08-26 08:16:41 -0500467 ${resp}= Redfish Post Request
468 ... /ibm/v1/HMC/LockService/Actions/LockService.AcquireLock data=${lock_dict_param}
Sushil Singh977f8f52020-11-20 06:32:50 -0600469 Should Be Equal As Strings ${resp.status_code} ${status_code}
470
471 [Return] ${resp}
472
473
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500474Redfish Post Acquire Invalid Lock
475 [Documentation] Redfish to post request to acquire in-valid lock.
476 [Arguments] ${lock_type} ${message} ${status_code}=${HTTP_OK}
Vijaybc331e22020-02-27 04:17:37 -0600477
478 # Description of argument(s):
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500479 # lock_type Read lock or Write lock.
480 # message Return message from URI.
481 # status_code HTTP status code.
Vijaybc331e22020-02-27 04:17:37 -0600482
Sushil Singhe33c6e62020-09-29 06:34:35 -0500483 ${lock_dict_param}= Form Data To Acquire Invalid Lock ${lock_type}
Sushil Singh8a3efe72021-08-26 08:16:41 -0500484 ${resp}= Redfish Post Request
485 ... /ibm/v1/HMC/LockService/Actions/LockService.AcquireLock data=${lock_dict_param}
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500486 Should Be Equal As Strings ${resp.status_code} ${status_code}
Sushil Singh3b3a7ec2020-11-23 03:54:06 -0600487 Run Keyword If '${message}' != '${EMPTY}'
488 ... Valid Value message ['${resp.content}']
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500489
490 [Return] ${resp}
Vijaybc331e22020-02-27 04:17:37 -0600491
492
Sushil Singhe33c6e62020-09-29 06:34:35 -0500493Redfish Post Acquire Invalid Lock With Invalid Data Type Of Resource ID
494 [Documentation] Redfish to post request to acquire in-valid lock with invalid data type of resource id.
495 [Arguments] ${lock_type} ${status_code}=${HTTP_OK}
496
497 # Description of argument(s):
498 # lock_type Read lock or Write lock.
499 # status_code HTTP status code.
500
Sushil Singh8a3efe72021-08-26 08:16:41 -0500501 ${lock_dict_param}=
502 ... Form Data To Acquire Invalid Lock With Invalid Data Type Of Resource ID ${lock_type}
503 ${resp}= Redfish Post Request
504 ... /ibm/v1/HMC/LockService/Actions/LockService.AcquireLock data=${lock_dict_param}
Sushil Singhe33c6e62020-09-29 06:34:35 -0500505 Should Be Equal As Strings ${resp.status_code} ${status_code}
506
507 [Return] ${resp}
508
509
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500510Form Data To Acquire Lock
George Keishing16b3c7b2021-01-28 09:23:37 -0600511 [Documentation] Create a dictionary for lock request.
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500512 [Arguments] ${lock_type}
513
514 # Description of argument(s):
515 # lock_type Read lock or Write lock.
516
517 ${lock_res_info}= Get Lock Resource Information
518 ${resp}= RW General Dictionary
519 ... ${lock_res_info["Valid Case"]["${lock_type}"]}
520 ... ${lock_res_info["Valid Case"]["ResourceID"]}
521 ${temp_list}= Create List ${resp}
Sushil Singhe33c6e62020-09-29 06:34:35 -0500522 ${lock_request_dict}= Create Dictionary Request=${temp_list}
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500523
Sushil Singhe33c6e62020-09-29 06:34:35 -0500524 [Return] ${lock_request_dict}
525
526
Sushil Singh977f8f52020-11-20 06:32:50 -0600527Create Data To Acquire List Of Lock
George Keishing16b3c7b2021-01-28 09:23:37 -0600528 [Documentation] Create a dictionary for list of lock request.
Sushil Singh977f8f52020-11-20 06:32:50 -0600529 [Arguments] ${lock_type_list}
530
531 # Description of argument(s):
532 # lock_type Read lock or Write lock.
533
534 ${temp_list}= Create List
535 ${lock_res_info}= Get Lock Resource Information
536
537 FOR ${lock_type} IN @{lock_type_list}
538 ${resp}= RW General Dictionary
539 ... ${lock_res_info["Valid Case"]["${lock_type}"]}
540 ... ${lock_res_info["Valid Case"]["ResourceID"]}
541 Append To List ${temp_list} ${resp}
542 END
543
544 ${lock_request_dict}= Create Dictionary Request=${temp_list}
545
546 [Return] ${lock_request_dict}
547
548
Sushil Singhe33c6e62020-09-29 06:34:35 -0500549Form Data To Acquire Invalid Lock With Invalid Data Type Of Resource ID
George Keishing16b3c7b2021-01-28 09:23:37 -0600550 [Documentation] Create a dictionary for in-valid lock request.
Sushil Singhe33c6e62020-09-29 06:34:35 -0500551 [Arguments] ${lock_type}
552
553 # Description of argument(s):
554 # lock_type Read lock or Write lock.
555
556 ${lock_res_info}= Get Lock Resource Information
557 ${resp}= RW General Dictionary
558 ... ${lock_res_info["Valid Case"]["${lock_type}"]}
559 ... ${lock_res_info["Invalid Case"]["ResourceIDInvalidDataType"]}
560 ${temp_list}= Create List ${resp}
561 ${lock_request_dict}= Create Dictionary Request=${temp_list}
562
563 [Return] ${lock_request_dict}
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500564
565
566Form Data To Acquire Invalid Lock
George Keishing16b3c7b2021-01-28 09:23:37 -0600567 [Documentation] Create a dictionary for in-valid lock request.
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500568 [Arguments] ${lock_type}
569
570 # Description of argument(s):
571 # lock_type Read lock or Write lock.
572
573 ${lock_res_info}= Get Lock Resource Information
574 ${resp}= RW General Dictionary
575 ... ${lock_res_info["Invalid Case"]["${lock_type}"]}
576 ... ${lock_res_info["Valid Case"]["ResourceID"]}
577 ${temp_list}= Create List ${resp}
Sushil Singhe33c6e62020-09-29 06:34:35 -0500578 ${lock_request_dict}= Create Dictionary Request=${temp_list}
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500579
Sushil Singhe33c6e62020-09-29 06:34:35 -0500580 [Return] ${lock_request_dict}
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500581
582
583Get Locks List On Resource
Vijaybc331e22020-02-27 04:17:37 -0600584 [Documentation] Get locks list.
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500585 [Arguments] ${session_info} ${exp_status_code}=${HTTP_OK}
Vijaybc331e22020-02-27 04:17:37 -0600586
587 # Description of argument(s):
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500588 # session_info Session information in dict.
589 # exp_status_code Expected HTTP status code.
Vijaybc331e22020-02-27 04:17:37 -0600590
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500591 ${data}= Set Variable {"SessionIDs": ["${session_info['SessionIDs']}"]}
George Keishing566daaf2020-07-02 06:18:50 -0500592 ${resp}= Redfish Post Request /ibm/v1/HMC/LockService/Actions/LockService.GetLockList
593 ... data=${data}
Vijaybc331e22020-02-27 04:17:37 -0600594 ${locks}= Evaluate json.loads('''${resp.text}''') json
595
596 [Return] ${locks["Records"]}
597
598
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500599Verify Lock On Resource
600 [Documentation] Verify lock on resource.
601 [Arguments] ${session_info} ${transaction_id}
Vijaybc331e22020-02-27 04:17:37 -0600602
603 # Description of argument(s):
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500604 # session_info Session information in dict.
605 # transaction_id Transaction id in list stored in dict.
Vijaybc331e22020-02-27 04:17:37 -0600606
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500607 ${sessions}= Redfish.Get Properties /redfish/v1/SessionService/Sessions/${session_info['SessionIDs']}
608 Rprint Vars sessions
609 ${lock_list}= Get Locks List On Resource ${session_info}
610 ${lock_length}= Get Length ${lock_list}
611 ${tran_id_length}= Get Length ${transaction_id}
612 Should Be Equal As Integers ${tran_id_length} ${lock_length}
Vijayafdd2a12020-04-09 02:03:20 -0500613
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500614 FOR ${tran_id} ${lock} IN ZIP ${transaction_id} ${lock_list}
615 Valid Value session_info['ClientID'] ['${lock['HMCID']}']
616 Valid Value session_info['SessionIDs'] ['${lock['SessionID']}']
617 Should Be Equal As Integers ${tran_id['TransactionID']} ${lock['TransactionID']}
Vijaybc331e22020-02-27 04:17:37 -0600618 END
619
Vijaybc331e22020-02-27 04:17:37 -0600620
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500621Acquire Lock On Resource
622 [Documentation] Acquire lock on resource.
623 [Arguments] ${client_id} ${lock_type} ${reboot_flag}=False
Vijaybc331e22020-02-27 04:17:37 -0600624
625 # Description of argument(s):
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500626 # client_id This client id can contain string value
627 # (e.g. 12345, "HMCID").
628 # lock_type Read lock or Write lock.
629 # reboot_flag Flag is used to run reboot the BMC code.
630 # (e.g. True or False).
Vijaybc331e22020-02-27 04:17:37 -0600631
Sushil Singh8a3efe72021-08-26 08:16:41 -0500632 ${trans_id_emptylist}= Create List
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500633 ${trans_id_list}= Create List
Sushil Singh8a3efe72021-08-26 08:16:41 -0500634
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500635 ${session_info}= Create Redfish Session With ClientID ${client_id}
636 ${trans_id}= Redfish Post Acquire Lock ${lock_type}
637 Append To List ${trans_id_list} ${trans_id}
Sushil Singh8a3efe72021-08-26 08:16:41 -0500638
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500639 Verify Lock On Resource ${session_info} ${trans_id_list}
George Keishing566daaf2020-07-02 06:18:50 -0500640
Sushil Singhe33c6e62020-09-29 06:34:35 -0500641 ${before_reboot_xauth_token}= Set Variable ${XAUTH_TOKEN}
Vijaybc331e22020-02-27 04:17:37 -0600642
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500643 Run Keyword If '${reboot_flag}' == 'True'
Sushil Singh8a3efe72021-08-26 08:16:41 -0500644 ... Run Keywords Redfish BMC Reset Operation AND
Sushil Singhe33c6e62020-09-29 06:34:35 -0500645 ... Set Global Variable ${XAUTH_TOKEN} ${before_reboot_xauth_token} AND
Sushil Singh8a3efe72021-08-26 08:16:41 -0500646 ... Is BMC Standby AND
647 ... Verify Lock On Resource ${session_info} ${trans_id_emptylist}
Vijaybc331e22020-02-27 04:17:37 -0600648
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500649 Run Keyword If '${reboot_flag}' == 'False'
650 ... Release Locks On Resource ${session_info} ${trans_id_list} Transaction ${HTTP_OK}
Vijaybc331e22020-02-27 04:17:37 -0600651
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500652 ${trans_id_emptylist}= Create List
653 Verify Lock On Resource ${session_info} ${trans_id_emptylist}
654 Redfish Delete Session ${session_info}
Vijaybc331e22020-02-27 04:17:37 -0600655
Vijaybc331e22020-02-27 04:17:37 -0600656
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500657Form Data To Release Lock
658 [Documentation] Create a dictonay to release lock.
659 [Arguments] ${trans_id_list}
Vijay355daac2020-03-26 12:06:08 -0500660
661 # Description of argument(s):
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500662 # trans_id_list
Vijay355daac2020-03-26 12:06:08 -0500663
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500664 @{tran_ids}= Create List
Vijay355daac2020-03-26 12:06:08 -0500665
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500666 FOR ${item} IN @{trans_id_list}
667 Append To List ${tran_ids} ${item['TransactionID']}
668 END
669
670 [Return] ${tran_ids}
671
672
673Release Locks On Resource
674 [Documentation] Redfish request to release a lock.
Sushil Singh8a3efe72021-08-26 08:16:41 -0500675 [Arguments] ${session_info} ${trans_id_list} ${release_lock_type}=Transaction
676 ... ${status_code}=${HTTP_OK}
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500677
678 # Description of argument(s):
679 # session_info Session information in dict.
680 # trans_id_list Transaction id list.
681 # release_lock_type Release lock by Transaction, Session.
682 # status_code HTTP status code.
683
684 ${tran_ids}= Form Data To Release Lock ${trans_id_list}
685 ${data}= Set Variable {"Type": "${release_lock_type}", "TransactionIDs":${tran_ids}}
686 ${data}= Evaluate json.dumps(${data}) json
687 ${resp}= Redfish Post Request /ibm/v1/HMC/LockService/Actions/LockService.ReleaseLock data=${data}
688 Should Be Equal As Strings ${resp.status_code} ${status_code}
689
690
Sushil Singhdf390b62021-01-19 00:50:05 -0600691Release locks And Delete Session
692 [Documentation] Release locks and delete redfish session.
693 [Arguments] ${session_info} ${trans_id_list}
694
695 Release Locks On Resource ${session_info} ${trans_id_list}
696
697 ${trans_id_emptylist}= Create List
698 Verify Lock On Resource ${session_info} ${trans_id_emptylist}
699
700 Redfish Delete Session ${session_info}
701
702
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500703Acquire Lock On Another Lock
704 [Documentation] Acquire lock on another lock.
705 [Arguments] ${client_id}
706
707 # Description of argument(s):
708 # client_id This client id can contain string value
709 # (e.g. 12345, "HMCID").
710
711 ${trans_id_list}= Create List
712 ${session_info}= Create Redfish Session With ClientID ${client_id}
713
714 ${trans_id}= Redfish Post Acquire Lock ReadCase1
715 Append To List ${trans_id_list} ${trans_id}
716
717 ${trans_id}= Redfish Post Acquire Lock ReadCase1
718 Append To List ${trans_id_list} ${trans_id}
719
720 Verify Lock On Resource ${session_info} ${trans_id_list}
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500721
Sushil Singhdf390b62021-01-19 00:50:05 -0600722 Release locks And Delete Session ${session_info} ${trans_id_list}
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500723
724
Sushil Singh977f8f52020-11-20 06:32:50 -0600725Verify Fail To Acquire Read And Write In Single Request
726 [Documentation] Verify fail to acquire read and write lock passed in single request.
727 [Arguments] ${client_id} ${lock_type}
728
729 # Description of argument(s):
730 # client_id This client id can contain string value
731 # (e.g. 12345, "HMCID").
732 # lock_type Read lock or Write lock.
733
734 ${lock_type_list}= Split String ${lock_type} ,
735
736 ${session_info}= Create Redfish Session With ClientID ${client_id}
737 ${trans_id}= Redfish Post Acquire List Lock ${lock_type_list} status_code=${HTTP_BAD_REQUEST}
738 Redfish Delete Session ${session_info}
739
740
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500741Verify Empty Lock Records For Invalid Session
742 [Documentation] Verify no lock record found for invalid session.
743 [Arguments] ${client_id}
744
745 # Description of argument(s):
746 # client_id This client id can contain string value
747 # (e.g. 12345, "HMCID").
748
749 ${session_info1}= Create Redfish Session With ClientID ${client_id}
750
751 ${lock_list1}= Get Locks List On Resource ${session_info1}
752 ${lock_length1}= Get Length ${lock_list1}
753
754 ${session_info2}= Copy Dictionary ${session_info1} deepcopy=True
755 set to dictionary ${session_info2} SessionIDs xxyXyyYZZz
756
757 ${lock_list2}= Get Locks List On Resource ${session_info2}
Sushil Singhf9a536c2020-11-09 07:33:17 -0600758 ${lock_length2}= Get Length ${lock_list2}
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500759
Sushil Singhf9a536c2020-11-09 07:33:17 -0600760 Should Be Equal As Integers ${lock_length1} ${lock_length2}
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500761
762 Redfish Delete Session ${session_info1}
763
764
765Verify Acquire Lock Fails On Another Lock
766 [Documentation] Verify acquire lock on another lock fails.
767 [Arguments] ${client_id} ${lock_type}
768
769 # Description of argument(s):
770 # client_id This client id can contain string value
771 # (e.g. 12345, "HMCID").
772 # lock_type Read lock or Write lock.
773
774 @{lock_type_list}= Split String ${lock_type} ,
775 ${session_info}= Create Redfish Session With ClientID ${client_id}
776 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0]
777
778 ${trans_id_list}= Create List
779 Append To List ${trans_id_list} ${trans_id}
780
781 Verify Lock On Resource ${session_info} ${trans_id_list}
782 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[1] status_code=${HTTP_CONFLICT}
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500783
Sushil Singhdf390b62021-01-19 00:50:05 -0600784 Release locks And Delete Session ${session_info} ${trans_id_list}
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500785
786
Sushil Singhe33c6e62020-09-29 06:34:35 -0500787Verify Acquire Lock After Reboot
788 [Documentation] Acquire read and write lock after the reboot and release lock.
789 [Arguments] ${client_id} ${lock_type}
790
791 # Description of argument(s):
792 # client_id This client id can contain string value
793 # (e.g. 12345, "HMCID").
794 # lock_type Read lock or Write lock.
795
796 ${trans_id_list}= Create List
Sushil Singhf9a536c2020-11-09 07:33:17 -0600797 ${session_info}= Create Session With ClientID ${client_id}
Sushil Singhac229c72021-09-13 02:26:51 -0500798
Sushil Singhe33c6e62020-09-29 06:34:35 -0500799 ${before_reboot_xauth_token}= Set Variable ${XAUTH_TOKEN}
Sushil Singhac229c72021-09-13 02:26:51 -0500800 Redfish BMC Reset Operation
Sushil Singhe33c6e62020-09-29 06:34:35 -0500801 Set Global Variable ${XAUTH_TOKEN} ${before_reboot_xauth_token}
Sushil Singhac229c72021-09-13 02:26:51 -0500802 Is BMC Standby
Sushil Singhe33c6e62020-09-29 06:34:35 -0500803
804 ${trans_id}= Redfish Post Acquire Lock ${lock_type}
805 Append To List ${trans_id_list} ${trans_id}
806 Verify Lock On Resource ${session_info} ${trans_id_list}
Sushil Singhe33c6e62020-09-29 06:34:35 -0500807
Sushil Singhdf390b62021-01-19 00:50:05 -0600808 Release locks And Delete Session ${session_info} ${trans_id_list}
809
810
811Verify Acquire Multiple Lock Request At CEC Level
812 [Documentation] Acquire lock in loop.
813 [Arguments] ${client_id} ${lock_type}
814
815 # Description of argument(s):
816 # client_id This client id can contain string value
817 # (e.g. 12345, "HMCID").
818 # lock_type Read lock or Write lock.
819
820 ${trans_id_list}= Create List
821 @{lock_type_list}= Split String ${lock_type} ,
822 ${session_info}= Create Redfish Session With ClientID ${client_id}
823
824 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0]
825 Append To List ${trans_id_list} ${trans_id}
826
827 Verify Lock On Resource ${session_info} ${trans_id_list}
828
829 Redfish Post Acquire Lock ${lock_type_list}[1] status_code=${HTTP_CONFLICT}
830
831 Release locks And Delete Session ${session_info} ${trans_id_list}
Sushil Singhe33c6e62020-09-29 06:34:35 -0500832
833
Sushil Singh8d420bf2021-09-06 08:27:41 -0500834Post Reboot Acquire Lock
835 [Documentation] Post reboot acquire lock and verify the transaction id is 1.
836 [Arguments] ${session_info} ${lock_type}
837
838 # Description of argument(s):
839 # session_info Session information.
840 # lock_type Read lock or Write lock.
841
842 ${trans_id_list}= Create List
843 ${trans_id_list_var}= Create List
844 ${trans_id}= Redfish Post Acquire Lock ${lock_type}
845 Append To List ${trans_id_list} ${trans_id}
846 Append To List ${trans_id_list_var} ${default_trans_id}
847 Verify Lock On Resource ${session_info} ${trans_id_list}
848 Verify Lock On Resource ${session_info} ${trans_id_list_var}
849 Release Locks On Resource ${session_info} ${trans_id_list} Transaction ${HTTP_OK}
850 ${trans_id_emptylist}= Create List
851 Verify Lock On Resource ${session_info} ${trans_id_emptylist}
852
853
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500854Verify Acquire And Release Lock In Loop
855 [Documentation] Acquire lock in loop.
Sushil Singh8d420bf2021-09-06 08:27:41 -0500856 [Arguments] ${client_id} ${lock_type} ${reboot_flag}=False
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500857
858 # Description of argument(s):
859 # client_id This client id can contain string value
860 # (e.g. 12345, "HMCID").
861 # lock_type Read lock or Write lock.
Sushil Singh8d420bf2021-09-06 08:27:41 -0500862 # reboot_flag Flag is used to run reboot the BMC code.
863 # (e.g. True or False).
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500864
865 FOR ${count} IN RANGE 1 11
866 ${trans_id_list}= Create List
867 ${session_info}= Create Redfish Session With ClientID ${client_id}
868 ${trans_id}= Redfish Post Acquire Lock ${lock_type}
869 Append To List ${trans_id_list} ${trans_id}
870 Verify Lock On Resource ${session_info} ${trans_id_list}
871 Release Locks On Resource ${session_info} ${trans_id_list} Transaction ${HTTP_OK}
872 ${trans_id_emptylist}= Create List
873 Verify Lock On Resource ${session_info} ${trans_id_emptylist}
Sushil Singh8d420bf2021-09-06 08:27:41 -0500874 Redfish Delete Session ${session_info}
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500875 END
876
Sushil Singh8d420bf2021-09-06 08:27:41 -0500877 ${session_info}= Create Redfish Session With ClientID ${client_id}
878 ${before_reboot_xauth_token}= Set Variable ${XAUTH_TOKEN}
879
880 Run Keyword If '${reboot_flag}' == 'True'
881 ... Run Keywords Redfish BMC Reset Operation AND
882 ... Set Global Variable ${XAUTH_TOKEN} ${before_reboot_xauth_token} AND
883 ... Is BMC Standby AND
884 ... Post Reboot Acquire Lock ${session_info} ${lock_type}
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500885 Redfish Delete Session ${session_info}
886
887
888Acquire And Release Multiple Locks
889 [Documentation] Acquire mutilple locks on resource.
890 [Arguments] ${client_id} ${lock_type} ${release_lock_type}
891
892 # Description of argument(s):
893 # client_id This client id can contain string value
894 # (e.g. 12345, "HMCID").
895 # lock_type Read lock or Write lock.
896 # release_lock_type The value can be Transaction or Session.
897
898 @{lock_type_list}= Split String ${lock_type} ,
899 ${session_info}= Create Redfish Session With ClientID ${client_id}
900 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0]
901
902 ${trans_id_list}= Create List
903
904 Append To List ${trans_id_list} ${trans_id}
905 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[1]
906
907 Append To List ${trans_id_list} ${trans_id}
908 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[2]
909
910 Append To List ${trans_id_list} ${trans_id}
911 Verify Lock On Resource ${session_info} ${trans_id_list}
912 Release Locks On Resource ${session_info} ${trans_id_list} release_lock_type=${release_lock_type}
913
914 ${trans_id_emptylist}= Create List
915 Verify Lock On Resource ${session_info} ${trans_id_emptylist}
916 Redfish Delete Session ${session_info}
917
918
susilsi794116c62021-03-04 07:57:51 -0600919Verify Release Lock When Session Deleted
920 [Documentation] Verify lock get released when session are deleted.
921 [Arguments] ${client_id} ${lock_type}
922
923 # Description of argument(s):
924 # client_ids This client id can contain string value
925 # (e.g. 12345, "HMCID").
926 # lock_type Read lock or Write lock.
927
928 ${trans_id_list}= Create List
929 @{lock_type_list}= Split String ${lock_type} ,
930
931 ${pre_session_info}= Create Redfish Session With ClientID ${client_id}
932
933 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0]
934 Append To List ${trans_id_list} ${trans_id}
935 Verify Lock On Resource ${pre_session_info} ${trans_id_list}
936
937 Redfish Delete Session ${pre_session_info}
938 ${post_session_info}= Create Redfish Session With ClientID ${client_id}
939 ${resp}= Get Locks List On Resource With Session List ${pre_session_info} ${HTTP_BAD_REQUEST}
940
941 Redfish Delete Session ${post_session_info}
942
943
944
Sushil Singh59011d02021-01-27 23:00:20 -0600945Verify Fail To Release Lock With Invalid TransactionID
George Keishing16b3c7b2021-01-28 09:23:37 -0600946 [Documentation] Verify fail to be release lock with invalid transaction ID.
Sushil Singh59011d02021-01-27 23:00:20 -0600947 [Arguments] ${client_id} ${lock_type} ${release_lock_type}
948
949 # Description of argument(s):
950 # client_id This client id can contain string value
951 # (e.g. 12345, "HMCID").
952 # lock_type Read lock or Write lock.
953 # release_lock_type The value can be Transaction or Session.
954
955 ${trans_id_list}= Create List
956 @{lock_type_list}= Split String ${lock_type} ,
957
958 ${session_info}= Create Redfish Session With ClientID ${client_id}
959
960 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0]
961 ${value}= Get From Dictionary ${trans_id} TransactionID
962 ${value}= Evaluate ${value} + 10
963 Set To Dictionary ${trans_id} TransactionID ${value}
964 Append To List ${trans_id_list} ${trans_id}
965
966 Release Locks On Resource
967 ... ${session_info} ${trans_id_list}
968 ... release_lock_type=${release_lock_type} status_code=${HTTP_BAD_REQUEST}
969 Release Locks On Resource ${session_info} ${trans_id_list} release_lock_type=Session
970
971 ${trans_id_emptylist}= Create List
972 Verify Lock On Resource ${session_info} ${trans_id_emptylist}
973 Redfish Delete Session ${session_info}
974
975
Sushil Singh1b590532021-01-20 05:13:54 -0600976Verify Fail To Release Multiple Lock With Invalid TransactionID
977 [Documentation] Verify release multiple locks with invalid transaction ID fails.
Sushil Singhd03f2ce2020-09-17 08:54:41 -0500978 [Arguments] ${client_id} ${lock_type} ${release_lock_type}
979
980 # Description of argument(s):
981 # client_id This client id can contain string value
982 # (e.g. 12345, "HMCID").
983 # lock_type Read lock or Write lock.
984 # release_lock_type The value can be Transaction or Session.
985
986 ${trans_id_list}= Create List
987 @{lock_type_list}= Split String ${lock_type} ,
988
989 ${session_info}= Create Redfish Session With ClientID ${client_id}
990
991 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0]
992 ${value}= Get From Dictionary ${trans_id} TransactionID
993 ${value}= Evaluate ${value} + 10
994 Set To Dictionary ${trans_id} TransactionID ${value}
995 Append To List ${trans_id_list} ${trans_id}
996
997 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[1]
998 ${value}= Get From Dictionary ${trans_id} TransactionID
999 ${value}= Evaluate ${value} + 10
1000 Set To Dictionary ${trans_id} TransactionID ${value}
1001 Append To List ${trans_id_list} ${trans_id}
1002
1003 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[2]
1004 ${value}= Get From Dictionary ${trans_id} TransactionID
1005 ${value}= Evaluate ${value} + 10
1006 Set To Dictionary ${trans_id} TransactionID ${value}
1007 Append To List ${trans_id_list} ${trans_id}
1008
1009 Release Locks On Resource
1010 ... ${session_info} ${trans_id_list}
1011 ... release_lock_type=${release_lock_type} status_code=${HTTP_BAD_REQUEST}
1012 Release Locks On Resource ${session_info} ${trans_id_list} release_lock_type=Session
1013
1014 ${trans_id_emptylist}= Create List
1015 Verify Lock On Resource ${session_info} ${trans_id_emptylist}
1016 Redfish Delete Session ${session_info}
1017
1018
Sushil Singh8bee3582021-01-27 23:46:48 -06001019Verify Fail To Release Multiple Lock With Valid And Invalid TransactionID
George Keishing96143832021-03-23 07:55:08 -05001020 [Documentation] Verify fail to be release multiple lock with valid and invalid transaction ID.
Sushil Singh8bee3582021-01-27 23:46:48 -06001021 [Arguments] ${client_id} ${lock_type} ${release_lock_type}
1022
1023 # Description of argument(s):
1024 # client_id This client id can contain string value
1025 # (e.g. 12345, "HMCID").
1026 # lock_type Read lock or Write lock.
1027 # release_lock_type The value can be Transaction or Session.
1028
1029 ${trans_id_list}= Create List
1030 @{lock_type_list}= Split String ${lock_type} ,
1031
1032 ${session_info}= Create Redfish Session With ClientID ${client_id}
1033
1034 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0]
1035 Append To List ${trans_id_list} ${trans_id}
1036
1037 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[1]
1038 ${value}= Get From Dictionary ${trans_id} TransactionID
1039 ${value}= Evaluate ${value} + 10
1040 Set To Dictionary ${trans_id} TransactionID ${value}
1041 Append To List ${trans_id_list} ${trans_id}
1042
1043 Release Locks On Resource
1044 ... ${session_info} ${trans_id_list}
1045 ... release_lock_type=${release_lock_type} status_code=${HTTP_BAD_REQUEST}
1046 Release Locks On Resource ${session_info} ${trans_id_list} release_lock_type=Session
1047
1048 ${trans_id_emptylist}= Create List
1049 Verify Lock On Resource ${session_info} ${trans_id_emptylist}
1050 Redfish Delete Session ${session_info}
1051
1052
susilsi71d7b9962021-03-02 03:06:18 -06001053Verify Fail To Release Lock With TransactionID As String Type
George Keishing96143832021-03-23 07:55:08 -05001054 [Documentation] Verify fail to be release lock with transaction ID as string data type.
susilsi71d7b9962021-03-02 03:06:18 -06001055 [Arguments] ${client_id} ${lock_type} ${release_lock_type}
1056
1057 # Description of argument(s):
1058 # client_id This client id can contain string value
1059 # (e.g. 12345, "HMCID").
1060 # lock_type Read lock or Write lock.
1061 # release_lock_type The value can be Transaction or Session.
1062
1063 ${trans_id_list}= Create List
1064 @{lock_type_list}= Split String ${lock_type} ,
1065
1066 ${session_info}= Create Redfish Session With ClientID ${client_id}
1067
1068 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0]
1069
1070 Append To List ${trans_id_list} ${trans_id}
1071
1072 ${temp_trans_id_list}= Copy Dictionary ${trans_id_list} deepcopy=True
1073
1074 ${value}= Get From Dictionary ${trans_id_list}[0] TransactionID
1075 ${value}= Set Variable \'${value}\'
1076 Set To Dictionary ${temp_trans_id_list}[0] TransactionID ${value}
1077
1078 Release Locks On Resource
1079 ... ${session_info} ${temp_trans_id_list}
1080 ... release_lock_type=${release_lock_type} status_code=${HTTP_BAD_REQUEST}
1081
1082 Release Locks On Resource ${session_info} ${trans_id_list} release_lock_type=${release_lock_type}
1083
1084 ${trans_id_emptylist}= Create List
1085 Verify Lock On Resource ${session_info} ${trans_id_emptylist}
1086 Redfish Delete Session ${session_info}
1087
1088
Sushil Singhd03f2ce2020-09-17 08:54:41 -05001089Verify Fail To Release Lock For Another Session
1090 [Documentation] Verify failed to release the lock form another session.
1091 [Arguments] ${client_id} ${lock_type}
1092
1093 # Description of argument(s):
1094 # client_id This client id can contain string value
1095 # (e.g. 12345, "HMCID").
1096 # lock_type Read lock or Write lock.
1097
1098 ${client_ids}= Split String ${client_id} ,
1099 ${lock_type_list}= Split String ${lock_type} ,
1100 ${trans_id_list1}= Create List
1101 ${trans_id_list2}= Create List
1102
1103 ${session_info1}= Create Redfish Session With ClientID ${client_ids}[0]
1104
1105 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0]
1106 Append To List ${trans_id_list1} ${trans_id}
1107 Verify Lock On Resource ${session_info1} ${trans_id_list1}
1108
1109 ${session_info2}= Create Redfish Session With ClientID ${client_ids}[1]
1110 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[1]
1111 Append To List ${trans_id_list2} ${trans_id}
1112 Verify Lock On Resource ${session_info2} ${trans_id_list2}
1113
1114 Release Locks On Resource
1115 ... ${session_info1} ${trans_id_list1} Transaction status_code=${HTTP_UNAUTHORIZED}
1116 Verify Lock On Resource ${session_info1} ${trans_id_list1}
1117 Release Locks On Resource ${session_info1} ${trans_id_list1} release_lock_type=Session
1118 Release Locks On Resource ${session_info2} ${trans_id_list2} release_lock_type=Session
1119 Redfish Delete Session ${session_info1}
1120 Redfish Delete Session ${session_info2}
1121
1122
Sushil Singhe33c6e62020-09-29 06:34:35 -05001123Verify Fail To Acquire Lock For Invalid Resource ID Data Type
1124 [Documentation] Verify fail to acquire the lock with invalid resource id data type.
1125 [Arguments] ${client_id} ${lock_type}
1126
1127 # Description of argument(s):
1128 # client_id This client id can contain string value
1129 # (e.g. 12345, "HMCID").
1130 # lock_type Read lock or Write lock.
1131
1132 ${session_info}= Create Redfish Session With ClientID ${client_id}
1133 Redfish Post Acquire Invalid Lock With Invalid Data Type Of Resource ID
1134 ... ${lock_type} status_code=${HTTP_BAD_REQUEST}
1135 Redfish Delete Session ${session_info}
1136
1137
Sushil Singhd03f2ce2020-09-17 08:54:41 -05001138Verify Fail To Acquire Lock For Invalid Lock Data
George Keishing16b3c7b2021-01-28 09:23:37 -06001139 [Documentation] Verify fail to acquired lock with invalid lock types, lock flags, segment flags.
Sushil Singhd03f2ce2020-09-17 08:54:41 -05001140 [Arguments] ${client_id} ${lock_type} ${message}
1141
1142 # Description of argument(s):
1143 # client_id This client id can contain string value
1144 # (e.g. 12345, "HMCID").
1145 # lock_type Read lock or Write lock.
1146 # message Return message from URI.
1147
1148 ${session_info}= Create Redfish Session With ClientID ${client_id}
Sushil Singh8a3efe72021-08-26 08:16:41 -05001149 ${trans_id}= Redfish Post Acquire Invalid Lock
1150 ... ${lock_type} message=${message} status_code=${HTTP_BAD_REQUEST}
Sushil Singhd03f2ce2020-09-17 08:54:41 -05001151 Redfish Delete Session ${session_info}
Sushil Singhbace3002020-10-08 08:12:58 -05001152
1153
1154Verify No Locks Records For Session With No Acquired Lock
1155 [Documentation] Verify no records found for a session where no lock is acquired.
1156 [Arguments] ${client_id}
1157
1158 # Description of argument(s):
1159 # client_id This client id can contain string value
1160 # (e.g. 12345, "HMCID").
1161
1162 ${session_info}= Create Redfish Session With ClientID ${client_id}
1163 ${trans_id_emptylist}= Create List
1164 Verify Lock On Resource ${session_info} ${trans_id_emptylist}
1165 Redfish Delete Session ${session_info}
Sushil Singh728ef9c2020-10-28 04:25:39 -05001166
1167
1168Create List Of Session ID
1169 [Documentation] Create session id list from session dict info.
1170 [Arguments] ${session_dict_info}
1171
1172 # Description of argument(s):
1173 # session_dict_info Session information in dict.
1174
1175 @{session_id_list}= Create List
1176
1177 FOR ${session} IN @{session_dict_info}
1178 Append To List ${session_id_list} ${session["SessionIDs"]}
1179 END
1180
1181 ${num_id}= Get Length ${session_id_list}
1182 Should Not Be Equal As Integers ${num_id} ${0}
1183
1184 ${session_id_list}= Evaluate json.dumps(${session_id_list}) json
1185
1186 [Return] ${session_id_list}
1187
1188
1189Get Locks List On Resource With Session List
1190 [Documentation] Get locks list from session of list.
1191 [Arguments] ${session_id_list} ${exp_status_code}=${HTTP_OK}
1192
1193 # Description of argument(s):
1194 # session_id_list Session ids list.
1195 # exp_status_code Expected HTTP status code.
1196
1197 ${resp}= Redfish Post Request /ibm/v1/HMC/LockService/Actions/LockService.GetLockList
1198 ... data={"SessionIDs": ${session_id_list}}
susilsi794116c62021-03-04 07:57:51 -06001199 Should Be Equal As Strings ${resp.status_code} ${exp_status_code}
Sushil Singh728ef9c2020-10-28 04:25:39 -05001200 ${locks}= Evaluate json.loads('''${resp.text}''') json
1201
1202 [Return] ${locks}
1203
1204
1205Verify List Of Session Lock On Resource
1206 [Documentation] Verify list of lock record from list of sessions.
1207 [Arguments] ${session_dict_info} ${transaction_id_list}
1208
1209 # Description of argument(s):
1210 # session_dict_info Session information in dict.
1211 # transaction_id_list Transaction id in list stored in dict.
1212
1213 ${session_id_list}= Create List Of Session ID ${session_dict_info}
1214 ${lock_list_resp}= Get Locks List On Resource With Session List ${session_id_list}
1215 ${lock_list}= Set Variable ${lock_list_resp['Records']}
1216
Sushil Singh8a3efe72021-08-26 08:16:41 -05001217 FOR ${session_id} ${tran_id} ${lock_record} IN ZIP
1218 ... ${session_dict_info} ${transaction_id_list} ${lock_list}
Sushil Singh728ef9c2020-10-28 04:25:39 -05001219 Valid Value session_id['SessionIDs'] ['${lock_record['SessionID']}']
1220 Should Be Equal As Integers ${tran_id['TransactionID']} ${lock_record['TransactionID']}
1221 END
1222
1223
1224Verify Lock Records Of Multiple Session
1225 [Documentation] Verify all records found for a multiple sessions.
1226 [Arguments] ${client_ids} ${lock_type}
1227
1228 # Description of argument(s):
1229 # client_ids This client id can contain string value
1230 # (e.g. 12345, "HMCID").
1231 # lock_type Read lock or Write lock.
1232
1233 ${client_id_list}= Split String ${client_ids} ,
1234 ${lock_type_list}= Split String ${lock_type} ,
1235 ${trans_id_list1}= Create List
1236 ${trans_id_list2}= Create List
1237
1238 ${session_dict_list}= Create List
1239 ${lock_list}= Create List
1240
1241 ${client_id1}= Create List
1242 Append To List ${client_id1} ${client_id_list}[0]
1243 ${session_info1}= Create Session With List Of ClientID ${client_id1}
1244 Append To List ${session_dict_list} ${session_info1}[0]
1245 Verify A Session Created With ClientID ${client_id1} ${session_info1}
1246
1247 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0]
1248 Append To List ${trans_id_list1} ${trans_id}
1249 Append To List ${lock_list} ${trans_id}
1250 Verify Lock On Resource ${session_info1}[0] ${trans_id_list1}
1251
1252
1253 ${client_id2}= Create List
1254 Append To List ${client_id2} ${client_id_list}[1]
1255 ${session_info2}= Create Session With List Of ClientID ${client_id2}
1256 Append To List ${session_dict_list} ${session_info2}[0]
1257 Verify A Session Created With ClientID ${client_id2} ${session_info2}
1258
1259 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[1]
1260 Append To List ${trans_id_list2} ${trans_id}
1261 Append To List ${lock_list} ${trans_id}
1262 Verify Lock On Resource ${session_info2}[0] ${trans_id_list2}
1263
1264 Verify List Of Session Lock On Resource ${session_dict_list} ${lock_list}
1265
1266 ${session_token}= Get From Dictionary ${session_info1}[0] SessionToken
1267 Set Global Variable ${XAUTH_TOKEN} ${session_token}
1268
1269 Release Locks On Resource ${session_info1} ${trans_id_list1} release_lock_type=Transaction
1270
1271 ${session_token}= Get From Dictionary ${session_info2}[0] SessionToken
1272 Set Global Variable ${XAUTH_TOKEN} ${session_token}
1273
1274 Release Locks On Resource ${session_info2} ${trans_id_list2} release_lock_type=Transaction
1275
1276 ${trans_id_emptylist}= Create List
1277 Verify Lock On Resource ${session_info1}[0] ${trans_id_emptylist}
1278 Verify Lock On Resource ${session_info2}[0] ${trans_id_emptylist}
1279
1280 Redfish Delete List Of Session ${session_dict_list}
Sushil Singhf9a536c2020-11-09 07:33:17 -06001281
1282
1283Verify Lock Records For Multiple Invalid Session
1284 [Documentation] Verify no lock record found for multiple invalid session.
1285 [Arguments] ${client_id}
1286
1287 # Description of argument(s):
1288 # client_id This client id can contain string value
1289 # (e.g. 12345, "HMCID").
1290
1291 ${session_dict_list}= Create List
1292 ${invalid_session_ids}= Create List xxyXyyYZZz xXyXYyYZzz
1293
1294 ${session_info1}= Create Session With ClientID ${client_id}
1295
1296 ${session_info2}= Copy Dictionary ${session_info1} deepcopy=True
1297 set to dictionary ${session_info2} SessionIDs ${invalid_session_ids}[0]
1298 Append To List ${session_dict_list} ${session_info2}
1299
1300 ${session_info3}= Copy Dictionary ${session_info1} deepcopy=True
1301 set to dictionary ${session_info3} SessionIDs ${invalid_session_ids}[0]
1302 Append To List ${session_dict_list} ${session_info3}
1303
1304 ${lock_list1}= Get Locks List On Resource ${session_info1}
1305 ${lock_length1}= Get Length ${lock_list1}
1306
1307 ${session_id_list}= Create List Of Session ID ${session_dict_list}
1308 ${lock_list_resp}= Get Locks List On Resource With Session List ${session_id_list}
1309 ${lock_length2}= Get Length ${lock_list_resp['Records']}
1310
1311 Should Be Equal As Integers ${lock_length1} ${lock_length2}
1312
1313 Redfish Delete Session ${session_info1}
Sushil Singh11949a22020-11-13 06:12:16 -06001314
1315
1316Verify Lock Records For Multiple Invalid And Valid Session
1317 [Documentation] Verify all records found for a valid and invalid sessions.
1318 [Arguments] ${client_ids} ${lock_type}
1319
1320 # Description of argument(s):
1321 # client_ids This client id can contain string value
1322 # (e.g. 12345, "HMCID").
1323 # lock_type Read lock or Write lock.
1324
1325 ${client_id_list}= Split String ${client_ids} ,
1326 ${lock_type_list}= Split String ${lock_type} ,
1327 ${trans_id_list1}= Create List
1328 ${invalid_session_ids}= Create List xxyXyyYZZz
1329
1330 ${session_dict_list}= Create List
1331 ${lock_list}= Create List
1332
1333 ${client_id1}= Create List
1334 Append To List ${client_id1} ${client_id_list}[0]
1335 ${session_info1}= Create Session With List Of ClientID ${client_id1}
1336 Append To List ${session_dict_list} ${session_info1}[0]
1337 Verify A Session Created With ClientID ${client_id1} ${session_info1}
1338
1339 ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0]
1340 Append To List ${trans_id_list1} ${trans_id}
1341 Append To List ${lock_list} ${trans_id}
1342 Verify Lock On Resource ${session_info1}[0] ${trans_id_list1}
1343
1344 ${session_info2}= Copy Dictionary ${session_info1} deepcopy=True
1345 set to dictionary ${session_info2}[0] SessionIDs ${invalid_session_ids}[0]
1346 Append To List ${session_dict_list} ${session_info2}[0]
1347
1348 Verify List Of Session Lock On Resource ${session_dict_list} ${lock_list}
1349
1350 ${session_token}= Get From Dictionary ${session_info1}[0] SessionToken
1351 Set Global Variable ${XAUTH_TOKEN} ${session_token}
1352
1353 Release Locks On Resource ${session_info1} ${trans_id_list1} release_lock_type=Transaction
1354
1355 ${trans_id_emptylist}= Create List
1356 Verify Lock On Resource ${session_info1}[0] ${trans_id_emptylist}
1357
1358 Redfish Delete Session ${session_info1}[0]