]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test: ceph-detect-init/run-tox.sh: run it from any path
authorKefu Chai <kchai@redhat.com>
Wed, 13 Jul 2016 13:09:59 +0000 (21:09 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 15 Jul 2016 01:55:51 +0000 (09:55 +0800)
this follows the pattern in ceph-disk. this enables us to run
ceph-detect-init/run-tox.sh from the ${CMAKE_BINARY_DIRECTORY}
as well.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/ceph-detect-init/run-tox.sh

index 8b09174c24a3a26b277feb1e2d9130d0189a2a21..3624381b8084ae7ded8846184e8904b64e722ba1 100755 (executable)
@@ -25,8 +25,15 @@ fi
 # run from the ceph-detect-init directory or from its parent
 : ${CEPH_DETECT_INIT_VIRTUALENV:=/tmp/ceph-detect-init-virtualenv}
 test -d ceph-detect-init && cd ceph-detect-init
+
+if [ -e tox.ini ]; then
+    TOX_PATH=`readlink -f tox.ini`
+else
+    TOX_PATH=`readlink -f $(dirname $0)/tox.ini`
+fi
+
 source ${CEPH_DETECT_INIT_VIRTUALENV}/bin/activate
-tox > ${CEPH_DETECT_INIT_VIRTUALENV}/tox.out 2>&1
+tox -c ${TOX_PATH} > ${CEPH_DETECT_INIT_VIRTUALENV}/tox.out 2>&1
 status=$?
 grep -v InterpreterNotFound < ${CEPH_DETECT_INIT_VIRTUALENV}/tox.out
 exit $status