Add plug-in "Running" output lines to last 10 boots
Made code changes to improve the defect report output by adding
"Running" plug-in output to "Last 10 boots" report as in the example
below.
-------------------------------------------------------------
Last 10 boots:
(CDT) 2018/10/30 12:40:38 - Doing "REST Power Off".
(CDT) 2018/10/30 12:40:44 - Running OBMC_Sample/cp_post_stack
-------------------------------------------------------------
Change-Id: Ifc3d4478a0642497d2cf8003b5787e35ccb3f05d
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/lib/obmc_boot_test.py b/lib/obmc_boot_test.py
index 24416df..11e9b0e 100755
--- a/lib/obmc_boot_test.py
+++ b/lib/obmc_boot_test.py
@@ -47,6 +47,8 @@
valid_boot_types = create_valid_boot_list(boot_table)
boot_lists = read_boot_lists()
+# The maximum number of entries that can be in the last_ten global variable.
+max_boot_history = 10
last_ten = []
state = st.return_state_constant('default_state')
@@ -741,8 +743,8 @@
last_ten.append(doing_msg)
- if len(last_ten) > 10:
- del last_ten[0]
+ # Trim list to max number of entries.
+ del last_ten[:max(0, len(last_ten) - max_boot_history)]
def run_boot(boot):
@@ -966,15 +968,23 @@
# For the purposes of the following plug-ins, mark the "boot" as a success.
boot_success = 1
plug_in_setup()
- rc, shell_rc, failed_plug_in_name = grpi.rprocess_plug_in_packages(
- call_point='post_stack', stop_on_plug_in_failure=0)
+ rc, shell_rc, failed_plug_in_name, history =\
+ grpi.rprocess_plug_in_packages(call_point='post_stack',
+ stop_on_plug_in_failure=0,
+ return_history=True)
+ last_ten.extend(history)
+ # Trim list to max number of entries.
+ del last_ten[:max(0, len(last_ten) - max_boot_history)]
+ if rc != 0:
+ boot_success = 0
plug_in_setup()
- if rc == 0:
- rc, shell_rc, failed_plug_in_name = grpi.rprocess_plug_in_packages(
- call_point='ffdc_check', shell_rc=dump_ffdc_rc(),
- stop_on_plug_in_failure=1, stop_on_non_zero_rc=1)
- if rc != 0 or shell_rc == dump_ffdc_rc():
+ rc, shell_rc, failed_plug_in_name =\
+ grpi.rprocess_plug_in_packages(call_point='ffdc_check',
+ shell_rc=dump_ffdc_rc(),
+ stop_on_plug_in_failure=1,
+ stop_on_non_zero_rc=1)
+ if shell_rc == dump_ffdc_rc():
status, ret_values = grk.run_key_u("my_ffdc", ignore=1)
if status != 'PASS':
gp.qprint_error("Call to my_ffdc failed.\n")