Home | History | Annotate | Download | only in d_xattr_sorting
      1 if test -x $DEBUGFS_EXE; then
      2 
      3 OUT=$test_name.log
      4 EXP=$test_dir/expect
      5 VERIFY_FSCK_OPT=-yf
      6 
      7 TEST_DATA=$test_name.tmp
      8 VERIFY_DATA=$test_name.ver.tmp
      9 
     10 echo "debugfs sort extended attributes" > $OUT
     11 
     12 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
     13 
     14 echo "mke2fs -Fq -b 1024 test.img 512" >> $OUT
     15 
     16 $MKE2FS -Fq $TMPFILE 512 > /dev/null 2>&1
     17 status=$?
     18 echo Exit status is $status >> $OUT
     19 
     20 B=$(mktemp ${TMPDIR:-/tmp}/b.XXXXXX)
     21 
     22 perl -e 'print "x" x 256;' > $B
     23 
     24 echo "ea_set -f /tmp/b / security.SMEG64" > $OUT.new
     25 $DEBUGFS -w -R "ea_set -f $B / security.SMEG64" $TMPFILE >> $OUT.new 2>&1
     26 status=$?
     27 echo Exit status is $status >> $OUT.new
     28 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
     29 
     30 echo "ea_set -f /tmp/b / security.imb" > $OUT.new
     31 $DEBUGFS -w -R "ea_set -f $B / security.imb" $TMPFILE >> $OUT.new 2>&1
     32 status=$?
     33 echo Exit status is $status >> $OUT.new
     34 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
     35 
     36 echo "ea_set / user.moo cow" > $OUT.new
     37 $DEBUGFS -w -R "ea_set / user.moo cow" $TMPFILE >> $OUT.new 2>&1
     38 status=$?
     39 echo Exit status is $status >> $OUT.new
     40 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
     41 
     42 rm -f $B
     43 unset B
     44 
     45 echo "ea_list /" > $OUT.new
     46 $DEBUGFS -w -R "ea_list /" $TMPFILE >> $OUT.new 2>&1
     47 status=$?
     48 echo Exit status is $status >> $OUT.new
     49 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
     50 
     51 echo "ea_get / security.imb" > $OUT.new
     52 $DEBUGFS -w -R "ea_get / security.imb" $TMPFILE >> $OUT.new 2>&1
     53 status=$?
     54 echo Exit status is $status >> $OUT.new
     55 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
     56 
     57 echo "ea_get / nosuchea" > $OUT.new
     58 $DEBUGFS -w -R "ea_get / nosuchea" $TMPFILE >> $OUT.new 2>&1
     59 status=$?
     60 echo Exit status is $status >> $OUT.new
     61 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
     62 
     63 echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new
     64 $FSCK $VERIFY_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 $OUT.new >> $OUT
     68 
     69 #
     70 # Do the verification
     71 #
     72 
     73 rm -f $TMPFILE $OUT.new
     74 cmp -s $OUT $EXP
     75 status=$?
     76 
     77 if [ "$status" = 0 ] ; then
     78 	echo "$test_name: $test_description: ok"
     79 	touch $test_name.ok
     80 else
     81 	echo "$test_name: $test_description: failed"
     82 	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
     83 fi
     84 
     85 unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA
     86 
     87 else #if test -x $DEBUGFS_EXE; then
     88 	echo "$test_name: $test_description: skipped"
     89 fi
     90