Added validation for power operation testcases using LDAP user.

Added code to check the host state after power operation and wait
until the host is up for power on.

Moved Redfish.Login to Test Teardown, to make the next testcase execute
with root user.

Added code to delete all redfish session in suite teardown.

Tested: Run robot redfish/account_service/test_ldap_configuration.robot

Signed-off-by: agarjun B  <nagarjunb@ami.com>
Change-Id: Iaafe0657d41a82be067c1ea91fe02ef995567394
diff --git a/lib/utils.robot b/lib/utils.robot
index 5e82041..1032514 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -1085,3 +1085,22 @@
     Redfish.login
     ${bmc_status}=  Redfish.Get Attribute  /redfish/v1/Managers/bmc  Status
     Should Be Equal  ${bmc_status["State"]}  Enabled
+
+
+Verify Host Power State
+    [Documentation]  Get the Host Power state and compare it with the expected state.
+    [Arguments]  ${expected_power_state}
+
+    # Description of argument(s):
+    # expected_power_state   State of Host e.g. Off or On.
+
+    ${power_state}  ${health_status}=  Redfish Get Host State
+    Should Be Equal  ${power_state}  ${expected_power_state}
+
+
+Verify Host Is Up
+    [Documentation]  Verify Host is Up.
+
+    Wait Until Keyword Succeeds  3 min  30 sec  Verify Host Power State  On
+    # Python module:  os_execute(cmd)
+    Wait Until Keyword Succeeds  10 min  30 sec  OS Execute Command  uptime