Chassis and Host state string
The Chassis and Host state is a full Dbus string.
Example :
xyz.openbmc_project.State.Host.HostState.Off
xyz.openbmc_project.State.Host.HostState.Running
xyz.openbmc_project.State.Chassis.PowerState.Off
xyz.openbmc_project.State.Chassis.PowerState.On
With this change, the state is pruned off to return the states
as On/Off/Running.
Resolves openbmc/openbmc-test-automation#288
Change-Id: Ie6b41dd8353e32deca015f98852eb86b82a3a92b
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/state_manager.robot b/lib/state_manager.robot
index 92c3e23..ada66dd 100755
--- a/lib/state_manager.robot
+++ b/lib/state_manager.robot
@@ -48,17 +48,17 @@
Is Host Running
[Documentation] Check if Chassis and Host state is ON.
${power_state}= Get Chassis Power State
- Should Be Equal ${CHASSIS_POWERON_STATE} ${power_state}
+ Should Be Equal On ${power_state}
${host_state}= Get Host State
- Should Be Equal ${HOST_POWERON_STATE} ${host_state}
+ Should Be Equal Running ${host_state}
Is Host Off
[Documentation] Check if Chassis and Host state is OFF.
${power_state}= Get Chassis Power State
- Should Be Equal ${CHASSIS_POWEROFF_STATE} ${power_state}
+ Should Be Equal Off ${power_state}
${host_state}= Get Host State
- Should Be Equal ${HOST_POWEROFF_STATE} ${host_state}
+ Should Be Equal Off ${host_state}
Get Host State
@@ -68,7 +68,7 @@
${state}=
... Read Attribute ${HOST_STATE_URI} CurrentHostState
... quiet=${quiet}
- [Return] ${state}
+ [Return] ${state.rsplit('.', 1)[1]}
Get Chassis Power State
@@ -79,4 +79,4 @@
${state}=
... Read Attribute ${CHASSIS_STATE_URI} CurrentPowerState
... quiet=${quiet}
- [Return] ${state}
+ [Return] ${state.rsplit('.', 1)[1]}