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