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