From: Mykola Golub Date: Mon, 12 Dec 2016 12:20:04 +0000 (+0200) Subject: qa/workunits/rbd: tweaks to use RBD_MIRROR_USE_EXISTING_CLUSTER locally X-Git-Tag: v12.0.0~38^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2bb480e8c342a0000b5fc96e4462ade9ad3f54a7;p=ceph-ci.git qa/workunits/rbd: tweaks to use RBD_MIRROR_USE_EXISTING_CLUSTER locally This var is mostly used when running rbd_mirror test scripts on teuthology. It can be used locally though to speedup re-running the tests: Set a test temp directory: export RBD_MIRROR_TEMDIR=/tmp/tmp.rbd_mirror Run the tests the first time with NOCLEANUP flag (the cluster and daemons are not stopped on finish): RBD_MIRROR_NOCLEANUP=1 ../qa/workunits/rbd/rbd_mirror.sh Now, to re-run the test without restarting the cluster, run cleanup with USE_EXISTING_CLUSTER flag: RBD_MIRROR_USE_EXISTING_CLUSTER=1 \ ../qa/workunits/rbd/rbd_mirror_ha.sh cleanup and then run the tests: RBD_MIRROR_USE_EXISTING_CLUSTER=1 ../qa/workunits/rbd/rbd_mirror_ha.sh Signed-off-by: Mykola Golub --- diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index 24c9000bca6..a930866c364 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -180,8 +180,10 @@ setup() trap cleanup INT TERM EXIT if [ -n "${RBD_MIRROR_TEMDIR}" ]; then + test -d "${RBD_MIRROR_TEMDIR}" || mkdir "${RBD_MIRROR_TEMDIR}" TEMPDIR="${RBD_MIRROR_TEMDIR}" + cd ${TEMPDIR} else TEMPDIR=`mktemp -d` fi @@ -191,8 +193,10 @@ setup() ${CEPH_SRC}/mstart.sh ${CLUSTER1} -n ${RBD_MIRROR_VARGS} ${CEPH_SRC}/mstart.sh ${CLUSTER2} -n ${RBD_MIRROR_VARGS} + rm -f ${TEMPDIR}/${CLUSTER1}.conf ln -s $(readlink -f run/${CLUSTER1}/ceph.conf) \ ${TEMPDIR}/${CLUSTER1}.conf + rm -f ${TEMPDIR}/${CLUSTER2}.conf ln -s $(readlink -f run/${CLUSTER2}/ceph.conf) \ ${TEMPDIR}/${CLUSTER2}.conf @@ -238,6 +242,7 @@ cleanup() ceph --cluster ${CLUSTER1} osd pool rm ${PARENT_POOL} ${PARENT_POOL} --yes-i-really-really-mean-it ceph --cluster ${CLUSTER2} osd pool rm ${PARENT_POOL} ${PARENT_POOL} --yes-i-really-really-mean-it fi + test "${RBD_MIRROR_TEMDIR}" = "${TEMPDIR}" || rm -Rf ${TEMPDIR} }