From: Loic Dachary Date: Tue, 19 Jan 2016 09:19:03 +0000 (+0700) Subject: ceph-disk: make all must setup.py install X-Git-Tag: v10.0.4~46^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7f6295d21fe9e94ae61fed7922c4d22c01bcd91e;p=ceph.git ceph-disk: make all must setup.py install Refactor the test / virtualenv setup in the same way it was done for ceph-detect-init. All shell tests use ceph-helpers.sh which is modified to add ceph-disk / ceph-detect-init virtualenv/bin to the PATH to ensure the source version is used even if ceph is installed. See "ceph-detect-init: make all must setup.py install" Signed-off-by: Loic Dachary --- diff --git a/qa/workunits/ceph-helpers.sh b/qa/workunits/ceph-helpers.sh index bb795d142949..2c1f7a47e355 100755 --- a/qa/workunits/ceph-helpers.sh +++ b/qa/workunits/ceph-helpers.sh @@ -1312,7 +1312,7 @@ function main() { shopt -s -o xtrace PS4='${BASH_SOURCE[0]}:$LINENO: ${FUNCNAME[0]}: ' - export PATH=:$PATH # make sure program from sources are prefered + export PATH=ceph-disk/virtualenv/bin:ceph-detect-init/virtualenv/bin:.:$PATH # make sure program from sources are prefered export CEPH_CONF=/dev/null unset CEPH_ARGS @@ -1334,7 +1334,8 @@ function run_tests() { shopt -s -o xtrace PS4='${BASH_SOURCE[0]}:$LINENO: ${FUNCNAME[0]}: ' - export PATH=":$PATH" + export PATH=ceph-disk/virtualenv/bin:ceph-detect-init/virtualenv/bin:.:$PATH # make sure program from sources are prefered + export CEPH_MON="127.0.0.1:7109" # git grep '\<7109\>' : there must be only one export CEPH_ARGS CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none " diff --git a/src/ceph-disk/.gitignore b/src/ceph-disk/.gitignore index 0b4b8149360f..dfb9bc7b5678 100644 --- a/src/ceph-disk/.gitignore +++ b/src/ceph-disk/.gitignore @@ -6,7 +6,7 @@ *.egg-info *.egg dist -build +virtualenv wheelhouse* *.log *.trs diff --git a/src/ceph-disk/Makefile.am b/src/ceph-disk/Makefile.am index 6beeb0bf5da3..a0f68dee174e 100644 --- a/src/ceph-disk/Makefile.am +++ b/src/ceph-disk/Makefile.am @@ -29,11 +29,13 @@ EXTRA_DIST += \ ceph-disk/tests/test_main.py \ ceph-disk/tox.ini -ceph-disk-all: - cd $(srcdir)/ceph-disk ; python setup.py build +ceph-disk-all: ceph-disk/virtualenv + +ceph-disk/virtualenv: + cd $(srcdir)/ceph-disk ; ../tools/setup-virtualenv.sh ; virtualenv/bin/python setup.py develop ceph-disk-clean: - cd $(srcdir)/ceph-disk ; python setup.py clean ; rm -fr wheelhouse .tox build .coverage *.egg-info + cd $(srcdir)/ceph-disk ; python setup.py clean ; rm -fr wheelhouse .tox virtualenv .coverage *.egg-info ceph-disk-install-data: cd $(srcdir)/ceph-disk ; \ diff --git a/src/ceph-disk/run-tox.sh b/src/ceph-disk/run-tox.sh index 8c08fb1e1ab3..1d2b30fc0646 100755 --- a/src/ceph-disk/run-tox.sh +++ b/src/ceph-disk/run-tox.sh @@ -17,18 +17,8 @@ # run from the ceph-disk directory or from its parent test -d ceph-disk && cd ceph-disk -trap "rm -fr make-check" EXIT -virtualenv make-check -. make-check/bin/activate -# older versions of pip will not install wrap_console scripts -# when using wheel packages -pip --log make-check/log.txt install --upgrade 'pip >= 6.1' -if test -d wheelhouse ; then - export NO_INDEX=--no-index -fi -pip --log make-check/log.txt install $NO_INDEX --use-wheel --find-links=file://$(pwd)/wheelhouse --upgrade distribute -pip --log make-check/log.txt install $NO_INDEX --use-wheel --find-links=file://$(pwd)/wheelhouse 'tox >=1.9' -tox > make-check/tox.out 2>&1 +source virtualenv/bin/activate +tox > virtualenv/tox.out 2>&1 status=$? -grep -v InterpreterNotFound < make-check/tox.out +grep -v InterpreterNotFound < virtualenv/tox.out exit $status