From: Ilya Dryomov Date: Sat, 8 Oct 2022 14:16:10 +0000 (+0200) Subject: qa/workunits/rbd-nbd: also test map/unmap with --namespace option X-Git-Tag: v18.1.0~1022^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=edfcf4bd6b2de0de124ec850c75feac3d76a863e;p=ceph.git qa/workunits/rbd-nbd: also test map/unmap with --namespace option The entire script is using specs, let's cover non-spec syntax as well. Signed-off-by: Ilya Dryomov --- diff --git a/qa/workunits/rbd/rbd-nbd.sh b/qa/workunits/rbd/rbd-nbd.sh index 0fc777168a29..e5ded83b79ff 100755 --- a/qa/workunits/rbd/rbd-nbd.sh +++ b/qa/workunits/rbd/rbd-nbd.sh @@ -113,10 +113,10 @@ function get_pid() unmap_device() { - local dev=$1 + local args=$1 local pid=$2 - _sudo rbd device --device-type nbd unmap ${dev} + _sudo rbd device --device-type nbd unmap ${args} rbd device --device-type nbd list | expect_false grep "^${pid}\\b" || return 1 ps -C rbd-nbd | expect_false grep "^ *${pid}\\b" || return 1 @@ -260,6 +260,15 @@ get_pid ${POOL} ${NS} unmap_device "${POOL}/${NS}/${IMAGE}@snap" ${PID} DEV= +# map/unmap namespace using options test +DEV=`_sudo rbd device --device-type nbd map --pool ${POOL} --namespace ${NS} --image ${IMAGE}` +get_pid ${POOL} ${NS} +unmap_device "--pool ${POOL} --namespace ${NS} --image ${IMAGE}" ${PID} +DEV=`_sudo rbd device --device-type nbd map --pool ${POOL} --namespace ${NS} --image ${IMAGE} --snap snap` +get_pid ${POOL} ${NS} +unmap_device "--pool ${POOL} --namespace ${NS} --image ${IMAGE} --snap snap" ${PID} +DEV= + # unmap by image name test 2 DEV=`_sudo rbd device --device-type nbd map ${POOL}/${IMAGE}` get_pid ${POOL}