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 resize_inode -o Linux -b 1024 -g 1024 test.img 16384 > $OUT 17 $MKE2FS -q -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 16384 2>&1 \ 18 | sed -e '1d' | grep -v "automatically checked" | 19 grep -v "whichever comes first" >> $OUT 20 21 echo resize2fs test.img 65536 >> $OUT 22 $RESIZE2FS $TMPFILE 65536 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 mke2fs -q -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 65536 >> $OUT 41 $MKE2FS -q -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 65536 2>&1 \ 42 | sed -e '1d' | grep -v "automatically checked" | 43 grep -v "whichever comes first" >> $OUT 44 45 echo resize2fs test.img 16384 >> $OUT 46 $RESIZE2FS $TMPFILE 16384 2>&1 | sed -e '1d' >> $OUT 47 48 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 49 status=$? 50 echo Exit status is $status >> $OUT.new 51 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 52 rm -f $OUT.new 53 54 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 55 $DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 56 $DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 57 $TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 58 59 echo dumpe2fs test.img >> $OUT 60 $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT 61 62 echo "--------------------------------" >> $OUT 63 64 echo resize2fs test.img 165536 >> $OUT 65 $RESIZE2FS $TMPFILE 165536 2>&1 | sed -e '1d' >> $OUT 66 67 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 68 status=$? 69 echo Exit status is $status >> $OUT.new 70 sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT 71 rm -f $OUT.new 72 73 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 74 $DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 75 $DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 76 $TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 77 78 echo dumpe2fs test.img >> $OUT 79 $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT 80 81 rm -f $test_name.ok $test_name.failed $TMPFILE 82 cmp -s $OUT $EXP 83 status=$? 84 85 if [ "$status" = 0 ] ; then 86 echo "ok" 87 touch $test_name.ok 88 else 89 echo "failed" 90 diff $DIFF_OPTS $EXP $OUT > $test_name.failed 91 rm -f tmp_expect 92 fi 93 94 unset IMAGE FSCK_OPT OUT EXP 95 96 else #if test -x $RESIZE2FS; then 97 rm -f $test_name.ok $test_name.failed 98 echo "skipped" 99 fi 100