Automation code fail to release lock with transaction id as string
Changes:
- Test case "Fail To Release Lock With String As TransactionID Data Type"
- Keyword "Verify Fail To Release Lock With TransactionID As String Type"
Signed-off-by: susilsi7 <susilsi7@in.ibm.com>
Change-Id: I239248ec4ea4b9abb4a3346bdfcdb4f2f52065e2
diff --git a/openpower/ext_interfaces/test_lock_management.robot b/openpower/ext_interfaces/test_lock_management.robot
index 50a2132..ef0c8cb 100644
--- a/openpower/ext_interfaces/test_lock_management.robot
+++ b/openpower/ext_interfaces/test_lock_management.robot
@@ -157,6 +157,16 @@
HMCID-01 ReadCase1,ReadCase1 Transaction
+Fail To Release Lock With String As TransactionID Data Type
+ [Documentation] Fail to release lock with string as transaction id data type.
+ [Tags] Fail_To_Release_Lock_With_String_As_TransactionID_Data_Type
+ [Template] Verify Fail To Release Lock With TransactionID As String Type
+
+ # client_id lock_type release_lock_type
+ HMCID-01 ReadCase1 Transaction
+ HMCID-01 WriteCase1 Transaction
+
+
Fail To Release Lock For Another Session
[Documentation] Failed to release locks from another session.
[Tags] Fail_To_Release_Lock_For_Another_Session
@@ -949,6 +959,42 @@
Redfish Delete Session ${session_info}
+Verify Fail To Release Lock With TransactionID As String Type
+ [Documentation] Verify fail to be release lock with trasaction ID as string data type.
+ [Arguments] ${client_id} ${lock_type} ${release_lock_type}
+
+ # Description of argument(s):
+ # client_id This client id can contain string value
+ # (e.g. 12345, "HMCID").
+ # lock_type Read lock or Write lock.
+ # release_lock_type The value can be Transaction or Session.
+
+ ${trans_id_list}= Create List
+ @{lock_type_list}= Split String ${lock_type} ,
+
+ ${session_info}= Create Redfish Session With ClientID ${client_id}
+
+ ${trans_id}= Redfish Post Acquire Lock ${lock_type_list}[0]
+
+ Append To List ${trans_id_list} ${trans_id}
+
+ ${temp_trans_id_list}= Copy Dictionary ${trans_id_list} deepcopy=True
+
+ ${value}= Get From Dictionary ${trans_id_list}[0] TransactionID
+ ${value}= Set Variable \'${value}\'
+ Set To Dictionary ${temp_trans_id_list}[0] TransactionID ${value}
+
+ Release Locks On Resource
+ ... ${session_info} ${temp_trans_id_list}
+ ... release_lock_type=${release_lock_type} status_code=${HTTP_BAD_REQUEST}
+
+ Release Locks On Resource ${session_info} ${trans_id_list} release_lock_type=${release_lock_type}
+
+ ${trans_id_emptylist}= Create List
+ Verify Lock On Resource ${session_info} ${trans_id_emptylist}
+ Redfish Delete Session ${session_info}
+
+
Verify Fail To Release Lock For Another Session
[Documentation] Verify failed to release the lock form another session.
[Arguments] ${client_id} ${lock_type}