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