summaryrefslogtreecommitdiffstats
path: root/src/test/cli/ceph-authtool/add-key.t
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /src/test/cli/ceph-authtool/add-key.t
parentInitial commit. (diff)
downloadceph-b26c4052f3542036551aa9dec9caa4226e456195.tar.xz
ceph-b26c4052f3542036551aa9dec9caa4226e456195.zip
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/cli/ceph-authtool/add-key.t')
-rw-r--r--src/test/cli/ceph-authtool/add-key.t27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/cli/ceph-authtool/add-key.t b/src/test/cli/ceph-authtool/add-key.t
new file mode 100644
index 000000000..0da2365c0
--- /dev/null
+++ b/src/test/cli/ceph-authtool/add-key.t
@@ -0,0 +1,27 @@
+ $ ceph-authtool kring --create-keyring --mode 0644
+ creating kring
+
+ $ ceph-authtool kring --add-key 'AQAK7yxNeF+nHBAA0SgSdbs8IkJrxroDeJ6SwQ== 18446744073709551615'
+ added entity client.admin auth(key=AQAK7yxNeF+nHBAA0SgSdbs8IkJrxroDeJ6SwQ==)
+
+# cram makes matching escape-containing lines with regexps a bit ugly
+ $ ceph-authtool kring --list
+ [client.admin]
+ \tkey = AQAK7yxNeF+nHBAA0SgSdbs8IkJrxroDeJ6SwQ== (esc)
+
+ $ cat kring
+ [client.admin]
+ \tkey = AQAK7yxNeF+nHBAA0SgSdbs8IkJrxroDeJ6SwQ== (esc)
+
+Test --add-key with empty argument
+
+ $ ceph-authtool kring -C --name=mon.* --add-key= --cap mon 'allow *'
+ Option --add-key requires an argument
+ [1]
+
+ $ ceph-authtool test.keyring --create-keyring --mode 0644
+ creating test.keyring
+
+ $ ceph-authtool test.keyring --name client.test --cap osd 'allow rwx' --cap mon 'allow r' --add-key 'AQAK7yxNeF+nHBAA0SgSdbs8IkJrxroDeJ6SwQ== 18446744073709551615'
+ added entity client.test auth(key=AQAK7yxNeF+nHBAA0SgSdbs8IkJrxroDeJ6SwQ==)
+ added 2 caps to entity client.test