2011-09-03 18:04:37 +04:00
|
|
|
if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then
|
2008-02-28 22:22:12 +03:00
|
|
|
|
|
|
|
IMAGE=$test_dir/image.gz
|
|
|
|
FSCK_OPT=-yf
|
|
|
|
OUT=$test_name.log
|
|
|
|
EXP=$test_dir/expect
|
|
|
|
|
|
|
|
gunzip < $IMAGE > $TMPFILE
|
|
|
|
|
|
|
|
echo "resize2fs test" > $OUT
|
|
|
|
|
|
|
|
# Look at existing inline extended attribute
|
2011-07-09 20:08:10 +04:00
|
|
|
echo "debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|name = ''" >> $OUT
|
2008-02-28 22:22:12 +03:00
|
|
|
$DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep "^Inode\|in inode body\|name = " >> $OUT
|
|
|
|
status=$?
|
|
|
|
echo Exit status is $status >> $OUT
|
|
|
|
|
|
|
|
# resize it
|
2011-07-09 20:08:10 +04:00
|
|
|
echo "resize2fs test.img 5M" >> $OUT
|
2008-02-28 22:22:12 +03:00
|
|
|
$RESIZE2FS $TMPFILE 5M 2>&1 >> $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
|
2008-02-28 22:22:12 +03:00
|
|
|
|
|
|
|
# Look at inline extended attribute in resized fs
|
2011-07-09 20:08:10 +04:00
|
|
|
echo "debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|name = ''" >> $OUT
|
2008-02-28 22:22:12 +03:00
|
|
|
$DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep "^Inode\|in inode body\|name = " >> $OUT
|
|
|
|
status=$?
|
|
|
|
echo Exit status is $status >> $OUT
|
|
|
|
|
|
|
|
rm $TMPFILE $OUT.new
|
|
|
|
|
|
|
|
#
|
|
|
|
# Do the verification
|
|
|
|
#
|
|
|
|
|
|
|
|
cmp -s $OUT $EXP
|
|
|
|
status=$?
|
|
|
|
|
|
|
|
if [ "$status" = 0 ] ; then
|
2012-05-29 02:58:24 +04:00
|
|
|
echo "$test_name: $test_description: ok"
|
2008-02-28 22:22:12 +03:00
|
|
|
touch $test_name.ok
|
|
|
|
else
|
2012-05-29 02:58:24 +04:00
|
|
|
echo "$test_name: $test_description: failed"
|
2008-02-28 22:22:12 +03:00
|
|
|
diff $DIFF_OPTS $EXP $OUT > $test_name.failed
|
|
|
|
fi
|
|
|
|
|
|
|
|
unset IMAGE FSCK_OPT OUT EXP
|
|
|
|
|
2011-09-03 18:04:37 +04:00
|
|
|
else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then
|
2012-05-29 02:58:24 +04:00
|
|
|
echo "$test_name: $test_description: skipped"
|
2008-02-28 22:22:12 +03:00
|
|
|
fi
|
|
|
|
|