lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 10 Oct 2017 16:39:52 -0600
From:   Andreas Dilger <adilger@...ger.ca>
To:     tytso@....edu
Cc:     linux-ext4@...r.kernel.org, Andreas Dilger <adilger@...ger.ca>
Subject: [PATCH] tests: don't leave temporary files at end of test

Don't leave temp files around after test has completed successfully.
Some test scripts were creating their own temporary files, and in
some cases test_one was skipping a test completely (e.g. slow) after
the temp file had been created.

Signed-off-by: Andreas Dilger <adilger@...ger.ca>
---
 tests/d_fallocate/script          | 2 +-
 tests/d_fallocate_bigalloc/script | 2 +-
 tests/d_xattr_edits/script        | 2 +-
 tests/test_one.in                 | 6 +++---
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/d_fallocate/script b/tests/d_fallocate/script
index ae8956e..b3982a3 100644
--- a/tests/d_fallocate/script
+++ b/tests/d_fallocate/script
@@ -165,8 +165,8 @@ if [ "$status" = 0 ] ; then
 else
 	echo "$test_name: $test_description: failed"
 	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
-	rm -f $test_name.tmp
 fi
+rm -f $EXP
 
 unset IMAGE FSCK_OPT OUT EXP
 
diff --git a/tests/d_fallocate_bigalloc/script b/tests/d_fallocate_bigalloc/script
index 6b6bf97..9022a2b 100644
--- a/tests/d_fallocate_bigalloc/script
+++ b/tests/d_fallocate_bigalloc/script
@@ -166,8 +166,8 @@ if [ "$status" = 0 ] ; then
 else
 	echo "$test_name: $test_description: failed"
 	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
-	rm -f $test_name.tmp
 fi
+rm -f $EXP
 
 unset IMAGE FSCK_OPT OUT EXP
 
diff --git a/tests/d_xattr_edits/script b/tests/d_xattr_edits/script
index df2a530..cd9d039 100644
--- a/tests/d_xattr_edits/script
+++ b/tests/d_xattr_edits/script
@@ -122,7 +122,7 @@ sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 # Do the verification
 #
 
-rm -f $TMPFILE $OUT.new
+rm -f $TMPFILE $OUT.new $TEST_DATA $VERIFY_DATA
 cmp -s $OUT $EXP
 status=$?
 
diff --git a/tests/test_one.in b/tests/test_one.in
index 9bf1185..c1f18dc 100644
--- a/tests/test_one.in
+++ b/tests/test_one.in
@@ -36,9 +36,6 @@ fi
 
 test_name=`echo $test_dir | sed -e 's;.*/;;'`
 
-TMPFILE=$(mktemp ${TMPDIR:-/tmp}/e2fsprogs-tmp-$test_name.XXXXXX)
-trap 'rm -f $TMPFILE ; exit' 1 2 15
-
 if [ -f $test_dir ] ; then
 	exit 0;
 fi
@@ -63,6 +60,9 @@ fi
 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
+
 start=$SECONDS
 if [ -f $test_dir/script ]; then
 	. $test_dir/script
-- 
1.8.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ