1if test -x $RESIZE2FS_EXE; then 2 3FSCK_OPT=-yf 4OUT=$test_name.log 5if [ -f $test_dir/expect.gz ]; then 6 EXP=tmp_expect 7 gunzip < $test_dir/expect.gz > $EXP1 8else 9 EXP=$test_dir/expect 10fi 11 12cp /dev/null $OUT 13 14dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 15 16echo mke2fs -q -F -o Linux -b 1024 -g 256 test.img 1024 > $OUT 17$MKE2FS -q -F -o Linux -b 1024 -g 256 $TMPFILE 1024 2>&1 \ 18 | sed -e '1d' | grep -v "automatically checked" | 19 grep -v "whichever comes first" >> $OUT 20 21echo resize2fs -p test.img 10000 >> $OUT 22$RESIZE2FS -p $TMPFILE 10000 2>&1 | sed -e '1d' >> $OUT 23 24$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 25status=$? 26echo Exit status is $status >> $OUT.new 27sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 28rm -f $OUT.new 29 30$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 31$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 32$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 33$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 34 35echo dumpe2fs test.img >> $OUT 36$DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT 37 38echo "--------------------------------" >> $OUT 39 40echo resize2fs -p test.img 20000 >> $OUT 41$RESIZE2FS -p $TMPFILE 20000 2>&1 | sed -e '1d' >> $OUT 42 43$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 44status=$? 45echo Exit status is $status >> $OUT.new 46sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 47rm -f $OUT.new 48 49$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 50$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 51$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 52$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 53 54echo dumpe2fs test.img >> $OUT 55$DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT 56 57echo "--------------------------------" >> $OUT 58 59echo resize2fs -p test.img 30000 >> $OUT 60$RESIZE2FS -p $TMPFILE 30000 2>&1 | sed -e '1d' >> $OUT 61 62$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 63status=$? 64echo Exit status is $status >> $OUT.new 65sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 66rm -f $OUT.new 67 68$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 69$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 70$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 71$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 72 73echo dumpe2fs test.img >> $OUT 74$DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT 75 76echo "--------------------------------" >> $OUT 77 78echo resize2fs -p test.img 40000 >> $OUT 79$RESIZE2FS -p $TMPFILE 40000 2>&1 | sed -e '1d' >> $OUT 80 81$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 82status=$? 83echo Exit status is $status >> $OUT.new 84sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 85rm -f $OUT.new 86 87$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 88$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 89$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 90$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 91 92echo dumpe2fs test.img >> $OUT 93$DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT 94 95rm -f $test_name.ok $test_name.failed $TMPFILE 96 97cmp -s $OUT $EXP 98status=$? 99 100if [ "$status" = 0 ] ; then 101 echo "ok" 102 touch $test_name.ok 103else 104 echo "failed" 105 diff $DIFF_OPTS $EXP $OUT > $test_name.failed 106 rm -f tmp_expect 107fi 108 109unset IMAGE FSCK_OPT OUT EXP 110 111else #if test -x $RESIZE2FS; then 112 rm -f $test_name.ok $test_name.failed 113 echo "skipped" 114fi 115