]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/cephtool: test with valid auth syntax
authorSage Weil <sage@redhat.com>
Mon, 9 Apr 2018 21:50:15 +0000 (16:50 -0500)
committerKefu Chai <kchai@redhat.com>
Fri, 4 Jan 2019 05:14:14 +0000 (13:14 +0800)
'allow' is not a valid mon cap; use 'allow *'.  Add some negative tests
to ensure the validation is working.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 497a63251b0d7b8b953bb01d0edb838b8b35919a)

qa/workunits/cephtool/test.sh

index 36f9dc43ebe861046db20aabb704e5ea956a981f..338102bd7e377856827ec8953f1b41ac2bad37c6 100755 (executable)
@@ -578,7 +578,9 @@ function test_tiering_9()
 
 function test_auth()
 {
-  ceph auth add client.xx mon allow osd "allow *"
+  expect_false ceph auth add client.xx mon 'invalid' osd "allow *"
+  expect_false ceph auth add client.xx mon 'allow *' osd "allow *" invalid "allow *"
+  ceph auth add client.xx mon 'allow *' osd "allow *"
   ceph auth export client.xx >client.xx.keyring
   ceph auth add client.xx -i client.xx.keyring
   rm -f client.xx.keyring
@@ -602,7 +604,7 @@ function test_auth()
   expect_false ceph auth get client.xx
 
   # (almost) interactive mode
-  echo -e 'auth add client.xx mon allow osd "allow *"\n' | ceph
+  echo -e 'auth add client.xx mon "allow *" osd "allow *"\n' | ceph
   ceph auth get client.xx
   # script mode
   echo 'auth del client.xx' | ceph