Support for 4 new Redfish boot tests

Change-Id: I2ab25656c87cbc6bafa87985dfabbe4964396077
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/data/boot_lists/All b/data/boot_lists/All
index 65edf4a..1ab8605 100755
--- a/data/boot_lists/All
+++ b/data/boot_lists/All
@@ -2,12 +2,18 @@
 Out of Band Code Update
 REST Power On
 REST Power On (mfg)
+Redfish Power On
+Redfish Power On (mfg)
 IPMI Power On
 IPMI Power On (mfg)
 REST Power Off
 REST Power Off (mfg)
+Redfish Power Off
+Redfish Power Off (mfg)
 REST Hard Power Off
 REST Hard Power Off (mfg)
+Redfish Hard Power Off
+Redfish Hard Power Off (mfg)
 IPMI Power Off
 IPMI Power Off (mfg)
 IPMI Power Soft
@@ -52,3 +58,5 @@
 Auto Reboot (mfg)
 Host Reboot
 Host Reboot (mfg)
+Redfish Host Reboot
+Redfish Host Reboot (mfg)
diff --git a/data/boot_lists/Manufacturing b/data/boot_lists/Manufacturing
index f157ee5..6075329 100755
--- a/data/boot_lists/Manufacturing
+++ b/data/boot_lists/Manufacturing
@@ -1,7 +1,10 @@
 REST Power On (mfg)
+Redfish Power On (mfg)
 IPMI Power On (mfg)
 REST Power Off (mfg)
+Redfish Power Off (mfg)
 REST Hard Power Off (mfg)
+Redfish Hard Power Off (mfg)
 IPMI Power Off (mfg)
 IPMI Power Soft (mfg)
 Host Power Off (mfg)
@@ -24,3 +27,4 @@
 IPMI Power Reset (mfg)
 Auto Reboot (mfg)
 Host Reboot (mfg)
+Redfish Host Reboot (mfg)
diff --git a/data/boot_lists/OS_reboot b/data/boot_lists/OS_reboot
index 6a531d8..e3387de 100755
--- a/data/boot_lists/OS_reboot
+++ b/data/boot_lists/OS_reboot
@@ -8,3 +8,5 @@
 Auto Reboot (mfg)
 Host Reboot
 Host Reboot (mfg)
+Redfish Host Reboot
+Redfish Host Reboot (mfg)
diff --git a/data/boot_lists/Power_off b/data/boot_lists/Power_off
index 4b0bb5a..ed54757 100755
--- a/data/boot_lists/Power_off
+++ b/data/boot_lists/Power_off
@@ -1,7 +1,11 @@
 REST Power Off
 REST Power Off (mfg)
+Redfish Power Off
+Redfish Power Off (mfg)
 REST Hard Power Off
 REST Hard Power Off (mfg)
+Redfish Hard Power Off
+Redfish Hard Power Off (mfg)
 IPMI Power Off
 IPMI Power Off (mfg)
 IPMI Power Soft
diff --git a/data/boot_lists/Power_on b/data/boot_lists/Power_on
index ff4a0e6..ce28a98 100755
--- a/data/boot_lists/Power_on
+++ b/data/boot_lists/Power_on
@@ -1,4 +1,6 @@
 REST Power On
 REST Power On (mfg)
+Redfish Power On
+Redfish Power On (mfg)
 IPMI Power On
 IPMI Power On (mfg)
diff --git a/data/boot_table.json b/data/boot_table.json
index 5ce8d92..fb5bd80 100644
--- a/data/boot_table.json
+++ b/data/boot_table.json
@@ -25,6 +25,30 @@
         "method": "Initiate Host Boot  wait=${0}",
         "lib_file_path": "state_manager.robot"
     },
+    # Initiate a power on using the Redfish API interface.
+    "Redfish Power On": {
+        "start": {
+            "rest": "^1$",
+            "chassis": "^Off$",
+            "boot_progress": "^Off|Unspecified$",
+            "operating_system": "^Inactive$",
+            "host": "^Off$"
+        },
+        "end": {
+            "rest": "^1$",
+            "chassis": "^On$",
+            "boot_progress": "^FW Progress, Starting OS|OSStart$",
+            "operating_system": "^BootComplete$",
+            "host": "^Running$",
+            "os_ping": "^1$",
+            "os_login": "^1$",
+            "os_run_cmd": "^1$"
+        },
+        "bmc_reboot": 0,
+        "method_type": "keyword",
+        "method": "Redfish Power Operation  On",
+        "lib_file_path": "bmc_redfish_utils.robot"
+    },
     # Initiate a power on using the IPMI interface.
     "IPMI Power On": {
         "start": {
@@ -73,6 +97,27 @@
         "method": "Initiate Host PowerOff  wait=${0}",
         "lib_file_path": "state_manager.robot"
     },
+    # Initiate a power off using the Redfish API interface.
+    "Redfish Power Off": {
+        "start": {
+            "rest": "^1$",
+            "chassis": "^On$"
+        },
+        "end": {
+            "rest": "^1$",
+            "chassis": "^Off$",
+            "boot_progress": "^Off|Unspecified$",
+            "operating_system": "^Inactive$",
+            "host": "^Off$",
+            "os_ping": "^0$",
+            "os_login": "^0$",
+            "os_run_cmd": "^0$"
+        },
+        "bmc_reboot": 0,
+        "method_type": "keyword",
+        "method": "Redfish Power Operation  GracefulShutdown",
+        "lib_file_path": "bmc_redfish_utils.robot"
+    },
     # Initiate a hard power off using the REST API interface.
     "REST Hard Power Off": {
         "start": {
@@ -94,6 +139,27 @@
         "method": "Hard Power Off  wait=${0}",
         "lib_file_path": "state_manager.robot"
     },
+    # Initiate a hard power off using the Redfish API interface.
+    "Redfish Hard Power Off": {
+        "start": {
+            "rest": "^1$",
+            "chassis": "^On$"
+        },
+        "end": {
+            "rest": "^1$",
+            "chassis": "^Off$",
+            "boot_progress": "^Off|Unspecified$",
+            "operating_system": "^Inactive$",
+            "host": "^Off$",
+            "os_ping": "^0$",
+            "os_login": "^0$",
+            "os_run_cmd": "^0$"
+        },
+        "bmc_reboot": 0,
+        "method_type": "keyword",
+        "method": "Redfish Power Operation  ForceOff",
+        "lib_file_path": "bmc_redfish_utils.robot"
+    },
     # Initiate a power off using the IPMI interface.
     "IPMI Power Off": {
         "start": {
@@ -626,5 +692,32 @@
         "method_type": "keyword",
         "method": "utils.Initiate OS Host Reboot",
         "lib_file_path": "utils.robot"
+    },
+    # Initiate host reboot using the Redfish API interface (GracefulRestart).
+    "Redfish Host Reboot": {
+        "start": {
+            "rest": "^1$",
+            "chassis": "^On$",
+            "boot_progress": "^FW Progress, Starting OS|OSStart$",
+            "operating_system": "^BootComplete$",
+            "host": "^Running$",
+            "os_ping": "^1$",
+            "os_login": "^1$",
+            "os_run_cmd": "^1$"
+        },
+        "end": {
+            "rest": "^1$",
+            "chassis": "^On$",
+            "boot_progress": "^FW Progress, Starting OS|OSStart$",
+            "operating_system": "^BootComplete$",
+            "host": "^Running$",
+            "os_ping": "^1$",
+            "os_login": "^1$",
+            "os_run_cmd": "^1$"
+        },
+        "bmc_reboot": 0,
+        "method_type": "keyword",
+        "method": "Redfish Power Operation  GracefulRestart",
+        "lib_file_path": "bmc_redfish_utils.robot"
     }
 }
diff --git a/lib/boot_utils.robot b/lib/boot_utils.robot
index fd41737..6a2a8b4 100644
--- a/lib/boot_utils.robot
+++ b/lib/boot_utils.robot
@@ -31,6 +31,32 @@
     Run Key U  ${cmd_buf}
 
 
+Redfish Power On
+    [Documentation]  Do "Redfish Power On" boot test.
+    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
+
+    # Description of argument(s):
+    # stack_mode                    If stack_mode is set to "skip", each test
+    #                               specified in the boot_stack is only
+    #                               performed if the machine is not already in
+    #                               the state that would normally result from
+    #                               running the given boot test.  Otherwise,
+    #                               the test is skipped.  If stack_mode is set
+    #                               to "normal", all tests from the boot_stack
+    #                               are performed.  "skip" mode is useful when
+    #                               you simply want the machine in a desired
+    #                               state.  The default value is the global
+    #                               value of "${stack_mode}"
+    # quiet                         If this parameter is set to ${1}, this
+    #                               keyword will print only essential
+    #                               information.  The default value is the
+    #                               global value of "${quiet}"
+
+    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=Redfish Power On
+    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+    Run Key U  ${cmd_buf}
+
+
 IPMI Power On
     [Documentation]  Do "IPMI Power On" boot test.
     [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
@@ -83,6 +109,32 @@
     Run Key U  ${cmd_buf}
 
 
+Redfish Power Off
+    [Documentation]  Do "Redfish Power Off" boot test.
+    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
+
+    # Description of argument(s):
+    # stack_mode                    If stack_mode is set to "skip", each test
+    #                               specified in the boot_stack is only
+    #                               performed if the machine is not already in
+    #                               the state that would normally result from
+    #                               running the given boot test.  Otherwise,
+    #                               the test is skipped.  If stack_mode is set
+    #                               to "normal", all tests from the boot_stack
+    #                               are performed.  "skip" mode is useful when
+    #                               you simply want the machine in a desired
+    #                               state.  The default value is the global
+    #                               value of "${stack_mode}"
+    # quiet                         If this parameter is set to ${1}, this
+    #                               keyword will print only essential
+    #                               information.  The default value is the
+    #                               global value of "${quiet}"
+
+    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=Redfish Power Off
+    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+    Run Key U  ${cmd_buf}
+
+
 REST Hard Power Off
     [Documentation]  Do "REST Hard Power Off" boot test.
     [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
@@ -109,6 +161,33 @@
     Run Key U  ${cmd_buf}
 
 
+Redfish Hard Power Off
+    [Documentation]  Do "Redfish Hard Power Off" boot test.
+    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
+
+    # Description of argument(s):
+    # stack_mode                    If stack_mode is set to "skip", each test
+    #                               specified in the boot_stack is only
+    #                               performed if the machine is not already in
+    #                               the state that would normally result from
+    #                               running the given boot test.  Otherwise,
+    #                               the test is skipped.  If stack_mode is set
+    #                               to "normal", all tests from the boot_stack
+    #                               are performed.  "skip" mode is useful when
+    #                               you simply want the machine in a desired
+    #                               state.  The default value is the global
+    #                               value of "${stack_mode}"
+    # quiet                         If this parameter is set to ${1}, this
+    #                               keyword will print only essential
+    #                               information.  The default value is the
+    #                               global value of "${quiet}"
+
+    ${cmd_buf}  Catenate  OBMC Boot Test
+    ...  \ loc_boot_stack=Redfish Hard Power Off
+    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+    Run Key U  ${cmd_buf}
+
+
 IPMI Power Off
     [Documentation]  Do "IPMI Power Off" boot test.
     [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
@@ -691,6 +770,32 @@
     Run Key U  ${cmd_buf}
 
 
+Redfish Host Reboot
+    [Documentation]  Do "Redfish Host Reboot" boot test.
+    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
+
+    # Description of argument(s):
+    # stack_mode                    If stack_mode is set to "skip", each test
+    #                               specified in the boot_stack is only
+    #                               performed if the machine is not already in
+    #                               the state that would normally result from
+    #                               running the given boot test.  Otherwise,
+    #                               the test is skipped.  If stack_mode is set
+    #                               to "normal", all tests from the boot_stack
+    #                               are performed.  "skip" mode is useful when
+    #                               you simply want the machine in a desired
+    #                               state.  The default value is the global
+    #                               value of "${stack_mode}"
+    # quiet                         If this parameter is set to ${1}, this
+    #                               keyword will print only essential
+    #                               information.  The default value is the
+    #                               global value of "${quiet}"
+
+    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=Redfish Host Reboot
+    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+    Run Key U  ${cmd_buf}
+
+
 Smart Power Off
     [Documentation]  Do a smart power off.
     [Arguments]  ${quiet}=${QUIET}