]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
tests: fix left-over e2fsprogs-tmp files not getting clean up
authorTheodore Ts'o <tytso@mit.edu>
Mon, 9 Jun 2014 14:34:17 +0000 (10:34 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 4 Jul 2014 20:39:49 +0000 (16:39 -0400)
In addition, incorporate the test name into the e2fsprogs-tmp to make
it easier to debug left-over temp files in the future.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
tests/f_mmp/script
tests/f_mmp_garbage/script
tests/m_mmp/script
tests/t_mmp_1on/script
tests/t_mmp_2off/script
tests/test_one.in

index d921672eea1a404a56d15fe56ec698f09baff5fe..9ff16c956f9c8fb8de7cb12718c80d8eef9b37f1 100644 (file)
@@ -1,7 +1,8 @@
 FSCK_OPT=-yf
 
-TMPFILE=$test_name.tmp
-> $TMPFILE
+# use current directory instead of /tmp becase tmpfs doesn't support DIO
+rm -f $TMPFILE
+TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX)
 
 stat -f $TMPFILE | grep -q "Type: tmpfs"
 if [ $? = 0 ]; then
@@ -21,8 +22,8 @@ fi
 
 kill_debugfs() {
        trap 0
-       PID=$(ps -o pid,command | grep -v awk |
-               awk "/debugfs -w $TMPFILE/ { print \$1 }")
+       PID=$(ps -o pid,command | grep -v grep |
+               grep "debugfs -w $TMPFILE" | awk "{ print \$1 }")
        [ "x$PID" != "x" ] && kill -9 $PID
 }
 
index 02cc12a4280b4ad8002d527c35eeae2309e9e5e0..6d451a676c1073c2fc83827e29a9fdf2320fd2b7 100644 (file)
@@ -1,7 +1,8 @@
 FSCK_OPT=-yf
 
-TMPFILE=$test_name.tmp
-> $TMPFILE
+# use current directory instead of /tmp becase tmpfs doesn't support DIO
+rm -f $TMPFILE
+TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX)
 
 stat -f $TMPFILE | grep -q "Type: tmpfs"
 if [ $? = 0 ] ; then
index 02b0b4b84c08d59313514034a4b4063cf646f020..6a9394dee1b8b80a1684572937ab1538f9fb2802 100644 (file)
@@ -2,8 +2,11 @@ DESCRIPTION="enable MMP during mke2fs"
 FS_SIZE=65536
 MKE2FS_DEVICE_SECTSIZE=2048
 export MKE2FS_DEVICE_SECTSIZE
-TMPFILE=$test_name.tmp
-> $TMPFILE
+
+# use current directory instead of /tmp becase tmpfs doesn't support DIO
+rm -f $TMPFILE
+TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX)
+
 stat -f $TMPFILE | grep -q "Type: tmpfs"
 if [ $? = 0 ]; then
        rm -f $TMPFILE
index 8fc8158ff60d23e1d480eb42b8a9fe91701d0d29..cfed2ca8c5b24e31310dac916a5a9d14a6905abc 100644 (file)
@@ -1,7 +1,8 @@
 FSCK_OPT=-yf
 
-TMPFILE=$test_name.tmp
-> $TMPFILE
+# use current directory instead of /tmp becase tmpfs doesn't support DIO
+rm -f $TMPFILE
+TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX)
 
 stat -f $TMPFILE | grep -q "Type: tmpfs"
 if [ $? = 0 ] ; then
index 1dee14ed53ccb9d3baa90541534420e593300055..6556201fa8c48172b56d44d5651c8158c119dbd5 100644 (file)
@@ -1,7 +1,8 @@
 FSCK_OPT=-yf
 
-TMPFILE=$test_name.tmp
-> $TMPFILE
+# use current directory instead of /tmp becase tmpfs doesn't support DIO
+rm -f $TMPFILE
+TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX)
 
 stat -f $TMPFILE | grep -q "Type: tmpfs"
 if [ $? = 0 ]; then
index d053fd71e90e07ca6ba2a935d7d724b68f96af37..01a9260352a2d7b4b1559d067471bd25a33f5b32 100644 (file)
@@ -28,9 +28,10 @@ fi
 
 . $TEST_CONFIG
 
-TMPFILE=$(mktemp -t e2fsprogs-tmp.XXXXXX)
-
 test_name=`echo $test_dir | sed -e 's;.*/;;'`
+
+TMPFILE=$(mktemp -t e2fsprogs-tmp-$test_name.XXXXXX)
+
 if [ -f $test_dir ] ; then
        exit 0;
 fi