]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-authtool: rename cli test dir
authorSage Weil <sage@newdream.net>
Fri, 20 Apr 2012 20:28:23 +0000 (13:28 -0700)
committerSage Weil <sage@newdream.net>
Fri, 20 Apr 2012 20:28:23 +0000 (13:28 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
30 files changed:
src/test/cli/cauthtool/add-key-segv.t [deleted file]
src/test/cli/cauthtool/add-key.t [deleted file]
src/test/cli/cauthtool/cap-bin.t [deleted file]
src/test/cli/cauthtool/cap-invalid.t [deleted file]
src/test/cli/cauthtool/cap-overwrite.t [deleted file]
src/test/cli/cauthtool/cap.t [deleted file]
src/test/cli/cauthtool/create-gen-list-bin.t [deleted file]
src/test/cli/cauthtool/create-gen-list.t [deleted file]
src/test/cli/cauthtool/help.t [deleted file]
src/test/cli/cauthtool/list-empty-bin.t [deleted file]
src/test/cli/cauthtool/list-empty.t [deleted file]
src/test/cli/cauthtool/list-nonexistent-bin.t [deleted file]
src/test/cli/cauthtool/list-nonexistent.t [deleted file]
src/test/cli/cauthtool/manpage.t [deleted file]
src/test/cli/cauthtool/simple.t [deleted file]
src/test/cli/ceph-authtool/add-key-segv.t [new file with mode: 0644]
src/test/cli/ceph-authtool/add-key.t [new file with mode: 0644]
src/test/cli/ceph-authtool/cap-bin.t [new file with mode: 0644]
src/test/cli/ceph-authtool/cap-invalid.t [new file with mode: 0644]
src/test/cli/ceph-authtool/cap-overwrite.t [new file with mode: 0644]
src/test/cli/ceph-authtool/cap.t [new file with mode: 0644]
src/test/cli/ceph-authtool/create-gen-list-bin.t [new file with mode: 0644]
src/test/cli/ceph-authtool/create-gen-list.t [new file with mode: 0644]
src/test/cli/ceph-authtool/help.t [new file with mode: 0644]
src/test/cli/ceph-authtool/list-empty-bin.t [new file with mode: 0644]
src/test/cli/ceph-authtool/list-empty.t [new file with mode: 0644]
src/test/cli/ceph-authtool/list-nonexistent-bin.t [new file with mode: 0644]
src/test/cli/ceph-authtool/list-nonexistent.t [new file with mode: 0644]
src/test/cli/ceph-authtool/manpage.t [new file with mode: 0644]
src/test/cli/ceph-authtool/simple.t [new file with mode: 0644]

diff --git a/src/test/cli/cauthtool/add-key-segv.t b/src/test/cli/cauthtool/add-key-segv.t
deleted file mode 100644 (file)
index 724deb0..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-  $ ceph-authtool kring --create-keyring
-  creating kring
-
-  $ ceph-authtool kring --add-key 'FAKEBASE64 foo'
-  can't decode key 'FAKEBASE64 foo'
-  [1]
diff --git a/src/test/cli/cauthtool/add-key.t b/src/test/cli/cauthtool/add-key.t
deleted file mode 100644 (file)
index 2bfcce0..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-  $ ceph-authtool kring --create-keyring
-  creating kring
-
-  $ ceph-authtool kring --add-key 'AQAK7yxNeF+nHBAA0SgSdbs8IkJrxroDeJ6SwQ== 18446744073709551615'
-  added entity client.admin auth auth(auid = 18446744073709551615 key=AQAK7yxNeF+nHBAA0SgSdbs8IkJrxroDeJ6SwQ== with 0 caps)
-
-# 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)
diff --git a/src/test/cli/cauthtool/cap-bin.t b/src/test/cli/cauthtool/cap-bin.t
deleted file mode 100644 (file)
index c0adb1f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-  $ ceph-authtool kring --create-keyring --gen-key --bin
-  creating kring
-
-  $ ceph-authtool --cap osd 'allow rx pool=swimming' --bin kring
-  $ ceph-authtool kring --list|grep -P '^\tcaps '
-  \tcaps osd = "allow rx pool=swimming" (esc)
diff --git a/src/test/cli/cauthtool/cap-invalid.t b/src/test/cli/cauthtool/cap-invalid.t
deleted file mode 100644 (file)
index c857e26..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-  $ ceph-authtool kring --create-keyring --gen-key
-  creating kring
-
-# TODO is this nice?
-  $ ceph-authtool --cap osd 'broken' kring
-  $ ceph-authtool kring --list|grep -P '^\tcaps '
-  \tcaps osd = "broken" (esc)
-
-# TODO is this nice?
-  $ ceph-authtool --cap xyzzy 'broken' kring
-  $ ceph-authtool kring --list|grep -P '^\tcaps '
-  \tcaps xyzzy = "broken" (esc)
diff --git a/src/test/cli/cauthtool/cap-overwrite.t b/src/test/cli/cauthtool/cap-overwrite.t
deleted file mode 100644 (file)
index 30788df..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-  $ ceph-authtool kring --create-keyring --gen-key
-  creating kring
-
-  $ ceph-authtool --cap osd 'allow rx pool=swimming' kring
-  $ ceph-authtool kring --list|grep -P '^\tcaps '
-  \tcaps osd = "allow rx pool=swimming" (esc)
-
-# TODO it seems --cap overwrites all previous caps; is this wanted?
-  $ ceph-authtool --cap mds 'allow' kring
-  $ ceph-authtool kring --list|grep -P '^\tcaps '
-  \tcaps mds = "allow" (esc)
diff --git a/src/test/cli/cauthtool/cap.t b/src/test/cli/cauthtool/cap.t
deleted file mode 100644 (file)
index 9681d2a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-  $ ceph-authtool kring --create-keyring --gen-key
-  creating kring
-
-  $ ceph-authtool --cap osd 'allow rx pool=swimming' kring
-  $ ceph-authtool kring --list|grep -P '^\tcaps '
-  \tcaps osd = "allow rx pool=swimming" (esc)
-
-  $ cat kring
-  [client.admin]
-  \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re)
-  \tcaps osd = "allow rx pool=swimming" (esc)
diff --git a/src/test/cli/cauthtool/create-gen-list-bin.t b/src/test/cli/cauthtool/create-gen-list-bin.t
deleted file mode 100644 (file)
index 84e636e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-  $ ceph-authtool kring --create-keyring --bin
-  creating kring
-
-  $ ceph-authtool kring --list --bin
-
-# --list actually does not use --bin, but autodetects; run it both
-# ways just to trigger that
-  $ ceph-authtool kring --list
-
-  $ ceph-authtool kring --gen-key --bin
-
-# cram makes matching escape-containing lines with regexps a bit ugly
-  $ ceph-authtool kring --list
-  [client.admin]
-  \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re)
-
-# synonym
-  $ ceph-authtool kring -l
-  [client.admin]
-  \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re)
-
diff --git a/src/test/cli/cauthtool/create-gen-list.t b/src/test/cli/cauthtool/create-gen-list.t
deleted file mode 100644 (file)
index 00f4ed5..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-  $ ceph-authtool kring --create-keyring
-  creating kring
-
-  $ ceph-authtool kring --list
-
-  $ ceph-authtool kring --gen-key
-
-# cram makes matching escape-containing lines with regexps a bit ugly
-  $ ceph-authtool kring --list
-  [client.admin]
-  \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re)
-
-# synonym
-  $ ceph-authtool kring -l
-  [client.admin]
-  \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re)
-
-  $ cat kring
-  [client.admin]
-  \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re)
diff --git a/src/test/cli/cauthtool/help.t b/src/test/cli/cauthtool/help.t
deleted file mode 100644 (file)
index d19330a..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# TODO synchronize with man page
-  $ ceph-authtool --help
-  no command specified
-  usage: ceph-authtool keyringfile [OPTIONS]...
-  where the options are:
-    -l, --list                    will list all keys and capabilities present in
-                                  the keyring
-    -p, --print                   will print an encoded key for the specified
-                                  entityname. This is suitable for the
-                                  'mount -o secret=..' argument
-    -C, --create-keyring          will create a new keyring, overwriting any
-                                  existing keyringfile
-    --gen-key                     will generate a new secret key for the
-                                  specified entityname
-    --add-key                     will add an encoded key to the keyring
-    --cap subsystem capability    will set the capability for given subsystem
-    --caps capsfile               will set all of capabilities associated with a
-                                  given key, for all subsystems
-    -b, --bin                     will create a binary formatted keyring
-  [1]
diff --git a/src/test/cli/cauthtool/list-empty-bin.t b/src/test/cli/cauthtool/list-empty-bin.t
deleted file mode 100644 (file)
index f8d517f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-  $ touch empty
-
-  $ ceph-authtool --list --bin empty
-
-  $ ceph-authtool -l --bin empty
diff --git a/src/test/cli/cauthtool/list-empty.t b/src/test/cli/cauthtool/list-empty.t
deleted file mode 100644 (file)
index 1b465fe..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-  $ touch empty
-
-  $ ceph-authtool --list empty
-
-  $ ceph-authtool -l empty
diff --git a/src/test/cli/cauthtool/list-nonexistent-bin.t b/src/test/cli/cauthtool/list-nonexistent-bin.t
deleted file mode 100644 (file)
index 3ee54c5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-  $ ceph-authtool --list --bin nonexistent
-  can't open nonexistent: can't open nonexistent: (2) No such file or directory
-  [1]
-
-  $ ceph-authtool -l --bin nonexistent
-  can't open nonexistent: can't open nonexistent: (2) No such file or directory
-  [1]
diff --git a/src/test/cli/cauthtool/list-nonexistent.t b/src/test/cli/cauthtool/list-nonexistent.t
deleted file mode 100644 (file)
index 4aecd3e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-  $ ceph-authtool --list nonexistent
-  can't open nonexistent: can't open nonexistent: (2) No such file or directory
-  [1]
-
-  $ ceph-authtool -l nonexistent
-  can't open nonexistent: can't open nonexistent: (2) No such file or directory
-  [1]
diff --git a/src/test/cli/cauthtool/manpage.t b/src/test/cli/cauthtool/manpage.t
deleted file mode 100644 (file)
index e64ac9a..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-  $ ceph-authtool
-  ceph-authtool: must specify filename
-  usage: ceph-authtool keyringfile [OPTIONS]...
-  where the options are:
-    -l, --list                    will list all keys and capabilities present in
-                                  the keyring
-    -p, --print                   will print an encoded key for the specified
-                                  entityname. This is suitable for the
-                                  'mount -o secret=..' argument
-    -C, --create-keyring          will create a new keyring, overwriting any
-                                  existing keyringfile
-    --gen-key                     will generate a new secret key for the
-                                  specified entityname
-    --add-key                     will add an encoded key to the keyring
-    --cap subsystem capability    will set the capability for given subsystem
-    --caps capsfile               will set all of capabilities associated with a
-                                  given key, for all subsystems
-    -b, --bin                     will create a binary formatted keyring
-  [1]
-
-# demonstrate that manpage examples fail without config
-# TODO fix the manpage
-  $ ceph-authtool --create-keyring --name client.foo --gen-key keyring
-  creating keyring
-
-# work around the above
-  $ touch ceph.conf
-
-To create a new keyring containing a key for client.foo:
-
-  $ ceph-authtool --create-keyring --id foo --gen-key keyring.bin
-  creating keyring.bin
-
-  $ ceph-authtool --create-keyring --name client.foo --gen-key keyring.bin
-  creating keyring.bin
-
-To associate some capabilities with the key (namely, the ability to mount a Ceph filesystem):
-
-  $ ceph-authtool -n client.foo --cap mds 'allow' --cap osd 'allow rw pool=data' --cap mon 'allow r' keyring.bin
-
-To display the contents of the keyring:
-
-  $ ceph-authtool -l keyring.bin
-  [client.foo]
-  \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re)
-  \tcaps mds = "allow" (esc)
-  \tcaps mon = "allow r" (esc)
-  \tcaps osd = "allow rw pool=data" (esc)
diff --git a/src/test/cli/cauthtool/simple.t b/src/test/cli/cauthtool/simple.t
deleted file mode 100644 (file)
index e2317d4..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-  $ ceph-authtool
-  ceph-authtool: must specify filename
-  usage: ceph-authtool keyringfile [OPTIONS]...
-  where the options are:
-    -l, --list                    will list all keys and capabilities present in
-                                  the keyring
-    -p, --print                   will print an encoded key for the specified
-                                  entityname. This is suitable for the
-                                  'mount -o secret=..' argument
-    -C, --create-keyring          will create a new keyring, overwriting any
-                                  existing keyringfile
-    --gen-key                     will generate a new secret key for the
-                                  specified entityname
-    --add-key                     will add an encoded key to the keyring
-    --cap subsystem capability    will set the capability for given subsystem
-    --caps capsfile               will set all of capabilities associated with a
-                                  given key, for all subsystems
-    -b, --bin                     will create a binary formatted keyring
-  [1]
diff --git a/src/test/cli/ceph-authtool/add-key-segv.t b/src/test/cli/ceph-authtool/add-key-segv.t
new file mode 100644 (file)
index 0000000..724deb0
--- /dev/null
@@ -0,0 +1,6 @@
+  $ ceph-authtool kring --create-keyring
+  creating kring
+
+  $ ceph-authtool kring --add-key 'FAKEBASE64 foo'
+  can't decode key 'FAKEBASE64 foo'
+  [1]
diff --git a/src/test/cli/ceph-authtool/add-key.t b/src/test/cli/ceph-authtool/add-key.t
new file mode 100644 (file)
index 0000000..2bfcce0
--- /dev/null
@@ -0,0 +1,14 @@
+  $ ceph-authtool kring --create-keyring
+  creating kring
+
+  $ ceph-authtool kring --add-key 'AQAK7yxNeF+nHBAA0SgSdbs8IkJrxroDeJ6SwQ== 18446744073709551615'
+  added entity client.admin auth auth(auid = 18446744073709551615 key=AQAK7yxNeF+nHBAA0SgSdbs8IkJrxroDeJ6SwQ== with 0 caps)
+
+# 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)
diff --git a/src/test/cli/ceph-authtool/cap-bin.t b/src/test/cli/ceph-authtool/cap-bin.t
new file mode 100644 (file)
index 0000000..c0adb1f
--- /dev/null
@@ -0,0 +1,6 @@
+  $ ceph-authtool kring --create-keyring --gen-key --bin
+  creating kring
+
+  $ ceph-authtool --cap osd 'allow rx pool=swimming' --bin kring
+  $ ceph-authtool kring --list|grep -P '^\tcaps '
+  \tcaps osd = "allow rx pool=swimming" (esc)
diff --git a/src/test/cli/ceph-authtool/cap-invalid.t b/src/test/cli/ceph-authtool/cap-invalid.t
new file mode 100644 (file)
index 0000000..c857e26
--- /dev/null
@@ -0,0 +1,12 @@
+  $ ceph-authtool kring --create-keyring --gen-key
+  creating kring
+
+# TODO is this nice?
+  $ ceph-authtool --cap osd 'broken' kring
+  $ ceph-authtool kring --list|grep -P '^\tcaps '
+  \tcaps osd = "broken" (esc)
+
+# TODO is this nice?
+  $ ceph-authtool --cap xyzzy 'broken' kring
+  $ ceph-authtool kring --list|grep -P '^\tcaps '
+  \tcaps xyzzy = "broken" (esc)
diff --git a/src/test/cli/ceph-authtool/cap-overwrite.t b/src/test/cli/ceph-authtool/cap-overwrite.t
new file mode 100644 (file)
index 0000000..30788df
--- /dev/null
@@ -0,0 +1,11 @@
+  $ ceph-authtool kring --create-keyring --gen-key
+  creating kring
+
+  $ ceph-authtool --cap osd 'allow rx pool=swimming' kring
+  $ ceph-authtool kring --list|grep -P '^\tcaps '
+  \tcaps osd = "allow rx pool=swimming" (esc)
+
+# TODO it seems --cap overwrites all previous caps; is this wanted?
+  $ ceph-authtool --cap mds 'allow' kring
+  $ ceph-authtool kring --list|grep -P '^\tcaps '
+  \tcaps mds = "allow" (esc)
diff --git a/src/test/cli/ceph-authtool/cap.t b/src/test/cli/ceph-authtool/cap.t
new file mode 100644 (file)
index 0000000..9681d2a
--- /dev/null
@@ -0,0 +1,11 @@
+  $ ceph-authtool kring --create-keyring --gen-key
+  creating kring
+
+  $ ceph-authtool --cap osd 'allow rx pool=swimming' kring
+  $ ceph-authtool kring --list|grep -P '^\tcaps '
+  \tcaps osd = "allow rx pool=swimming" (esc)
+
+  $ cat kring
+  [client.admin]
+  \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re)
+  \tcaps osd = "allow rx pool=swimming" (esc)
diff --git a/src/test/cli/ceph-authtool/create-gen-list-bin.t b/src/test/cli/ceph-authtool/create-gen-list-bin.t
new file mode 100644 (file)
index 0000000..84e636e
--- /dev/null
@@ -0,0 +1,21 @@
+  $ ceph-authtool kring --create-keyring --bin
+  creating kring
+
+  $ ceph-authtool kring --list --bin
+
+# --list actually does not use --bin, but autodetects; run it both
+# ways just to trigger that
+  $ ceph-authtool kring --list
+
+  $ ceph-authtool kring --gen-key --bin
+
+# cram makes matching escape-containing lines with regexps a bit ugly
+  $ ceph-authtool kring --list
+  [client.admin]
+  \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re)
+
+# synonym
+  $ ceph-authtool kring -l
+  [client.admin]
+  \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re)
+
diff --git a/src/test/cli/ceph-authtool/create-gen-list.t b/src/test/cli/ceph-authtool/create-gen-list.t
new file mode 100644 (file)
index 0000000..00f4ed5
--- /dev/null
@@ -0,0 +1,20 @@
+  $ ceph-authtool kring --create-keyring
+  creating kring
+
+  $ ceph-authtool kring --list
+
+  $ ceph-authtool kring --gen-key
+
+# cram makes matching escape-containing lines with regexps a bit ugly
+  $ ceph-authtool kring --list
+  [client.admin]
+  \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re)
+
+# synonym
+  $ ceph-authtool kring -l
+  [client.admin]
+  \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re)
+
+  $ cat kring
+  [client.admin]
+  \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re)
diff --git a/src/test/cli/ceph-authtool/help.t b/src/test/cli/ceph-authtool/help.t
new file mode 100644 (file)
index 0000000..d19330a
--- /dev/null
@@ -0,0 +1,20 @@
+# TODO synchronize with man page
+  $ ceph-authtool --help
+  no command specified
+  usage: ceph-authtool keyringfile [OPTIONS]...
+  where the options are:
+    -l, --list                    will list all keys and capabilities present in
+                                  the keyring
+    -p, --print                   will print an encoded key for the specified
+                                  entityname. This is suitable for the
+                                  'mount -o secret=..' argument
+    -C, --create-keyring          will create a new keyring, overwriting any
+                                  existing keyringfile
+    --gen-key                     will generate a new secret key for the
+                                  specified entityname
+    --add-key                     will add an encoded key to the keyring
+    --cap subsystem capability    will set the capability for given subsystem
+    --caps capsfile               will set all of capabilities associated with a
+                                  given key, for all subsystems
+    -b, --bin                     will create a binary formatted keyring
+  [1]
diff --git a/src/test/cli/ceph-authtool/list-empty-bin.t b/src/test/cli/ceph-authtool/list-empty-bin.t
new file mode 100644 (file)
index 0000000..f8d517f
--- /dev/null
@@ -0,0 +1,5 @@
+  $ touch empty
+
+  $ ceph-authtool --list --bin empty
+
+  $ ceph-authtool -l --bin empty
diff --git a/src/test/cli/ceph-authtool/list-empty.t b/src/test/cli/ceph-authtool/list-empty.t
new file mode 100644 (file)
index 0000000..1b465fe
--- /dev/null
@@ -0,0 +1,5 @@
+  $ touch empty
+
+  $ ceph-authtool --list empty
+
+  $ ceph-authtool -l empty
diff --git a/src/test/cli/ceph-authtool/list-nonexistent-bin.t b/src/test/cli/ceph-authtool/list-nonexistent-bin.t
new file mode 100644 (file)
index 0000000..3ee54c5
--- /dev/null
@@ -0,0 +1,7 @@
+  $ ceph-authtool --list --bin nonexistent
+  can't open nonexistent: can't open nonexistent: (2) No such file or directory
+  [1]
+
+  $ ceph-authtool -l --bin nonexistent
+  can't open nonexistent: can't open nonexistent: (2) No such file or directory
+  [1]
diff --git a/src/test/cli/ceph-authtool/list-nonexistent.t b/src/test/cli/ceph-authtool/list-nonexistent.t
new file mode 100644 (file)
index 0000000..4aecd3e
--- /dev/null
@@ -0,0 +1,7 @@
+  $ ceph-authtool --list nonexistent
+  can't open nonexistent: can't open nonexistent: (2) No such file or directory
+  [1]
+
+  $ ceph-authtool -l nonexistent
+  can't open nonexistent: can't open nonexistent: (2) No such file or directory
+  [1]
diff --git a/src/test/cli/ceph-authtool/manpage.t b/src/test/cli/ceph-authtool/manpage.t
new file mode 100644 (file)
index 0000000..e64ac9a
--- /dev/null
@@ -0,0 +1,48 @@
+  $ ceph-authtool
+  ceph-authtool: must specify filename
+  usage: ceph-authtool keyringfile [OPTIONS]...
+  where the options are:
+    -l, --list                    will list all keys and capabilities present in
+                                  the keyring
+    -p, --print                   will print an encoded key for the specified
+                                  entityname. This is suitable for the
+                                  'mount -o secret=..' argument
+    -C, --create-keyring          will create a new keyring, overwriting any
+                                  existing keyringfile
+    --gen-key                     will generate a new secret key for the
+                                  specified entityname
+    --add-key                     will add an encoded key to the keyring
+    --cap subsystem capability    will set the capability for given subsystem
+    --caps capsfile               will set all of capabilities associated with a
+                                  given key, for all subsystems
+    -b, --bin                     will create a binary formatted keyring
+  [1]
+
+# demonstrate that manpage examples fail without config
+# TODO fix the manpage
+  $ ceph-authtool --create-keyring --name client.foo --gen-key keyring
+  creating keyring
+
+# work around the above
+  $ touch ceph.conf
+
+To create a new keyring containing a key for client.foo:
+
+  $ ceph-authtool --create-keyring --id foo --gen-key keyring.bin
+  creating keyring.bin
+
+  $ ceph-authtool --create-keyring --name client.foo --gen-key keyring.bin
+  creating keyring.bin
+
+To associate some capabilities with the key (namely, the ability to mount a Ceph filesystem):
+
+  $ ceph-authtool -n client.foo --cap mds 'allow' --cap osd 'allow rw pool=data' --cap mon 'allow r' keyring.bin
+
+To display the contents of the keyring:
+
+  $ ceph-authtool -l keyring.bin
+  [client.foo]
+  \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re)
+  \tcaps mds = "allow" (esc)
+  \tcaps mon = "allow r" (esc)
+  \tcaps osd = "allow rw pool=data" (esc)
diff --git a/src/test/cli/ceph-authtool/simple.t b/src/test/cli/ceph-authtool/simple.t
new file mode 100644 (file)
index 0000000..e2317d4
--- /dev/null
@@ -0,0 +1,19 @@
+  $ ceph-authtool
+  ceph-authtool: must specify filename
+  usage: ceph-authtool keyringfile [OPTIONS]...
+  where the options are:
+    -l, --list                    will list all keys and capabilities present in
+                                  the keyring
+    -p, --print                   will print an encoded key for the specified
+                                  entityname. This is suitable for the
+                                  'mount -o secret=..' argument
+    -C, --create-keyring          will create a new keyring, overwriting any
+                                  existing keyringfile
+    --gen-key                     will generate a new secret key for the
+                                  specified entityname
+    --add-key                     will add an encoded key to the keyring
+    --cap subsystem capability    will set the capability for given subsystem
+    --caps capsfile               will set all of capabilities associated with a
+                                  given key, for all subsystems
+    -b, --bin                     will create a binary formatted keyring
+  [1]