From: Kefu Chai Date: Wed, 13 Jul 2016 13:09:59 +0000 (+0800) Subject: test: ceph-detect-init/run-tox.sh: run it from any path X-Git-Tag: ses5-milestone5~376^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3be6e1c76bd02fa13611f5cef8a945d74e7acd12;p=ceph.git test: ceph-detect-init/run-tox.sh: run it from any path 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 --- diff --git a/src/ceph-detect-init/run-tox.sh b/src/ceph-detect-init/run-tox.sh index 8b09174c24a3..3624381b8084 100755 --- a/src/ceph-detect-init/run-tox.sh +++ b/src/ceph-detect-init/run-tox.sh @@ -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