From: Loic Dachary Date: Sun, 20 Sep 2015 22:23:26 +0000 (+0200) Subject: tests: ceph-disk: workunit must fail when test fail X-Git-Tag: v9.1.0~89^2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F5999%2Fhead;p=ceph.git tests: ceph-disk: workunit must fail when test fail Signed-off-by: Joe Julian --- 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