1if test -x $RESIZE2FS_EXE; then 2 3FSCK_OPT=-yf 4OUT=$test_name.log 5if [ -f $test_dir/expect.gz ]; then 6 EXP=$test_name.tmp 7 gunzip < $test_dir/expect.gz > $EXP1 8else 9 EXP=$test_dir/expect 10fi 11 12dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 13 14echo mke2fs -q -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 16384 > $OUT.new 15$MKE2FS -q -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 16384 >> $OUT.new 2>&1 16 17echo dumpe2fs test.img >> $OUT.new 18$DUMPE2FS $TMPFILE >> $OUT.new 2>&1 19 20echo resize2fs -p test.img 65536 >> $OUT.new 21$RESIZE2FS -p $TMPFILE 65536 >> $OUT.new 2>&1 22 23$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 24status=$? 25echo Exit status is $status >> $OUT.new 26 27$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 28$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 29$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 30$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 31 32echo dumpe2fs test.img >> $OUT.new 33$DUMPE2FS $TMPFILE >> $OUT.new 2>&1 34 35echo "--------------------------------" >> $OUT.new 36 37dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 38 39echo mke2fs -q -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 65536 >> $OUT.new 40$MKE2FS -q -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 65536 >> $OUT.new 2>&1 41 42echo dumpe2fs test.img >> $OUT.new 43$DUMPE2FS $TMPFILE >> $OUT.new 2>&1 44 45echo resize2fs -p test.img 16384 >> $OUT.new 46$RESIZE2FS -p $TMPFILE 16384 >> $OUT.new 2>&1 47 48$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 49status=$? 50echo Exit status is $status >> $OUT.new 51 52$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 53$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 54$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 55$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 56 57echo dumpe2fs test.img >> $OUT.new 58$DUMPE2FS $TMPFILE >> $OUT.new 2>&1 59 60echo "--------------------------------" >> $OUT.new 61 62echo resize2fs -p test.img 165536 >> $OUT.new 63$RESIZE2FS -p $TMPFILE 165536 >> $OUT.new 2>&1 64 65$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 66status=$? 67echo Exit status is $status >> $OUT.new 68 69$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 70$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 71$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 72$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 73 74echo dumpe2fs test.img >> $OUT.new 75$DUMPE2FS $TMPFILE >> $OUT.new 2>&1 76sed -f $cmd_dir/filter.sed -e '/Block bitmap.*$/N;s/\n Inode bitmap/, Inode bitmap/g' < $OUT.new > $OUT 77rm -f $TMPFILE $OUT.new 78 79cmp -s $OUT $EXP 80status=$? 81 82if [ "$status" = 0 ] ; then 83 echo "$test_name: $test_description: ok" 84 touch $test_name.ok 85else 86 echo "$test_name: $test_description: failed" 87 diff $DIFF_OPTS $EXP $OUT > $test_name.failed 88 rm -f $test_name.tmp 89fi 90 91unset IMAGE FSCK_OPT OUT EXP 92 93else #if test -x $RESIZE2FS; then 94 echo "$test_name: $test_description: skipped" 95fi 96