diff mbox series

[02/10] tests: don't unlink test image if SKIP_UNLINK set

Message ID 1525235166-6448-3-git-send-email-adilger@dilger.ca
State Accepted, archived
Headers show
Series test cleanups and minor improvements | expand

Commit Message

Andreas Dilger May 2, 2018, 4:25 a.m. UTC
Don't register a trap to unlink $TMPFILE at the test exit if
SKIP_UNLINK is set.  Otherwise, this makes it difficult to
debug a failing test.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
---
 tests/test_one.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Theodore Ts'o June 22, 2018, 3:42 p.m. UTC | #1
On Tue, May 01, 2018 at 10:25:58PM -0600, Andreas Dilger wrote:
> Don't register a trap to unlink $TMPFILE at the test exit if
> SKIP_UNLINK is set.  Otherwise, this makes it difficult to
> debug a failing test.
> 
> Signed-off-by: Andreas Dilger <adilger@dilger.ca>

Applied, thanks.

					- Ted
diff mbox series

Patch

diff --git a/tests/test_one.in b/tests/test_one.in
index c1f18dc..664cf86 100644
--- a/tests/test_one.in
+++ b/tests/test_one.in
@@ -61,7 +61,7 @@  rm -f $test_name.ok $test_name.failed
 #echo -e -n "$test_name: $test_description:\r"
 
 TMPFILE=$(mktemp ${TMPDIR:-/tmp}/e2fsprogs-tmp-$test_name.XXXXXX)
-trap 'rm -f $TMPFILE ; exit' 1 2 15
+[ "$SKIP_UNLINK" != "true" ] && trap 'rm -f $TMPFILE ; exit' 1 2 15
 
 start=$SECONDS
 if [ -f $test_dir/script ]; then