]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rbd-nbd: also test map/unmap with --namespace option
authorIlya Dryomov <idryomov@gmail.com>
Sat, 8 Oct 2022 14:16:10 +0000 (16:16 +0200)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Mon, 17 Oct 2022 08:47:42 +0000 (15:47 +0700)
The entire script is using specs, let's cover non-spec syntax as well.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit edfcf4bd6b2de0de124ec850c75feac3d76a863e)

qa/workunits/rbd/rbd-nbd.sh

index 0fc777168a29f619a0ec9cfcb45bad36ec503d7e..e5ded83b79ffc87c9c13c3ca6814dff8cfdb3f82 100755 (executable)
@@ -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}