File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -609,6 +609,26 @@ function test_auth()
609609 ceph auth del client.xx
610610 expect_false ceph auth get client.xx
611611
612+ # test rotation
613+ ceph auth get-or-create client.admin2 mon ' allow *'
614+ ceph auth get client.admin2 >> keyring1
615+ env CEPH_KEYRING=keyring1 ceph -n client.admin2 auth get client.admin2 >> keyring2
616+ # they are the same:
617+ expect_true diff -au keyring1 keyring2
618+ # rotate itself
619+ env CEPH_KEYRING=keyring1 ceph -n client.admin2 auth rotate client.admin2 >> keyring3
620+ # only the key has changed:
621+ diff -au keyring1 keyring3 | grep -E ' ^[-+][^-+]' | expect_false grep -v key
622+ # the key in keyring1 no longer works:
623+ expect_false env CEPH_KEYRING=keyring1 ceph -n client.admin2 auth get client.admin2
624+ # the key in keyring3 should work:
625+ expect_true env CEPH_KEYRING=keyring3 ceph -n client.admin2 auth get client.admin2
626+ # now verify the key from `auth get` matches what rotate produced:
627+ expect_true ceph auth get client.admin2 >> keyring4
628+ expect_true diff -au keyring3 keyring4
629+ expect_true ceph auth rm client.admin2
630+ rm keyring[1234]
631+
612632 # (almost) interactive mode
613633 echo -e ' auth add client.xx mon "allow *" osd "allow *"\n' | ceph
614634 ceph auth get client.xx
You can’t perform that action at this time.
0 commit comments