From 7cccdef25e3c35a743414d5a7a6e0b10b8878b9b Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 22 Oct 2019 11:19:14 -0400 Subject: [PATCH] qa/workunits/rbd: add permission tests for mgr profile Signed-off-by: Jason Dillaman --- qa/workunits/rbd/permissions.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/qa/workunits/rbd/permissions.sh b/qa/workunits/rbd/permissions.sh index 9bcdd7914f9..cf836848065 100755 --- a/qa/workunits/rbd/permissions.sh +++ b/qa/workunits/rbd/permissions.sh @@ -40,7 +40,10 @@ delete_users() { } create_users() { - ceph auth get-or-create client.volumes mon 'profile rbd' osd 'profile rbd pool=volumes, profile rbd-read-only pool=images' >> $KEYRING + ceph auth get-or-create client.volumes \ + mon 'profile rbd' \ + osd 'profile rbd pool=volumes, profile rbd-read-only pool=images' \ + mgr 'profile rbd pool=volumes, profile rbd-read-only pool=images' >> $KEYRING ceph auth get-or-create client.images mon 'profile rbd' osd 'profile rbd pool=images' >> $KEYRING ceph auth get-or-create client.snap_none mon 'allow r' >> $KEYRING @@ -231,6 +234,17 @@ test_remove_self_managed_snapshots() { expect 1 remove_self_managed_snapshot snap_profile_pool volumes } +test_rbd_support() { + # read-only commands should work on both pools + ceph -k $KEYRING --id volumes rbd perf image stats volumes + ceph -k $KEYRING --id volumes rbd perf image stats images + + # read/write commands should only work on 'volumes' + rbd -k $KEYRING --id volumes create --image-format 2 --image-feature $IMAGE_FEATURES -s 1 volumes/foo + ceph -k $KEYRING --id volumes rbd task add remove volumes/foo + expect 13 ceph -k $KEYRING --id volumes rbd task add remove images/foo +} + cleanup() { rm -f $KEYRING } @@ -249,6 +263,8 @@ test_volumes_access test_remove_self_managed_snapshots +test_rbd_support + delete_pools delete_users -- 2.39.5