Support for new 'Redfish OBMC Reboot' tests

Change-Id: Id11cdb5c8f6469c4d246903aeec6a708c38341cf
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/data/boot_lists/All b/data/boot_lists/All
index 1ab8605..eeba815 100755
--- a/data/boot_lists/All
+++ b/data/boot_lists/All
@@ -26,10 +26,14 @@
 OBMC Reboot (run) (mfg)
 REST OBMC Reboot (run)
 REST OBMC Reboot (run) (mfg)
+Redfish OBMC Reboot (run)
+Redfish OBMC Reboot (run) (mfg)
 OBMC Reboot (off)
 OBMC Reboot (off) (mfg)
 REST OBMC Reboot (off)
 REST OBMC Reboot (off) (mfg)
+Redfish OBMC Reboot (off)
+Redfish OBMC Reboot (off) (mfg)
 PDU AC Cycle (run)
 PDU AC Cycle (run) (mfg)
 PDU AC Cycle (off)
diff --git a/data/boot_lists/Manufacturing b/data/boot_lists/Manufacturing
index 6075329..c837437 100755
--- a/data/boot_lists/Manufacturing
+++ b/data/boot_lists/Manufacturing
@@ -11,8 +11,10 @@
 APOR (mfg)
 OBMC Reboot (run) (mfg)
 REST OBMC Reboot (run) (mfg)
+Redfish OBMC Reboot (run) (mfg)
 OBMC Reboot (off) (mfg)
 REST OBMC Reboot (off) (mfg)
+Redfish OBMC Reboot (off) (mfg)
 PDU AC Cycle (run) (mfg)
 PDU AC Cycle (off) (mfg)
 IPMI MC Reset Warm (run) (mfg)
diff --git a/data/boot_lists/OBMC_reboot b/data/boot_lists/OBMC_reboot
index 29637d1..3d6bbcf 100755
--- a/data/boot_lists/OBMC_reboot
+++ b/data/boot_lists/OBMC_reboot
@@ -4,10 +4,14 @@
 OBMC Reboot (run) (mfg)
 REST OBMC Reboot (run)
 REST OBMC Reboot (run) (mfg)
+Redfish OBMC Reboot (run)
+Redfish OBMC Reboot (run) (mfg)
 OBMC Reboot (off)
 OBMC Reboot (off) (mfg)
 REST OBMC Reboot (off)
 REST OBMC Reboot (off) (mfg)
+Redfish OBMC Reboot (off)
+Redfish OBMC Reboot (off) (mfg)
 PDU AC Cycle (run)
 PDU AC Cycle (run) (mfg)
 PDU AC Cycle (off)
diff --git a/data/boot_table.json b/data/boot_table.json
index fb5bd80..df1a4b2 100644
--- a/data/boot_table.json
+++ b/data/boot_table.json
@@ -313,6 +313,33 @@
         "method": "Initiate BMC Reboot  wait=${0}",
         "lib_file_path": "state_manager.robot"
     },
+    # Run a Redfish "reboot" on the OBMC while host is running.
+    "Redfish OBMC Reboot (run)": {
+        "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": 1,
+        "method_type": "keyword",
+        "method": "Redfish BMC Reset Operation",
+        "lib_file_path": "bmc_redfish_utils.robot"
+    },
     # Run a "reboot" on the OBMC while host is off.
     "OBMC Reboot (off)": {
         "start": {
@@ -348,6 +375,24 @@
         "method": "Initiate BMC Reboot  wait=${0}",
         "lib_file_path": "state_manager.robot"
     },
+    # Run a "reboot" on the OBMC while host is off.
+    "Redfish OBMC Reboot (off)": {
+        "start": {
+            "rest": "^1$",
+            "chassis": "^Off$"
+        },
+        "end": {
+            "rest": "^1$",
+            "chassis": "^Off$",
+            "boot_progress": "^Off|Unspecified$",
+            "operating_system": "^Inactive$",
+            "host": "^Off$"
+        },
+        "bmc_reboot": 1,
+        "method_type": "keyword",
+        "method": "Redfish BMC Reset Operation",
+        "lib_file_path": "bmc_redfish_utils.robot"
+    },
     # Cycle AC via the PDU while host is off.
     "PDU AC Cycle (run)": {
         "start": {
diff --git a/lib/boot_utils.robot b/lib/boot_utils.robot
index 6a2a8b4..361f977 100644
--- a/lib/boot_utils.robot
+++ b/lib/boot_utils.robot
@@ -345,6 +345,33 @@
     Run Key U  ${cmd_buf}
 
 
+Redfish OBMC Reboot (run)
+    [Documentation]  Do "Redfish OBMC Reboot (run)" 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 OBMC Reboot (run)
+    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+    Run Key U  ${cmd_buf}
+
+
 OBMC Reboot (off)
     [Documentation]  Do "OBMC Reboot (off)" boot test.
     [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
@@ -398,6 +425,33 @@
     Run Key U  ${cmd_buf}
 
 
+Redfish OBMC Reboot (off)
+    [Documentation]  Do "Redfish OBMC Reboot (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 OBMC Reboot (off)
+    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+    Run Key U  ${cmd_buf}
+
+
 PDU AC Cycle (run)
     [Documentation]  Do "PDU AC Cycle (run)" boot test.
     [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}