Home | History | Annotate | Download | only in r_resize_inode
      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=$test_name.tmp
      7 	gunzip < $test_dir/expect.gz > $EXP1
      8 else
      9 	EXP=$test_dir/expect
     10 fi
     11 
     12 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
     13 
     14 echo 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 
     17 echo 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
     21 status=$?
     22 echo 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 
     29 echo dumpe2fs test.img >> $OUT.new
     30 $DUMPE2FS $TMPFILE >> $OUT.new 2>&1
     31 
     32 echo "--------------------------------" >> $OUT.new
     33 
     34 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
     35 
     36 echo 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 
     39 echo 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
     43 status=$?
     44 echo 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 
     51 echo dumpe2fs test.img >> $OUT.new
     52 $DUMPE2FS $TMPFILE >> $OUT.new 2>&1
     53 
     54 echo "--------------------------------" >> $OUT.new
     55 
     56 echo 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
     60 status=$?
     61 echo 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 
     68 echo dumpe2fs test.img >> $OUT.new
     69 $DUMPE2FS $TMPFILE >> $OUT.new 2>&1
     70 sed -f $cmd_dir/filter.sed -e '/Block bitmap.*$/N;s/\n  Inode bitmap/, Inode bitmap/g' < $OUT.new > $OUT
     71 rm -f $TMPFILE $OUT.new
     72 
     73 cmp -s $OUT $EXP
     74 status=$?
     75 
     76 if [ "$status" = 0 ] ; then
     77 	echo "$test_name: $test_description: ok"
     78 	touch $test_name.ok
     79 else
     80 	echo "$test_name: $test_description: failed"
     81 	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
     82 	rm -f $test_name.tmp
     83 fi
     84 
     85 unset IMAGE FSCK_OPT OUT EXP
     86 
     87 else #if test -x $RESIZE2FS; then
     88 	echo "$test_name: $test_description: skipped"
     89 fi 
     90