summaryrefslogtreecommitdiffstats
path: root/src/ceph/qa/workunits/rados/test_pool_access.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/ceph/qa/workunits/rados/test_pool_access.sh')
-rwxr-xr-xsrc/ceph/qa/workunits/rados/test_pool_access.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ceph/qa/workunits/rados/test_pool_access.sh b/src/ceph/qa/workunits/rados/test_pool_access.sh
new file mode 100755
index 0000000..8597b71
--- /dev/null
+++ b/src/ceph/qa/workunits/rados/test_pool_access.sh
@@ -0,0 +1,23 @@
+#!/bin/bash -x
+
+set -e
+
+expect_1()
+{
+ set -x
+ set +e
+ "$@"
+ if [ $? == 1 ]; then return 0; else return 1; fi
+}
+
+
+key=`ceph auth get-or-create-key client.poolaccess1 mon 'allow r' osd 'allow *'`
+rados --id poolaccess1 --key $key -p rbd ls
+
+key=`ceph auth get-or-create-key client.poolaccess2 mon 'allow r' osd 'allow * pool=nopool'`
+expect_1 rados --id poolaccess2 --key $key -p rbd ls
+
+key=`ceph auth get-or-create-key client.poolaccess3 mon 'allow r' osd 'allow rw pool=nopool'`
+expect_1 rados --id poolaccess3 --key $key -p rbd ls
+
+echo OK