From 3be6e1c76bd02fa13611f5cef8a945d74e7acd12 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 13 Jul 2016 21:09:59 +0800 Subject: [PATCH] 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 --- src/ceph-detect-init/run-tox.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- 2.47.3