From: Sage Weil Date: Fri, 20 Apr 2012 20:28:23 +0000 (-0700) Subject: ceph-authtool: rename cli test dir X-Git-Tag: v0.46~39 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f00dab6f4a39586be6c3b00278a377d93495a175;p=ceph.git ceph-authtool: rename cli test dir Signed-off-by: Sage Weil --- diff --git a/src/test/cli/cauthtool/add-key-segv.t b/src/test/cli/cauthtool/add-key-segv.t deleted file mode 100644 index 724deb0b6f3..00000000000 --- a/src/test/cli/cauthtool/add-key-segv.t +++ /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 index 2bfcce0b12d..00000000000 --- a/src/test/cli/cauthtool/add-key.t +++ /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 index c0adb1f5364..00000000000 --- a/src/test/cli/cauthtool/cap-bin.t +++ /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 index c857e26ab52..00000000000 --- a/src/test/cli/cauthtool/cap-invalid.t +++ /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 index 30788dfd4fd..00000000000 --- a/src/test/cli/cauthtool/cap-overwrite.t +++ /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 index 9681d2acfeb..00000000000 --- a/src/test/cli/cauthtool/cap.t +++ /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 index 84e636e633d..00000000000 --- a/src/test/cli/cauthtool/create-gen-list-bin.t +++ /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 index 00f4ed5e0f6..00000000000 --- a/src/test/cli/cauthtool/create-gen-list.t +++ /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 index d19330a1ca7..00000000000 --- a/src/test/cli/cauthtool/help.t +++ /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 index f8d517f8931..00000000000 --- a/src/test/cli/cauthtool/list-empty-bin.t +++ /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 index 1b465fe6560..00000000000 --- a/src/test/cli/cauthtool/list-empty.t +++ /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 index 3ee54c536b1..00000000000 --- a/src/test/cli/cauthtool/list-nonexistent-bin.t +++ /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 index 4aecd3e2702..00000000000 --- a/src/test/cli/cauthtool/list-nonexistent.t +++ /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 index e64ac9a3c31..00000000000 --- a/src/test/cli/cauthtool/manpage.t +++ /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 index e2317d45a05..00000000000 --- a/src/test/cli/cauthtool/simple.t +++ /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 index 00000000000..724deb0b6f3 --- /dev/null +++ b/src/test/cli/ceph-authtool/add-key-segv.t @@ -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 index 00000000000..2bfcce0b12d --- /dev/null +++ b/src/test/cli/ceph-authtool/add-key.t @@ -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 index 00000000000..c0adb1f5364 --- /dev/null +++ b/src/test/cli/ceph-authtool/cap-bin.t @@ -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 index 00000000000..c857e26ab52 --- /dev/null +++ b/src/test/cli/ceph-authtool/cap-invalid.t @@ -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 index 00000000000..30788dfd4fd --- /dev/null +++ b/src/test/cli/ceph-authtool/cap-overwrite.t @@ -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 index 00000000000..9681d2acfeb --- /dev/null +++ b/src/test/cli/ceph-authtool/cap.t @@ -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 index 00000000000..84e636e633d --- /dev/null +++ b/src/test/cli/ceph-authtool/create-gen-list-bin.t @@ -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 index 00000000000..00f4ed5e0f6 --- /dev/null +++ b/src/test/cli/ceph-authtool/create-gen-list.t @@ -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 index 00000000000..d19330a1ca7 --- /dev/null +++ b/src/test/cli/ceph-authtool/help.t @@ -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 index 00000000000..f8d517f8931 --- /dev/null +++ b/src/test/cli/ceph-authtool/list-empty-bin.t @@ -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 index 00000000000..1b465fe6560 --- /dev/null +++ b/src/test/cli/ceph-authtool/list-empty.t @@ -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 index 00000000000..3ee54c536b1 --- /dev/null +++ b/src/test/cli/ceph-authtool/list-nonexistent-bin.t @@ -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 index 00000000000..4aecd3e2702 --- /dev/null +++ b/src/test/cli/ceph-authtool/list-nonexistent.t @@ -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 index 00000000000..e64ac9a3c31 --- /dev/null +++ b/src/test/cli/ceph-authtool/manpage.t @@ -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 index 00000000000..e2317d45a05 --- /dev/null +++ b/src/test/cli/ceph-authtool/simple.t @@ -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]