Filter based on REDFISH_SUPPORT_TRANS_STATE for x86 for redfish path
REDFISH_SUPPORT_TRANS_STATE is still a development variable which
will be eventually auto populated when the firmware and test is ready
to run is to run in Redfish mode ONLY.
User can force test to run ONLY redfish mode using this varaible
-v REDFISH_SUPPORT_TRANS_STATE:1
Change-Id: I64cebc635845376a7564c5b537aa44495c890666
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/data/boot_table_x86.json b/data/boot_table_x86.json
index ec830aa..48e28b5 100644
--- a/data/boot_table_x86.json
+++ b/data/boot_table_x86.json
@@ -1,37 +1,17 @@
{
# Power on boot types:
- # Initiate a power on using the REST API interface.
- "REST Power On": {
- "start": {
- "rest": "^1$",
- "chassis": "^Off$",
- "host": "^Off$"
- },
- "end": {
- "rest": "^1$",
- "chassis": "^On$",
- "host": "^Running$",
- "os_ping": "^1$",
- "os_login": "^1$",
- "os_run_cmd": "^1$"
- },
- "bmc_reboot": 0,
- "method_type": "keyword",
- "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$",
+ "redfish": "^1$",
"chassis": "^Off$",
- "host": "^Off$"
+ "host": "^Disabled$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
@@ -44,14 +24,14 @@
# Initiate a power on using the IPMI interface.
"IPMI Power On": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$",
- "host": "^Off$"
+ "host": "^Disabled$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
@@ -64,35 +44,16 @@
# Power off boot types:
- # Initiate a power off using the REST API interface.
- "REST Power Off": {
- "start": {
- "rest": "^1$",
- "chassis": "^On$"
- },
- "end": {
- "rest": "^1$",
- "chassis": "^Off$",
- "host": "^Off$",
- "os_ping": "^0$",
- "os_login": "^0$",
- "os_run_cmd": "^0$"
- },
- "bmc_reboot": 0,
- "method_type": "keyword",
- "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$",
+ "redfish": "^1$",
"chassis": "^On$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$",
- "host": "^Off$",
+ "host": "^Disabled$",
"os_ping": "^0$",
"os_login": "^0$",
"os_run_cmd": "^0$"
@@ -102,35 +63,16 @@
"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": {
- "rest": "^1$",
- "chassis": "^On$"
- },
- "end": {
- "rest": "^1$",
- "chassis": "^Off$",
- "host": "^Off$",
- "os_ping": "^0$",
- "os_login": "^0$",
- "os_run_cmd": "^0$"
- },
- "bmc_reboot": 0,
- "method_type": "keyword",
- "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$",
+ "redfish": "^1$",
"chassis": "^On$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$",
- "host": "^Off$",
+ "host": "^Disabled$",
"os_ping": "^0$",
"os_login": "^0$",
"os_run_cmd": "^0$"
@@ -143,13 +85,13 @@
# Initiate a power off using the IPMI interface.
"IPMI Power Off": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$",
- "host": "^Off$",
+ "host": "^Disabled$",
"os_ping": "^0$",
"os_login": "^0$",
"os_run_cmd": "^0$"
@@ -162,13 +104,13 @@
# Initiate a power soft using the IPMI interface.
"IPMI Power Soft": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$",
- "host": "^Off$",
+ "host": "^Disabled$",
"os_ping": "^0$",
"os_login": "^0$",
"os_run_cmd": "^0$"
@@ -181,17 +123,17 @@
# Run a "shutdown" command on the OS_HOST.
"Host Power Off": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$",
- "host": "^Off$",
+ "host": "^Disabled$",
"os_ping": "^0$",
"os_login": "^0$",
"os_run_cmd": "^0$"
@@ -208,17 +150,17 @@
# to 'PDU AC Cycle (run)'.
"APOR": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
@@ -231,17 +173,17 @@
# Run a "reboot" on the OBMC while host is running.
"OBMC Reboot (run)": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
@@ -250,43 +192,20 @@
"method_type": "keyword",
"method": "BMC Execute Command /sbin/reboot fork=${1}"
},
- # Run a REST "reboot" on the OBMC while host is running.
- "REST OBMC Reboot (run)": {
- "start": {
- "rest": "^1$",
- "chassis": "^On$",
- "host": "^Running$",
- "os_ping": "^1$",
- "os_login": "^1$",
- "os_run_cmd": "^1$"
- },
- "end": {
- "rest": "^1$",
- "chassis": "^On$",
- "host": "^Running$",
- "os_ping": "^1$",
- "os_login": "^1$",
- "os_run_cmd": "^1$"
- },
- "bmc_reboot": 1,
- "method_type": "keyword",
- "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$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
@@ -299,44 +218,28 @@
# Run a "reboot" on the OBMC while host is off.
"OBMC Reboot (off)": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$",
- "host": "^Off$"
+ "host": "^Disabled$"
},
"bmc_reboot": 1,
"method_type": "keyword",
"method": "BMC Execute Command /sbin/reboot fork=${1}"
},
# Run a "reboot" on the OBMC while host is off.
- "REST OBMC Reboot (off)": {
- "start": {
- "rest": "^1$",
- "chassis": "^Off$"
- },
- "end": {
- "rest": "^1$",
- "chassis": "^Off$",
- "host": "^Off$"
- },
- "bmc_reboot": 1,
- "method_type": "keyword",
- "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$",
+ "redfish": "^1$",
"chassis": "^Off$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$",
- "host": "^Off$"
+ "host": "^Disabled$"
},
"bmc_reboot": 1,
"method_type": "keyword",
@@ -346,17 +249,17 @@
# Cycle AC via the PDU while host is off.
"PDU AC Cycle (run)": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
@@ -369,13 +272,13 @@
# Cycle AC via the PDU while host is off.
"PDU AC Cycle (off)": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$",
- "host": "^Off$"
+ "host": "^Disabled$"
},
"bmc_reboot": 1,
"method_type": "keyword",
@@ -386,17 +289,17 @@
# powered on.
"IPMI MC Reset Warm (run)": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
@@ -410,13 +313,13 @@
# powered off.
"IPMI MC Reset Warm (off)": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$",
- "host": "^Off$"
+ "host": "^Disabled$"
},
"bmc_reboot": 1,
"method_type": "keyword",
@@ -427,17 +330,17 @@
# powered on.
"IPMI MC Reset Cold (run)": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
@@ -451,13 +354,13 @@
# powered off.
"IPMI MC Reset Cold (off)": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$",
- "host": "^Off$"
+ "host": "^Disabled$"
},
"bmc_reboot": 1,
"method_type": "keyword",
@@ -468,17 +371,17 @@
# is powered on.
"IPMI Std MC Reset Warm (run)": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
@@ -492,13 +395,13 @@
# is powered off.
"IPMI Std MC Reset Warm (off)": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$",
- "host": "^Off$"
+ "host": "^Disabled$"
},
"bmc_reboot": 1,
"method_type": "keyword",
@@ -509,17 +412,17 @@
# is powered on.
"IPMI Std MC Reset Cold (run)": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
@@ -533,13 +436,13 @@
# is powered off.
"IPMI Std MC Reset Cold (off)": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^Off$",
- "host": "^Off$"
+ "host": "^Disabled$"
},
"bmc_reboot": 1,
"method_type": "keyword",
@@ -552,17 +455,17 @@
# Initiate a power cycle using the IPMI interface (equivalent to off/on).
"IPMI Power Cycle": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
@@ -576,17 +479,17 @@
# Functionally equivalent to "IPMI Power Cycle".
"IPMI Power Reset": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
@@ -599,17 +502,17 @@
# Do an auto reboot by setting auto reboot to "yes" and going to quiesce state.
"Auto Reboot": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
@@ -622,17 +525,17 @@
# Run a "reboot" command on the OS_HOST.
"Host Reboot": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
@@ -645,17 +548,17 @@
# Initiate host reboot using the Redfish API interface (GracefulRestart).
"RF SYS GracefulRestart": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
@@ -668,17 +571,17 @@
# Initiate host reboot using the Redfish API interface (ForceRestart).
"RF SYS ForceRestart": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
@@ -691,17 +594,17 @@
# OPAL Terminate Immediate.
"OPAL TI": {
"start": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
},
"end": {
- "rest": "^1$",
+ "redfish": "^1$",
"chassis": "^On$",
- "host": "^Running$",
+ "host": "^Enabled$",
"os_ping": "^1$",
"os_login": "^1$",
"os_run_cmd": "^1$"
diff --git a/lib/boot_data.py b/lib/boot_data.py
index 7b918fa..f1b7147 100755
--- a/lib/boot_data.py
+++ b/lib/boot_data.py
@@ -53,7 +53,7 @@
boot entries.
"""
if file_path is None:
- if redfish_support_trans_state:
+ if redfish_support_trans_state and platform_arch_type != "x86":
file_path = os.environ.get('BOOT_TABLE_PATH', 'data/boot_table_redfish.json')
elif platform_arch_type == "x86":
file_path = os.environ.get('BOOT_TABLE_PATH', 'data/boot_table_x86.json')
diff --git a/lib/state.py b/lib/state.py
index c715ba0..ea45dd2 100755
--- a/lib/state.py
+++ b/lib/state.py
@@ -261,19 +261,22 @@
# Filter the states based on platform type.
if platform_arch_type == "x86":
- default_req_states.remove("operating_system")
+
+ if not redfish_support_trans_state:
+ default_req_states.remove("operating_system")
+ valid_req_states.remove("operating_system")
+ del default_state["operating_system"]
+ del standby_match_state["operating_system"]
+ del os_running_match_state["operating_system"]
+ del master_os_up_match["operating_system"]
+ del invalid_state_match["operating_system"]
+
default_req_states.remove("boot_progress")
- valid_req_states.remove("operating_system")
valid_req_states.remove("boot_progress")
- del default_state["operating_system"]
del default_state["boot_progress"]
- del standby_match_state["operating_system"]
del standby_match_state["boot_progress"]
- del os_running_match_state["operating_system"]
del os_running_match_state["boot_progress"]
- del master_os_up_match["operating_system"]
del master_os_up_match["boot_progress"]
- del invalid_state_match["operating_system"]
del invalid_state_match["boot_progress"]
@@ -747,9 +750,10 @@
if int(state['redfish']):
state['chassis'] = ret_values['chassis']
- state['boot_progress'] = ret_values['boot_progress']
state['host'] = ret_values['host']
state['bmc'] = ret_values['bmc']
+ if platform_arch_type != "x86":
+ state['boot_progress'] = ret_values['boot_progress']
for sub_state in req_states:
if sub_state in state:
diff --git a/lib/utils.robot b/lib/utils.robot
index a73a56c..0a8f1cf 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -876,7 +876,7 @@
# "State": "StandbyOffline"
# },
- ${chassis}= Redfish.Get Properties /redfish/v1/Chassis/chassis
+ ${chassis}= Redfish.Get Properties /redfish/v1/Chassis/${CHASSIS_ID}
[Return] ${chassis["PowerState"]} ${chassis["Status"]["State"]}
@@ -889,6 +889,10 @@
# },
${boot_progress}= Redfish.Get Properties /redfish/v1/Systems/system/
+
+ Return From Keyword If "${PLATFORM_ARCH_TYPE}" == "x86"
+ ... NA ${boot_progress["Status"]["State"]}
+
[Return] ${boot_progress["BootProgress"]["LastState"]} ${boot_progress["Status"]["State"]}