Added service login automation testcase
-- Verify Service User Sets Admin Password
Change-Id: I96e85619c59558007eb98c4db8fee91111584ca6
Signed-off-by: manashsarma <manashsarma@in.ibm.com>
diff --git a/openpower/service_account/test_service_login.robot b/openpower/service_account/test_service_login.robot
index 85181af..792c1b9 100644
--- a/openpower/service_account/test_service_login.robot
+++ b/openpower/service_account/test_service_login.robot
@@ -98,6 +98,18 @@
Should Be Equal ${status} ${False}
+Verify Service User Sets Admin Password
+ [Documentation] Verify that service user can update admin password.
+ [Tags] Verify_Service_User_Sets_Admin_Password
+ [Teardown] Restore Admin Password
+
+ Redfish.Login service ${SERVICE_USER_PASSWORD}
+
+ # Update admin user password using Redfish.
+ ${payload}= Create Dictionary Password=NewTestPwd123
+ Redfish.Patch /redfish/v1/AccountService/Accounts/admin body=&{payload}
+ ... valid_status_codes=[${HTTP_OK}]
+
*** Keywords ***
Suite Setup Execution
@@ -118,3 +130,11 @@
Run Keywords Open Connection for SCP
scp.Put File ${SERVICE_FILE_PATH} ${acf_dir}
+
+
+Restore Admin Password
+ [Documentation] Restore original password of admin user.
+
+ ${payload}= Create Dictionary Password=${OPENBMC_ADMIN_PASSWORD}
+ Redfish.Patch /redfish/v1/AccountService/Accounts/admin body=&{payload}
+ ... valid_status_codes=[${HTTP_OK}]