From 44fa7ee788fc2dc943fcd682067cb871608c22e1 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Mon, 10 Jul 2017 13:03:11 -0400 Subject: [PATCH] qa/workunits/rbd: rbd-mirror tests should use 'mirror' user Signed-off-by: Jason Dillaman --- qa/workunits/rbd/rbd_mirror.sh | 4 +-- qa/workunits/rbd/rbd_mirror_helpers.sh | 34 +++++++++++++++++--------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/qa/workunits/rbd/rbd_mirror.sh b/qa/workunits/rbd/rbd_mirror.sh index f000b66271c1d..bb0216e78a5d3 100755 --- a/qa/workunits/rbd/rbd_mirror.sh +++ b/qa/workunits/rbd/rbd_mirror.sh @@ -388,7 +388,7 @@ request_resync_image ${CLUSTER1} ${POOL} ${image} image_id wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position' testlog "TEST: no blacklists" -ceph --cluster ${CLUSTER1} osd blacklist ls 2>&1 | grep -q "listed 0 entries" -ceph --cluster ${CLUSTER2} osd blacklist ls 2>&1 | grep -q "listed 0 entries" +CEPH_ARGS='--id admin' ceph --cluster ${CLUSTER1} osd blacklist ls 2>&1 | grep -q "listed 0 entries" +CEPH_ARGS='--id admin' ceph --cluster ${CLUSTER2} osd blacklist ls 2>&1 | grep -q "listed 0 entries" echo OK diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index 98beb7891ec13..b3cf017f6652a 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -69,6 +69,8 @@ CLUSTER2=cluster2 POOL=mirror PARENT_POOL=mirror_parent TEMPDIR= +USER_ID=mirror +export CEPH_ARGS="--id ${USER_ID}" CEPH_ROOT=$(readlink -f $(dirname $0)/../../../src) CEPH_BIN=. @@ -190,8 +192,15 @@ setup() if [ -z "${RBD_MIRROR_USE_EXISTING_CLUSTER}" ]; then cd ${CEPH_ROOT} - ${CEPH_SRC}/mstart.sh ${CLUSTER1} -n ${RBD_MIRROR_VARGS} - ${CEPH_SRC}/mstart.sh ${CLUSTER2} -n ${RBD_MIRROR_VARGS} + CEPH_ARGS='' ${CEPH_SRC}/mstart.sh ${CLUSTER1} -n ${RBD_MIRROR_VARGS} + CEPH_ARGS='' ${CEPH_SRC}/mstart.sh ${CLUSTER2} -n ${RBD_MIRROR_VARGS} + + CEPH_ARGS='' ceph --conf run/${CLUSTER1}/ceph.conf \ + auth get-or-create client.${USER_ID} mon 'profile rbd' osd 'profile rbd' >> \ + run/${CLUSTER1}/keyring + CEPH_ARGS='' ceph --conf run/${CLUSTER2}/ceph.conf \ + auth get-or-create client.${USER_ID} mon 'profile rbd' osd 'profile rbd' >> \ + run/${CLUSTER2}/keyring rm -f ${TEMPDIR}/${CLUSTER1}.conf ln -s $(readlink -f run/${CLUSTER1}/ceph.conf) \ @@ -203,10 +212,10 @@ setup() cd ${TEMPDIR} fi - ceph --cluster ${CLUSTER1} osd pool create ${POOL} 64 64 - ceph --cluster ${CLUSTER1} osd pool create ${PARENT_POOL} 64 64 - ceph --cluster ${CLUSTER2} osd pool create ${PARENT_POOL} 64 64 - ceph --cluster ${CLUSTER2} osd pool create ${POOL} 64 64 + CEPH_ARGS='' ceph --cluster ${CLUSTER1} osd pool create ${POOL} 64 64 + CEPH_ARGS='' ceph --cluster ${CLUSTER1} osd pool create ${PARENT_POOL} 64 64 + CEPH_ARGS='' ceph --cluster ${CLUSTER2} osd pool create ${PARENT_POOL} 64 64 + CEPH_ARGS='' ceph --cluster ${CLUSTER2} osd pool create ${POOL} 64 64 rbd --cluster ${CLUSTER1} mirror pool enable ${POOL} pool rbd --cluster ${CLUSTER2} mirror pool enable ${POOL} pool @@ -234,13 +243,13 @@ cleanup() if [ -z "${RBD_MIRROR_USE_EXISTING_CLUSTER}" ]; then cd ${CEPH_ROOT} - ${CEPH_SRC}/mstop.sh ${CLUSTER1} - ${CEPH_SRC}/mstop.sh ${CLUSTER2} + CEPH_ARGS='' ${CEPH_SRC}/mstop.sh ${CLUSTER1} + CEPH_ARGS='' ${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 - 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 + CEPH_ARGS='' ceph --cluster ${CLUSTER1} osd pool rm ${POOL} ${POOL} --yes-i-really-really-mean-it + CEPH_ARGS='' ceph --cluster ${CLUSTER2} osd pool rm ${POOL} ${POOL} --yes-i-really-really-mean-it + CEPH_ARGS='' ceph --cluster ${CLUSTER1} osd pool rm ${PARENT_POOL} ${PARENT_POOL} --yes-i-really-really-mean-it + CEPH_ARGS='' 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} @@ -257,6 +266,7 @@ start_mirror() rbd-mirror \ --cluster ${cluster} \ + --id mirror \ --pid-file=$(daemon_pid_file "${cluster}:${instance}") \ --log-file=${TEMPDIR}/rbd-mirror.${cluster}_daemon.${instance}.log \ --admin-socket=${TEMPDIR}/rbd-mirror.${cluster}_daemon.${instance}.\$cluster.asok \ -- 2.39.5