]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits: Allow setting $PYTHON in ceph-disk/ceph-disk.sh
authorAnirudha Bose <ani07nov@gmail.com>
Fri, 19 Aug 2016 06:45:49 +0000 (12:15 +0530)
committerAnirudha Bose <ani07nov@gmail.com>
Fri, 19 Aug 2016 19:48:33 +0000 (01:18 +0530)
$PYTHON defaults to "python"

Signed-off-by: Anirudha Bose <ani07nov@gmail.com>
qa/workunits/ceph-disk/ceph-disk.sh

index cf36324fb45229abece70e89a951f7f09a59869e..1566d6048828a0b89bbdcbba563cea93af419003 100755 (executable)
@@ -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