Set boot mode default to regular
Needed for CI and CT at the start of the initial setup.
Resolves openbmc/openbmc-test-automation#1062
Change-Id: I726cc4bd9ede9b7002dc8465e509105130e2c97d
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index 90f0cfb..a341459 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -1179,3 +1179,20 @@
${valueDict}= Create Dictionary data=${setting}
Write Attribute ${SENSORS_URI}host/TurboAllowed value data=${valueDict}
+
+
+Set Control Boot Mode
+ [Documentation] Set given boot mode on the boot object path attribute.
+ [Arguments] ${boot_path} ${boot_mode}
+
+ # Description of argument(s):
+ # boot_path Boot object path.
+ # Example:
+ # /xyz/openbmc_project/control/host0/boot
+ # /xyz/openbmc_project/control/host0/boot/one_time
+ # boot_mode Boot mode which need to be set.
+ # Example:
+ # "xyz.openbmc_project.Control.Boot.Mode.Modes.Regular"
+
+ ${valueDict}= Create Dictionary data=${boot_mode}
+ Write Attribute ${boot_path} BootMode data=${valueDict}
diff --git a/tests/__init__.robot b/tests/__init__.robot
index c5c2f99..a5109ae 100644
--- a/tests/__init__.robot
+++ b/tests/__init__.robot
@@ -23,6 +23,12 @@
Run Keyword And Ignore Error Log PNOR Driver Details
Run Keyword And Ignore Error Log BMC Model
Run Keyword And Ignore Error Enable Core Dump On BMC
+ Run Keyword And Ignore Error Set Boot Defaults
+
+Set Boot Defaults
+ Set Control Boot Mode ${CONTROL_HOST_URI}/boot ${BOOT_MODE_REGULAR}
+ Set Control Boot Mode
+ ... ${CONTROL_HOST_URI}/boot/one_time ${BOOT_MODE_REGULAR}
Log BMC Driver Details
[Documentation] Get BMC driver details and log.