Moved chassis power policy test case to new ipmi bucket

Change-Id: I3cf1b3e2ce9a3b2ce65a9fd9872540a23dc7a066
Signed-off-by: Rahul Maheshwari <rahulmaheshwari@in.ibm.com>
diff --git a/ipmi/test_ipmi_chassis.robot b/ipmi/test_ipmi_chassis.robot
index 91a98a6..5b0f8b2 100644
--- a/ipmi/test_ipmi_chassis.robot
+++ b/ipmi/test_ipmi_chassis.robot
@@ -3,6 +3,7 @@
 Documentation    Module to test IPMI chassis functionality.
 Resource         ../lib/ipmi_client.robot
 Resource         ../lib/openbmc_ffdc.robot
+Library          ../lib/ipmi_utils.py
 
 Test Teardown    FFDC On Test Case Fail
 
@@ -53,3 +54,38 @@
     Run IPMI Standard Command  chassis power soft
     Wait Until Keyword Succeeds  3 min  10 sec  Is Host Off Via IPMI
 
+
+Verify Chassis Power Policy
+    [Documentation]  Verify setting chassis power policy via IPMI command.
+    [Tags]  Verify_Chassis_Power_Policy
+    [Setup]  Test Setup Execution
+    [Teardown]  Run Keywords  FFDC On Test Case Fail  AND
+    ...  Run IPMI Standard Command  chassis policy ${initial_power_policy}
+    [Template]  Set Chassis Power Policy Via IPMI And Verify
+
+    # power_policy
+    always-off
+    always-on
+    previous
+
+
+*** Keywords ***
+
+Set Chassis Power Policy Via IPMI And Verify
+    [Documentation]  Set chasiss power policy via IPMI and verify.
+    [Arguments]  ${power_policy}
+
+    # Description of argument(s):
+    # power_policy    Chassis power policy to be set(e.g. "always-off", "always-on").
+
+    Run IPMI Standard Command  chassis policy ${power_policy}
+    ${resp}=  Get Chassis Status
+    Valid Value  resp['power_restore_policy']  ['${power_policy}']
+
+
+Test Setup Execution
+    [Documentation]  Do test setup tasks.
+
+    ${chassis_status}=  Get Chassis Status
+    Set Test Variable  ${initial_power_policy}  ${chassis_status['power_restore_policy']}
+
diff --git a/tests/ipmi/test_chassis.robot b/tests/ipmi/test_chassis.robot
deleted file mode 100755
index a02b801..0000000
--- a/tests/ipmi/test_chassis.robot
+++ /dev/null
@@ -1,54 +0,0 @@
-*** Settings ***
-Documentation          This suite tests IPMI chassis status in Open BMC.
-
-Resource               ../../lib/rest_client.robot
-Resource               ../../lib/ipmi_client.robot
-Resource               ../../lib/openbmc_ffdc.robot
-Resource               ../../lib/utils.robot
-Resource               ../../lib/boot_utils.robot
-Resource               ../../lib/resource.robot
-Resource               ../../lib/state_manager.robot
-
-Test Teardown          Test Teardown Execution
-
-*** Test Cases ***
-
-IPMI Chassis Restore Power Policy
-     [Documentation]  Verify IPMI chassis restore power policy.
-     [Tags]  IPMI_Chassis_Restore_Power_Policy
-
-     ${initial_power_policy}=  Read Attribute
-     ...  ${CONTROL_HOST_URI}/power_restore_policy  PowerRestorePolicy
-
-     Set BMC Power Policy  ${ALWAYS_POWER_ON}
-     ${resp}=  Run IPMI Standard Command  chassis status
-     ${power_status}=
-     ...  Get Lines Containing String  ${resp}  Power Restore Policy
-     Should Contain  ${power_status}  always-on
-
-     Set BMC Power Policy  ${RESTORE_LAST_STATE}
-     ${resp}=  Run IPMI Standard Command  chassis status
-     ${power_status}=
-     ...  Get Lines Containing String  ${resp}  Power Restore Policy
-     Should Contain  ${power_status}  previous
-
-     Set BMC Power Policy  ${ALWAYS_POWER_OFF}
-     ${resp}=    Run IPMI Standard Command  chassis status
-     ${power_status}=
-     ...  Get Lines Containing String  ${resp}  Power Restore Policy
-     Should Contain  ${power_status}    always-off
-
-     Set BMC Power Policy  ${initial_power_policy}
-     ${power_policy}=  Read Attribute
-     ...  ${CONTROL_HOST_URI}/power_restore_policy  PowerRestorePolicy
-     Should Be Equal  ${power_policy}  ${initial_power_policy}
-
-
-*** Keywords ***
-
-Test Teardown Execution
-    [Documentation]    Log FFDC if test failed.
-
-    Set BMC Power Policy  ${ALWAYS_POWER_OFF}
-
-    FFDC On Test Case Fail