tests: add new test t_uninit_bg_rm

This test checks tune2fs's support for removing the uninit_bg feature
flag.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
pu
Theodore Ts'o 2013-10-12 23:08:02 -04:00
parent 45e9ccdbb3
commit e7619b71c0
3 changed files with 77 additions and 1 deletions

View File

@ -1,4 +1,9 @@
/^[dbgumpe2fsckrsiz]* [1-9]\.[0-9]*[.-][^ ]* ([0-9]*-[A-Za-z]*-[0-9]*)/d
/^debugfs [1-9]\.[0-9]*[.-][^ ]* ([0-9]*-[A-Za-z]*-[0-9]*)/d
/^dumpe2fs [1-9]\.[0-9]*[.-][^ ]* ([0-9]*-[A-Za-z]*-[0-9]*)/d
/^e2fsck [1-9]\.[0-9]*[.-][^ ]* ([0-9]*-[A-Za-z]*-[0-9]*)/d
/^mke2fs [1-9]\.[0-9]*[.-][^ ]* ([0-9]*-[A-Za-z]*-[0-9]*)/d
/^resize2fs [1-9]\.[0-9]*[.-][^ ]* ([0-9]*-[A-Za-z]*-[0-9]*)/d
/^tune2fs [1-9]\.[0-9]*[.-][^ ]* ([0-9]*-[A-Za-z]*-[0-9]*)/d
s/\\015//g
/automatically checked/d
/^Directory Hash Seed:/d

View File

@ -0,0 +1,21 @@
mke2fs -q -t ext4 -F -o Linux -b 1024 test.img 1G
tune2fs -f -O ^uninit_bg test.img
fsck -yf -N test_filesys test.img
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
test_filesys: 11/65536 files (0.0% non-contiguous), 52294/1048576 blocks
mke2fs -q -t ext4 -O bigalloc -F -o Linux -b 1024 -C 8192 test.img 10G
tune2fs -f -O ^uninit_bg test.img
fsck -yf -N test_filesys test.img
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
test_filesys: 11/655360 files (0.0% non-contiguous), 199864/10485760 blocks

View File

@ -0,0 +1,50 @@
test_description="remove uninit_bg"
OUT=$test_name.log
FSCK_OPT=-yf
EXP=$test_dir/expect
cp /dev/null $TMPFILE
rm -f $OUT.new
echo mke2fs -q -t ext4 -F -o Linux -b 1024 $TMPFILE 1G >> $OUT.new
$MKE2FS -q -t ext4 -F -o Linux -b 1024 $TMPFILE 1G >> $OUT.new 2>&1
echo "tune2fs -f -O ^uninit_bg $TMPFILE" >> $OUT.new
$TUNE2FS -f -O ^uninit_bg $TMPFILE >> $OUT.new 2>&1
echo " " >> $OUT.new
echo fsck $FSCK_OPT -N test_filesys test.img >> $OUT.new
$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
echo " " >> $OUT.new
cp /dev/null $TMPFILE
echo mke2fs -q -t ext4 -O bigalloc -F -o Linux -b 1024 -C 8192 $TMPFILE 10G >> $OUT.new
$MKE2FS -q -t ext4 -O bigalloc -F -o Linux -b 1024 -C 8192 $TMPFILE 10G >> $OUT.new 2>&1
echo "tune2fs -f -O ^uninit_bg $TMPFILE" >> $OUT.new
$TUNE2FS -f -O ^uninit_bg $TMPFILE >> $OUT.new 2>&1
echo " " >> $OUT.new
echo fsck $FSCK_OPT -N test_filesys test.img >> $OUT.new
$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT
rm -f $OUT.new $TMPFILE
#
# Do the verification
#
cmp -s $OUT $EXP
status=$?
if [ "$status" = 0 ] ; then
echo "$test_name: $test_description: ok"
touch $test_name.ok
else
echo "$test_name: $test_description: failed"
diff $DIFF_OPTS $EXP $OUT > $test_name.failed
fi
unset IMAGE FSCK_OPT OUT EXP