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
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
19 $MKE2FS -Fq -b 1024 -o linux $TMPFILE 512 > /dev/null 2>&1
21 echo Exit status is $status >> $OUT
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
39 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
41 echo "debugfs -R ''stat foo2'' -w test.img" > $OUT.new
42 $DEBUGFS -R "stat foo2" -w $TMPFILE >> $OUT.new 2>&1
44 echo Exit status is $status >> $OUT.new
45 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
47 echo "debugfs -R ''block_dump 28'' -w test.img" > $OUT.new
48 $DEBUGFS -R "block_dump 28" -w $TMPFILE >> $OUT.new 2>&1
50 echo Exit status is $status >> $OUT.new
51 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
53 echo "debugfs -R ''stat pipe'' -w test.img" > $OUT.new
54 $DEBUGFS -R "stat pipe" -w $TMPFILE >> $OUT.new 2>&1
56 echo Exit status is $status >> $OUT.new
57 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
59 echo "debugfs -R ''stat sda'' -w test.img" > $OUT.new
60 $DEBUGFS -R "stat sda" -w $TMPFILE >> $OUT.new 2>&1
62 echo Exit status is $status >> $OUT.new
63 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
65 echo "debugfs -R ''stat null'' -w test.img" > $OUT.new
66 $DEBUGFS -R "stat null" -w $TMPFILE >> $OUT.new 2>&1
68 echo Exit status is $status >> $OUT.new
69 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
71 echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new
72 $FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
74 echo Exit status is $status >> $OUT.new
75 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
81 rm -f $TMPFILE $OUT.new
85 if [ "$status" = 0 ] ; then
86 echo "$test_name: $test_description: ok"
89 echo "$test_name: $test_description: failed"
90 diff $DIFF_OPTS $EXP $OUT > $test_name.failed
93 unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA