Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
Sushil Singh | 8d420bf | 2021-09-06 08:27:41 -0500 | [diff] [blame] | 3 | Documentation Test lock management feature of management console on BMC. |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 4 | |
Sushil Singh | 8d420bf | 2021-09-06 08:27:41 -0500 | [diff] [blame] | 5 | Resource ../../lib/resource.robot |
| 6 | Resource ../../lib/openbmc_ffdc.robot |
| 7 | Resource ../../lib/bmc_redfish_utils.robot |
| 8 | Resource ../../lib/external_intf/management_console_utils.robot |
| 9 | Resource ../../lib/rest_response_code.robot |
| 10 | Library ../../lib/bmc_network_utils.py |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 11 | |
Sushil Singh | 8d420bf | 2021-09-06 08:27:41 -0500 | [diff] [blame] | 12 | Suite Setup Run Keyword And Ignore Error Delete All Redfish Sessions |
| 13 | Suite Teardown Run Keyword And Ignore Error Delete All Redfish Sessions |
| 14 | Test Setup Printn |
| 15 | Test Teardown FFDC On Test Case Fail |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 16 | |
| 17 | *** Variables *** |
| 18 | |
Sushil Singh | e3f2e3b | 2022-07-28 05:15:43 -0500 | [diff] [blame] | 19 | ${CONFLICT_RQUEST} Conflict |
Sushil Singh | 8d420bf | 2021-09-06 08:27:41 -0500 | [diff] [blame] | 20 | ${BAD_REQUEST} Bad Request |
| 21 | &{default_trans_id} TransactionID=${1} |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 22 | |
| 23 | *** Test Cases *** |
| 24 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 25 | Acquire Read Write Lock |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 26 | [Documentation] Acquire and release different read locks. |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 27 | [Tags] Acquire_Read_Write_Lock |
| 28 | [Template] Acquire Lock On Resource |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 29 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 30 | # client_id lock_type reboot_flag |
| 31 | HMCID-01 ReadCase1 False |
| 32 | HMCID-01 ReadCase2 False |
| 33 | HMCID-01 ReadCase3 False |
| 34 | HMCID-01 WriteCase1 False |
| 35 | HMCID-01 WriteCase2 False |
| 36 | HMCID-01 WriteCase3 False |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 37 | |
| 38 | |
Sushil Singh | d8bf142 | 2021-09-06 05:19:09 -0500 | [diff] [blame] | 39 | Verify Lock Is Not Persistent On BMC Reboot |
| 40 | [Documentation] Acquire lock and after reboot the locks are removed as no persistency |
| 41 | ... maintained. |
| 42 | [Tags] Verify_Lock_Is_Not_Persistent_On_BMC_Reboot |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 43 | [Template] Acquire Lock On Resource |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 44 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 45 | # client_id lock_type reboot_flag |
| 46 | HMCID-01 ReadCase1 True |
| 47 | HMCID-01 ReadCase2 True |
| 48 | HMCID-01 ReadCase3 True |
| 49 | HMCID-01 WriteCase1 True |
| 50 | HMCID-01 WriteCase2 True |
| 51 | HMCID-01 WriteCase3 True |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 52 | |
| 53 | |
Sushil Singh | 8d420bf | 2021-09-06 08:27:41 -0500 | [diff] [blame] | 54 | Check After Reboot Transaction ID Set To Default |
| 55 | [Documentation] After reboot, the transaction id starts with default i.e. 1, |
George Keishing | 7fd1ac0 | 2021-09-23 08:10:33 -0500 | [diff] [blame] | 56 | ... if any lock is acquired. |
Sushil Singh | 8d420bf | 2021-09-06 08:27:41 -0500 | [diff] [blame] | 57 | [Tags] Check_After_Reboot_Transaction_ID_Set_To_Default |
| 58 | [Template] Verify Acquire And Release Lock In Loop |
| 59 | |
| 60 | # client_id lock_type reboot_flag |
| 61 | HMCID-01 ReadCase1 True |
| 62 | HMCID-01 WriteCase1 True |
| 63 | |
| 64 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 65 | Acquire Read Lock On Read Lock |
| 66 | [Documentation] Acquire read lock on another read lock. |
| 67 | [Tags] Acquire_Read_Lock_On_Read_Lock |
| 68 | [Template] Acquire Lock On Another Lock |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 69 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 70 | # client_id |
| 71 | HMCID-01 |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 72 | |
| 73 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 74 | Fail To Acquire Lock On Another Lock |
| 75 | [Documentation] Fail to acquire another lock. |
| 76 | [Tags] Fail_To_Acquire_Lock_On_Another_Lock |
| 77 | [Template] Verify Acquire Lock Fails On Another Lock |
Vijay | 85610ee | 2020-04-03 05:30:28 -0500 | [diff] [blame] | 78 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 79 | # client_id lock_type |
Sushil Singh | 5d05994 | 2021-09-27 08:41:38 -0500 | [diff] [blame] | 80 | HMCID-01 ReadCase7,WriteCase6 |
| 81 | HMCID-01 WriteCase6,WriteCase6 |
| 82 | HMCID-01 WriteCase6,ReadCase7 |
George Keishing | 566daaf | 2020-07-02 06:18:50 -0500 | [diff] [blame] | 83 | |
| 84 | |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 85 | Acquire Lock After Reboot |
| 86 | [Documentation] Acquire and release read and write locks after reboot. |
| 87 | [Tags] Acquire_Lock_After_Reboot |
| 88 | [Template] Verify Acquire Lock After Reboot |
| 89 | |
| 90 | # client_id lock_type |
| 91 | HMCID-01 ReadCase1 |
| 92 | HMCID-01 ReadCase2 |
| 93 | HMCID-01 ReadCase3 |
| 94 | HMCID-01 WriteCase1 |
| 95 | HMCID-01 WriteCase2 |
| 96 | HMCID-01 WriteCase3 |
| 97 | |
| 98 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 99 | Acquire And Release Lock In Loop |
| 100 | [Documentation] Acquire and release read, write locks in loop. |
| 101 | [Tags] Acquire_And_Release_Lock_In_Loop |
| 102 | [Template] Verify Acquire And Release Lock In Loop |
George Keishing | 566daaf | 2020-07-02 06:18:50 -0500 | [diff] [blame] | 103 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 104 | # client_id lock_type |
| 105 | HMCID-01 ReadCase1 |
| 106 | HMCID-01 ReadCase2 |
| 107 | HMCID-01 ReadCase3 |
| 108 | HMCID-01 WriteCase1 |
| 109 | HMCID-01 WriteCase2 |
| 110 | HMCID-01 WriteCase3 |
Vijay | 85610ee | 2020-04-03 05:30:28 -0500 | [diff] [blame] | 111 | |
| 112 | |
Sushil Singh | 977f8f5 | 2020-11-20 06:32:50 -0600 | [diff] [blame] | 113 | Fail To Acquire Read And Write In Single Request |
| 114 | [Documentation] Fail to acquire read and write lock in single request. |
| 115 | [Tags] Fail_To_Acquire_Read_And_Write_In_Single_Request |
| 116 | [Template] Verify Fail To Acquire Read And Write In Single Request |
| 117 | |
Sushil Singh | e3f2e3b | 2022-07-28 05:15:43 -0500 | [diff] [blame] | 118 | # client_id lock_type status_code |
| 119 | HMCID-01 ReadCase1,WriteCase1 ${HTTP_CONFLICT} |
| 120 | HMCID-01 WriteCase1,ReadCase1 ${HTTP_CONFLICT} |
| 121 | HMCID-01 WriteCase1,WriteCase1 ${HTTP_CONFLICT} |
| 122 | |
| 123 | |
| 124 | Acquire Read In Single Request |
| 125 | [Documentation] Acquire read in single request. |
| 126 | [Tags] Acquire_Read_In_Single_Request |
| 127 | [Template] Verify Acquire Read In Single Request |
| 128 | |
Sushil Singh | 977f8f5 | 2020-11-20 06:32:50 -0600 | [diff] [blame] | 129 | # client_id lock_type |
Sushil Singh | e3f2e3b | 2022-07-28 05:15:43 -0500 | [diff] [blame] | 130 | HMCID-01 ReadCase1,ReadCase1 |
Sushil Singh | 977f8f5 | 2020-11-20 06:32:50 -0600 | [diff] [blame] | 131 | |
| 132 | |
Sushil Singh | df390b6 | 2021-01-19 00:50:05 -0600 | [diff] [blame] | 133 | Acquire Multiple Lock Request At CEC Level |
| 134 | [Documentation] Acquire write lock on read lock under CEC level. |
| 135 | [Tags] Acquire_Multiple_Lock_Request_At_CEC_Level |
| 136 | [Template] Verify Acquire Multiple Lock Request At CEC Level |
| 137 | |
| 138 | # client_id lock_type |
| 139 | HMCID-01 ReadCase4,WriteCase4 |
| 140 | HMCID-01 WriteCase5,ReadCase5 |
| 141 | HMCID-01 ReadCase6,WriteCase6 |
| 142 | HMCID-01 WriteCase7,ReadCase7 |
| 143 | |
| 144 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 145 | Verify Release Of Valid Locks |
| 146 | [Documentation] Release all valid locks. |
| 147 | [Tags] Verify_Release_Of_Valid_Locks |
| 148 | [Template] Acquire And Release Multiple Locks |
Vijay | afdd2a1 | 2020-04-09 02:03:20 -0500 | [diff] [blame] | 149 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 150 | # client_id lock_type release_lock_type |
| 151 | HMCID-01 ReadCase1,ReadCase1,ReadCase1 Transaction |
| 152 | HMCID-02 ReadCase1,ReadCase1,ReadCase1 Session |
Vijay | afdd2a1 | 2020-04-09 02:03:20 -0500 | [diff] [blame] | 153 | |
| 154 | |
susilsi7 | 94116c6 | 2021-03-04 07:57:51 -0600 | [diff] [blame] | 155 | Release Lock When Session Deleted |
| 156 | [Documentation] Release lock when session gets deleted. |
| 157 | [Tags] Release_Lock_When_Session_Deleted |
| 158 | [Template] Verify Release Lock When Session Deleted |
| 159 | |
| 160 | # client_id lock_type |
| 161 | HMCID-01 ReadCase1 |
| 162 | HMCID-01 WriteCase1 |
| 163 | |
| 164 | |
Sushil Singh | 59011d0 | 2021-01-27 23:00:20 -0600 | [diff] [blame] | 165 | Fail To Release Lock With Invalid TransactionID |
| 166 | [Documentation] Fail to release lock with invalid transaction id. |
| 167 | [Tags] Fail_To_Release_Lock_With_Invalid_TransactionID |
| 168 | [Template] Verify Fail To Release Lock With Invalid TransactionID |
| 169 | |
susilsi7 | 43b0c06 | 2021-03-02 04:24:19 -0600 | [diff] [blame] | 170 | # client_id lock_type release_lock_type |
| 171 | HMCID-01 ReadCase1 Transaction |
| 172 | HMCID-01 WriteCase1 Transaction |
Sushil Singh | 59011d0 | 2021-01-27 23:00:20 -0600 | [diff] [blame] | 173 | |
| 174 | |
Sushil Singh | 1b59053 | 2021-01-20 05:13:54 -0600 | [diff] [blame] | 175 | Fail To Release Multiple Lock With Invalid TransactionID |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 176 | [Documentation] Release in-valid lock result in fail. |
Sushil Singh | 1b59053 | 2021-01-20 05:13:54 -0600 | [diff] [blame] | 177 | [Tags] Fail_To_Release_Multiple_Lock_With_Invalid_TransactionID |
| 178 | [Template] Verify Fail To Release Multiple Lock With Invalid TransactionID |
Vijay | afdd2a1 | 2020-04-09 02:03:20 -0500 | [diff] [blame] | 179 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 180 | # client_id lock_type release_lock_type |
| 181 | HMCID-01 ReadCase1,ReadCase1,ReadCase1 Transaction |
| 182 | 12345 ReadCase2,ReadCase2,ReadCase2 Transaction |
| 183 | HMCID ReadCase3,ReadCase3,ReadCase3 Transaction |
Vijay | afdd2a1 | 2020-04-09 02:03:20 -0500 | [diff] [blame] | 184 | |
| 185 | |
Sushil Singh | 8bee358 | 2021-01-27 23:46:48 -0600 | [diff] [blame] | 186 | Fail To Release Multiple Lock With Valid And Invalid TransactionID |
George Keishing | 9614383 | 2021-03-23 07:55:08 -0500 | [diff] [blame] | 187 | [Documentation] Release multiple lock with valid and invalid transaction. |
Sushil Singh | 8bee358 | 2021-01-27 23:46:48 -0600 | [diff] [blame] | 188 | [Tags] Fail_To_Release_Multiple_Lock_With_Valid_And_Invalid_TransactionID |
| 189 | [Template] Verify Fail To Release Multiple Lock With Valid And Invalid TransactionID |
| 190 | |
| 191 | # client_id lock_type release_lock_type |
| 192 | HMCID-01 ReadCase1,ReadCase1 Transaction |
| 193 | |
| 194 | |
susilsi7 | 1d7b996 | 2021-03-02 03:06:18 -0600 | [diff] [blame] | 195 | Fail To Release Lock With String As TransactionID Data Type |
| 196 | [Documentation] Fail to release lock with string as transaction id data type. |
| 197 | [Tags] Fail_To_Release_Lock_With_String_As_TransactionID_Data_Type |
| 198 | [Template] Verify Fail To Release Lock With TransactionID As String Type |
| 199 | |
| 200 | # client_id lock_type release_lock_type |
| 201 | HMCID-01 ReadCase1 Transaction |
| 202 | HMCID-01 WriteCase1 Transaction |
| 203 | |
| 204 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 205 | Fail To Release Lock For Another Session |
| 206 | [Documentation] Failed to release locks from another session. |
| 207 | [Tags] Fail_To_Release_Lock_For_Another_Session |
| 208 | [Template] Verify Fail To Release Lock For Another Session |
Vijay | afdd2a1 | 2020-04-09 02:03:20 -0500 | [diff] [blame] | 209 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 210 | # client_id lock_type |
| 211 | HMCID-01,HMCID-02 ReadCase1,ReadCase1 |
Vijay | afdd2a1 | 2020-04-09 02:03:20 -0500 | [diff] [blame] | 212 | |
| 213 | |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 214 | Test Invalid Resource ID Data Type Locking |
| 215 | [Documentation] Failed to acquire lock for invalid resource id data type. |
| 216 | [Tags] Test_Invalid_Resource_ID_Data_Type_Locking |
| 217 | [Template] Verify Fail To Acquire Lock For Invalid Resource ID Data Type |
| 218 | |
| 219 | # client_id lock_type |
| 220 | HMCID-01 ReadCase1 |
| 221 | HMCID-01 ReadCase2 |
| 222 | HMCID-01 ReadCase3 |
| 223 | HMCID-01 WriteCase1 |
| 224 | HMCID-01 WriteCase2 |
| 225 | HMCID-01 WriteCase3 |
| 226 | |
| 227 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 228 | Fail To Acquire Lock For Invalid Lock Type |
| 229 | [Documentation] Failed to acquire read, write lock for invalid lock data passed. |
| 230 | [Tags] Fail_To_Acquire_Lock_For_Invalid_Lock_Type |
| 231 | [Template] Verify Fail To Acquire Lock For Invalid Lock Data |
Vijay | afdd2a1 | 2020-04-09 02:03:20 -0500 | [diff] [blame] | 232 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 233 | # client_id lock_type message |
| 234 | HMCID-01 ReadCase1 ${BAD_REQUEST} |
| 235 | HMCID-01 ReadCase2 ${BAD_REQUEST} |
| 236 | HMCID-01 ReadCase3 ${BAD_REQUEST} |
| 237 | HMCID-01 ReadCase4 ${BAD_REQUEST} |
| 238 | HMCID-01 ReadCase5 ${BAD_REQUEST} |
| 239 | HMCID-01 WriteCase1 ${BAD_REQUEST} |
| 240 | HMCID-01 WriteCase2 ${BAD_REQUEST} |
| 241 | HMCID-01 WriteCase3 ${BAD_REQUEST} |
| 242 | HMCID-01 WriteCase4 ${BAD_REQUEST} |
| 243 | HMCID-01 WriteCase5 ${BAD_REQUEST} |
Vijay | afdd2a1 | 2020-04-09 02:03:20 -0500 | [diff] [blame] | 244 | |
Vijay | afdd2a1 | 2020-04-09 02:03:20 -0500 | [diff] [blame] | 245 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 246 | Fail To Acquire Lock For Invalid Lock Flag |
| 247 | [Documentation] Failed to acquire read write lock for invalid lock flag passed. |
| 248 | [Tags] Fail_To_Acquire_Lock_For_Invalid_Lock_Flag |
| 249 | [Template] Verify Fail To Acquire Lock For Invalid Lock Data |
Vijay | afdd2a1 | 2020-04-09 02:03:20 -0500 | [diff] [blame] | 250 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 251 | # client_id lock_type message |
| 252 | HMCID-01 ReadCase6 ${BAD_REQUEST} |
| 253 | HMCID-01 ReadCase7 ${BAD_REQUEST} |
| 254 | HMCID-01 ReadCase8 ${BAD_REQUEST} |
| 255 | HMCID-01 ReadCase9 ${BAD_REQUEST} |
| 256 | HMCID-01 ReadCase10 ${BAD_REQUEST} |
| 257 | HMCID-01 ReadCase11 ${BAD_REQUEST} |
| 258 | HMCID-01 WriteCase6 ${BAD_REQUEST} |
| 259 | HMCID-01 WriteCase7 ${BAD_REQUEST} |
| 260 | HMCID-01 WriteCase8 ${BAD_REQUEST} |
| 261 | HMCID-01 WriteCase9 ${BAD_REQUEST} |
| 262 | HMCID-01 WriteCase10 ${BAD_REQUEST} |
| 263 | HMCID-01 WriteCase11 ${BAD_REQUEST} |
Vijay | afdd2a1 | 2020-04-09 02:03:20 -0500 | [diff] [blame] | 264 | |
Vijay | afdd2a1 | 2020-04-09 02:03:20 -0500 | [diff] [blame] | 265 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 266 | Fail To Acquire Lock For Invalid Segment Flag |
| 267 | [Documentation] Failed to acquire read write lock for invalid segment flag passed. |
| 268 | [Tags] Fail_To_Acquire_Lock_For_Invalid_Segment_Flag |
| 269 | [Template] Verify Fail To Acquire Lock For Invalid Lock Data |
| 270 | |
| 271 | # client_id lock_type message |
| 272 | HMCID-01 ReadCase12 ${BAD_REQUEST} |
| 273 | HMCID-01 ReadCase13 ${BAD_REQUEST} |
| 274 | HMCID-01 ReadCase14 ${BAD_REQUEST} |
| 275 | HMCID-01 WriteCase12 ${BAD_REQUEST} |
| 276 | HMCID-01 WriteCase13 ${BAD_REQUEST} |
| 277 | HMCID-01 WriteCase14 ${BAD_REQUEST} |
Vijay | afdd2a1 | 2020-04-09 02:03:20 -0500 | [diff] [blame] | 278 | |
Sushil Singh | bace300 | 2020-10-08 08:12:58 -0500 | [diff] [blame] | 279 | |
Sushil Singh | 3b3a7ec | 2020-11-23 03:54:06 -0600 | [diff] [blame] | 280 | Fail To Acquire Lock For Invalid Segment Data Type Flag |
| 281 | [Documentation] Failed to acquire read write lock for invalid segment flag passed. |
| 282 | [Tags] Fail_To_Acquire_Lock_For_Invalid_Segment_Data_Type_Flag |
| 283 | [Template] Verify Fail To Acquire Lock For Invalid Lock Data |
| 284 | |
| 285 | # client_id lock_type message |
| 286 | HMCID-01 ReadCase15 ${EMPTY} |
| 287 | HMCID-01 ReadCase16 ${EMPTY} |
| 288 | HMCID-01 ReadCase17 ${EMPTY} |
| 289 | HMCID-01 ReadCase18 ${EMPTY} |
| 290 | HMCID-01 WriteCase15 ${EMPTY} |
| 291 | HMCID-01 WriteCase16 ${EMPTY} |
| 292 | HMCID-01 WriteCase17 ${EMPTY} |
| 293 | HMCID-01 WriteCase18 ${EMPTY} |
| 294 | |
| 295 | |
Sushil Singh | bace300 | 2020-10-08 08:12:58 -0500 | [diff] [blame] | 296 | Get Empty Lock Records For Session Where No Locks Acquired |
| 297 | [Documentation] If session does not acquire locks then get lock should return |
| 298 | ... empty lock records. |
| 299 | [Tags] Get_Empty_Lock_Records_For_Session_Where_No_Locks_Acquired |
| 300 | [Template] Verify No Locks Records For Session With No Acquired Lock |
| 301 | |
| 302 | # client_id |
| 303 | HMCID-01 |
| 304 | |
Sushil Singh | 728ef9c | 2020-10-28 04:25:39 -0500 | [diff] [blame] | 305 | |
Sushil Singh | f9a536c | 2020-11-09 07:33:17 -0600 | [diff] [blame] | 306 | Get Lock Records Empty For Invalid Session |
| 307 | [Documentation] Record of lock list is empty for invalid session. |
| 308 | [Tags] Get_Lock_Records_Empty_For_Invalid_Session |
| 309 | [Template] Verify Empty Lock Records For Invalid Session |
| 310 | |
| 311 | # client_id |
| 312 | HMCID-01 |
| 313 | |
| 314 | |
Sushil Singh | 728ef9c | 2020-10-28 04:25:39 -0500 | [diff] [blame] | 315 | Get Lock Records For Multiple Session |
| 316 | [Documentation] Get lock records of multiple session. |
| 317 | [Tags] Get_Lock_Records_For_Multiple_Session |
| 318 | [Template] Verify Lock Records Of Multiple Session |
| 319 | |
| 320 | # client_ids lock_type |
| 321 | HMCID-01,HMCID-02 ReadCase1,ReadCase1 |
| 322 | |
| 323 | |
Sushil Singh | f9a536c | 2020-11-09 07:33:17 -0600 | [diff] [blame] | 324 | Get Lock Records For Multiple Invalid Session |
| 325 | [Documentation] Record of lock list is empty for list of invalid session. |
| 326 | [Tags] Get_Lock_Records_For_Multiple_Invalid_Session |
| 327 | [Template] Verify Lock Records For Multiple Invalid Session |
| 328 | |
| 329 | # client_id |
| 330 | HMCID-01 |
| 331 | |
Sushil Singh | 11949a2 | 2020-11-13 06:12:16 -0600 | [diff] [blame] | 332 | |
| 333 | Get Lock Records For Multiple Invalid And Valid Session |
| 334 | [Documentation] Get record of lock from invalid and valid session. |
| 335 | [Tags] Get_Lock_Records_For_Multiple_Invalid_And_Valid_Session |
| 336 | [Template] Verify Lock Records For Multiple Invalid And Valid Session |
| 337 | |
| 338 | # client_id lock_type |
| 339 | HMCID-01,HMCID-02 ReadCase1 |
| 340 | |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 341 | *** Keywords *** |
| 342 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 343 | Create Redfish Session With ClientID |
| 344 | [Documentation] Create redifish session with client id. |
| 345 | [Arguments] ${client_id} |
Vijay | 85610ee | 2020-04-03 05:30:28 -0500 | [diff] [blame] | 346 | |
| 347 | # Description of argument(s): |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 348 | # client_id This client id can contain string value |
| 349 | # (e.g. 12345, "HMCID"). |
Vijay | 85610ee | 2020-04-03 05:30:28 -0500 | [diff] [blame] | 350 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 351 | ${session_info}= Create Dictionary |
| 352 | ${session}= Redfish Login kwargs= "Oem":{"OpenBMC" : {"ClientID":"${client_id}"}} |
Vijay | 85610ee | 2020-04-03 05:30:28 -0500 | [diff] [blame] | 353 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 354 | Set To Dictionary ${session_info} SessionIDs ${session['Id']} |
| 355 | Set To Dictionary ${session_info} ClientID ${session["Oem"]["OpenBMC"]["ClientID"]} |
Vijay | 85610ee | 2020-04-03 05:30:28 -0500 | [diff] [blame] | 356 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 357 | [Return] ${session_info} |
Vijay | 85610ee | 2020-04-03 05:30:28 -0500 | [diff] [blame] | 358 | |
| 359 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 360 | RW General Dictionary |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 361 | [Documentation] Create dictionary of lock request. |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 362 | [Arguments] ${read_case} ${res_id} |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 363 | |
| 364 | # Description of argument(s): |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 365 | # read_case Read or Write lock type. |
| 366 | # res_id Resource id. |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 367 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 368 | ${request_dict}= Create Dictionary |
George Keishing | 566daaf | 2020-07-02 06:18:50 -0500 | [diff] [blame] | 369 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 370 | FOR ${key} IN @{read_case.keys()} |
| 371 | Set To Dictionary ${request_dict} LockType ${key} |
| 372 | Set To Dictionary ${request_dict} SegmentFlags ${read_case["${key}"]} |
| 373 | END |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 374 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 375 | Set To Dictionary ${request_dict} ResourceID ${res_id} |
| 376 | |
| 377 | [Return] ${request_dict} |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 378 | |
| 379 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 380 | Return Description Of Response |
| 381 | [Documentation] Return description of REST response. |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 382 | [Arguments] ${resp_text} |
| 383 | |
| 384 | # Description of argument(s): |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 385 | # resp_text REST response body. |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 386 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 387 | # resp_text after successful partition file upload looks like: |
| 388 | # { |
| 389 | # "Description": "File Created" |
| 390 | # } |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 391 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 392 | ${message}= Evaluate json.loads('''${resp_text}''') json |
| 393 | |
| 394 | [Return] ${message} |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 395 | |
| 396 | |
Sushil Singh | a7d71f0 | 2020-11-02 05:24:22 -0600 | [diff] [blame] | 397 | Verify Redfish Session Deleted |
| 398 | [Documentation] Verify the redfish session is deleted. |
| 399 | [Arguments] ${session_info} |
| 400 | |
| 401 | # Description of argument(s): |
| 402 | # session_info Session information are stored in dictionary. |
| 403 | |
| 404 | # ${session_info} = { |
| 405 | # 'SessionIDs': 'XXXXXXXXX', |
| 406 | # 'ClientID': 'XXXXXX', |
| 407 | # 'SessionToken': 'XXXXXXXXX', |
| 408 | # 'SessionResp': session response from redfish login |
| 409 | # } |
| 410 | |
| 411 | # SessionIDs : Session IDs |
| 412 | # ClientID : Client ID |
| 413 | # SessionToken : Session token |
| 414 | # SessionResp : Response of creating an redfish login session |
| 415 | |
| 416 | ${sessions}= Redfish.Get Properties /redfish/v1/SessionService/Sessions |
| 417 | |
| 418 | FOR ${session} IN @{sessions['Members']} |
Sushil Singh | 8a3efe7 | 2021-08-26 08:16:41 -0500 | [diff] [blame] | 419 | Should Not Be Equal As Strings |
| 420 | ... session ['/redfish/v1/SessionService/Sessions/${session_info["SessionIDs"]}'] |
Sushil Singh | a7d71f0 | 2020-11-02 05:24:22 -0600 | [diff] [blame] | 421 | END |
| 422 | |
| 423 | |
| 424 | Verify Redfish List Of Session Deleted |
| 425 | [Documentation] Verify all the list of redfish session is deleted. |
| 426 | [Arguments] ${session_info_list} |
| 427 | |
| 428 | # Description of argument(s): |
| 429 | # session_info_list List contains individual session record are stored in dictionary. |
| 430 | |
| 431 | # ${session_info_list} = [{ |
| 432 | # 'SessionIDs': 'XXXXXXXXX', |
| 433 | # 'ClientID': 'XXXXXX', |
| 434 | # 'SessionToken': 'XXXXXXXXX', |
| 435 | # 'SessionResp': session response from redfish login |
| 436 | # }] |
| 437 | |
| 438 | # SessionIDs : Session IDs |
| 439 | # ClientID : Client ID |
| 440 | # SessionToken : Session token |
| 441 | # SessionResp : Response of creating an redfish login session |
| 442 | |
| 443 | FOR ${session_record} IN @{session_info_list} |
| 444 | Verify Redfish Session Deleted ${session_record} |
| 445 | END |
| 446 | |
| 447 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 448 | Redfish Post Acquire Lock |
| 449 | [Documentation] Acquire and release lock. |
| 450 | [Arguments] ${lock_type} ${status_code}=${HTTP_OK} |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 451 | |
| 452 | # Description of argument(s): |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 453 | # lock_type Read lock or Write lock. |
| 454 | # status_code HTTP status code. |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 455 | |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 456 | ${lock_dict_param}= Form Data To Acquire Lock ${lock_type} |
Sushil Singh | 8a3efe7 | 2021-08-26 08:16:41 -0500 | [diff] [blame] | 457 | ${resp}= Redfish Post Request |
| 458 | ... /ibm/v1/HMC/LockService/Actions/LockService.AcquireLock data=${lock_dict_param} |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 459 | Should Be Equal As Strings ${resp.status_code} ${status_code} |
Sushil Singh | df390b6 | 2021-01-19 00:50:05 -0600 | [diff] [blame] | 460 | |
| 461 | Run Keyword If ${status_code} == ${HTTP_BAD_REQUEST} |
| 462 | ... Valid Value ${BAD_REQUEST} ['${resp.content}'] |
| 463 | ... ELSE |
| 464 | ... Run Keyword And Return Return Description Of Response ${resp.content} |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 465 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 466 | [Return] ${resp} |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 467 | |
| 468 | |
Sushil Singh | 977f8f5 | 2020-11-20 06:32:50 -0600 | [diff] [blame] | 469 | Redfish Post Acquire List Lock |
| 470 | [Documentation] Acquire and release lock. |
| 471 | [Arguments] ${lock_type} ${status_code}=${HTTP_OK} |
| 472 | |
| 473 | # Description of argument(s): |
| 474 | # lock_type Read lock or Write lock. |
| 475 | # status_code HTTP status code. |
| 476 | |
| 477 | ${lock_dict_param}= Create Data To Acquire List Of Lock ${lock_type} |
Sushil Singh | 8a3efe7 | 2021-08-26 08:16:41 -0500 | [diff] [blame] | 478 | ${resp}= Redfish Post Request |
| 479 | ... /ibm/v1/HMC/LockService/Actions/LockService.AcquireLock data=${lock_dict_param} |
Sushil Singh | 977f8f5 | 2020-11-20 06:32:50 -0600 | [diff] [blame] | 480 | Should Be Equal As Strings ${resp.status_code} ${status_code} |
| 481 | |
Sushil Singh | e3f2e3b | 2022-07-28 05:15:43 -0500 | [diff] [blame] | 482 | Run Keyword If ${status_code} == ${HTTP_CONFLICT} |
| 483 | ... Should Be Equal As Strings ${CONFLICT_RQUEST} ${resp.content} |
| 484 | ... ELSE |
| 485 | ... Run Keyword And Return Return Description Of Response ${resp.content} |
| 486 | |
Sushil Singh | 977f8f5 | 2020-11-20 06:32:50 -0600 | [diff] [blame] | 487 | [Return] ${resp} |
| 488 | |
| 489 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 490 | Redfish Post Acquire Invalid Lock |
| 491 | [Documentation] Redfish to post request to acquire in-valid lock. |
| 492 | [Arguments] ${lock_type} ${message} ${status_code}=${HTTP_OK} |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 493 | |
| 494 | # Description of argument(s): |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 495 | # lock_type Read lock or Write lock. |
| 496 | # message Return message from URI. |
| 497 | # status_code HTTP status code. |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 498 | |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 499 | ${lock_dict_param}= Form Data To Acquire Invalid Lock ${lock_type} |
Sushil Singh | 8a3efe7 | 2021-08-26 08:16:41 -0500 | [diff] [blame] | 500 | ${resp}= Redfish Post Request |
| 501 | ... /ibm/v1/HMC/LockService/Actions/LockService.AcquireLock data=${lock_dict_param} |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 502 | Should Be Equal As Strings ${resp.status_code} ${status_code} |
Sushil Singh | 3b3a7ec | 2020-11-23 03:54:06 -0600 | [diff] [blame] | 503 | Run Keyword If '${message}' != '${EMPTY}' |
| 504 | ... Valid Value message ['${resp.content}'] |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 505 | |
| 506 | [Return] ${resp} |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 507 | |
| 508 | |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 509 | Redfish Post Acquire Invalid Lock With Invalid Data Type Of Resource ID |
| 510 | [Documentation] Redfish to post request to acquire in-valid lock with invalid data type of resource id. |
| 511 | [Arguments] ${lock_type} ${status_code}=${HTTP_OK} |
| 512 | |
| 513 | # Description of argument(s): |
| 514 | # lock_type Read lock or Write lock. |
| 515 | # status_code HTTP status code. |
| 516 | |
Sushil Singh | 8a3efe7 | 2021-08-26 08:16:41 -0500 | [diff] [blame] | 517 | ${lock_dict_param}= |
| 518 | ... Form Data To Acquire Invalid Lock With Invalid Data Type Of Resource ID ${lock_type} |
| 519 | ${resp}= Redfish Post Request |
| 520 | ... /ibm/v1/HMC/LockService/Actions/LockService.AcquireLock data=${lock_dict_param} |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 521 | Should Be Equal As Strings ${resp.status_code} ${status_code} |
| 522 | |
| 523 | [Return] ${resp} |
| 524 | |
| 525 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 526 | Form Data To Acquire Lock |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 527 | [Documentation] Create a dictionary for lock request. |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 528 | [Arguments] ${lock_type} |
| 529 | |
| 530 | # Description of argument(s): |
| 531 | # lock_type Read lock or Write lock. |
| 532 | |
| 533 | ${lock_res_info}= Get Lock Resource Information |
| 534 | ${resp}= RW General Dictionary |
| 535 | ... ${lock_res_info["Valid Case"]["${lock_type}"]} |
| 536 | ... ${lock_res_info["Valid Case"]["ResourceID"]} |
| 537 | ${temp_list}= Create List ${resp} |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 538 | ${lock_request_dict}= Create Dictionary Request=${temp_list} |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 539 | |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 540 | [Return] ${lock_request_dict} |
| 541 | |
| 542 | |
Sushil Singh | 977f8f5 | 2020-11-20 06:32:50 -0600 | [diff] [blame] | 543 | Create Data To Acquire List Of Lock |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 544 | [Documentation] Create a dictionary for list of lock request. |
Sushil Singh | 977f8f5 | 2020-11-20 06:32:50 -0600 | [diff] [blame] | 545 | [Arguments] ${lock_type_list} |
| 546 | |
| 547 | # Description of argument(s): |
| 548 | # lock_type Read lock or Write lock. |
| 549 | |
| 550 | ${temp_list}= Create List |
| 551 | ${lock_res_info}= Get Lock Resource Information |
| 552 | |
| 553 | FOR ${lock_type} IN @{lock_type_list} |
| 554 | ${resp}= RW General Dictionary |
| 555 | ... ${lock_res_info["Valid Case"]["${lock_type}"]} |
| 556 | ... ${lock_res_info["Valid Case"]["ResourceID"]} |
| 557 | Append To List ${temp_list} ${resp} |
| 558 | END |
| 559 | |
| 560 | ${lock_request_dict}= Create Dictionary Request=${temp_list} |
| 561 | |
| 562 | [Return] ${lock_request_dict} |
| 563 | |
| 564 | |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 565 | Form Data To Acquire Invalid Lock With Invalid Data Type Of Resource ID |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 566 | [Documentation] Create a dictionary for in-valid lock request. |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 567 | [Arguments] ${lock_type} |
| 568 | |
| 569 | # Description of argument(s): |
| 570 | # lock_type Read lock or Write lock. |
| 571 | |
| 572 | ${lock_res_info}= Get Lock Resource Information |
| 573 | ${resp}= RW General Dictionary |
| 574 | ... ${lock_res_info["Valid Case"]["${lock_type}"]} |
| 575 | ... ${lock_res_info["Invalid Case"]["ResourceIDInvalidDataType"]} |
| 576 | ${temp_list}= Create List ${resp} |
| 577 | ${lock_request_dict}= Create Dictionary Request=${temp_list} |
| 578 | |
| 579 | [Return] ${lock_request_dict} |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 580 | |
| 581 | |
| 582 | Form Data To Acquire Invalid Lock |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 583 | [Documentation] Create a dictionary for in-valid lock request. |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 584 | [Arguments] ${lock_type} |
| 585 | |
| 586 | # Description of argument(s): |
| 587 | # lock_type Read lock or Write lock. |
| 588 | |
| 589 | ${lock_res_info}= Get Lock Resource Information |
| 590 | ${resp}= RW General Dictionary |
| 591 | ... ${lock_res_info["Invalid Case"]["${lock_type}"]} |
| 592 | ... ${lock_res_info["Valid Case"]["ResourceID"]} |
| 593 | ${temp_list}= Create List ${resp} |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 594 | ${lock_request_dict}= Create Dictionary Request=${temp_list} |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 595 | |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 596 | [Return] ${lock_request_dict} |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 597 | |
| 598 | |
| 599 | Get Locks List On Resource |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 600 | [Documentation] Get locks list. |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 601 | [Arguments] ${session_info} ${exp_status_code}=${HTTP_OK} |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 602 | |
| 603 | # Description of argument(s): |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 604 | # session_info Session information in dict. |
| 605 | # exp_status_code Expected HTTP status code. |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 606 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 607 | ${data}= Set Variable {"SessionIDs": ["${session_info['SessionIDs']}"]} |
George Keishing | 566daaf | 2020-07-02 06:18:50 -0500 | [diff] [blame] | 608 | ${resp}= Redfish Post Request /ibm/v1/HMC/LockService/Actions/LockService.GetLockList |
| 609 | ... data=${data} |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 610 | ${locks}= Evaluate json.loads('''${resp.text}''') json |
| 611 | |
| 612 | [Return] ${locks["Records"]} |
| 613 | |
| 614 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 615 | Verify Lock On Resource |
| 616 | [Documentation] Verify lock on resource. |
| 617 | [Arguments] ${session_info} ${transaction_id} |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 618 | |
| 619 | # Description of argument(s): |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 620 | # session_info Session information in dict. |
| 621 | # transaction_id Transaction id in list stored in dict. |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 622 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 623 | ${sessions}= Redfish.Get Properties /redfish/v1/SessionService/Sessions/${session_info['SessionIDs']} |
| 624 | Rprint Vars sessions |
| 625 | ${lock_list}= Get Locks List On Resource ${session_info} |
| 626 | ${lock_length}= Get Length ${lock_list} |
| 627 | ${tran_id_length}= Get Length ${transaction_id} |
| 628 | Should Be Equal As Integers ${tran_id_length} ${lock_length} |
Vijay | afdd2a1 | 2020-04-09 02:03:20 -0500 | [diff] [blame] | 629 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 630 | FOR ${tran_id} ${lock} IN ZIP ${transaction_id} ${lock_list} |
| 631 | Valid Value session_info['ClientID'] ['${lock['HMCID']}'] |
| 632 | Valid Value session_info['SessionIDs'] ['${lock['SessionID']}'] |
| 633 | Should Be Equal As Integers ${tran_id['TransactionID']} ${lock['TransactionID']} |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 634 | END |
| 635 | |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 636 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 637 | Acquire Lock On Resource |
| 638 | [Documentation] Acquire lock on resource. |
| 639 | [Arguments] ${client_id} ${lock_type} ${reboot_flag}=False |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 640 | |
| 641 | # Description of argument(s): |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 642 | # client_id This client id can contain string value |
| 643 | # (e.g. 12345, "HMCID"). |
| 644 | # lock_type Read lock or Write lock. |
| 645 | # reboot_flag Flag is used to run reboot the BMC code. |
| 646 | # (e.g. True or False). |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 647 | |
Sushil Singh | 8a3efe7 | 2021-08-26 08:16:41 -0500 | [diff] [blame] | 648 | ${trans_id_emptylist}= Create List |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 649 | ${trans_id_list}= Create List |
Sushil Singh | 8a3efe7 | 2021-08-26 08:16:41 -0500 | [diff] [blame] | 650 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 651 | ${session_info}= Create Redfish Session With ClientID ${client_id} |
| 652 | ${trans_id}= Redfish Post Acquire Lock ${lock_type} |
| 653 | Append To List ${trans_id_list} ${trans_id} |
Sushil Singh | 8a3efe7 | 2021-08-26 08:16:41 -0500 | [diff] [blame] | 654 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 655 | Verify Lock On Resource ${session_info} ${trans_id_list} |
George Keishing | 566daaf | 2020-07-02 06:18:50 -0500 | [diff] [blame] | 656 | |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 657 | ${before_reboot_xauth_token}= Set Variable ${XAUTH_TOKEN} |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 658 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 659 | Run Keyword If '${reboot_flag}' == 'True' |
Sushil Singh | 8a3efe7 | 2021-08-26 08:16:41 -0500 | [diff] [blame] | 660 | ... Run Keywords Redfish BMC Reset Operation AND |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 661 | ... Set Global Variable ${XAUTH_TOKEN} ${before_reboot_xauth_token} AND |
Sushil Singh | 8a3efe7 | 2021-08-26 08:16:41 -0500 | [diff] [blame] | 662 | ... Is BMC Standby AND |
| 663 | ... Verify Lock On Resource ${session_info} ${trans_id_emptylist} |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 664 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 665 | Run Keyword If '${reboot_flag}' == 'False' |
| 666 | ... Release Locks On Resource ${session_info} ${trans_id_list} Transaction ${HTTP_OK} |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 667 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 668 | ${trans_id_emptylist}= Create List |
| 669 | Verify Lock On Resource ${session_info} ${trans_id_emptylist} |
| 670 | Redfish Delete Session ${session_info} |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 671 | |
Vijay | bc331e2 | 2020-02-27 04:17:37 -0600 | [diff] [blame] | 672 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 673 | Form Data To Release Lock |
| 674 | [Documentation] Create a dictonay to release lock. |
| 675 | [Arguments] ${trans_id_list} |
Vijay | 355daac | 2020-03-26 12:06:08 -0500 | [diff] [blame] | 676 | |
| 677 | # Description of argument(s): |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 678 | # trans_id_list |
Vijay | 355daac | 2020-03-26 12:06:08 -0500 | [diff] [blame] | 679 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 680 | @{tran_ids}= Create List |
Vijay | 355daac | 2020-03-26 12:06:08 -0500 | [diff] [blame] | 681 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 682 | FOR ${item} IN @{trans_id_list} |
| 683 | Append To List ${tran_ids} ${item['TransactionID']} |
| 684 | END |
| 685 | |
| 686 | [Return] ${tran_ids} |
| 687 | |
| 688 | |
| 689 | Release Locks On Resource |
| 690 | [Documentation] Redfish request to release a lock. |
Sushil Singh | 8a3efe7 | 2021-08-26 08:16:41 -0500 | [diff] [blame] | 691 | [Arguments] ${session_info} ${trans_id_list} ${release_lock_type}=Transaction |
| 692 | ... ${status_code}=${HTTP_OK} |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 693 | |
| 694 | # Description of argument(s): |
| 695 | # session_info Session information in dict. |
| 696 | # trans_id_list Transaction id list. |
| 697 | # release_lock_type Release lock by Transaction, Session. |
| 698 | # status_code HTTP status code. |
| 699 | |
| 700 | ${tran_ids}= Form Data To Release Lock ${trans_id_list} |
| 701 | ${data}= Set Variable {"Type": "${release_lock_type}", "TransactionIDs":${tran_ids}} |
| 702 | ${data}= Evaluate json.dumps(${data}) json |
| 703 | ${resp}= Redfish Post Request /ibm/v1/HMC/LockService/Actions/LockService.ReleaseLock data=${data} |
| 704 | Should Be Equal As Strings ${resp.status_code} ${status_code} |
| 705 | |
| 706 | |
Sushil Singh | df390b6 | 2021-01-19 00:50:05 -0600 | [diff] [blame] | 707 | Release locks And Delete Session |
| 708 | [Documentation] Release locks and delete redfish session. |
| 709 | [Arguments] ${session_info} ${trans_id_list} |
| 710 | |
| 711 | Release Locks On Resource ${session_info} ${trans_id_list} |
| 712 | |
| 713 | ${trans_id_emptylist}= Create List |
| 714 | Verify Lock On Resource ${session_info} ${trans_id_emptylist} |
| 715 | |
| 716 | Redfish Delete Session ${session_info} |
| 717 | |
| 718 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 719 | Acquire Lock On Another Lock |
| 720 | [Documentation] Acquire lock on another lock. |
| 721 | [Arguments] ${client_id} |
| 722 | |
| 723 | # Description of argument(s): |
| 724 | # client_id This client id can contain string value |
| 725 | # (e.g. 12345, "HMCID"). |
| 726 | |
| 727 | ${trans_id_list}= Create List |
| 728 | ${session_info}= Create Redfish Session With ClientID ${client_id} |
| 729 | |
| 730 | ${trans_id}= Redfish Post Acquire Lock ReadCase1 |
| 731 | Append To List ${trans_id_list} ${trans_id} |
| 732 | |
| 733 | ${trans_id}= Redfish Post Acquire Lock ReadCase1 |
| 734 | Append To List ${trans_id_list} ${trans_id} |
| 735 | |
| 736 | Verify Lock On Resource ${session_info} ${trans_id_list} |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 737 | |
Sushil Singh | df390b6 | 2021-01-19 00:50:05 -0600 | [diff] [blame] | 738 | Release locks And Delete Session ${session_info} ${trans_id_list} |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 739 | |
| 740 | |
Sushil Singh | 977f8f5 | 2020-11-20 06:32:50 -0600 | [diff] [blame] | 741 | Verify Fail To Acquire Read And Write In Single Request |
| 742 | [Documentation] Verify fail to acquire read and write lock passed in single request. |
Sushil Singh | e3f2e3b | 2022-07-28 05:15:43 -0500 | [diff] [blame] | 743 | [Arguments] ${client_id} ${lock_type} ${status_code} |
| 744 | |
| 745 | # Description of argument(s): |
| 746 | # client_id This client id can contain string value |
| 747 | # (e.g. 12345, "HMCID"). |
| 748 | # lock_type Read lock or Write lock. |
| 749 | # status_code HTTP status code |
| 750 | |
| 751 | ${lock_type_list}= Split String ${lock_type} , |
| 752 | |
| 753 | ${session_info}= Create Redfish Session With ClientID ${client_id} |
| 754 | ${trans_id}= Redfish Post Acquire List Lock ${lock_type_list} status_code=${status_code} |
| 755 | Redfish Delete Session ${session_info} |
| 756 | |
| 757 | |
| 758 | Verify Acquire Read In Single Request |
| 759 | [Documentation] Verify acquire read in single request. |
Sushil Singh | 977f8f5 | 2020-11-20 06:32:50 -0600 | [diff] [blame] | 760 | [Arguments] ${client_id} ${lock_type} |
| 761 | |
| 762 | # Description of argument(s): |
| 763 | # client_id This client id can contain string value |
| 764 | # (e.g. 12345, "HMCID"). |
| 765 | # lock_type Read lock or Write lock. |
| 766 | |
Sushil Singh | e3f2e3b | 2022-07-28 05:15:43 -0500 | [diff] [blame] | 767 | ${trans_id_list}= Create List |
Sushil Singh | 977f8f5 | 2020-11-20 06:32:50 -0600 | [diff] [blame] | 768 | ${lock_type_list}= Split String ${lock_type} , |
| 769 | |
| 770 | ${session_info}= Create Redfish Session With ClientID ${client_id} |
Sushil Singh | e3f2e3b | 2022-07-28 05:15:43 -0500 | [diff] [blame] | 771 | ${trans_id}= Redfish Post Acquire List Lock ${lock_type_list} |
| 772 | Append To List ${trans_id_list} ${trans_id} |
| 773 | Append To List ${trans_id_list} ${trans_id} |
| 774 | |
| 775 | Verify Lock On Resource ${session_info} ${trans_id_list} |
| 776 | Remove From List ${trans_id_list} 1 |
| 777 | Release Locks On Resource ${session_info} ${trans_id_list} |
| 778 | |
Sushil Singh | 977f8f5 | 2020-11-20 06:32:50 -0600 | [diff] [blame] | 779 | Redfish Delete Session ${session_info} |
| 780 | |
| 781 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 782 | Verify Empty Lock Records For Invalid Session |
| 783 | [Documentation] Verify no lock record found for invalid session. |
| 784 | [Arguments] ${client_id} |
| 785 | |
| 786 | # Description of argument(s): |
| 787 | # client_id This client id can contain string value |
| 788 | # (e.g. 12345, "HMCID"). |
| 789 | |
| 790 | ${session_info1}= Create Redfish Session With ClientID ${client_id} |
| 791 | |
| 792 | ${lock_list1}= Get Locks List On Resource ${session_info1} |
| 793 | ${lock_length1}= Get Length ${lock_list1} |
| 794 | |
| 795 | ${session_info2}= Copy Dictionary ${session_info1} deepcopy=True |
| 796 | set to dictionary ${session_info2} SessionIDs xxyXyyYZZz |
| 797 | |
| 798 | ${lock_list2}= Get Locks List On Resource ${session_info2} |
Sushil Singh | f9a536c | 2020-11-09 07:33:17 -0600 | [diff] [blame] | 799 | ${lock_length2}= Get Length ${lock_list2} |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 800 | |
Sushil Singh | f9a536c | 2020-11-09 07:33:17 -0600 | [diff] [blame] | 801 | Should Be Equal As Integers ${lock_length1} ${lock_length2} |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 802 | |
| 803 | Redfish Delete Session ${session_info1} |
| 804 | |
| 805 | |
| 806 | Verify Acquire Lock Fails On Another Lock |
| 807 | [Documentation] Verify acquire lock on another lock fails. |
| 808 | [Arguments] ${client_id} ${lock_type} |
| 809 | |
| 810 | # Description of argument(s): |
| 811 | # client_id This client id can contain string value |
| 812 | # (e.g. 12345, "HMCID"). |
| 813 | # lock_type Read lock or Write lock. |
| 814 | |
| 815 | @{lock_type_list}= Split String ${lock_type} , |
| 816 | ${session_info}= Create Redfish Session With ClientID ${client_id} |
| 817 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0] |
| 818 | |
| 819 | ${trans_id_list}= Create List |
| 820 | Append To List ${trans_id_list} ${trans_id} |
| 821 | |
| 822 | Verify Lock On Resource ${session_info} ${trans_id_list} |
| 823 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[1] status_code=${HTTP_CONFLICT} |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 824 | |
Sushil Singh | df390b6 | 2021-01-19 00:50:05 -0600 | [diff] [blame] | 825 | Release locks And Delete Session ${session_info} ${trans_id_list} |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 826 | |
| 827 | |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 828 | Verify Acquire Lock After Reboot |
| 829 | [Documentation] Acquire read and write lock after the reboot and release lock. |
| 830 | [Arguments] ${client_id} ${lock_type} |
| 831 | |
| 832 | # Description of argument(s): |
| 833 | # client_id This client id can contain string value |
| 834 | # (e.g. 12345, "HMCID"). |
| 835 | # lock_type Read lock or Write lock. |
| 836 | |
| 837 | ${trans_id_list}= Create List |
Sushil Singh | f9a536c | 2020-11-09 07:33:17 -0600 | [diff] [blame] | 838 | ${session_info}= Create Session With ClientID ${client_id} |
Sushil Singh | ac229c7 | 2021-09-13 02:26:51 -0500 | [diff] [blame] | 839 | |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 840 | ${before_reboot_xauth_token}= Set Variable ${XAUTH_TOKEN} |
Sushil Singh | ac229c7 | 2021-09-13 02:26:51 -0500 | [diff] [blame] | 841 | Redfish BMC Reset Operation |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 842 | Set Global Variable ${XAUTH_TOKEN} ${before_reboot_xauth_token} |
Sushil Singh | ac229c7 | 2021-09-13 02:26:51 -0500 | [diff] [blame] | 843 | Is BMC Standby |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 844 | |
| 845 | ${trans_id}= Redfish Post Acquire Lock ${lock_type} |
| 846 | Append To List ${trans_id_list} ${trans_id} |
| 847 | Verify Lock On Resource ${session_info} ${trans_id_list} |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 848 | |
Sushil Singh | df390b6 | 2021-01-19 00:50:05 -0600 | [diff] [blame] | 849 | Release locks And Delete Session ${session_info} ${trans_id_list} |
| 850 | |
| 851 | |
| 852 | Verify Acquire Multiple Lock Request At CEC Level |
| 853 | [Documentation] Acquire lock in loop. |
| 854 | [Arguments] ${client_id} ${lock_type} |
| 855 | |
| 856 | # Description of argument(s): |
| 857 | # client_id This client id can contain string value |
| 858 | # (e.g. 12345, "HMCID"). |
| 859 | # lock_type Read lock or Write lock. |
| 860 | |
| 861 | ${trans_id_list}= Create List |
| 862 | @{lock_type_list}= Split String ${lock_type} , |
| 863 | ${session_info}= Create Redfish Session With ClientID ${client_id} |
| 864 | |
| 865 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0] |
| 866 | Append To List ${trans_id_list} ${trans_id} |
| 867 | |
| 868 | Verify Lock On Resource ${session_info} ${trans_id_list} |
| 869 | |
| 870 | Redfish Post Acquire Lock ${lock_type_list}[1] status_code=${HTTP_CONFLICT} |
| 871 | |
| 872 | Release locks And Delete Session ${session_info} ${trans_id_list} |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 873 | |
| 874 | |
Sushil Singh | 8d420bf | 2021-09-06 08:27:41 -0500 | [diff] [blame] | 875 | Post Reboot Acquire Lock |
| 876 | [Documentation] Post reboot acquire lock and verify the transaction id is 1. |
| 877 | [Arguments] ${session_info} ${lock_type} |
| 878 | |
| 879 | # Description of argument(s): |
| 880 | # session_info Session information. |
| 881 | # lock_type Read lock or Write lock. |
| 882 | |
| 883 | ${trans_id_list}= Create List |
| 884 | ${trans_id_list_var}= Create List |
| 885 | ${trans_id}= Redfish Post Acquire Lock ${lock_type} |
| 886 | Append To List ${trans_id_list} ${trans_id} |
| 887 | Append To List ${trans_id_list_var} ${default_trans_id} |
| 888 | Verify Lock On Resource ${session_info} ${trans_id_list} |
| 889 | Verify Lock On Resource ${session_info} ${trans_id_list_var} |
| 890 | Release Locks On Resource ${session_info} ${trans_id_list} Transaction ${HTTP_OK} |
| 891 | ${trans_id_emptylist}= Create List |
| 892 | Verify Lock On Resource ${session_info} ${trans_id_emptylist} |
| 893 | |
| 894 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 895 | Verify Acquire And Release Lock In Loop |
| 896 | [Documentation] Acquire lock in loop. |
Sushil Singh | 8d420bf | 2021-09-06 08:27:41 -0500 | [diff] [blame] | 897 | [Arguments] ${client_id} ${lock_type} ${reboot_flag}=False |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 898 | |
| 899 | # Description of argument(s): |
| 900 | # client_id This client id can contain string value |
| 901 | # (e.g. 12345, "HMCID"). |
| 902 | # lock_type Read lock or Write lock. |
Sushil Singh | 8d420bf | 2021-09-06 08:27:41 -0500 | [diff] [blame] | 903 | # reboot_flag Flag is used to run reboot the BMC code. |
| 904 | # (e.g. True or False). |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 905 | |
| 906 | FOR ${count} IN RANGE 1 11 |
| 907 | ${trans_id_list}= Create List |
| 908 | ${session_info}= Create Redfish Session With ClientID ${client_id} |
| 909 | ${trans_id}= Redfish Post Acquire Lock ${lock_type} |
| 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} Transaction ${HTTP_OK} |
| 913 | ${trans_id_emptylist}= Create List |
| 914 | Verify Lock On Resource ${session_info} ${trans_id_emptylist} |
Sushil Singh | 8d420bf | 2021-09-06 08:27:41 -0500 | [diff] [blame] | 915 | Redfish Delete Session ${session_info} |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 916 | END |
| 917 | |
Sushil Singh | 8d420bf | 2021-09-06 08:27:41 -0500 | [diff] [blame] | 918 | ${session_info}= Create Redfish Session With ClientID ${client_id} |
| 919 | ${before_reboot_xauth_token}= Set Variable ${XAUTH_TOKEN} |
| 920 | |
| 921 | Run Keyword If '${reboot_flag}' == 'True' |
| 922 | ... Run Keywords Redfish BMC Reset Operation AND |
| 923 | ... Set Global Variable ${XAUTH_TOKEN} ${before_reboot_xauth_token} AND |
| 924 | ... Is BMC Standby AND |
| 925 | ... Post Reboot Acquire Lock ${session_info} ${lock_type} |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 926 | Redfish Delete Session ${session_info} |
| 927 | |
| 928 | |
| 929 | Acquire And Release Multiple Locks |
| 930 | [Documentation] Acquire mutilple locks on resource. |
| 931 | [Arguments] ${client_id} ${lock_type} ${release_lock_type} |
| 932 | |
| 933 | # Description of argument(s): |
| 934 | # client_id This client id can contain string value |
| 935 | # (e.g. 12345, "HMCID"). |
| 936 | # lock_type Read lock or Write lock. |
| 937 | # release_lock_type The value can be Transaction or Session. |
| 938 | |
| 939 | @{lock_type_list}= Split String ${lock_type} , |
| 940 | ${session_info}= Create Redfish Session With ClientID ${client_id} |
| 941 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0] |
| 942 | |
| 943 | ${trans_id_list}= Create List |
| 944 | |
| 945 | Append To List ${trans_id_list} ${trans_id} |
| 946 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[1] |
| 947 | |
| 948 | Append To List ${trans_id_list} ${trans_id} |
| 949 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[2] |
| 950 | |
| 951 | Append To List ${trans_id_list} ${trans_id} |
| 952 | Verify Lock On Resource ${session_info} ${trans_id_list} |
| 953 | Release Locks On Resource ${session_info} ${trans_id_list} release_lock_type=${release_lock_type} |
| 954 | |
| 955 | ${trans_id_emptylist}= Create List |
| 956 | Verify Lock On Resource ${session_info} ${trans_id_emptylist} |
| 957 | Redfish Delete Session ${session_info} |
| 958 | |
| 959 | |
susilsi7 | 94116c6 | 2021-03-04 07:57:51 -0600 | [diff] [blame] | 960 | Verify Release Lock When Session Deleted |
| 961 | [Documentation] Verify lock get released when session are deleted. |
| 962 | [Arguments] ${client_id} ${lock_type} |
| 963 | |
| 964 | # Description of argument(s): |
| 965 | # client_ids This client id can contain string value |
| 966 | # (e.g. 12345, "HMCID"). |
| 967 | # lock_type Read lock or Write lock. |
| 968 | |
| 969 | ${trans_id_list}= Create List |
| 970 | @{lock_type_list}= Split String ${lock_type} , |
| 971 | |
| 972 | ${pre_session_info}= Create Redfish Session With ClientID ${client_id} |
| 973 | |
| 974 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0] |
| 975 | Append To List ${trans_id_list} ${trans_id} |
| 976 | Verify Lock On Resource ${pre_session_info} ${trans_id_list} |
| 977 | |
| 978 | Redfish Delete Session ${pre_session_info} |
| 979 | ${post_session_info}= Create Redfish Session With ClientID ${client_id} |
| 980 | ${resp}= Get Locks List On Resource With Session List ${pre_session_info} ${HTTP_BAD_REQUEST} |
| 981 | |
| 982 | Redfish Delete Session ${post_session_info} |
| 983 | |
| 984 | |
| 985 | |
Sushil Singh | 59011d0 | 2021-01-27 23:00:20 -0600 | [diff] [blame] | 986 | Verify Fail To Release Lock With Invalid TransactionID |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 987 | [Documentation] Verify fail to be release lock with invalid transaction ID. |
Sushil Singh | 59011d0 | 2021-01-27 23:00:20 -0600 | [diff] [blame] | 988 | [Arguments] ${client_id} ${lock_type} ${release_lock_type} |
| 989 | |
| 990 | # Description of argument(s): |
| 991 | # client_id This client id can contain string value |
| 992 | # (e.g. 12345, "HMCID"). |
| 993 | # lock_type Read lock or Write lock. |
| 994 | # release_lock_type The value can be Transaction or Session. |
| 995 | |
| 996 | ${trans_id_list}= Create List |
| 997 | @{lock_type_list}= Split String ${lock_type} , |
| 998 | |
| 999 | ${session_info}= Create Redfish Session With ClientID ${client_id} |
| 1000 | |
| 1001 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0] |
| 1002 | ${value}= Get From Dictionary ${trans_id} TransactionID |
| 1003 | ${value}= Evaluate ${value} + 10 |
| 1004 | Set To Dictionary ${trans_id} TransactionID ${value} |
| 1005 | Append To List ${trans_id_list} ${trans_id} |
| 1006 | |
| 1007 | Release Locks On Resource |
| 1008 | ... ${session_info} ${trans_id_list} |
| 1009 | ... release_lock_type=${release_lock_type} status_code=${HTTP_BAD_REQUEST} |
| 1010 | Release Locks On Resource ${session_info} ${trans_id_list} release_lock_type=Session |
| 1011 | |
| 1012 | ${trans_id_emptylist}= Create List |
| 1013 | Verify Lock On Resource ${session_info} ${trans_id_emptylist} |
| 1014 | Redfish Delete Session ${session_info} |
| 1015 | |
| 1016 | |
Sushil Singh | 1b59053 | 2021-01-20 05:13:54 -0600 | [diff] [blame] | 1017 | Verify Fail To Release Multiple Lock With Invalid TransactionID |
| 1018 | [Documentation] Verify release multiple locks with invalid transaction ID fails. |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 1019 | [Arguments] ${client_id} ${lock_type} ${release_lock_type} |
| 1020 | |
| 1021 | # Description of argument(s): |
| 1022 | # client_id This client id can contain string value |
| 1023 | # (e.g. 12345, "HMCID"). |
| 1024 | # lock_type Read lock or Write lock. |
| 1025 | # release_lock_type The value can be Transaction or Session. |
| 1026 | |
| 1027 | ${trans_id_list}= Create List |
| 1028 | @{lock_type_list}= Split String ${lock_type} , |
| 1029 | |
| 1030 | ${session_info}= Create Redfish Session With ClientID ${client_id} |
| 1031 | |
| 1032 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0] |
| 1033 | ${value}= Get From Dictionary ${trans_id} TransactionID |
| 1034 | ${value}= Evaluate ${value} + 10 |
| 1035 | Set To Dictionary ${trans_id} TransactionID ${value} |
| 1036 | Append To List ${trans_id_list} ${trans_id} |
| 1037 | |
| 1038 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[1] |
| 1039 | ${value}= Get From Dictionary ${trans_id} TransactionID |
| 1040 | ${value}= Evaluate ${value} + 10 |
| 1041 | Set To Dictionary ${trans_id} TransactionID ${value} |
| 1042 | Append To List ${trans_id_list} ${trans_id} |
| 1043 | |
| 1044 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[2] |
| 1045 | ${value}= Get From Dictionary ${trans_id} TransactionID |
| 1046 | ${value}= Evaluate ${value} + 10 |
| 1047 | Set To Dictionary ${trans_id} TransactionID ${value} |
| 1048 | Append To List ${trans_id_list} ${trans_id} |
| 1049 | |
| 1050 | Release Locks On Resource |
| 1051 | ... ${session_info} ${trans_id_list} |
| 1052 | ... release_lock_type=${release_lock_type} status_code=${HTTP_BAD_REQUEST} |
| 1053 | Release Locks On Resource ${session_info} ${trans_id_list} release_lock_type=Session |
| 1054 | |
| 1055 | ${trans_id_emptylist}= Create List |
| 1056 | Verify Lock On Resource ${session_info} ${trans_id_emptylist} |
| 1057 | Redfish Delete Session ${session_info} |
| 1058 | |
| 1059 | |
Sushil Singh | 8bee358 | 2021-01-27 23:46:48 -0600 | [diff] [blame] | 1060 | Verify Fail To Release Multiple Lock With Valid And Invalid TransactionID |
George Keishing | 9614383 | 2021-03-23 07:55:08 -0500 | [diff] [blame] | 1061 | [Documentation] Verify fail to be release multiple lock with valid and invalid transaction ID. |
Sushil Singh | 8bee358 | 2021-01-27 23:46:48 -0600 | [diff] [blame] | 1062 | [Arguments] ${client_id} ${lock_type} ${release_lock_type} |
| 1063 | |
| 1064 | # Description of argument(s): |
| 1065 | # client_id This client id can contain string value |
| 1066 | # (e.g. 12345, "HMCID"). |
| 1067 | # lock_type Read lock or Write lock. |
| 1068 | # release_lock_type The value can be Transaction or Session. |
| 1069 | |
| 1070 | ${trans_id_list}= Create List |
| 1071 | @{lock_type_list}= Split String ${lock_type} , |
| 1072 | |
| 1073 | ${session_info}= Create Redfish Session With ClientID ${client_id} |
| 1074 | |
| 1075 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0] |
| 1076 | Append To List ${trans_id_list} ${trans_id} |
| 1077 | |
| 1078 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[1] |
| 1079 | ${value}= Get From Dictionary ${trans_id} TransactionID |
| 1080 | ${value}= Evaluate ${value} + 10 |
| 1081 | Set To Dictionary ${trans_id} TransactionID ${value} |
| 1082 | Append To List ${trans_id_list} ${trans_id} |
| 1083 | |
| 1084 | Release Locks On Resource |
| 1085 | ... ${session_info} ${trans_id_list} |
| 1086 | ... release_lock_type=${release_lock_type} status_code=${HTTP_BAD_REQUEST} |
| 1087 | Release Locks On Resource ${session_info} ${trans_id_list} release_lock_type=Session |
| 1088 | |
| 1089 | ${trans_id_emptylist}= Create List |
| 1090 | Verify Lock On Resource ${session_info} ${trans_id_emptylist} |
| 1091 | Redfish Delete Session ${session_info} |
| 1092 | |
| 1093 | |
susilsi7 | 1d7b996 | 2021-03-02 03:06:18 -0600 | [diff] [blame] | 1094 | Verify Fail To Release Lock With TransactionID As String Type |
George Keishing | 9614383 | 2021-03-23 07:55:08 -0500 | [diff] [blame] | 1095 | [Documentation] Verify fail to be release lock with transaction ID as string data type. |
susilsi7 | 1d7b996 | 2021-03-02 03:06:18 -0600 | [diff] [blame] | 1096 | [Arguments] ${client_id} ${lock_type} ${release_lock_type} |
| 1097 | |
| 1098 | # Description of argument(s): |
| 1099 | # client_id This client id can contain string value |
| 1100 | # (e.g. 12345, "HMCID"). |
| 1101 | # lock_type Read lock or Write lock. |
| 1102 | # release_lock_type The value can be Transaction or Session. |
| 1103 | |
| 1104 | ${trans_id_list}= Create List |
| 1105 | @{lock_type_list}= Split String ${lock_type} , |
| 1106 | |
| 1107 | ${session_info}= Create Redfish Session With ClientID ${client_id} |
| 1108 | |
| 1109 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0] |
| 1110 | |
| 1111 | Append To List ${trans_id_list} ${trans_id} |
| 1112 | |
| 1113 | ${temp_trans_id_list}= Copy Dictionary ${trans_id_list} deepcopy=True |
| 1114 | |
| 1115 | ${value}= Get From Dictionary ${trans_id_list}[0] TransactionID |
| 1116 | ${value}= Set Variable \'${value}\' |
| 1117 | Set To Dictionary ${temp_trans_id_list}[0] TransactionID ${value} |
| 1118 | |
| 1119 | Release Locks On Resource |
| 1120 | ... ${session_info} ${temp_trans_id_list} |
| 1121 | ... release_lock_type=${release_lock_type} status_code=${HTTP_BAD_REQUEST} |
| 1122 | |
| 1123 | Release Locks On Resource ${session_info} ${trans_id_list} release_lock_type=${release_lock_type} |
| 1124 | |
| 1125 | ${trans_id_emptylist}= Create List |
| 1126 | Verify Lock On Resource ${session_info} ${trans_id_emptylist} |
| 1127 | Redfish Delete Session ${session_info} |
| 1128 | |
| 1129 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 1130 | Verify Fail To Release Lock For Another Session |
| 1131 | [Documentation] Verify failed to release the lock form another session. |
| 1132 | [Arguments] ${client_id} ${lock_type} |
| 1133 | |
| 1134 | # Description of argument(s): |
| 1135 | # client_id This client id can contain string value |
| 1136 | # (e.g. 12345, "HMCID"). |
| 1137 | # lock_type Read lock or Write lock. |
| 1138 | |
| 1139 | ${client_ids}= Split String ${client_id} , |
| 1140 | ${lock_type_list}= Split String ${lock_type} , |
| 1141 | ${trans_id_list1}= Create List |
| 1142 | ${trans_id_list2}= Create List |
| 1143 | |
| 1144 | ${session_info1}= Create Redfish Session With ClientID ${client_ids}[0] |
| 1145 | |
| 1146 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0] |
| 1147 | Append To List ${trans_id_list1} ${trans_id} |
| 1148 | Verify Lock On Resource ${session_info1} ${trans_id_list1} |
| 1149 | |
| 1150 | ${session_info2}= Create Redfish Session With ClientID ${client_ids}[1] |
| 1151 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[1] |
| 1152 | Append To List ${trans_id_list2} ${trans_id} |
| 1153 | Verify Lock On Resource ${session_info2} ${trans_id_list2} |
| 1154 | |
| 1155 | Release Locks On Resource |
Sushil Singh | e3f2e3b | 2022-07-28 05:15:43 -0500 | [diff] [blame] | 1156 | ... ${session_info1} ${trans_id_list1} Transaction status_code=${HTTP_BAD_REQUEST} |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 1157 | Verify Lock On Resource ${session_info1} ${trans_id_list1} |
| 1158 | Release Locks On Resource ${session_info1} ${trans_id_list1} release_lock_type=Session |
| 1159 | Release Locks On Resource ${session_info2} ${trans_id_list2} release_lock_type=Session |
| 1160 | Redfish Delete Session ${session_info1} |
| 1161 | Redfish Delete Session ${session_info2} |
| 1162 | |
| 1163 | |
Sushil Singh | e33c6e6 | 2020-09-29 06:34:35 -0500 | [diff] [blame] | 1164 | Verify Fail To Acquire Lock For Invalid Resource ID Data Type |
| 1165 | [Documentation] Verify fail to acquire the lock with invalid resource id data type. |
| 1166 | [Arguments] ${client_id} ${lock_type} |
| 1167 | |
| 1168 | # Description of argument(s): |
| 1169 | # client_id This client id can contain string value |
| 1170 | # (e.g. 12345, "HMCID"). |
| 1171 | # lock_type Read lock or Write lock. |
| 1172 | |
| 1173 | ${session_info}= Create Redfish Session With ClientID ${client_id} |
| 1174 | Redfish Post Acquire Invalid Lock With Invalid Data Type Of Resource ID |
| 1175 | ... ${lock_type} status_code=${HTTP_BAD_REQUEST} |
| 1176 | Redfish Delete Session ${session_info} |
| 1177 | |
| 1178 | |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 1179 | Verify Fail To Acquire Lock For Invalid Lock Data |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 1180 | [Documentation] Verify fail to acquired lock with invalid lock types, lock flags, segment flags. |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 1181 | [Arguments] ${client_id} ${lock_type} ${message} |
| 1182 | |
| 1183 | # Description of argument(s): |
| 1184 | # client_id This client id can contain string value |
| 1185 | # (e.g. 12345, "HMCID"). |
| 1186 | # lock_type Read lock or Write lock. |
| 1187 | # message Return message from URI. |
| 1188 | |
| 1189 | ${session_info}= Create Redfish Session With ClientID ${client_id} |
Sushil Singh | 8a3efe7 | 2021-08-26 08:16:41 -0500 | [diff] [blame] | 1190 | ${trans_id}= Redfish Post Acquire Invalid Lock |
| 1191 | ... ${lock_type} message=${message} status_code=${HTTP_BAD_REQUEST} |
Sushil Singh | d03f2ce | 2020-09-17 08:54:41 -0500 | [diff] [blame] | 1192 | Redfish Delete Session ${session_info} |
Sushil Singh | bace300 | 2020-10-08 08:12:58 -0500 | [diff] [blame] | 1193 | |
| 1194 | |
| 1195 | Verify No Locks Records For Session With No Acquired Lock |
| 1196 | [Documentation] Verify no records found for a session where no lock is acquired. |
| 1197 | [Arguments] ${client_id} |
| 1198 | |
| 1199 | # Description of argument(s): |
| 1200 | # client_id This client id can contain string value |
| 1201 | # (e.g. 12345, "HMCID"). |
| 1202 | |
| 1203 | ${session_info}= Create Redfish Session With ClientID ${client_id} |
| 1204 | ${trans_id_emptylist}= Create List |
| 1205 | Verify Lock On Resource ${session_info} ${trans_id_emptylist} |
| 1206 | Redfish Delete Session ${session_info} |
Sushil Singh | 728ef9c | 2020-10-28 04:25:39 -0500 | [diff] [blame] | 1207 | |
| 1208 | |
| 1209 | Create List Of Session ID |
| 1210 | [Documentation] Create session id list from session dict info. |
| 1211 | [Arguments] ${session_dict_info} |
| 1212 | |
| 1213 | # Description of argument(s): |
| 1214 | # session_dict_info Session information in dict. |
| 1215 | |
| 1216 | @{session_id_list}= Create List |
| 1217 | |
| 1218 | FOR ${session} IN @{session_dict_info} |
| 1219 | Append To List ${session_id_list} ${session["SessionIDs"]} |
| 1220 | END |
| 1221 | |
| 1222 | ${num_id}= Get Length ${session_id_list} |
| 1223 | Should Not Be Equal As Integers ${num_id} ${0} |
| 1224 | |
| 1225 | ${session_id_list}= Evaluate json.dumps(${session_id_list}) json |
| 1226 | |
| 1227 | [Return] ${session_id_list} |
| 1228 | |
| 1229 | |
| 1230 | Get Locks List On Resource With Session List |
| 1231 | [Documentation] Get locks list from session of list. |
| 1232 | [Arguments] ${session_id_list} ${exp_status_code}=${HTTP_OK} |
| 1233 | |
| 1234 | # Description of argument(s): |
| 1235 | # session_id_list Session ids list. |
| 1236 | # exp_status_code Expected HTTP status code. |
| 1237 | |
| 1238 | ${resp}= Redfish Post Request /ibm/v1/HMC/LockService/Actions/LockService.GetLockList |
| 1239 | ... data={"SessionIDs": ${session_id_list}} |
susilsi7 | 94116c6 | 2021-03-04 07:57:51 -0600 | [diff] [blame] | 1240 | Should Be Equal As Strings ${resp.status_code} ${exp_status_code} |
Sushil Singh | 728ef9c | 2020-10-28 04:25:39 -0500 | [diff] [blame] | 1241 | ${locks}= Evaluate json.loads('''${resp.text}''') json |
| 1242 | |
| 1243 | [Return] ${locks} |
| 1244 | |
| 1245 | |
| 1246 | Verify List Of Session Lock On Resource |
| 1247 | [Documentation] Verify list of lock record from list of sessions. |
| 1248 | [Arguments] ${session_dict_info} ${transaction_id_list} |
| 1249 | |
| 1250 | # Description of argument(s): |
| 1251 | # session_dict_info Session information in dict. |
| 1252 | # transaction_id_list Transaction id in list stored in dict. |
| 1253 | |
| 1254 | ${session_id_list}= Create List Of Session ID ${session_dict_info} |
| 1255 | ${lock_list_resp}= Get Locks List On Resource With Session List ${session_id_list} |
| 1256 | ${lock_list}= Set Variable ${lock_list_resp['Records']} |
| 1257 | |
Sushil Singh | 8a3efe7 | 2021-08-26 08:16:41 -0500 | [diff] [blame] | 1258 | FOR ${session_id} ${tran_id} ${lock_record} IN ZIP |
| 1259 | ... ${session_dict_info} ${transaction_id_list} ${lock_list} |
Sushil Singh | 728ef9c | 2020-10-28 04:25:39 -0500 | [diff] [blame] | 1260 | Valid Value session_id['SessionIDs'] ['${lock_record['SessionID']}'] |
| 1261 | Should Be Equal As Integers ${tran_id['TransactionID']} ${lock_record['TransactionID']} |
| 1262 | END |
| 1263 | |
| 1264 | |
| 1265 | Verify Lock Records Of Multiple Session |
| 1266 | [Documentation] Verify all records found for a multiple sessions. |
| 1267 | [Arguments] ${client_ids} ${lock_type} |
| 1268 | |
| 1269 | # Description of argument(s): |
| 1270 | # client_ids This client id can contain string value |
| 1271 | # (e.g. 12345, "HMCID"). |
| 1272 | # lock_type Read lock or Write lock. |
| 1273 | |
| 1274 | ${client_id_list}= Split String ${client_ids} , |
| 1275 | ${lock_type_list}= Split String ${lock_type} , |
| 1276 | ${trans_id_list1}= Create List |
| 1277 | ${trans_id_list2}= Create List |
| 1278 | |
| 1279 | ${session_dict_list}= Create List |
| 1280 | ${lock_list}= Create List |
| 1281 | |
| 1282 | ${client_id1}= Create List |
| 1283 | Append To List ${client_id1} ${client_id_list}[0] |
| 1284 | ${session_info1}= Create Session With List Of ClientID ${client_id1} |
| 1285 | Append To List ${session_dict_list} ${session_info1}[0] |
| 1286 | Verify A Session Created With ClientID ${client_id1} ${session_info1} |
| 1287 | |
| 1288 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0] |
| 1289 | Append To List ${trans_id_list1} ${trans_id} |
| 1290 | Append To List ${lock_list} ${trans_id} |
| 1291 | Verify Lock On Resource ${session_info1}[0] ${trans_id_list1} |
| 1292 | |
| 1293 | |
| 1294 | ${client_id2}= Create List |
| 1295 | Append To List ${client_id2} ${client_id_list}[1] |
| 1296 | ${session_info2}= Create Session With List Of ClientID ${client_id2} |
| 1297 | Append To List ${session_dict_list} ${session_info2}[0] |
| 1298 | Verify A Session Created With ClientID ${client_id2} ${session_info2} |
| 1299 | |
| 1300 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[1] |
| 1301 | Append To List ${trans_id_list2} ${trans_id} |
| 1302 | Append To List ${lock_list} ${trans_id} |
| 1303 | Verify Lock On Resource ${session_info2}[0] ${trans_id_list2} |
| 1304 | |
| 1305 | Verify List Of Session Lock On Resource ${session_dict_list} ${lock_list} |
| 1306 | |
| 1307 | ${session_token}= Get From Dictionary ${session_info1}[0] SessionToken |
| 1308 | Set Global Variable ${XAUTH_TOKEN} ${session_token} |
| 1309 | |
| 1310 | Release Locks On Resource ${session_info1} ${trans_id_list1} release_lock_type=Transaction |
| 1311 | |
| 1312 | ${session_token}= Get From Dictionary ${session_info2}[0] SessionToken |
| 1313 | Set Global Variable ${XAUTH_TOKEN} ${session_token} |
| 1314 | |
| 1315 | Release Locks On Resource ${session_info2} ${trans_id_list2} release_lock_type=Transaction |
| 1316 | |
| 1317 | ${trans_id_emptylist}= Create List |
| 1318 | Verify Lock On Resource ${session_info1}[0] ${trans_id_emptylist} |
| 1319 | Verify Lock On Resource ${session_info2}[0] ${trans_id_emptylist} |
| 1320 | |
| 1321 | Redfish Delete List Of Session ${session_dict_list} |
Sushil Singh | f9a536c | 2020-11-09 07:33:17 -0600 | [diff] [blame] | 1322 | |
| 1323 | |
| 1324 | Verify Lock Records For Multiple Invalid Session |
| 1325 | [Documentation] Verify no lock record found for multiple invalid session. |
| 1326 | [Arguments] ${client_id} |
| 1327 | |
| 1328 | # Description of argument(s): |
| 1329 | # client_id This client id can contain string value |
| 1330 | # (e.g. 12345, "HMCID"). |
| 1331 | |
| 1332 | ${session_dict_list}= Create List |
| 1333 | ${invalid_session_ids}= Create List xxyXyyYZZz xXyXYyYZzz |
| 1334 | |
| 1335 | ${session_info1}= Create Session With ClientID ${client_id} |
| 1336 | |
| 1337 | ${session_info2}= Copy Dictionary ${session_info1} deepcopy=True |
| 1338 | set to dictionary ${session_info2} SessionIDs ${invalid_session_ids}[0] |
| 1339 | Append To List ${session_dict_list} ${session_info2} |
| 1340 | |
| 1341 | ${session_info3}= Copy Dictionary ${session_info1} deepcopy=True |
| 1342 | set to dictionary ${session_info3} SessionIDs ${invalid_session_ids}[0] |
| 1343 | Append To List ${session_dict_list} ${session_info3} |
| 1344 | |
| 1345 | ${lock_list1}= Get Locks List On Resource ${session_info1} |
| 1346 | ${lock_length1}= Get Length ${lock_list1} |
| 1347 | |
| 1348 | ${session_id_list}= Create List Of Session ID ${session_dict_list} |
| 1349 | ${lock_list_resp}= Get Locks List On Resource With Session List ${session_id_list} |
| 1350 | ${lock_length2}= Get Length ${lock_list_resp['Records']} |
| 1351 | |
| 1352 | Should Be Equal As Integers ${lock_length1} ${lock_length2} |
| 1353 | |
| 1354 | Redfish Delete Session ${session_info1} |
Sushil Singh | 11949a2 | 2020-11-13 06:12:16 -0600 | [diff] [blame] | 1355 | |
| 1356 | |
| 1357 | Verify Lock Records For Multiple Invalid And Valid Session |
| 1358 | [Documentation] Verify all records found for a valid and invalid sessions. |
| 1359 | [Arguments] ${client_ids} ${lock_type} |
| 1360 | |
| 1361 | # Description of argument(s): |
| 1362 | # client_ids This client id can contain string value |
| 1363 | # (e.g. 12345, "HMCID"). |
| 1364 | # lock_type Read lock or Write lock. |
| 1365 | |
| 1366 | ${client_id_list}= Split String ${client_ids} , |
| 1367 | ${lock_type_list}= Split String ${lock_type} , |
| 1368 | ${trans_id_list1}= Create List |
| 1369 | ${invalid_session_ids}= Create List xxyXyyYZZz |
| 1370 | |
| 1371 | ${session_dict_list}= Create List |
| 1372 | ${lock_list}= Create List |
| 1373 | |
| 1374 | ${client_id1}= Create List |
| 1375 | Append To List ${client_id1} ${client_id_list}[0] |
| 1376 | ${session_info1}= Create Session With List Of ClientID ${client_id1} |
| 1377 | Append To List ${session_dict_list} ${session_info1}[0] |
| 1378 | Verify A Session Created With ClientID ${client_id1} ${session_info1} |
| 1379 | |
| 1380 | ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0] |
| 1381 | Append To List ${trans_id_list1} ${trans_id} |
| 1382 | Append To List ${lock_list} ${trans_id} |
| 1383 | Verify Lock On Resource ${session_info1}[0] ${trans_id_list1} |
| 1384 | |
| 1385 | ${session_info2}= Copy Dictionary ${session_info1} deepcopy=True |
| 1386 | set to dictionary ${session_info2}[0] SessionIDs ${invalid_session_ids}[0] |
| 1387 | Append To List ${session_dict_list} ${session_info2}[0] |
| 1388 | |
| 1389 | Verify List Of Session Lock On Resource ${session_dict_list} ${lock_list} |
| 1390 | |
| 1391 | ${session_token}= Get From Dictionary ${session_info1}[0] SessionToken |
| 1392 | Set Global Variable ${XAUTH_TOKEN} ${session_token} |
| 1393 | |
| 1394 | Release Locks On Resource ${session_info1} ${trans_id_list1} release_lock_type=Transaction |
| 1395 | |
| 1396 | ${trans_id_emptylist}= Create List |
| 1397 | Verify Lock On Resource ${session_info1}[0] ${trans_id_emptylist} |
| 1398 | |
| 1399 | Redfish Delete Session ${session_info1}[0] |