From: Jashan Kamboj Date: Fri, 10 Jul 2015 18:30:28 +0000 (+0530) Subject: functional test of mds cap path restriction X-Git-Tag: v10.0.0~123^2~79 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eef20282f047dcf014dc6f66cb0dcd61bcb9ff1e;p=ceph.git functional test of mds cap path restriction Signed-off-by: Jashan Kamboj --- diff --git a/qa/workunits/fs/test_path_caps.sh b/qa/workunits/fs/test_path_caps.sh new file mode 100755 index 000000000000..57c6af770c4f --- /dev/null +++ b/qa/workunits/fs/test_path_caps.sh @@ -0,0 +1,34 @@ +#!/bin/sh -ex + +mkdir mnt.admin mnt.foo + +./ceph-fuse -n client.admin mnt.admin +mkdir mnt.admin/foo mnt.admin/bar + +./ceph auth get-or-create client.foo mon 'allow r' mds 'allow r, allow rw path=/foo' osd 'allow rwx' >> keyring +./ceph-fuse -n client.foo mnt.foo + +cleanup() +{ + rm -rf mnt.admin/foo mnt.admin/bar + fusermount -u mnt.foo + fusermount -u mnt.admin + rmdir mnt.admin mnt.foo +} + +trap cleanup INT TERM EXIT + +expect_false() +{ + if "$@"; then return 1; + else return 0; + fi +} + +# things in /foo/ are allowed +mkdir mnt.foo/foo/x +mkdir mnt.foo/foo/y + +# everything else is not +expect_false mkdir mnt.foo/bar/x +expect_false mkdir mnt.foo/food \ No newline at end of file