2011-09-03 18:04:37 +04:00
|
|
|
if test -x $DEBUGFS_EXE; then
|
|
|
|
|
2012-05-29 02:58:24 +04:00
|
|
|
test_description="e2fsck with resize_inode"
|
2004-12-24 09:47:50 +03:00
|
|
|
FSCK_OPT=-yf
|
|
|
|
OUT=$test_name.log
|
|
|
|
if [ -f $test_dir/expect.gz ]; then
|
2012-05-29 02:58:24 +04:00
|
|
|
EXP=$test_name.tmp
|
2004-12-24 09:47:50 +03:00
|
|
|
gunzip < $test_dir/expect.gz > $EXP1
|
|
|
|
else
|
|
|
|
EXP=$test_dir/expect
|
|
|
|
fi
|
|
|
|
|
|
|
|
cp /dev/null $OUT
|
|
|
|
|
|
|
|
dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
|
|
|
|
|
2005-01-20 02:06:45 +03:00
|
|
|
echo mke2fs -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 16384 > $OUT
|
2013-06-16 02:44:09 +04:00
|
|
|
$MKE2FS -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 16384 2>&1 |
|
|
|
|
sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
|
2004-12-24 09:47:50 +03:00
|
|
|
|
|
|
|
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
|
|
|
|
status=$?
|
|
|
|
echo Exit status is $status >> $OUT.new
|
2013-06-16 02:44:09 +04:00
|
|
|
sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
|
2004-12-24 09:47:50 +03:00
|
|
|
rm -f $OUT.new
|
|
|
|
|
|
|
|
echo ----------------------------------------------- >> $OUT
|
|
|
|
|
|
|
|
echo " " >> $OUT
|
2011-07-09 20:08:10 +04:00
|
|
|
echo "debugfs -R ''set_inode_field <7> block[2] 42'' -w test.img" > $OUT.new
|
2005-01-08 06:46:21 +03:00
|
|
|
$DEBUGFS -R "set_inode_field <7> block[2] 42" -w $TMPFILE >> $OUT.new 2>&1
|
2004-12-24 09:47:50 +03:00
|
|
|
status=$?
|
|
|
|
echo Exit status is $status >> $OUT.new
|
2013-06-16 02:44:09 +04:00
|
|
|
sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
|
2004-12-24 09:47:50 +03:00
|
|
|
|
|
|
|
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
|
|
|
|
status=$?
|
|
|
|
echo Exit status is $status >> $OUT.new
|
2013-06-16 02:44:09 +04:00
|
|
|
sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
|
2004-12-24 09:47:50 +03:00
|
|
|
rm -f $OUT.new
|
|
|
|
|
|
|
|
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
|
|
|
|
status=$?
|
|
|
|
echo Exit status is $status >> $OUT.new
|
2013-06-16 02:44:09 +04:00
|
|
|
sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
|
2004-12-24 09:47:50 +03:00
|
|
|
rm -f $OUT.new
|
|
|
|
|
|
|
|
echo ----------------------------------------------- >> $OUT
|
|
|
|
|
|
|
|
echo " " >> $OUT
|
2011-07-09 20:08:10 +04:00
|
|
|
echo "debugfs -R ''clri <7>'' -w test.img" > $OUT.new
|
2004-12-24 09:47:50 +03:00
|
|
|
$DEBUGFS -R "clri <7>" -w $TMPFILE >> $OUT.new 2>&1
|
|
|
|
status=$?
|
|
|
|
echo Exit status is $status >> $OUT.new
|
2013-06-16 02:44:09 +04:00
|
|
|
sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
|
2004-12-24 09:47:50 +03:00
|
|
|
|
|
|
|
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
|
|
|
|
status=$?
|
|
|
|
echo Exit status is $status >> $OUT.new
|
2013-06-16 02:44:09 +04:00
|
|
|
sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
|
2004-12-24 09:47:50 +03:00
|
|
|
rm -f $OUT.new
|
|
|
|
|
|
|
|
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
|
|
|
|
status=$?
|
|
|
|
echo Exit status is $status >> $OUT.new
|
2013-06-16 02:44:09 +04:00
|
|
|
sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
|
2004-12-24 09:47:50 +03:00
|
|
|
rm -f $OUT.new
|
|
|
|
|
|
|
|
echo ----------------------------------------------- >> $OUT
|
|
|
|
|
|
|
|
echo " " >> $OUT
|
2011-07-09 20:08:10 +04:00
|
|
|
echo "debugfs -R ''set_inode_field <7> bmap[524] 57'' -w test.img" > $OUT.new
|
2005-01-08 06:46:21 +03:00
|
|
|
$DEBUGFS -R "set_inode_field <7> bmap[524] 57" -w $TMPFILE >> $OUT.new 2>&1
|
2004-12-24 09:47:50 +03:00
|
|
|
status=$?
|
|
|
|
echo Exit status is $status >> $OUT.new
|
2013-06-16 02:44:09 +04:00
|
|
|
sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
|
2004-12-24 09:47:50 +03:00
|
|
|
|
|
|
|
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
|
|
|
|
status=$?
|
|
|
|
echo Exit status is $status >> $OUT.new
|
2013-06-16 02:44:09 +04:00
|
|
|
sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
|
2004-12-24 09:47:50 +03:00
|
|
|
rm -f $OUT.new
|
|
|
|
|
|
|
|
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
|
|
|
|
status=$?
|
|
|
|
echo Exit status is $status >> $OUT.new
|
2013-06-16 02:44:09 +04:00
|
|
|
sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
|
2004-12-24 09:47:50 +03:00
|
|
|
rm -f $OUT.new
|
|
|
|
|
|
|
|
echo ----------------------------------------------- >> $OUT
|
|
|
|
|
|
|
|
echo " " >> $OUT
|
2011-07-09 20:08:10 +04:00
|
|
|
echo "debugfs -R ''set_super_value reserved_gdt_blocks 15679'' -w test.img" > $OUT.new
|
2004-12-24 09:47:50 +03:00
|
|
|
$DEBUGFS -R "set_super_value reserved_gdt_blocks 15679" -w $TMPFILE >> $OUT.new 2>&1
|
|
|
|
status=$?
|
|
|
|
echo Exit status is $status >> $OUT.new
|
2013-06-16 02:44:09 +04:00
|
|
|
sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
|
2004-12-24 09:47:50 +03:00
|
|
|
|
|
|
|
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
|
|
|
|
status=$?
|
|
|
|
echo Exit status is $status >> $OUT.new
|
2013-06-16 02:44:09 +04:00
|
|
|
sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
|
2004-12-24 09:47:50 +03:00
|
|
|
rm -f $OUT.new
|
|
|
|
|
|
|
|
echo ----------------------------------------------- >> $OUT
|
|
|
|
|
|
|
|
echo " " >> $OUT
|
2011-07-09 20:08:10 +04:00
|
|
|
echo "debugfs -R ''set_super_value reserved_gdt_blocks 32'' -w test.img" > $OUT.new
|
2004-12-24 09:47:50 +03:00
|
|
|
$DEBUGFS -R "set_super_value reserved_gdt_blocks 32" -w $TMPFILE >> $OUT.new 2>&1
|
|
|
|
status=$?
|
|
|
|
echo Exit status is $status >> $OUT.new
|
2013-06-16 02:44:09 +04:00
|
|
|
sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
|
2004-12-24 09:47:50 +03:00
|
|
|
|
|
|
|
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
|
|
|
|
status=$?
|
|
|
|
echo Exit status is $status >> $OUT.new
|
2013-06-16 02:44:09 +04:00
|
|
|
sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
|
2004-12-24 09:47:50 +03:00
|
|
|
rm -f $OUT.new
|
|
|
|
|
|
|
|
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
|
|
|
|
status=$?
|
|
|
|
echo Exit status is $status >> $OUT.new
|
2013-06-16 02:44:09 +04:00
|
|
|
sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
|
2004-12-24 09:47:50 +03:00
|
|
|
rm -f $OUT.new
|
|
|
|
|
|
|
|
|
|
|
|
cmp -s $OUT $EXP
|
|
|
|
status=$?
|
|
|
|
|
|
|
|
if [ "$status" = 0 ] ; then
|
2012-05-29 02:58:24 +04:00
|
|
|
echo "$test_name: $test_description: ok"
|
2004-12-24 09:47:50 +03:00
|
|
|
touch $test_name.ok
|
|
|
|
else
|
2012-05-29 02:58:24 +04:00
|
|
|
echo "$test_name: $test_description: failed"
|
2005-06-16 23:08:00 +04:00
|
|
|
diff $DIFF_OPTS $EXP $OUT > $test_name.failed
|
2004-12-24 09:47:50 +03:00
|
|
|
rm -f tmp_expect
|
|
|
|
fi
|
|
|
|
|
|
|
|
unset IMAGE FSCK_OPT OUT EXP
|
|
|
|
|
2011-09-03 18:04:37 +04:00
|
|
|
else #if test -x $DEBUGFS_EXE; then
|
2012-05-29 02:58:24 +04:00
|
|
|
echo "$test_name: $test_description: skipped"
|
2011-09-03 18:04:37 +04:00
|
|
|
fi
|