From 182676d6bfa817cc2fa26e99c36597ffc41585f0 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Mon, 21 Sep 2015 00:23:26 +0200 Subject: [PATCH] tests: ceph-disk: workunit must fail when test fail Signed-off-by: Joe Julian --- qa/workunits/ceph-disk/ceph-disk.sh | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/qa/workunits/ceph-disk/ceph-disk.sh b/qa/workunits/ceph-disk/ceph-disk.sh index d364efd4f956..69bf525baa6d 100755 --- a/qa/workunits/ceph-disk/ceph-disk.sh +++ b/qa/workunits/ceph-disk/ceph-disk.sh @@ -1,10 +1,26 @@ -source $(dirname $0)/../ceph-helpers-root.sh true +#!/bin/bash +if [ -f $(dirname $0)/../ceph-helpers-root.sh ]; then + source $(dirname $0)/../ceph-helpers-root.sh +else + echo "$(dirname $0)/../ceph-helpers-root.sh does not exist." + exit 1 +fi + +install python-pytest || true +install pytest || true + +PATH=$(dirname $0)/..:$PATH + +if ! which py.test > /dev/null; then + echo "py.test not installed" + exit 1 +fi -install python-pytest -install pytest sudo env PATH=$(dirname $0)/..:$PATH py.test -v $(dirname $0)/ceph-disk-test.py +result=$? + # own whatever was created as a side effect of the py.test run # so that it can successfully be removed later on by a non privileged # process sudo chown -R $(id -u) $(dirname $0) - +exit $result -- 2.47.3