1 if test -x $RESIZE2FS_EXE; then 2 3 FSCK_OPT=-yf 4 OUT=$test_name.log 5 if [ -f $test_dir/expect.gz ]; then 6 EXP=tmp_expect 7 gunzip < $test_dir/expect.gz > $EXP1 8 else 9 EXP=$test_dir/expect 10 fi 11 12 cp /dev/null $OUT 13 14 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 15 16 echo 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 21 echo 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 25 status=$? 26 echo Exit status is $status >> $OUT.new 27 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 28 rm -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 35 echo dumpe2fs test.img >> $OUT 36 $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT 37 38 echo "--------------------------------" >> $OUT 39 40 echo 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 44 status=$? 45 echo Exit status is $status >> $OUT.new 46 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 47 rm -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 54 echo dumpe2fs test.img >> $OUT 55 $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT 56 57 echo "--------------------------------" >> $OUT 58 59 echo 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 63 status=$? 64 echo Exit status is $status >> $OUT.new 65 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 66 rm -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 73 echo dumpe2fs test.img >> $OUT 74 $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT 75 76 echo "--------------------------------" >> $OUT 77 78 echo 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 82 status=$? 83 echo Exit status is $status >> $OUT.new 84 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 85 rm -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 92 echo dumpe2fs test.img >> $OUT 93 $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT 94 95 rm -f $test_name.ok $test_name.failed $TMPFILE 96 97 cmp -s $OUT $EXP 98 status=$? 99 100 if [ "$status" = 0 ] ; then 101 echo "ok" 102 touch $test_name.ok 103 else 104 echo "failed" 105 diff $DIFF_OPTS $EXP $OUT > $test_name.failed 106 rm -f tmp_expect 107 fi 108 109 unset IMAGE FSCK_OPT OUT EXP 110 111 else #if test -x $RESIZE2FS; then 112 rm -f $test_name.ok $test_name.failed 113 echo "skipped" 114 fi 115