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