From 07b15e708639aeaa393b7e3f28afb35807ae23ef Mon Sep 17 00:00:00 2001 From: Anirudha Bose Date: Fri, 19 Aug 2016 12:15:49 +0530 Subject: [PATCH] qa/workunits: Allow setting $PYTHON in ceph-disk/ceph-disk.sh $PYTHON defaults to "python" Signed-off-by: Anirudha Bose --- qa/workunits/ceph-disk/ceph-disk.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/qa/workunits/ceph-disk/ceph-disk.sh b/qa/workunits/ceph-disk/ceph-disk.sh index cf36324fb452..1566d6048828 100755 --- a/qa/workunits/ceph-disk/ceph-disk.sh +++ b/qa/workunits/ceph-disk/ceph-disk.sh @@ -24,16 +24,19 @@ perl -pi -e 's|pid file.*|pid file = /var/run/ceph/\$cluster-\$name.pid|' /etc/c PATH=$(dirname $0):$(dirname $0)/..:$PATH -if ! which py.test > /dev/null; then - echo "py.test not installed" +: ${PYTHON:=python} +PY_VERSION=$($PYTHON --version 2>&1) + +if ! ${PYTHON} -m pytest --version > /dev/null 2>&1; then + echo "py.test not installed for ${PY_VERSION}" exit 1 fi -sudo env PATH=$(dirname $0):$(dirname $0)/..:$PATH py.test -s -v $(dirname $0)/ceph-disk-test.py +sudo env PATH=$(dirname $0):$(dirname $0)/..:$PATH ${PYTHON} -m pytest -s -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 +# 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