diff options
author | Theodore Ts'o <tytso@mit.edu> | 2014-06-09 10:34:17 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-07-04 16:39:49 -0400 |
commit | 358c94ab3375be1a32851437c69b5842a7aea8a4 (patch) | |
tree | 7e29823156ba40f29389d5467ee405c028035cd5 /tests | |
parent | 9e9e7b4a027d3ce247a01e6151f7d1536b8b188f (diff) | |
download | e2fsprogs-358c94ab3375be1a32851437c69b5842a7aea8a4.tar.gz |
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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/f_mmp/script | 9 | ||||
-rw-r--r-- | tests/f_mmp_garbage/script | 5 | ||||
-rw-r--r-- | tests/m_mmp/script | 7 | ||||
-rw-r--r-- | tests/t_mmp_1on/script | 5 | ||||
-rw-r--r-- | tests/t_mmp_2off/script | 5 | ||||
-rw-r--r-- | tests/test_one.in | 5 |
6 files changed, 22 insertions, 14 deletions
diff --git a/tests/f_mmp/script b/tests/f_mmp/script index d921672e..9ff16c95 100644 --- a/tests/f_mmp/script +++ b/tests/f_mmp/script @@ -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 } diff --git a/tests/f_mmp_garbage/script b/tests/f_mmp_garbage/script index 02cc12a4..6d451a67 100644 --- a/tests/f_mmp_garbage/script +++ b/tests/f_mmp_garbage/script @@ -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 diff --git a/tests/m_mmp/script b/tests/m_mmp/script index 02b0b4b8..6a9394de 100644 --- a/tests/m_mmp/script +++ b/tests/m_mmp/script @@ -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 diff --git a/tests/t_mmp_1on/script b/tests/t_mmp_1on/script index 8fc8158f..cfed2ca8 100644 --- a/tests/t_mmp_1on/script +++ b/tests/t_mmp_1on/script @@ -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 diff --git a/tests/t_mmp_2off/script b/tests/t_mmp_2off/script index 1dee14ed..6556201f 100644 --- a/tests/t_mmp_2off/script +++ b/tests/t_mmp_2off/script @@ -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 diff --git a/tests/test_one.in b/tests/test_one.in index d053fd71..01a92603 100644 --- a/tests/test_one.in +++ b/tests/test_one.in @@ -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 |