aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2011-07-09 12:08:10 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-07-09 12:08:10 -0400
commitb4db1e4c7461a50e18c9fd135b9f1ba6f27e4390 (patch)
tree81789569aecb98c46a1e815461f946245c835241 /tests
parent0bd0e5932046401049502ee99529b984d7cd316e (diff)
downloade2fsprogs-b4db1e4c7461a50e18c9fd135b9f1ba6f27e4390.tar.gz
e2fsprogs-b4db1e4c7461a50e18c9fd135b9f1ba6f27e4390.tar.xz
e2fsprogs-b4db1e4c7461a50e18c9fd135b9f1ba6f27e4390.zip
tests: use /tmp for scratch files
The /tmp directory is often a memory based file system, and using this can speed up running the regression test suite. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'tests')
-rw-r--r--tests/d_loaddump/expect6
-rw-r--r--tests/d_loaddump/script6
-rw-r--r--tests/f_crashdisk/expect.12
-rw-r--r--tests/f_resize_inode/expect10
-rw-r--r--tests/f_resize_inode/script10
-rw-r--r--tests/m_mkfs_overhead/expect.110
-rw-r--r--tests/m_mkfs_overhead/script32
-rw-r--r--tests/r_inline_xattr/expect10
-rw-r--r--tests/r_inline_xattr/script8
-rw-r--r--tests/r_move_itable/expect16
-rw-r--r--tests/r_move_itable/script12
-rw-r--r--tests/r_resize_inode/expect12
-rw-r--r--tests/r_resize_inode/script9
-rw-r--r--tests/run_e2fsck6
-rw-r--r--tests/test_config1
-rw-r--r--tests/test_script.in2
-rw-r--r--tests/u_mke2fs/script4
-rw-r--r--tests/u_tune2fs/script4
18 files changed, 94 insertions, 66 deletions
diff --git a/tests/d_loaddump/expect b/tests/d_loaddump/expect
index f66e2183..e142eac3 100644
--- a/tests/d_loaddump/expect
+++ b/tests/d_loaddump/expect
@@ -1,7 +1,7 @@
debugfs load/dump test
-mke2fs -Fq -b 1024 ./test.img 512
+mke2fs -Fq -b 1024 test.img 512
Exit status is 0
-debugfs -R ''write test.data test_data'' -w ./test.img
+debugfs -R ''write test.data test_data'' -w test.img
Allocated inode: 12
Exit status is 0
e2fsck -yf -N test_filesys
@@ -12,7 +12,7 @@ Pass 4: Checking reference counts
Pass 5: Checking group summary information
test_filesys: 12/64 files (0.0% non-contiguous), 158/512 blocks
Exit status is 0
-debugfs -R ''dump test_data test.verify'' ./test.img
+debugfs -R ''dump test_data test.verify'' test.img
Exit status is 0
cmp test.data test.verify
Exit status is 0
diff --git a/tests/d_loaddump/script b/tests/d_loaddump/script
index 3ac1f800..598f6656 100644
--- a/tests/d_loaddump/script
+++ b/tests/d_loaddump/script
@@ -9,7 +9,7 @@ echo "debugfs load/dump test" > $OUT
dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
-echo "mke2fs -Fq -b 1024 $TMPFILE 512" >> $OUT
+echo "mke2fs -Fq -b 1024 test.img 512" >> $OUT
$MKE2FS -Fq $TMPFILE 512 > /dev/null 2>&1
status=$?
@@ -18,7 +18,7 @@ echo Exit status is $status >> $OUT
dd if=$TEST_BITS of=$TEST_DATA bs=128k count=1 conv=sync > /dev/null 2>&1
echo "file fragment odd size" >> $TEST_DATA
-echo "debugfs -R ''write $TEST_DATA test_data'' -w $TMPFILE" > $OUT.new
+echo "debugfs -R ''write $TEST_DATA test_data'' -w test.img" > $OUT.new
$DEBUGFS -R "write $TEST_DATA test_data" -w $TMPFILE >> $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
@@ -30,7 +30,7 @@ status=$?
echo Exit status is $status >> $OUT.new
sed -e '2d' $OUT.new >> $OUT
-echo "debugfs -R ''dump test_data $VERIFY_DATA'' $TMPFILE" > $OUT.new
+echo "debugfs -R ''dump test_data $VERIFY_DATA'' test.img" > $OUT.new
$DEBUGFS -R "dump test_data $VERIFY_DATA" $TMPFILE >> $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
diff --git a/tests/f_crashdisk/expect.1 b/tests/f_crashdisk/expect.1
index b6fd71a8..132d49af 100644
--- a/tests/f_crashdisk/expect.1
+++ b/tests/f_crashdisk/expect.1
@@ -1,5 +1,5 @@
../e2fsck/e2fsck: Superblock invalid, trying backup blocks...
-../e2fsck/e2fsck: The ext2 superblock is corrupt while trying to open ./test.img
+../e2fsck/e2fsck: The ext2 superblock is corrupt while trying to open test.img
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
diff --git a/tests/f_resize_inode/expect b/tests/f_resize_inode/expect
index 965819a9..a396927c 100644
--- a/tests/f_resize_inode/expect
+++ b/tests/f_resize_inode/expect
@@ -27,7 +27,7 @@ test_filesys: 11/4096 files (0.0% non-contiguous), 2107/16384 blocks
Exit status is 0
-----------------------------------------------
-debugfs -R ''set_inode_field <7> block[2] 42'' -w ./test.img
+debugfs -R ''set_inode_field <7> block[2] 42'' -w test.img
Exit status is 0
Resize inode not valid. Recreate? yes
@@ -55,7 +55,7 @@ test_filesys: 11/4096 files (0.0% non-contiguous), 2107/16384 blocks
Exit status is 0
-----------------------------------------------
-debugfs -R ''clri <7>'' -w ./test.img
+debugfs -R ''clri <7>'' -w test.img
Exit status is 0
Resize inode not valid. Recreate? yes
@@ -83,7 +83,7 @@ test_filesys: 11/4096 files (0.0% non-contiguous), 2107/16384 blocks
Exit status is 0
-----------------------------------------------
-debugfs -R ''set_inode_field <7> bmap[524] 57'' -w ./test.img
+debugfs -R ''set_inode_field <7> bmap[524] 57'' -w test.img
Exit status is 0
Resize inode not valid. Recreate? yes
@@ -111,7 +111,7 @@ test_filesys: 11/4096 files (0.0% non-contiguous), 2107/16384 blocks
Exit status is 0
-----------------------------------------------
-debugfs -R ''set_super_value reserved_gdt_blocks 15679'' -w ./test.img
+debugfs -R ''set_super_value reserved_gdt_blocks 15679'' -w test.img
Exit status is 0
../e2fsck/e2fsck: Group descriptors look bad... trying backup blocks...
Pass 1: Checking inodes, blocks, and sizes
@@ -125,7 +125,7 @@ test_filesys: 11/4096 files (0.0% non-contiguous), 2107/16384 blocks
Exit status is 1
-----------------------------------------------
-debugfs -R ''set_super_value reserved_gdt_blocks 32'' -w ./test.img
+debugfs -R ''set_super_value reserved_gdt_blocks 32'' -w test.img
Exit status is 0
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
diff --git a/tests/f_resize_inode/script b/tests/f_resize_inode/script
index 75d90fee..327f41ba 100644
--- a/tests/f_resize_inode/script
+++ b/tests/f_resize_inode/script
@@ -26,7 +26,7 @@ rm -f $OUT.new
echo ----------------------------------------------- >> $OUT
echo " " >> $OUT
-echo "debugfs -R ''set_inode_field <7> block[2] 42'' -w $TMPFILE" > $OUT.new
+echo "debugfs -R ''set_inode_field <7> block[2] 42'' -w test.img" > $OUT.new
$DEBUGFS -R "set_inode_field <7> block[2] 42" -w $TMPFILE >> $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
@@ -47,7 +47,7 @@ rm -f $OUT.new
echo ----------------------------------------------- >> $OUT
echo " " >> $OUT
-echo "debugfs -R ''clri <7>'' -w $TMPFILE" > $OUT.new
+echo "debugfs -R ''clri <7>'' -w test.img" > $OUT.new
$DEBUGFS -R "clri <7>" -w $TMPFILE >> $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
@@ -68,7 +68,7 @@ rm -f $OUT.new
echo ----------------------------------------------- >> $OUT
echo " " >> $OUT
-echo "debugfs -R ''set_inode_field <7> bmap[524] 57'' -w $TMPFILE" > $OUT.new
+echo "debugfs -R ''set_inode_field <7> bmap[524] 57'' -w test.img" > $OUT.new
$DEBUGFS -R "set_inode_field <7> bmap[524] 57" -w $TMPFILE >> $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
@@ -89,7 +89,7 @@ rm -f $OUT.new
echo ----------------------------------------------- >> $OUT
echo " " >> $OUT
-echo "debugfs -R ''set_super_value reserved_gdt_blocks 15679'' -w $TMPFILE" > $OUT.new
+echo "debugfs -R ''set_super_value reserved_gdt_blocks 15679'' -w test.img" > $OUT.new
$DEBUGFS -R "set_super_value reserved_gdt_blocks 15679" -w $TMPFILE >> $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
@@ -104,7 +104,7 @@ rm -f $OUT.new
echo ----------------------------------------------- >> $OUT
echo " " >> $OUT
-echo "debugfs -R ''set_super_value reserved_gdt_blocks 32'' -w $TMPFILE" > $OUT.new
+echo "debugfs -R ''set_super_value reserved_gdt_blocks 32'' -w test.img" > $OUT.new
$DEBUGFS -R "set_super_value reserved_gdt_blocks 32" -w $TMPFILE >> $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
diff --git a/tests/m_mkfs_overhead/expect.1 b/tests/m_mkfs_overhead/expect.1
deleted file mode 100644
index 4bfc84e4..00000000
--- a/tests/m_mkfs_overhead/expect.1
+++ /dev/null
@@ -1,10 +0,0 @@
-./test.img: Cannot create filesystem with requested number of inodes while setting up superblock
-./test.img: Attempt to read block from filesystem resulted in short read while opening filesystem
-features: Filesystem not open
-
-../e2fsck/e2fsck: Attempt to read block from filesystem resulted in short read while trying to open ./test.img
-Could this be a zero-length partition?
-Exit status is 8
-
-../misc/dumpe2fs: Attempt to read block from filesystem resulted in short read while trying to open ./test.img
-Couldn't find valid filesystem superblock.
diff --git a/tests/m_mkfs_overhead/script b/tests/m_mkfs_overhead/script
index 8cd91349..ff461996 100644
--- a/tests/m_mkfs_overhead/script
+++ b/tests/m_mkfs_overhead/script
@@ -1,5 +1,33 @@
-DESCRIPTION="test bg overhead calculation"
+echo -n "test bg overhead calculation: "
+
+OUT=$test_name.log
+EXP=$test_dir/expect
FS_SIZE=1024
MKE2FS_OPTS="-b 1024 -m 0 -g 256 -N 3745"
-. $cmd_dir/run_mke2fs
+MKE2FS_SKIP_PROGRESS=true
+MKE2FS_SKIP_CHECK_MSG=true
+export MKE2FS_SKIP_PROGRESS MKE2FS_SKIP_CHECK_MSG
+> $TMPFILE
+
+cp /dev/null $OUT
+
+$MKE2FS -F -o Linux $MKE2FS_OPTS $TMPFILE $FS_SIZE 2>&1 | sed -e 1d | \
+ sed -e "s;$TMPFILE;test.img;" | tr -d \\015 > $OUT
+
+rm -f $TMPFILE
+
+rm -f $test_name.ok $test_name.failed
+cmp -s $OUT $EXP
+status1=$?
+
+if [ "$status1" = 0 ] ; then
+ echo "ok"
+ touch $test_name.ok
+else
+ echo "failed"
+ diff $DIFF_OPTS $EXP $OUT > $test_name.failed
+fi
+rm -f tmp_expect
+
+unset OUT EXP DESCRIPTION FS_SIZE MKE2FS_OPTS MKE2FS_SKIP_PROGRESS
diff --git a/tests/r_inline_xattr/expect b/tests/r_inline_xattr/expect
index 8e59de36..9e712646 100644
--- a/tests/r_inline_xattr/expect
+++ b/tests/r_inline_xattr/expect
@@ -1,15 +1,15 @@
resize2fs test
-debugfs -R ''stat file'' ./test.img 2>&1 | grep ''^Inode\|in inode body\|name = ''
+debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|name = ''
Inode: 1550 Type: regular Mode: 0644 Flags: 0x0
Extended attributes stored in inode body:
name = "propervalue" (11)
Exit status is 0
-resize2fs ./test.img 5M
-Resizing the filesystem on ./test.img to 5120 (1k) blocks.
-The filesystem on ./test.img is now 5120 blocks long.
+resize2fs test.img 5M
+Resizing the filesystem on test.img to 5120 (1k) blocks.
+The filesystem on test.img is now 5120 blocks long.
Exit status is 0
-debugfs -R ''stat file'' ./test.img 2>&1 | grep ''^Inode\|in inode body\|name = ''
+debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|name = ''
Inode: 12 Type: regular Mode: 0644 Flags: 0x0
Extended attributes stored in inode body:
name = "propervalue" (11)
diff --git a/tests/r_inline_xattr/script b/tests/r_inline_xattr/script
index eb923de4..d9c36440 100644
--- a/tests/r_inline_xattr/script
+++ b/tests/r_inline_xattr/script
@@ -10,20 +10,20 @@ gunzip < $IMAGE > $TMPFILE
echo "resize2fs test" > $OUT
# Look at existing inline extended attribute
-echo "debugfs -R ''stat file'' $TMPFILE 2>&1 | grep ''^Inode\|in inode body\|name = ''" >> $OUT
+echo "debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|name = ''" >> $OUT
$DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep "^Inode\|in inode body\|name = " >> $OUT
status=$?
echo Exit status is $status >> $OUT
# resize it
-echo "resize2fs $TMPFILE 5M" >> $OUT
+echo "resize2fs test.img 5M" >> $OUT
$RESIZE2FS $TMPFILE 5M 2>&1 >> $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
-sed -e '1d' $OUT.new >> $OUT
+sed -e '1d' $OUT.new | sed -e "s;$TMPFILE;test.img;" >> $OUT
# Look at inline extended attribute in resized fs
-echo "debugfs -R ''stat file'' $TMPFILE 2>&1 | grep ''^Inode\|in inode body\|name = ''" >> $OUT
+echo "debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|name = ''" >> $OUT
$DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep "^Inode\|in inode body\|name = " >> $OUT
status=$?
echo Exit status is $status >> $OUT
diff --git a/tests/r_move_itable/expect b/tests/r_move_itable/expect
index 0d08b169..7752438f 100644
--- a/tests/r_move_itable/expect
+++ b/tests/r_move_itable/expect
@@ -1,9 +1,9 @@
mke2fs -q -F -o Linux -b 1024 -g 256 test.img 1024
resize2fs -p test.img 10000
-Resizing the filesystem on ./test.img to 10000 (1k) blocks.
+Resizing the filesystem on test.img to 10000 (1k) blocks.
Begin pass 1 (max = 35)
Extending the inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-The filesystem on ./test.img is now 9985 blocks long.
+The filesystem on test.img is now 9985 blocks long.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
@@ -297,10 +297,10 @@ Group 38: (Blocks 9729-9984)
Free inodes: 1217-1248
--------------------------------
resize2fs -p test.img 20000
-Resizing the filesystem on ./test.img to 20000 (1k) blocks.
+Resizing the filesystem on test.img to 20000 (1k) blocks.
Begin pass 1 (max = 39)
Extending the inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-The filesystem on ./test.img is now 19969 blocks long.
+The filesystem on test.img is now 19969 blocks long.
Filesystem did not have a UUID; generating one.
@@ -834,10 +834,10 @@ Group 77: (Blocks 19713-19968)
Free inodes: 2465-2496
--------------------------------
resize2fs -p test.img 30000
-Resizing the filesystem on ./test.img to 30000 (1k) blocks.
+Resizing the filesystem on test.img to 30000 (1k) blocks.
Begin pass 1 (max = 39)
Extending the inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-The filesystem on ./test.img is now 29953 blocks long.
+The filesystem on test.img is now 29953 blocks long.
Filesystem did not have a UUID; generating one.
@@ -1607,10 +1607,10 @@ Group 116: (Blocks 29697-29952)
Free inodes: 3713-3744
--------------------------------
resize2fs -p test.img 40000
-Resizing the filesystem on ./test.img to 40000 (1k) blocks.
+Resizing the filesystem on test.img to 40000 (1k) blocks.
Begin pass 1 (max = 40)
Extending the inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-The filesystem on ./test.img is now 40000 blocks long.
+The filesystem on test.img is now 40000 blocks long.
Filesystem did not have a UUID; generating one.
diff --git a/tests/r_move_itable/script b/tests/r_move_itable/script
index 673f65c0..c257e429 100644
--- a/tests/r_move_itable/script
+++ b/tests/r_move_itable/script
@@ -19,7 +19,8 @@ $MKE2FS -q -F -o Linux -b 1024 -g 256 $TMPFILE 1024 2>&1 \
grep -v "whichever comes first" >> $OUT
echo resize2fs -p test.img 10000 >> $OUT
-$RESIZE2FS -p $TMPFILE 10000 2>&1 | sed -e '1d' >> $OUT
+$RESIZE2FS -p $TMPFILE 10000 2>&1 | sed -e '1d' | \
+ sed -e "s;$TMPFILE;test.img;" >> $OUT
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
status=$?
@@ -38,7 +39,8 @@ $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT
echo "--------------------------------" >> $OUT
echo resize2fs -p test.img 20000 >> $OUT
-$RESIZE2FS -p $TMPFILE 20000 2>&1 | sed -e '1d' >> $OUT
+$RESIZE2FS -p $TMPFILE 20000 2>&1 | sed -e '1d' | \
+ sed -e "s;$TMPFILE;test.img;" >> $OUT
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
status=$?
@@ -57,7 +59,8 @@ $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT
echo "--------------------------------" >> $OUT
echo resize2fs -p test.img 30000 >> $OUT
-$RESIZE2FS -p $TMPFILE 30000 2>&1 | sed -e '1d' >> $OUT
+$RESIZE2FS -p $TMPFILE 30000 2>&1 | sed -e '1d' | \
+ sed -e "s;$TMPFILE;test.img;" >> $OUT
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
status=$?
@@ -76,7 +79,8 @@ $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT
echo "--------------------------------" >> $OUT
echo resize2fs -p test.img 40000 >> $OUT
-$RESIZE2FS -p $TMPFILE 40000 2>&1 | sed -e '1d' >> $OUT
+$RESIZE2FS -p $TMPFILE 40000 2>&1 | sed -e '1d' | \
+ sed -e "s;$TMPFILE;test.img;" >> $OUT
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
status=$?
diff --git a/tests/r_resize_inode/expect b/tests/r_resize_inode/expect
index f4bee0fb..39919827 100644
--- a/tests/r_resize_inode/expect
+++ b/tests/r_resize_inode/expect
@@ -1,7 +1,7 @@
mke2fs -q -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 16384
resize2fs test.img 65536
-Resizing the filesystem on ./test.img to 65536 (1k) blocks.
-The filesystem on ./test.img is now 65536 blocks long.
+Resizing the filesystem on test.img to 65536 (1k) blocks.
+The filesystem on test.img is now 65536 blocks long.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
@@ -448,8 +448,8 @@ Group 63: (Blocks 64513-65535)
--------------------------------
mke2fs -q -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 65536
resize2fs test.img 16384
-Resizing the filesystem on ./test.img to 16384 (1k) blocks.
-The filesystem on ./test.img is now 16384 blocks long.
+Resizing the filesystem on test.img to 16384 (1k) blocks.
+The filesystem on test.img is now 16384 blocks long.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
@@ -601,8 +601,8 @@ Group 15: (Blocks 15361-16383)
Free inodes: 3841-4096
--------------------------------
resize2fs test.img 165536
-Resizing the filesystem on ./test.img to 165536 (1k) blocks.
-The filesystem on ./test.img is now 165536 blocks long.
+Resizing the filesystem on test.img to 165536 (1k) blocks.
+The filesystem on test.img is now 165536 blocks long.
Filesystem did not have a UUID; generating one.
diff --git a/tests/r_resize_inode/script b/tests/r_resize_inode/script
index aced9c4f..c8db1279 100644
--- a/tests/r_resize_inode/script
+++ b/tests/r_resize_inode/script
@@ -19,7 +19,8 @@ $MKE2FS -q -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 16384 2>&1 \
grep -v "whichever comes first" >> $OUT
echo resize2fs test.img 65536 >> $OUT
-$RESIZE2FS $TMPFILE 65536 2>&1 | sed -e '1d' >> $OUT
+$RESIZE2FS $TMPFILE 65536 2>&1 | sed -e '1d' | \
+ sed -e "s;$TMPFILE;test.img;" >> $OUT
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
status=$?
@@ -45,7 +46,8 @@ $MKE2FS -q -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 65536 2>&1 \
grep -v "whichever comes first" >> $OUT
echo resize2fs test.img 16384 >> $OUT
-$RESIZE2FS $TMPFILE 16384 2>&1 | sed -e '1d' >> $OUT
+$RESIZE2FS $TMPFILE 16384 2>&1 | sed -e '1d' | \
+ sed -e "s;$TMPFILE;test.img;" >> $OUT
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
status=$?
@@ -64,7 +66,8 @@ $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT
echo "--------------------------------" >> $OUT
echo resize2fs test.img 165536 >> $OUT
-$RESIZE2FS $TMPFILE 165536 2>&1 | sed -e '1d' >> $OUT
+$RESIZE2FS $TMPFILE 165536 2>&1 | sed -e '1d' | \
+ sed -e "s;$TMPFILE;test.img;" >> $OUT
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
status=$?
diff --git a/tests/run_e2fsck b/tests/run_e2fsck
index 9b4f170d..9202e121 100644
--- a/tests/run_e2fsck
+++ b/tests/run_e2fsck
@@ -50,14 +50,16 @@ eval $PREP_CMD
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT1.new 2>&1
status=$?
echo Exit status is $status >> $OUT1.new
-sed -e '1d' $OUT1.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT1
+sed -e '1d' $OUT1.new | sed -e '/^JFS DEBUG:/d' | \
+ sed -e "s;$TMPFILE;test.img;" | tr -d \\015 >> $OUT1
rm -f $OUT1.new
if [ "$ONE_PASS_ONLY" != "true" ]; then
$FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1
status=$?
echo Exit status is $status >> $OUT2.new
- sed -e '1d' $OUT2.new | sed -e '/^JFS DEBUG:/d' > $OUT2
+ sed -e '1d' $OUT2.new | sed -e '/^JFS DEBUG:/d' | \
+ sed -e "s;$TMPFILE;test.img;" > $OUT2
rm -f $OUT2.new
fi
diff --git a/tests/test_config b/tests/test_config
index 3c757e33..2d85e030 100644
--- a/tests/test_config
+++ b/tests/test_config
@@ -19,7 +19,6 @@ TEST_REL=../tests/progs/test_rel
TEST_ICOUNT=../tests/progs/test_icount
LD_LIBRARY_PATH=../lib:../lib/ext2fs:../lib/e2p:../lib/et:../lib/ss
DYLD_LIBRARY_PATH=../lib:../lib/ext2fs:../lib/e2p:../lib/et:../lib/ss
-TMPFILE=./test.img
export LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH
TZ=GMT0
diff --git a/tests/test_script.in b/tests/test_script.in
index aac28fb6..cec09dfd 100644
--- a/tests/test_script.in
+++ b/tests/test_script.in
@@ -39,6 +39,8 @@ fi
. $TEST_CONFIG
+TMPFILE=$(mktemp)
+
for test_dir in $TESTS
do
test_name=`echo $test_dir | sed -e 's;.*/;;'`
diff --git a/tests/u_mke2fs/script b/tests/u_mke2fs/script
index 8d511597..ef98899e 100644
--- a/tests/u_mke2fs/script
+++ b/tests/u_mke2fs/script
@@ -1,9 +1,9 @@
printf "e2undo with mke2fs: "
if test -x $E2UNDO_EXE; then
-E2FSPROGS_UNDO_DIR=./
+E2FSPROGS_UNDO_DIR=/tmp
export E2FSPROGS_UNDO_DIR
-TDB_FILE=./mke2fs-test.img.e2undo
+TDB_FILE=$E2FSPROGS_UNDO_DIR/mke2fs-$(basename $TMPFILE).e2undo
OUT=$test_name.log
rm -f $TDB_FILE >/dev/null 2>&1
diff --git a/tests/u_tune2fs/script b/tests/u_tune2fs/script
index 5382cad1..222b95f3 100644
--- a/tests/u_tune2fs/script
+++ b/tests/u_tune2fs/script
@@ -1,9 +1,9 @@
printf "e2undo with tune2fs: "
if test -x $E2UNDO_EXE; then
-E2FSPROGS_UNDO_DIR=./
+E2FSPROGS_UNDO_DIR=/tmp
export E2FSPROGS_UNDO_DIR
-TDB_FILE=./tune2fs-test.img.e2undo
+TDB_FILE=$E2FSPROGS_UNDO_DIR/tune2fs-$(basename $TMPFILE).e2undo
OUT=$test_name.log
rm -f $TDB_FILE >/dev/null 2>&1