Default to Redfish Power On/Off

If Redfish is supported by the OBMC, obmc_boot_test.py will use
'Redfish Power On' and 'Redfish Power Off' as the default transitional
boot tests.

Change-Id: I56235ccd750bddd1be67d65340a0de9a1b73b76e
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/lib/bmc_redfish.py b/lib/bmc_redfish.py
index 4a54630..3f1f322 100644
--- a/lib/bmc_redfish.py
+++ b/lib/bmc_redfish.py
@@ -48,6 +48,7 @@
                 gp.lprint_var(except_type)
                 gp.lprint_varx("except_value", str(except_value))
                 raise(get_exception)
+        BuiltIn().set_global_variable("${REDFISH_SUPPORTED}", self.__inited__)
 
     def login(self, *args, **kwargs):
         r"""
diff --git a/lib/obmc_boot_test.py b/lib/obmc_boot_test.py
index c544fe4..734be47 100755
--- a/lib/obmc_boot_test.py
+++ b/lib/obmc_boot_test.py
@@ -65,8 +65,13 @@
 status_dir_path = os.environ.get('STATUS_DIR_PATH', "")
 if status_dir_path != "":
     status_dir_path = os.path.normpath(status_dir_path) + os.sep
-default_power_on = "REST Power On"
-default_power_off = "REST Power Off"
+redfish_supported = BuiltIn().get_variable_value("${REDFISH_SUPPORTED}", default=False)
+if redfish_supported:
+    default_power_on = "Redfish Power On"
+    default_power_off = "Redfish Power Off"
+else:
+    default_power_on = "REST Power On"
+    default_power_off = "REST Power Off"
 boot_count = 0
 
 LOG_LEVEL = BuiltIn().get_variable_value("${LOG_LEVEL}")