Core dump check introduction before and after code update.
This change addresses as follows:
1. Core dump check introduction before and after code update
2. Set core file size to unlimited after code update
Resolves openbmc/openbmc-test-automation#426
Change-Id: Iccaca5e6fc3c7a99b6758a0f44882fe816acc5e3
Signed-off-by: Sivas SRR <sivas.srr@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index a04bc58..487ef5d 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -761,6 +761,25 @@
... echo '/tmp/core_%e.%p' | tee /proc/sys/kernel/core_pattern
Should Be Equal As Strings ${core_pattern} /tmp/core_%e.%p
+Get Number Of BMC Core Dump Files
+ [Documentation] Get number of core dump files on BMC.
+ Open Connection And Log In
+ ${num_of_core_dump}= Execute Command
+ ... ls /tmp/core* 2>/dev/null | wc -l
+ [Return] ${num_of_core_dump}
+
+Set Core Dump File Size Unlimited
+ [Documentation] Set core dump file size to unlimited.
+ Open Connection And Log In
+ Execute Command On BMC
+ ... ulimit -c unlimited
+
+Check For Core Dumps
+ [Documentation] Check for any core dumps exist.
+ ${output}= Get Number Of BMC Core Dump Files
+ Run Keyword If ${output} > 0
+ ... Log **Warning** BMC core dump files exist level=WARN
+
Trigger Host Watchdog Error
[Documentation] Inject host watchdog error using BMC.
[Arguments] ${milliseconds}=1000 ${sleep_time}=5s