]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
unittest_mds_authcap: test lists of allow grants
authorSage Weil <sage@redhat.com>
Thu, 9 Jul 2015 16:13:55 +0000 (12:13 -0400)
committerSage Weil <sage@redhat.com>
Thu, 1 Oct 2015 13:39:31 +0000 (09:39 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/test/mds/TestMDSAuthCaps.cc

index 8cf039a6a9364d78c09ff1dd26cf88cd485d713a..3620c122e0590dc65ffbab8f70fd63b671e29165 100644 (file)
@@ -34,6 +34,13 @@ const char *parse_good[] = {
   "allow rw",
   "allow rw uid=1 gids=1,2,3",
   "allow rw path=/foo uid=1 gids=1,2,3",
+  "allow r, allow rw path=/foo",
+  "allow r, allow * uid=1",
+  "allow r ,allow * uid=1",
+  "allow r ;allow * uid=1",
+  "allow r ; allow * uid=1",
+  "allow r ; allow * uid=1",
+  "allow r uid=1 gids=1,2,3, allow * uid=2",
   0
 };
 
@@ -153,6 +160,8 @@ TEST(MDSAuthCaps, OutputParsed) {
      "MDSAuthCaps[allow * path=\"/foo\" uid=1]"},
     {"allow * path=\"/foo\" uid=1 gids=1,2,3",
      "MDSAuthCaps[allow * path=\"/foo\" uid=1 gids=1,2,3]"},
+    {"allow r uid=1 gids=1,2,3, allow * uid=2",
+     "MDSAuthCaps[allow r uid=1 gids=1,2,3, allow * uid=2]"},
   };
   size_t num_tests = sizeof(test_values) / sizeof(*test_values);
   for (size_t i = 0; i < num_tests; ++i) {