Home | History | Annotate | Download | only in r_inline_xattr
      1 if test -x $RESIZE2FS_EXE; then
      2 
      3 IMAGE=$test_dir/image.gz
      4 FSCK_OPT=-yf
      5 OUT=$test_name.log
      6 EXP=$test_dir/expect
      7 
      8 gunzip < $IMAGE > $TMPFILE
      9 
     10 echo "resize2fs test" > $OUT
     11 
     12 # Look at existing inline extended attribute
     13 echo "debugfs -R ''stat file'' $TMPFILE 2>&1 | grep ''^Inode\|in inode body\|name = ''" >> $OUT
     14 $DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep "^Inode\|in inode body\|name = " >> $OUT
     15 status=$?
     16 echo Exit status is $status >> $OUT
     17 
     18 # resize it
     19 echo "resize2fs $TMPFILE 5M" >> $OUT
     20 $RESIZE2FS $TMPFILE 5M 2>&1 >> $OUT.new 2>&1
     21 status=$?
     22 echo Exit status is $status >> $OUT.new
     23 sed -e '1d' $OUT.new >> $OUT
     24 
     25 # Look at inline extended attribute in resized fs
     26 echo "debugfs -R ''stat file'' $TMPFILE 2>&1 | grep ''^Inode\|in inode body\|name = ''" >> $OUT
     27 $DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep "^Inode\|in inode body\|name = " >> $OUT
     28 status=$?
     29 echo Exit status is $status >> $OUT
     30 
     31 rm $TMPFILE $OUT.new
     32 
     33 #
     34 # Do the verification
     35 #
     36 
     37 rm -f $test_name.ok $test_name.failed
     38 cmp -s $OUT $EXP
     39 status=$?
     40 
     41 if [ "$status" = 0 ] ; then
     42 	echo "ok"
     43 	touch $test_name.ok
     44 else
     45 	echo "failed"
     46 	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
     47 fi
     48 
     49 unset IMAGE FSCK_OPT OUT EXP
     50 
     51 else #if test -x $RESIZE2FS; then
     52         rm -f $test_name.ok $test_name.failed
     53         echo "skipped"
     54 fi
     55 
     56