Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / ceph-disk / run-tox.sh
1 #!/bin/bash
2 #
3 # Copyright (C) 2015 <contact@redhat.com>
4 #
5 # Author: Loic Dachary <loic@dachary.org>
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU Library Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU Library Public License for more details.
16 #
17
18 # run from the ceph-disk directory or from its parent
19 : ${CEPH_DISK_VIRTUALENV:=/tmp/ceph-disk-virtualenv}
20 test -d ceph-disk && cd ceph-disk
21
22 if [ -e tox.ini ]; then
23     TOX_PATH=`readlink -f tox.ini`
24 else
25     TOX_PATH=`readlink -f $(dirname $0)/tox.ini`
26 fi
27
28 if [ -z $CEPH_BUILD_DIR ]; then
29     export CEPH_BUILD_DIR=$(dirname ${TOX_PATH})
30 fi
31
32 source ${CEPH_DISK_VIRTUALENV}/bin/activate
33 tox -c ${TOX_PATH}