Added check for no dump in progress before deleting all dumps.
Resolves openbmc/openbmc-test-automation#1057
Change-Id: Ied4a0857092bff09c0ab284c988d65fe14220644
Signed-off-by: Rahul Maheshwari <rahulmaheshwari@in.ibm.com>
diff --git a/lib/dump_utils.robot b/lib/dump_utils.robot
index 6af6189..ccfaac0 100644
--- a/lib/dump_utils.robot
+++ b/lib/dump_utils.robot
@@ -24,6 +24,15 @@
[Return] ${dump_id}
+Verify No Dump In Progress
+ [Documentation] Verify no dump in progress.
+
+ ${dump_progress} ${stderr} ${rc}= BMC Execute Command
+ ... [ -d /tmp/obmcdump* ] && echo 'In Progress' || echo 'No Progress'
+
+ Should Be Equal As Strings ${dump_progress} No Progress
+
+
Check Dump Existence
[Documentation] Verify if given dump exist.
[Arguments] ${dump_id}
diff --git a/tests/test_bmc_dump.robot b/tests/test_bmc_dump.robot
index bfe48ee..cd506e9 100644
--- a/tests/test_bmc_dump.robot
+++ b/tests/test_bmc_dump.robot
@@ -31,7 +31,6 @@
Create User Initiated Dump
-
Verify Dump Persistency On Service Restart
[Documentation] Create user dump, restart BMC service and verify dump
... persistency.
@@ -135,6 +134,8 @@
Post Testcase Execution
[Documentation] Do the post test teardown.
+ Wait Until Keyword Succeeds 3 min 15 sec Verify No Dump In Progress
+
Delete All BMC Dump
FFDC On Test Case Fail
Close All Connections