aboutsummaryrefslogtreecommitdiffstats
path: root/check
diff options
context:
space:
mode:
authorEryu Guan <eguan@redhat.com>2015-05-14 20:27:54 +1000
committerDave Chinner <david@fromorbit.com>2015-05-14 20:27:54 +1000
commita276c261c9c943e1b50cc5ebbfcb900df6ba081f (patch)
treef1d03460b08fabd8b0d199789c0809408ef850c4 /check
parent32d2a17f47087839602b7f1a2505615a88849695 (diff)
downloadxfstests-dev-a276c261c9c943e1b50cc5ebbfcb900df6ba081f.tar.gz
check: set failure status before exit
check has trapped 'exit 1' and exit with $status, but check always returns 0 on error because status never gets updated. This causes problems while running some tests in a loop until it fails, e.g. while ./check generic/081; do : ; done Just set status to 1 before exit, as what we do in the tests. Also remove an unused $flag while we're at it. Signed-off-by: Eryu Guan <eguan@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'check')
-rwxr-xr-xcheck20
1 files changed, 13 insertions, 7 deletions
diff --git a/check b/check
index 4fa96ed2b8..a3001309e7 100755
--- a/check
+++ b/check
@@ -451,7 +451,8 @@ for section in $HOST_OPTIONS_SECTIONS; do
mkdir -p $RESULT_BASE
if [ ! -d $RESULT_BASE ]; then
echo "failed to create results directory $RESULT_BASE"
- exit 1;
+ status=1
+ exit
fi
if $OPTIONS_HAVE_SECTIONS; then
@@ -466,12 +467,14 @@ for section in $HOST_OPTIONS_SECTIONS; do
echo "our local _test_mkfs routine ..."
cat $tmp.err
echo "check: failed to mkfs \$TEST_DEV using specified options"
- exit 1
+ status=1
+ exit
fi
out=`_mount_or_remount_rw "$MOUNT_OPTIONS" $TEST_DEV $TEST_DIR`
if [ $? -ne 1 ]; then
echo $out
- exit 1
+ status=1
+ exit
fi
_prepare_test_list
elif [ "$OLD_MOUNT_OPTIONS" != "$MOUNT_OPTIONS" ]; then
@@ -479,7 +482,8 @@ for section in $HOST_OPTIONS_SECTIONS; do
out=`_mount_or_remount_rw "$MOUNT_OPTIONS" $TEST_DEV $TEST_DIR`
if [ $? -ne 1 ]; then
echo $out
- exit 1
+ status=1
+ exit
fi
fi
@@ -508,12 +512,13 @@ for section in $HOST_OPTIONS_SECTIONS; do
# call the overridden mkfs - make sure the FS is built
# the same as we'll create it later.
- if ! _scratch_mkfs $flag >$tmp.err 2>&1
+ if ! _scratch_mkfs >$tmp.err 2>&1
then
echo "our local _scratch_mkfs routine ..."
cat $tmp.err
echo "check: failed to mkfs \$SCRATCH_DEV using specified options"
- exit 1
+ status=1
+ exit
fi
# call the overridden mount - make sure the FS mounts with
@@ -523,7 +528,8 @@ for section in $HOST_OPTIONS_SECTIONS; do
echo "our local mount routine ..."
cat $tmp.err
echo "check: failed to mount \$SCRATCH_DEV using specified options"
- exit 1
+ status=1
+ exit
fi
fi