Deprecate SetPassword usage and update test with new users method

Changes:
   - Remove SetPassword code from lib.
   - Update test case with new user method (redfish/ipmi)

Change-Id: I39a20eab1cc1885d115305bc548d4911e43aee54
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index 78c2b5b..afaf56e 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -558,23 +558,6 @@
     [Return]  ${boot_side}
 
 
-Update Root Password
-    [Documentation]  Update system "root" user password.
-    [Arguments]  ${openbmc_password}=${OPENBMC_PASSWORD}
-
-    # Description of argument(s):
-    # openbmc_password   The root password for the open BMC system.
-
-    @{password}=  Create List  ${openbmc_password}
-    ${data}=  Create Dictionary  data=@{password}
-
-    ${headers}=  Create Dictionary  Content-Type=application/json  X-Auth-Token=${XAUTH_TOKEN}
-    ${resp}=  Post Request  openbmc  ${BMC_USER_URI}root/action/SetPassword
-    ...  data=${data}  headers=${headers}
-    Should Be Equal As Strings  ${resp.status_code}  ${HTTP_OK}
-    ...  msg=Updating the new root password failed, RC=${resp.status_code}.
-
-
 Watchdog Object Should Exist
     [Documentation]  Check that watchdog object exists.
 
diff --git a/remote_logging/test_remote_logging.robot b/remote_logging/test_remote_logging.robot
index ed82ccb..5cc96e1 100644
--- a/remote_logging/test_remote_logging.robot
+++ b/remote_logging/test_remote_logging.robot
@@ -12,6 +12,8 @@
 Resource         ../lib/openbmc_ffdc.robot
 Resource         ../lib/boot_utils.robot
 Resource         ../lib/remote_logging_utils.robot
+Resource         ../lib/bmc_redfish_resource.robot
+Resource         ../lib/ipmi_client.robot
 Library          ../lib/gen_misc.py
 
 Suite Setup      Suite Setup Execution
@@ -27,6 +29,7 @@
 ${BMC_SYSLOG_REGEX}      dropbear|vrm-control.sh
 ${RSYSLOG_REGEX}         start|exiting on signal 15|there are no active actions configured
 ${RSYSLOG_RETRY_REGEX}   suspended
+${valid_password}        0penBmc1
 
 *** Test Cases ***
 
@@ -209,7 +212,8 @@
     [Tags]  Verify_BMC_Journald_Contains_No_Credential_Data
 
     Initialize OpenBMC
-    Update Root Password  ${REST_PASSWORD}
+
+    Create Redfish And IPMI Users
 
     # Time for user manager to sync.
     Sleep  5 s
@@ -353,3 +357,35 @@
 
     Should Be Equal  ${status}  ${expectation}
     ...  msg=Test result ${status} and expectation ${expectation} do not match.
+
+
+Create Redfish And IPMI Users
+    [Documentation]  Create a valid Redfish and IPMI local user accounts and
+    ...  delete them.
+
+    # Create redfish local valid user.
+    ${redfish_username}=  Generate Random String  8  [LETTERS]
+
+    Redfish.Login
+
+    ${payload}=  Create Dictionary
+    ...  UserName=${redfish_username}  Password=${valid_password}
+    ...  RoleId=Administrator  Enabled=${True}
+    Redfish.Post  /redfish/v1/AccountService/Accounts  body=&{payload}
+    ...  valid_status_codes=[${HTTP_CREATED}]
+
+    # Delete newly created user.
+    Redfish.Delete  /redfish/v1/AccountService/Accounts/${redfish_username}
+
+    Redfish.Logout
+
+    # Create IPMI local valid user.
+    ${ipmi_username}=  Generate Random String  8  [LETTERS]
+    Set Test Variable  ${ipmi_username}
+    ${random_userid}=  Evaluate  random.randint(2, 15)  modules=random
+    ${ipmi_cmd}=  Catenate  user set name ${random_userid} ${ipmi_username}
+    Run IPMI Standard Command  ${ipmi_cmd}
+
+    # Delete IPMI user.
+    Run IPMI Standard Command  user set name ${random_userid} ""
+