]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rbd: fix issues under cmake build environment 10076/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 30 Jun 2016 20:59:19 +0000 (16:59 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 30 Jun 2016 20:59:19 +0000 (16:59 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
qa/workunits/rbd/rbd_mirror_helpers.sh

index 9478cc8f9d1c209edd71c9d4f1e035451ae37bd8..307705eacda2033716ecb4ea9b59d287171c0f80 100755 (executable)
@@ -64,9 +64,24 @@ CLUSTER1=cluster1
 CLUSTER2=cluster2
 POOL=mirror
 PARENT_POOL=mirror_parent
-SRC_DIR=$(readlink -f $(dirname $0)/../../../src)
 TEMPDIR=
 
+CEPH_ROOT=$(readlink -f $(dirname $0)/../../../src)
+CEPH_BIN=.
+CEPH_SRC=.
+if [ -e CMakeCache.txt ]; then
+    CEPH_SRC=${CEPH_ROOT}
+    CEPH_ROOT=${PWD}
+    CEPH_BIN=./bin
+
+    # needed for ceph CLI under cmake
+    export LD_LIBRARY_PATH=${CEPH_ROOT}/lib:${LD_LIBRARY_PATH}
+    export PYTHONPATH=${PYTHONPATH}:${CEPH_SRC}/pybind
+    for x in ${CEPH_ROOT}/lib/cython_modules/lib* ; do
+        export PYTHONPATH="${PYTHONPATH}:${x}"
+    done
+fi
+
 # These vars facilitate running this script in an environment with
 # ceph installed from packages, like teuthology. These are not defined
 # by default.
@@ -121,9 +136,9 @@ setup()
     fi
 
     if [ -z "${RBD_MIRROR_USE_EXISTING_CLUSTER}" ]; then
-        cd ${SRC_DIR}
-        ./mstart.sh ${CLUSTER1} -n
-        ./mstart.sh ${CLUSTER2} -n
+        cd ${CEPH_ROOT}
+        ${CEPH_SRC}/mstart.sh ${CLUSTER1} -n
+        ${CEPH_SRC}/mstart.sh ${CLUSTER2} -n
 
         ln -s $(readlink -f run/${CLUSTER1}/ceph.conf) \
            ${TEMPDIR}/${CLUSTER1}.conf
@@ -159,9 +174,9 @@ cleanup()
     stop_mirror "${CLUSTER2}"
 
     if [ -z "${RBD_MIRROR_USE_EXISTING_CLUSTER}" ]; then
-        cd ${SRC_DIR}
-        ./mstop.sh ${CLUSTER1}
-        ./mstop.sh ${CLUSTER2}
+        cd ${CEPH_ROOT}
+        ${CEPH_SRC}/mstop.sh ${CLUSTER1}
+        ${CEPH_SRC}/mstop.sh ${CLUSTER2}
     else
         ceph --cluster ${CLUSTER1} osd pool rm ${POOL} ${POOL} --yes-i-really-really-mean-it
         ceph --cluster ${CLUSTER2} osd pool rm ${POOL} ${POOL} --yes-i-really-really-mean-it