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