From 0d0e03e02c097c01df5fea615c1009ee9e417ea1 Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Fri, 14 Jan 2011 15:00:47 -0800 Subject: [PATCH] Now that cauthtool has two kinds of keyrings, test them both. --- src/test/cli/cauthtool/cap-bin.t | 6 +++++ src/test/cli/cauthtool/create-gen-list-bin.t | 23 +++++++++++++++++++ src/test/cli/cauthtool/list-empty-bin.t | 5 ++++ src/test/cli/cauthtool/list-nonexistent-bin.t | 7 ++++++ 4 files changed, 41 insertions(+) create mode 100644 src/test/cli/cauthtool/cap-bin.t create mode 100644 src/test/cli/cauthtool/create-gen-list-bin.t create mode 100644 src/test/cli/cauthtool/list-empty-bin.t create mode 100644 src/test/cli/cauthtool/list-nonexistent-bin.t diff --git a/src/test/cli/cauthtool/cap-bin.t b/src/test/cli/cauthtool/cap-bin.t new file mode 100644 index 0000000000000..9f34c19dd426b --- /dev/null +++ b/src/test/cli/cauthtool/cap-bin.t @@ -0,0 +1,6 @@ + $ cauthtool kring --create-keyring --gen-key --bin + creating kring + + $ cauthtool --cap osd 'allow rx pool=swimming' --bin kring + $ cauthtool kring --list|grep -P '^\tcaps ' + \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 new file mode 100644 index 0000000000000..34475e0ad5412 --- /dev/null +++ b/src/test/cli/cauthtool/create-gen-list-bin.t @@ -0,0 +1,23 @@ + $ cauthtool kring --create-keyring --bin + creating kring + + $ cauthtool kring --list --bin + +# --list actually does not use --bin, but autodetects; run it both +# ways just to trigger that + $ cauthtool kring --list + + $ cauthtool kring --gen-key --bin + +# cram makes matching escape-containing lines with regexps a bit ugly + $ cauthtool kring --list + [client.admin] + \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re) + \\tauid = [0-9]{20} \(esc\) (re) + +# synonym + $ cauthtool kring -l + [client.admin] + \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re) + \\tauid = [0-9]{20} \(esc\) (re) + diff --git a/src/test/cli/cauthtool/list-empty-bin.t b/src/test/cli/cauthtool/list-empty-bin.t new file mode 100644 index 0000000000000..33ec16d48e53f --- /dev/null +++ b/src/test/cli/cauthtool/list-empty-bin.t @@ -0,0 +1,5 @@ + $ touch empty + + $ cauthtool --list --bin empty + + $ cauthtool -l --bin empty diff --git a/src/test/cli/cauthtool/list-nonexistent-bin.t b/src/test/cli/cauthtool/list-nonexistent-bin.t new file mode 100644 index 0000000000000..009b598d91d88 --- /dev/null +++ b/src/test/cli/cauthtool/list-nonexistent-bin.t @@ -0,0 +1,7 @@ + $ cauthtool --list --bin nonexistent + can't open nonexistent: No such file or directory + [1] + + $ cauthtool -l --bin nonexistent + can't open nonexistent: No such file or directory + [1] -- 2.39.5