1 if test -x $DEBUGFS_EXE; then
7 TEST_DATA=$test_name.tmp
8 VERIFY_DATA=$test_name.ver.tmp
10 echo "debugfs create special files" > $OUT
12 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
14 echo "mke2fs -Fq -b 1024 test.img 512" >> $OUT
16 $MKE2FS -Fq $TMPFILE 512 > /dev/null 2>&1
18 echo Exit status is $status >> $OUT
20 $DEBUGFS -w $TMPFILE << EOF > /dev/null 2>&1
21 set_current_time 20130115140000
22 set_super_value lastcheck 0
23 set_super_value hash_seed null
24 set_super_value mkfs_time 0
26 symlink foo2 12345678901234567890123456789012345678901234567890123456789012345678901234567890
32 echo "debugfs -R ''stat foo'' -w test.img" > $OUT.new
33 $DEBUGFS -R "stat foo" -w $TMPFILE >> $OUT.new 2>&1
35 echo Exit status is $status >> $OUT.new
36 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
38 echo "debugfs -R ''stat foo2'' -w test.img" > $OUT.new
39 $DEBUGFS -R "stat foo2" -w $TMPFILE >> $OUT.new 2>&1
41 echo Exit status is $status >> $OUT.new
42 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
44 echo "debugfs -R ''block_dump 28'' -w test.img" > $OUT.new
45 $DEBUGFS -R "block_dump 28" -w $TMPFILE >> $OUT.new 2>&1
47 echo Exit status is $status >> $OUT.new
48 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
50 echo "debugfs -R ''stat pipe'' -w test.img" > $OUT.new
51 $DEBUGFS -R "stat pipe" -w $TMPFILE >> $OUT.new 2>&1
53 echo Exit status is $status >> $OUT.new
54 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
56 echo "debugfs -R ''stat sda'' -w test.img" > $OUT.new
57 $DEBUGFS -R "stat sda" -w $TMPFILE >> $OUT.new 2>&1
59 echo Exit status is $status >> $OUT.new
60 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
62 echo "debugfs -R ''stat null'' -w test.img" > $OUT.new
63 $DEBUGFS -R "stat null" -w $TMPFILE >> $OUT.new 2>&1
65 echo Exit status is $status >> $OUT.new
66 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
68 echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new
69 $FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
71 echo Exit status is $status >> $OUT.new
72 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
78 rm -f $TMPFILE $OUT.new
82 if [ "$status" = 0 ] ; then
83 echo "$test_name: $test_description: ok"
86 echo "$test_name: $test_description: failed"
87 diff $DIFF_OPTS $EXP $OUT > $test_name.failed
90 unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA
92 else #if test -x $DEBUGFS_EXE; then
93 echo "$test_name: $test_description: skipped"