Whamcloud - gitweb
Fix the resize inode test case
[tools/e2fsprogs.git] / tests / r_resize_inode / script
index 339345c..aced9c4 100644 (file)
@@ -1,4 +1,5 @@
-echo -n "resize2fs with resize_inode: "
+if test -x $RESIZE2FS_EXE; then
+
 FSCK_OPT=-yf
 OUT=$test_name.log
 if [ -f $test_dir/expect.gz ]; then
@@ -36,6 +37,8 @@ $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT
 
 echo "--------------------------------" >> $OUT
 
+dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
+
 echo mke2fs -q -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 65536 >> $OUT
 $MKE2FS -q -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 65536 2>&1 \
        | sed -e '1d' | grep -v "automatically checked" | 
@@ -77,10 +80,7 @@ $TUNE2FS -c 20 -U clear $TMPFILE  >/dev/null 2>&1
 echo dumpe2fs test.img >> $OUT
 $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs >> $OUT
 
-
-
-
-rm -f $test_name.ok $test_name.failed
+rm -f $test_name.ok $test_name.failed $TMPFILE
 cmp -s $OUT $EXP
 status=$?
 
@@ -89,9 +89,13 @@ if [ "$status" = 0 ] ; then
        touch $test_name.ok
 else
        echo "failed"
-       diff -c $EXP $OUT > $test_name.failed
+       diff $DIFF_OPTS $EXP $OUT > $test_name.failed
        rm -f tmp_expect
 fi
 
 unset IMAGE FSCK_OPT OUT EXP
 
+else #if test -x $RESIZE2FS; then
+       rm -f $test_name.ok $test_name.failed
+       echo "skipped"
+fi