tests: fix left-over e2fsprogs-tmp files not getting clean up

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>
maint-test
Theodore Ts'o 2014-06-09 10:34:17 -04:00
parent 9e9e7b4a02
commit 358c94ab33
6 changed files with 22 additions and 14 deletions

View 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
}

View 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

View 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

View 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

View 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

View 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