1 if ! test -x $DEBUGFS_EXE; then
2 echo "$test_name: $test_description: skipped (no debugfs)"
10 TEST_DATA=$test_name.tmp
11 VERIFY_DATA=$test_name.ver.tmp
13 echo "debugfs create special files" > $OUT.new
15 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
17 echo "mke2fs -Fq -b 1024 test.img 512" >> $OUT.new
19 $MKE2FS -Fq -b 1024 -o linux $TMPFILE 512 > /dev/null 2>&1
21 echo Exit status is $status >> $OUT.new
23 $DEBUGFS -w $TMPFILE << EOF > /dev/null 2>&1
24 set_current_time 20130115140000
25 set_super_value lastcheck 0
26 set_super_value hash_seed null
27 set_super_value mkfs_time 0
29 symlink foo2 12345678901234567890123456789012345678901234567890123456789012345678901234567890
35 echo "debugfs -R ''stat foo'' -w test.img" >> $OUT.new
36 $DEBUGFS -R "stat foo" -w $TMPFILE >> $OUT.new 2>&1
38 echo Exit status is $status >> $OUT.new
40 echo "debugfs -R ''stat foo2'' -w test.img" >> $OUT.new
41 $DEBUGFS -R "stat foo2" -w $TMPFILE >> $OUT.new 2>&1
43 echo Exit status is $status >> $OUT.new
45 echo "debugfs -R ''block_dump 28'' -w test.img" >> $OUT.new
46 $DEBUGFS -R "block_dump 28" -w $TMPFILE >> $OUT.new 2>&1
48 echo Exit status is $status >> $OUT.new
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
55 echo "debugfs -R ''stat sda'' -w test.img" >> $OUT.new
56 $DEBUGFS -R "stat sda" -w $TMPFILE >> $OUT.new 2>&1
58 echo Exit status is $status >> $OUT.new
60 echo "debugfs -R ''stat null'' -w test.img" >> $OUT.new
61 $DEBUGFS -R "stat null" -w $TMPFILE >> $OUT.new 2>&1
63 echo Exit status is $status >> $OUT.new
65 echo e2fsck $VERIFY_FSCK_OPT -N test_filesys >> $OUT.new
66 $FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
68 echo Exit status is $status >> $OUT.new
69 sed -f $cmd_dir/filter.sed $OUT.new > $OUT
75 rm -f $TMPFILE $OUT.new
79 if [ "$status" = 0 ] ; then
80 echo "$test_name: $test_description: ok"
83 echo "$test_name: $test_description: failed"
84 diff $DIFF_OPTS $EXP $OUT > $test_name.failed
87 unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA