Redfish boot option with IPMI verification
Resolves https://github.com/openbmc/openbmc-test-automation/issues/1666
Change-Id: Ib5cdb425d59bc5844812d88f55be0e8611174b3f
Signed-off-by: Anusha Dathatri <adathatr@in.ibm.com>
diff --git a/redfish/systems/test_boot_devices.robot b/redfish/systems/test_boot_devices.robot
index 2d5b80d..bc1f0fb 100644
--- a/redfish/systems/test_boot_devices.robot
+++ b/redfish/systems/test_boot_devices.robot
@@ -4,11 +4,33 @@
Resource ../../lib/bmc_redfish_resource.robot
Resource ../../lib/common_utils.robot
Resource ../../lib/openbmc_ffdc.robot
+Resource ../../lib/ipmi_client.robot
Test Setup Test Setup Execution
Test Teardown Test Teardown Execution
Suite Teardown Suite Teardown Execution
+*** Variables ***
+# Maps for correlating redfish data values to IPMI data values.
+# The redfish values are obtained with Redfish.Get or Redfish.Get Properties.
+# The corresponding IPMI values are obtained with the "chassis bootparam get
+# 5" IPMI command.
+
+# This dictionary maps the redfish 'BootSourceOverrideEnabled' value to the
+# corresponding IPMI output value.
+&{redfish_ipmi_enabled_map} Once=Options apply to only next boot
+... Continuous=Options apply to all future boots
+... Disabled=Options apply to all future boots
+
+# This dictionary maps the redfish 'BootSourceOverrideTarget' value to the
+# corresponding IPMI output value.
+&{redfish_ipmi_target_map} Hdd=Force Boot from default Hard-Drive
+... Pxe=Force PXE
+... Diags=Force Boot from default Hard-Drive, request Safe-Mode
+... Cd=Force Boot from CD/DVD
+... BiosSetup=Force Boot into BIOS Setup
+... None=No override
+
*** Test Cases ***
Verify BMC Redfish Boot Types With BootSource As Once
@@ -60,6 +82,25 @@
# "Diags",
# "BiosSetup"]}
+ # The values set using Redfish are verified via IPMI using the command:
+ # chassis bootparam get 5
+ # Option 5 returns the boot parameters.
+ #
+ # Sample output:
+ # Boot parameter version: 1
+ # Boot parameter 5 is valid/unlocked
+ # Boot parameter data: c000000000
+ # Boot Flags :
+ # - Boot Flag Valid
+ # - Options apply to all future boots
+ # - BIOS PC Compatible (legacy) boot
+ # - Boot Device Selector : No override
+ # - Console Redirection control : System Default
+ # - BIOS verbosity : Console redirection occurs per BIOS configuration
+ # setting (default)
+ # - BIOS Mux Control Override : BIOS uses recommended setting of the mux at
+ # the end of POST
+
${data}= Create Dictionary BootSourceOverrideEnabled=${override_enabled}
... BootSourceOverrideTarget=${override_target}
${payload}= Create Dictionary Boot=${data}
@@ -71,7 +112,9 @@
... ${override_enabled}
Should Be Equal As Strings ${resp.dict["Boot"]["BootSourceOverrideTarget"]}
... ${override_target}
-
+ ${output}= Run IPMI Standard Command chassis bootparam get 5
+ Should Contain ${output} ${redfish_ipmi_enabled_map['${override_enabled}']}
+ Should Contain ${output} ${redfish_ipmi_target_map['${override_target}']}
Suite Teardown Execution
[Documentation] Do the post suite teardown.
@@ -92,4 +135,3 @@
FFDC On Test Case Fail
Redfish.Logout
-