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 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 -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
     19 
     20 echo 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
     25 status=$?
     26 echo Exit status is $status >> $OUT.new
     27 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $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.sed >> $OUT
     37 
     38 echo "--------------------------------" >> $OUT
     39 
     40 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
     41 
     42 echo 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 
     46 echo 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
     51 status=$?
     52 echo Exit status is $status >> $OUT.new
     53 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
     54 rm -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 
     61 echo dumpe2fs test.img >> $OUT
     62 $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT
     63 
     64 echo "--------------------------------" >> $OUT
     65 
     66 echo 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
     71 status=$?
     72 echo Exit status is $status >> $OUT.new
     73 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
     74 rm -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 
     81 echo dumpe2fs test.img >> $OUT
     82 $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT
     83 
     84 rm -f $TMPFILE
     85 cmp -s $OUT $EXP
     86 status=$?
     87 
     88 if [ "$status" = 0 ] ; then
     89 	echo "$test_name: $test_description: ok"
     90 	touch $test_name.ok
     91 else
     92 	echo "$test_name: $test_description: failed"
     93 	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
     94 	rm -f $test_name.tmp
     95 fi
     96 
     97 unset IMAGE FSCK_OPT OUT EXP
     98 
     99 else #if test -x $RESIZE2FS; then
    100 	echo "$test_name: $test_description: skipped"
    101 fi 
    102