test 032: Run mkfs.xfs only if the prior mkfs.${fs} succeded
authorChandra Seetharaman <sekharan@us.ibm.com>
Thu, 16 Jun 2011 18:01:12 +0000 (20:01 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 16 Jun 2011 18:01:12 +0000 (20:01 +0200)
This test fails when mkfs of a different filesystem fails, which is not
a failure case for this specific test.

Hence, change the test to run mkfs.xfs only if the prior mkfs.${fs} on
different filesystem succeded.

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
032

diff --git a/032 b/032
index 839b913b45c13f46bd442351da806c4e98b6e0db..4261ca2a9f39582f52b73c0661410af12aa6fb4f 100755 (executable)
--- a/032
+++ b/032
@@ -75,11 +75,15 @@ do
        echo "    ( $preop mkfs -t $fs $preargs $SCRATCH_DEV $postargs )" >>$seq.full
        eval $preop mkfs -t $fs $preargs $SCRATCH_DEV $postargs >>$seq.full 2>&1
 
-       # next, ensure we don't overwrite it
-       echo "=== Attempting XFS overwrite of $fs..." >>$seq.full
-       /sbin/mkfs.xfs $SCRATCH_DEV >>$seq.full 2>&1
+       if [ $? -eq 0 ] ; then
+               # next, ensure we don't overwrite it
+               echo "=== Attempting XFS overwrite of $fs..." >>$seq.full
+               /sbin/mkfs.xfs $SCRATCH_DEV >>$seq.full 2>&1
 
-       [ $? -eq 0 ] && echo "Failed - overwrote fs type ${fs}!"
+               [ $? -eq 0 ] && echo "Failed - overwrote fs type ${fs}!"
+       else
+               echo "mkfs of type ${fs} failed" >>$seq.full
+       fi
 done
 
 # success, all done