Corrected the logic to set version variable.
Earlier logic was to check org interface to decide. As older
org interfaces are always present, automation code was always
taking org interface.
Now with changes we take decision based on xyz interface. So
if xyz interface available, we set version variable to 1 else 0.
Also corrected setting OBMC_STATES_VERSION to 0 for old
interface and 1 for new xyz interface.
Resolves openbmc/openbmc-test-automation#387
Change-Id: I4699be2d5650cc9ffcc1c6265bce2f695a5b8516
Signed-off-by: Rahul Maheshwari <rahulmaheshwari@in.ibm.com>
diff --git a/lib/state_manager.robot b/lib/state_manager.robot
index 9372c15..d5bf4ee 100755
--- a/lib/state_manager.robot
+++ b/lib/state_manager.robot
@@ -147,7 +147,7 @@
Set State Interface Version
[Documentation] Set version to indicate which interface to use.
- ${resp}= Openbmc Get Request ${CONTROL_URI}chassis0
+ ${resp}= Openbmc Get Request ${CHASSIS_STATE_URI}
${status}= Run Keyword And Return Status
... Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
Run Keyword If '${status}' == '${True}'
@@ -158,7 +158,7 @@
Power Off Request
[Documentation] Select appropriate poweroff keyword.
- Run Keyword If '${OBMC_STATES_VERSION}' == '${1}'
+ Run Keyword If '${OBMC_STATES_VERSION}' == '${0}'
... Initiate Power Off
... ELSE
... Initiate Host PowerOff
@@ -167,7 +167,7 @@
Wait For BMC Ready
[Documentation] Check BMC state and wait for BMC Ready.
@{states}= Create List BMC_READY HOST_POWERED_OFF
- Run Keyword If '${OBMC_STATES_VERSION}' == '${1}'
+ Run Keyword If '${OBMC_STATES_VERSION}' == '${0}'
... Wait Until Keyword Succeeds 10 min 10 sec
... Verify BMC State ${states}
... ELSE