Home | History | Annotate | Download | only in r_move_itable
      1 if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_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 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 -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
     19 
     20 echo resize2fs -p test.img 10000 >> $OUT
     21 $RESIZE2FS -p $TMPFILE 10000 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 -e '/Block bitmap.*$/N;s/\n  Inode bitmap/, Inode bitmap/g' >> $OUT
     37 
     38 echo "--------------------------------" >> $OUT
     39 
     40 echo resize2fs -p test.img 20000 >> $OUT
     41 $RESIZE2FS -p $TMPFILE 20000 2>&1 |
     42 	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
     43 
     44 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
     45 status=$?
     46 echo Exit status is $status >> $OUT.new
     47 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
     48 rm -f $OUT.new
     49 
     50 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
     51 $DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1
     52 $DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1
     53 $TUNE2FS -c 20 -U clear $TMPFILE  >/dev/null 2>&1
     54 
     55 echo dumpe2fs test.img >> $OUT
     56 $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed -e '/Block bitmap.*$/N;s/\n  Inode bitmap/, Inode bitmap/g' >> $OUT
     57 
     58 echo "--------------------------------" >> $OUT
     59 
     60 echo resize2fs -p test.img 30000 >> $OUT
     61 $RESIZE2FS -p $TMPFILE 30000 2>&1 |
     62 	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
     63 
     64 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
     65 status=$?
     66 echo Exit status is $status >> $OUT.new
     67 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
     68 rm -f $OUT.new
     69 
     70 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
     71 $DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1
     72 $DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1
     73 $TUNE2FS -c 20 -U clear $TMPFILE  >/dev/null 2>&1
     74 
     75 echo dumpe2fs test.img >> $OUT
     76 $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed -e '/Block bitmap.*$/N;s/\n  Inode bitmap/, Inode bitmap/g' >> $OUT
     77 
     78 echo "--------------------------------" >> $OUT
     79 
     80 echo resize2fs -p test.img 40000 >> $OUT
     81 $RESIZE2FS -p $TMPFILE 40000 2>&1 |
     82 	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
     83 
     84 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
     85 status=$?
     86 echo Exit status is $status >> $OUT.new
     87 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
     88 rm -f $OUT.new
     89 
     90 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
     91 $DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1
     92 $DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1
     93 $TUNE2FS -c 20 -U clear $TMPFILE  >/dev/null 2>&1
     94 
     95 echo dumpe2fs test.img >> $OUT
     96 $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed -e '/Block bitmap.*$/N;s/\n  Inode bitmap/, Inode bitmap/g' >> $OUT
     97 
     98 rm -f $TMPFILE
     99 
    100 cmp -s $OUT $EXP
    101 status=$?
    102 
    103 if [ "$status" = 0 ] ; then
    104 	echo "$test_name: $test_description: ok"
    105 	touch $test_name.ok
    106 else
    107 	echo "$test_name: $test_description: failed"
    108 	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
    109 	rm -f $test_name.tmp
    110 fi
    111 
    112 unset IMAGE FSCK_OPT OUT EXP
    113 
    114 else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then
    115 	echo "$test_name: $test_description: skipped"
    116 fi 
    117