1 if test -x $DEBUGFS_EXE; then
3 test_description="e2fsck with resize_inode"
6 if [ -f $test_dir/expect.gz ]; then
8 gunzip < $test_dir/expect.gz > $EXP1
15 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
17 echo mke2fs -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 16384 > $OUT
18 $MKE2FS -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 16384 2>&1 |
19 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
21 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
23 echo Exit status is $status >> $OUT.new
24 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
27 echo ----------------------------------------------- >> $OUT
30 echo "debugfs -R ''set_inode_field <7> block[2] 42'' -w test.img" > $OUT.new
31 $DEBUGFS -R "set_inode_field <7> block[2] 42" -w $TMPFILE >> $OUT.new 2>&1
33 echo Exit status is $status >> $OUT.new
34 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
36 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
38 echo Exit status is $status >> $OUT.new
39 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
42 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
44 echo Exit status is $status >> $OUT.new
45 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
48 echo ----------------------------------------------- >> $OUT
51 echo "debugfs -R ''clri <7>'' -w test.img" > $OUT.new
52 $DEBUGFS -R "clri <7>" -w $TMPFILE >> $OUT.new 2>&1
54 echo Exit status is $status >> $OUT.new
55 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
57 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
59 echo Exit status is $status >> $OUT.new
60 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
63 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
65 echo Exit status is $status >> $OUT.new
66 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
69 echo ----------------------------------------------- >> $OUT
72 echo "debugfs -R ''set_inode_field <7> bmap[524] 57'' -w test.img" > $OUT.new
73 $DEBUGFS -R "set_inode_field <7> bmap[524] 57" -w $TMPFILE >> $OUT.new 2>&1
75 echo Exit status is $status >> $OUT.new
76 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
78 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
80 echo Exit status is $status >> $OUT.new
81 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
84 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
86 echo Exit status is $status >> $OUT.new
87 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
90 echo ----------------------------------------------- >> $OUT
93 echo "debugfs -R ''set_super_value reserved_gdt_blocks 15679'' -w test.img" > $OUT.new
94 $DEBUGFS -R "set_super_value reserved_gdt_blocks 15679" -w $TMPFILE >> $OUT.new 2>&1
96 echo Exit status is $status >> $OUT.new
97 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
99 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
101 echo Exit status is $status >> $OUT.new
102 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
105 echo ----------------------------------------------- >> $OUT
108 echo "debugfs -R ''set_super_value reserved_gdt_blocks 32'' -w test.img" > $OUT.new
109 $DEBUGFS -R "set_super_value reserved_gdt_blocks 32" -w $TMPFILE >> $OUT.new 2>&1
111 echo Exit status is $status >> $OUT.new
112 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
114 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
116 echo Exit status is $status >> $OUT.new
117 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
120 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
122 echo Exit status is $status >> $OUT.new
123 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
130 if [ "$status" = 0 ] ; then
131 echo "$test_name: $test_description: ok"
134 echo "$test_name: $test_description: failed"
135 diff $DIFF_OPTS $EXP $OUT > $test_name.failed
139 unset IMAGE FSCK_OPT OUT EXP
141 else #if test -x $DEBUGFS_EXE; then
142 echo "$test_name: $test_description: skipped"