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>
bitmap-optimize
Theodore Ts'o 2011-07-09 12:08:10 -04:00
parent 0bd0e59320
commit b4db1e4c74
18 changed files with 94 additions and 66 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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.

View File

@ -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=$?

View File

@ -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.

View File

@ -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=$?

View File

@ -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

View File

@ -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

View File

@ -39,6 +39,8 @@ fi
. $TEST_CONFIG
TMPFILE=$(mktemp)
for test_dir in $TESTS
do
test_name=`echo $test_dir | sed -e 's;.*/;;'`

View File

@ -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

View File

@ -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