]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rbd: additional overrides for CEPH_ARGS
authorJason Dillaman <dillaman@redhat.com>
Tue, 11 Feb 2020 19:15:28 +0000 (14:15 -0500)
committerJason Dillaman <dillaman@redhat.com>
Thu, 13 Feb 2020 01:21:48 +0000 (20:21 -0500)
The 'ceph' CLI and 'rbd mirror pool/image status' commandsshould revert
to use the admin user so that it has proper credentials for the cluster.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
qa/workunits/rbd/rbd_mirror_bootstrap.sh
qa/workunits/rbd/rbd_mirror_helpers.sh

index 05352f36bb081c3a4cf7dde0d3c59b506b182f8d..e0a096ee8a370a2a3d9992886563df814ad83663 100755 (executable)
@@ -13,12 +13,12 @@ testlog "TEST: bootstrap cluster2 from cluster1"
 # create token on cluster1 and import to cluster2
 TOKEN=${TEMPDIR}/peer-token
 TOKEN_2=${TEMPDIR}/peer-token-2
-rbd --cluster ${CLUSTER1} mirror pool peer bootstrap create ${POOL} > ${TOKEN}
-rbd --cluster ${CLUSTER1} mirror pool peer bootstrap create ${PARENT_POOL} > ${TOKEN_2}
+CEPH_ARGS='' rbd --cluster ${CLUSTER1} mirror pool peer bootstrap create ${POOL} > ${TOKEN}
+CEPH_ARGS='' rbd --cluster ${CLUSTER1} mirror pool peer bootstrap create ${PARENT_POOL} > ${TOKEN_2}
 cmp ${TOKEN} ${TOKEN_2}
 
-rbd --cluster ${CLUSTER2} --pool ${POOL} mirror pool peer bootstrap import ${TOKEN} --direction rx-only
-rbd --cluster ${CLUSTER2} --pool ${PARENT_POOL} mirror pool peer bootstrap import ${TOKEN} --direction rx-tx
+CEPH_ARGS='' rbd --cluster ${CLUSTER2} --pool ${POOL} mirror pool peer bootstrap import ${TOKEN} --direction rx-only
+CEPH_ARGS='' rbd --cluster ${CLUSTER2} --pool ${PARENT_POOL} mirror pool peer bootstrap import ${TOKEN} --direction rx-tx
 
 start_mirrors ${CLUSTER1}
 start_mirrors ${CLUSTER2}
index 9810d2eea87bfb5d836edae9df9facb3b61a477d..688a2a72c82fd7726f79b088ce5086434f8170cb 100755 (executable)
@@ -264,21 +264,21 @@ setup_pools()
         rbd --cluster ${cluster} mirror pool peer add ${PARENT_POOL} ${remote_cluster}
       else
         mon_map_file=${TEMPDIR}/${remote_cluster}.monmap
-        ceph --cluster ${remote_cluster} mon getmap > ${mon_map_file}
+        CEPH_ARGS='' ceph --cluster ${remote_cluster} mon getmap > ${mon_map_file}
         mon_addr=$(monmaptool --print ${mon_map_file} | grep -E 'mon\.' |
           head -n 1 | sed -E 's/^[0-9]+: ([^ ]+).+$/\1/' | sed -E 's/\/[0-9]+//g')
 
         admin_key_file=${TEMPDIR}/${remote_cluster}.client.${CEPH_ID}.key
         CEPH_ARGS='' ceph --cluster ${remote_cluster} auth get-key client.${CEPH_ID} > ${admin_key_file}
 
-        rbd --cluster ${cluster} mirror pool peer add ${POOL} \
+        CEPH_ARGS='' rbd --cluster ${cluster} mirror pool peer add ${POOL} \
             client.${CEPH_ID}@${remote_cluster}${PEER_CLUSTER_SUFFIX} \
             --remote-mon-host "${mon_addr}" --remote-key-file ${admin_key_file}
 
         uuid=$(rbd --cluster ${cluster} mirror pool peer add ${PARENT_POOL} \
             client.${CEPH_ID}@${remote_cluster}${PEER_CLUSTER_SUFFIX})
-        rbd --cluster ${cluster} mirror pool peer set ${PARENT_POOL} ${uuid} mon-host ${mon_addr}
-        rbd --cluster ${cluster} mirror pool peer set ${PARENT_POOL} ${uuid} key-file ${admin_key_file}
+        CEPH_ARGS='' rbd --cluster ${cluster} mirror pool peer set ${PARENT_POOL} ${uuid} mon-host ${mon_addr}
+        CEPH_ARGS='' rbd --cluster ${cluster} mirror pool peer set ${PARENT_POOL} ${uuid} key-file ${admin_key_file}
       fi
     fi
 }
@@ -469,9 +469,9 @@ status()
     for cluster in ${CLUSTER1} ${CLUSTER2}
     do
        echo "${cluster} status"
-       ceph --cluster ${cluster} -s
-       ceph --cluster ${cluster} service dump
-       ceph --cluster ${cluster} service status
+       CEPH_ARGS='' ceph --cluster ${cluster} -s
+       CEPH_ARGS='' ceph --cluster ${cluster} service dump
+       CEPH_ARGS='' ceph --cluster ${cluster} service status
        echo
 
        for image_pool in ${POOL} ${PARENT_POOL}
@@ -487,7 +487,7 @@ status()
                echo
 
                echo "${cluster} ${image_pool}${image_ns} mirror pool status"
-               rbd --cluster ${cluster} -p ${image_pool}${image_ns} mirror pool status --verbose
+               CEPH_ARGS='' rbd --cluster ${cluster} -p ${image_pool}${image_ns} mirror pool status --verbose
                echo
 
                for image in `rbd --cluster ${cluster} -p ${image_pool}${image_ns} ls 2>/dev/null`
@@ -699,7 +699,7 @@ test_status_in_pool_dir()
     local service_pattern="$6"
 
     local status_log=${TEMPDIR}/$(mkfname ${cluster}-${pool}-${image}.mirror_status)
-    rbd --cluster ${cluster} mirror image status ${pool}/${image} |
+    CEPH_ARGS='' rbd --cluster ${cluster} mirror image status ${pool}/${image} |
        tee ${status_log} >&2
     grep "^  state: .*${state_pattern}" ${status_log} || return 1
     grep "^  description: .*${description_pattern}" ${status_log} || return 1