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