Made deletion of errlogs optional with default of ${0}.

Resolves https://github.com/openbmc/openbmc-test-automation/issues/987

Change-Id: Iadc017592267088fff1d65d1cd419a151dd23705
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 9bfc8b3..732c214 100644
--- a/extended/obmc_boot_test_resource.robot
+++ b/extended/obmc_boot_test_resource.robot
@@ -19,7 +19,7 @@
 ...  plug_in_dir_paths  status_file_path  openbmc_model  boot_pass  boot_fail
 ...  ffdc_dir_path_style  ffdc_check  ffdc_only  ffdc_function_list
 ...  state_change_timeout  power_on_timeout  power_off_timeout
-...  boot_fail_threshold  test_mode  quiet  debug
+...  boot_fail_threshold  delete_errlogs  test_mode  quiet  debug
 
 # Initialize each program parameter.
 ${openbmc_host}             ${EMPTY}
@@ -57,6 +57,7 @@
 # If the number of boot failures, exceeds boot_fail_threshold, this program
 # returns non-zero.
 ${boot_fail_threshold}      ${0}
+${delete_errlogs}           ${0}
 ${test_mode}                0
 ${quiet}                    0
 ${debug}                    0
diff --git a/lib/obmc_boot_test.py b/lib/obmc_boot_test.py
index 578e7eb..8c76f84 100755
--- a/lib/obmc_boot_test.py
+++ b/lib/obmc_boot_test.py
@@ -129,7 +129,8 @@
     parm_list = BuiltIn().get_variable_value("${parm_list}")
     # The following subset of parms should be processed as integers.
     int_list = ['max_num_tests', 'boot_pass', 'boot_fail', 'ffdc_only',
-                'boot_fail_threshold', 'quiet', 'test_mode', 'debug']
+                'boot_fail_threshold', 'delete_errlogs', 'quiet', 'test_mode',
+                'debug']
     for parm in parm_list:
         if parm in int_list:
             sub_cmd = "int(BuiltIn().get_variable_value(\"${" + parm +\
@@ -887,8 +888,9 @@
         if status != 'PASS':
             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)
+    if delete_errlogs:
+        # We need to purge error logs between boots or they build up.
+        grk.run_key("Delete Error logs", ignore=1)
 
     boot_results.print_report()
     gp.qprint_timen("Finished boot " + str(boot_count) + ".")