Allow boot_utils users to pass stack_mode/quiet.
Where at one time users had to do this:
Set Global Variable ${stack_mode} skip
Set Global Variable ${quiet} ${1}
REST Power On
They may now do this:
REST Power On stack_mode=skip quiet=1
Change-Id: I53d34a591a529d890e85b3f7b23a322d2f26e7e2
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/extended/obmc_boot_test_resource.robot b/extended/obmc_boot_test_resource.robot
index 6c64da8..9bfc8b3 100644
--- a/extended/obmc_boot_test_resource.robot
+++ b/extended/obmc_boot_test_resource.robot
@@ -6,6 +6,7 @@
Library ../lib/state.py
Library ../lib/obmc_boot_test.py
+Library Collections
*** Variables ***
# Initialize program parameters variables.
@@ -69,12 +70,15 @@
###############################################################################
OBMC Boot Test
[Teardown] OBMC Boot Test Teardown
- [Arguments] @{arguments}
+ [Arguments] ${pos_arg1}=${EMPTY} &{arguments}
# Note: If I knew how to specify a keyword teardown in python, I would
# rename the "OBMC Boot Test Py" python function to "OBMC Boot Test" and
# do away with this robot keyword.
- OBMC Boot Test Py @{arguments}
+ Run Keyword If '${pos_arg1}' != '${EMPTY}'
+ ... Set To Dictionary ${arguments} loc_boot_stack=${pos_arg1}
+
+ OBMC Boot Test Py &{arguments}
###############################################################################
diff --git a/lib/boot_utils.robot b/lib/boot_utils.robot
index e5d52a5..f7ae504 100644
--- a/lib/boot_utils.robot
+++ b/lib/boot_utils.robot
@@ -8,8 +8,28 @@
###############################################################################
REST Power On
[Documentation] Do "REST Power On" boot test.
+ [Arguments] ${stack_mode}=${stack_mode} ${quiet}=${quiet}
- Run Key U OBMC Boot Test \ REST Power On
+ # 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=REST Power On
+ ... \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+ Run Key U ${cmd_buf}
###############################################################################
@@ -17,8 +37,28 @@
###############################################################################
IPMI Power On
[Documentation] Do "IPMI Power On" boot test.
+ [Arguments] ${stack_mode}=${stack_mode} ${quiet}=${quiet}
- Run Key U OBMC Boot Test \ IPMI Power On
+ # 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=IPMI Power On
+ ... \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+ Run Key U ${cmd_buf}
###############################################################################
@@ -26,8 +66,28 @@
###############################################################################
REST Power Off
[Documentation] Do "REST Power Off" boot test.
+ [Arguments] ${stack_mode}=${stack_mode} ${quiet}=${quiet}
- Run Key U OBMC Boot Test \ REST Power Off
+ # 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=REST Power Off
+ ... \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+ Run Key U ${cmd_buf}
###############################################################################
@@ -35,8 +95,28 @@
###############################################################################
IPMI Power Off
[Documentation] Do "IPMI Power Off" boot test.
+ [Arguments] ${stack_mode}=${stack_mode} ${quiet}=${quiet}
- Run Key U OBMC Boot Test \ IPMI Power Off
+ # 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=IPMI Power Off
+ ... \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+ Run Key U ${cmd_buf}
###############################################################################
@@ -44,8 +124,28 @@
###############################################################################
IPMI Power Soft
[Documentation] Do "IPMI Power Soft" boot test.
+ [Arguments] ${stack_mode}=${stack_mode} ${quiet}=${quiet}
- Run Key U OBMC Boot Test \ IPMI Power Soft
+ # 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=IPMI Power Soft
+ ... \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+ Run Key U ${cmd_buf}
###############################################################################
@@ -53,8 +153,28 @@
###############################################################################
Host Power Off
[Documentation] Do "Host Power Off" boot test.
+ [Arguments] ${stack_mode}=${stack_mode} ${quiet}=${quiet}
- Run Key U OBMC Boot Test \ Host Power Off
+ # 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=Host Power Off
+ ... \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+ Run Key U ${cmd_buf}
###############################################################################
@@ -62,8 +182,28 @@
###############################################################################
APOR
[Documentation] Do "APOR" boot test.
+ [Arguments] ${stack_mode}=${stack_mode} ${quiet}=${quiet}
- Run Key U OBMC Boot Test \ APOR
+ # 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=APOR
+ ... \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+ Run Key U ${cmd_buf}
###############################################################################
@@ -71,8 +211,28 @@
###############################################################################
OBMC Reboot (run)
[Documentation] Do "OBMC Reboot (run)" boot test.
+ [Arguments] ${stack_mode}=${stack_mode} ${quiet}=${quiet}
- Run Key U OBMC Boot Test \ OBMC Reboot (run)
+ # 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=OBMC Reboot (run)
+ ... \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+ Run Key U ${cmd_buf}
###############################################################################
@@ -80,8 +240,28 @@
###############################################################################
OBMC Reboot (off)
[Documentation] Do "OBMC Reboot (off)" boot test.
+ [Arguments] ${stack_mode}=${stack_mode} ${quiet}=${quiet}
- Run Key U OBMC Boot Test \ OBMC Reboot (off)
+ # 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=OBMC Reboot (off)
+ ... \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+ Run Key U ${cmd_buf}
###############################################################################
@@ -89,8 +269,28 @@
###############################################################################
PDU AC Cycle (run)
[Documentation] Do "PDU AC Cycle (run)" boot test.
+ [Arguments] ${stack_mode}=${stack_mode} ${quiet}=${quiet}
- Run Key U OBMC Boot Test \ PDU AC Cycle (run)
+ # 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=PDU AC Cycle (run)
+ ... \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+ Run Key U ${cmd_buf}
###############################################################################
@@ -98,8 +298,28 @@
###############################################################################
PDU AC Cycle (off)
[Documentation] Do "PDU AC Cycle (off)" boot test.
+ [Arguments] ${stack_mode}=${stack_mode} ${quiet}=${quiet}
- Run Key U OBMC Boot Test \ PDU AC Cycle (off)
+ # 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=PDU AC Cycle (off)
+ ... \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+ Run Key U ${cmd_buf}
###############################################################################
@@ -107,8 +327,29 @@
###############################################################################
IPMI MC Reset Warm (run)
[Documentation] Do "IPMI MC Reset Warm (run)" boot test.
+ [Arguments] ${stack_mode}=${stack_mode} ${quiet}=${quiet}
- Run Key U OBMC Boot Test \ IPMI MC Reset Warm (run)
+ # 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=IPMI MC Reset Warm (run)
+ ... \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+ Run Key U ${cmd_buf}
###############################################################################
@@ -116,8 +357,29 @@
###############################################################################
IPMI MC Reset Warm (off)
[Documentation] Do "IPMI MC Reset Warm (off)" boot test.
+ [Arguments] ${stack_mode}=${stack_mode} ${quiet}=${quiet}
- Run Key U OBMC Boot Test \ IPMI MC Reset Warm (off)
+ # 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=IPMI MC Reset Warm (off)
+ ... \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+ Run Key U ${cmd_buf}
###############################################################################
@@ -125,8 +387,28 @@
###############################################################################
IPMI Power Cycle
[Documentation] Do "IPMI Power Cycle" boot test.
+ [Arguments] ${stack_mode}=${stack_mode} ${quiet}=${quiet}
- Run Key U OBMC Boot Test \ IPMI Power Cycle
+ # 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=IPMI Power Cycle
+ ... \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+ Run Key U ${cmd_buf}
###############################################################################
@@ -134,8 +416,28 @@
###############################################################################
IPMI Power Reset
[Documentation] Do "IPMI Power Reset" boot test.
+ [Arguments] ${stack_mode}=${stack_mode} ${quiet}=${quiet}
- Run Key U OBMC Boot Test \ IPMI Power Reset
+ # 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=IPMI Power Reset
+ ... \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+ Run Key U ${cmd_buf}
###############################################################################
@@ -143,8 +445,28 @@
###############################################################################
Auto Reboot
[Documentation] Do "Auto Reboot" boot test.
+ [Arguments] ${stack_mode}=${stack_mode} ${quiet}=${quiet}
- Run Key U OBMC Boot Test \ Auto Reboot
+ # 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=Auto Reboot
+ ... \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+ Run Key U ${cmd_buf}
###############################################################################
@@ -152,8 +474,28 @@
###############################################################################
Host Reboot
[Documentation] Do "Host Reboot" boot test.
+ [Arguments] ${stack_mode}=${stack_mode} ${quiet}=${quiet}
- Run Key U OBMC Boot Test \ Host Reboot
+ # 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=Host Reboot
+ ... \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
+ Run Key U ${cmd_buf}
###############################################################################
diff --git a/lib/obmc_boot_test.py b/lib/obmc_boot_test.py
index 265d7ee..4ee66d1 100755
--- a/lib/obmc_boot_test.py
+++ b/lib/obmc_boot_test.py
@@ -25,6 +25,7 @@
import gen_cmd as gc
import gen_robot_keyword as grk
import state as st
+import var_stack as vs
base_path = os.path.dirname(os.path.dirname(
imp.find_module("gen_robot_print")[1])) +\
@@ -63,6 +64,8 @@
ffdc_prefix = ""
boot_start_time = ""
boot_end_time = ""
+save_stack = vs.var_stack('save_stack')
+main_func_parm_list = ['boot_stack', 'stack_mode', 'quiet']
###############################################################################
@@ -133,6 +136,7 @@
else:
sub_cmd = "BuiltIn().get_variable_value(\"${" + parm + "}\")"
cmd_buf = "global " + parm + " ; " + parm + " = " + sub_cmd
+ gp.dpissuing(cmd_buf)
exec(cmd_buf)
if re.match(r".*_host$", parm):
cmd_buf = "process_host(" + parm + ", '" + parm + "')"
@@ -502,14 +506,14 @@
else:
if st.compare_states(state, boot_table[boot_candidate]['end']):
if not skip_boot_printed:
- gp.print_var(stack_mode)
- gp.printn()
- gp.print_timen("Skipping the following boot tests" +
- " which are unnecessary since their" +
- " required end states match the" +
- " current machine state:")
+ gp.qprint_var(stack_mode)
+ gp.qprintn()
+ gp.qprint_timen("Skipping the following boot tests" +
+ " which are unnecessary since their" +
+ " required end states match the" +
+ " current machine state:")
skip_boot_printed = 1
- gp.print_var(boot_candidate)
+ gp.qprint_var(boot_candidate)
boot_candidate = ""
if boot_candidate == "":
gp.qprint_dashes()
@@ -527,8 +531,8 @@
gp.qprint_timen("The machine state does not match the required" +
" starting state for a '" + boot_candidate +
"' boot test:")
- gp.print_varx("boot_table[" + boot_candidate + "][start]",
- boot_table[boot_candidate]['start'], 1)
+ gp.qprint_varx("boot_table[" + boot_candidate + "][start]",
+ boot_table[boot_candidate]['start'], 1)
boot_stack.append(boot_candidate)
popped_boot = boot_candidate
@@ -633,7 +637,7 @@
gp.qprintn("Copy this data to the defect:\n")
if len(more_header_info) > 0:
- gp.printn(more_header_info)
+ gp.qprintn(more_header_info)
gp.qpvars(host_name, host_ip, openbmc_nickname, openbmc_host,
openbmc_host_name, openbmc_ip, openbmc_username,
openbmc_password, os_host, os_host_name, os_ip, os_username,
@@ -658,7 +662,7 @@
gp.qprintn()
if len(ffdc_summary_info) > 0:
- gp.printn(ffdc_summary_info)
+ gp.qprintn(ffdc_summary_info)
gp.qprint_dashes(0, 90, 1, "=")
@@ -687,7 +691,7 @@
" ffdc_function_list=" +
ffdc_function_list, ignore=1)
if status != 'PASS':
- gp.print_error("Call to ffdc failed.\n")
+ gp.qprint_error("Call to ffdc failed.\n")
my_get_state()
@@ -833,12 +837,12 @@
gp.qprintn()
if boot_status == "PASS":
boot_success = 1
- completion_msg = gp.sprint_time("BOOT_SUCCESS: \"" + next_boot +
- "\" succeeded.")
+ completion_msg = gp.sprint_timen("BOOT_SUCCESS: \"" + next_boot +
+ "\" succeeded.")
else:
boot_success = 0
- completion_msg = gp.sprint_time("BOOT_FAILED: \"" + next_boot +
- "\" failed.")
+ completion_msg = gp.sprint_timen("BOOT_FAILED: \"" + next_boot +
+ "\" failed.")
# Set boot_end_time for use by plug-ins.
boot_end_time = completion_msg[1:33]
@@ -861,7 +865,7 @@
if boot_status != "PASS" or ffdc_check == "All" or shell_rc == 0x00000200:
status, ret_values = grk.run_key_u("my_ffdc", ignore=1)
if status != 'PASS':
- gp.print_error("Call to my_ffdc failed.\n")
+ gp.qprint_error("Call to my_ffdc failed.\n")
# We need to purge error logs between boots or they build up.
grk.run_key("Delete Error logs", ignore=1)
@@ -904,6 +908,24 @@
pickle.dump(boot_results, open(boot_results_file_path, 'wb'),
pickle.HIGHEST_PROTOCOL)
+ global save_stack
+ # Restore any global values saved on the save_stack.
+ for parm_name in main_func_parm_list:
+ # Get the parm_value if it was saved on the stack.
+ try:
+ parm_value = save_stack.pop(parm_name)
+ except:
+ # If it was not saved, no further action is required.
+ continue
+
+ # Restore the saved value.
+ cmd_buf = "BuiltIn().set_global_variable(\"${" + parm_name +\
+ "}\", parm_value)"
+ gp.dpissuing(cmd_buf)
+ exec(cmd_buf)
+
+ gp.dprintn(save_stack.sprint_obj())
+
###############################################################################
@@ -925,14 +947,45 @@
###############################################################################
-def obmc_boot_test_py(alt_boot_stack=None):
+def obmc_boot_test_py(loc_boot_stack=None,
+ loc_stack_mode=None,
+ loc_quiet=None):
r"""
Do main program processing.
"""
- if alt_boot_stack is not None:
- BuiltIn().set_global_variable("${boot_stack}", alt_boot_stack)
+ global save_stack
+
+ # Process function parms.
+ for parm_name in main_func_parm_list:
+ # Get parm's value.
+ cmd_buf = "parm_value = loc_" + parm_name
+ exec(cmd_buf)
+ gp.dpvar(parm_name)
+ gp.dpvar(parm_value)
+
+ if parm_value is None:
+ # Parm was not specified by the calling function so set it to its
+ # corresponding global value.
+ cmd_buf = "loc_" + parm_name + " = BuiltIn().get_variable_value" +\
+ "(\"${" + parm_name + "}\")"
+ gp.dpissuing(cmd_buf)
+ exec(cmd_buf)
+ else:
+ # Save the global value on a stack.
+ cmd_buf = "save_stack.push(BuiltIn().get_variable_value(\"${" +\
+ parm_name + "}\"), \"" + parm_name + "\")"
+ gp.dpissuing(cmd_buf)
+ exec(cmd_buf)
+
+ # Set the global value to the passed value.
+ cmd_buf = "BuiltIn().set_global_variable(\"${" + parm_name +\
+ "}\", loc_" + parm_name + ")"
+ gp.dpissuing(cmd_buf)
+ exec(cmd_buf)
+
+ gp.dprintn(save_stack.sprint_obj())
setup()