summaryrefslogtreecommitdiff
path: root/tests/data
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2006-08-23 21:50:29 +0000
committerRuss Allbery <rra@stanford.edu>2006-08-23 21:50:29 +0000
commit06f652577d54e4a2b7d2724a1f9201e220d78159 (patch)
tree3861fb3c601ff240d3819112c37a77e2225b71d2 /tests/data
parent4718fc31896a0cc73ce93647b02bca4fb37754bd (diff)
Add a test infrastructure and a very basic test for the client
functionality so far.
Diffstat (limited to 'tests/data')
-rw-r--r--tests/data/README17
-rwxr-xr-xtests/data/cmd-fake39
-rw-r--r--tests/data/fake-keytabbin0 -> 62 bytes
-rw-r--r--tests/data/wallet.conf4
4 files changed, 60 insertions, 0 deletions
diff --git a/tests/data/README b/tests/data/README
new file mode 100644
index 0000000..890c4dc
--- /dev/null
+++ b/tests/data/README
@@ -0,0 +1,17 @@
+This directory contains data used by wallet's test suite. To enable tests
+that require GSS-API authentication and a working end-to-end Kerberos
+environment, create the K5 keytab that will be used for both the server
+and the client and put it in this directory as test.keytab. Then, create
+a file named test.principal and in it put the principal name corresponding
+to the key in the keytab on a single line ending with a newline.
+
+The presence of these two files will enable the tests that actually do
+GSS-API authentication.
+
+If you are building in a different directory tree than the source tree,
+don't put the files in this directory. Instead, after running configure,
+you will have an empty tests/data directory in your build tree. Put the
+test.keytab and test.principal files in that directory instead.
+
+Note that to successfully run much of the test suite, you will need to have
+remctld installed on the system running the tests.
diff --git a/tests/data/cmd-fake b/tests/data/cmd-fake
new file mode 100755
index 0000000..4093320
--- /dev/null
+++ b/tests/data/cmd-fake
@@ -0,0 +1,39 @@
+#!/bin/sh
+# $Id$
+#
+# This is a fake wallet backend that returns bogus data for verification by
+# the client test suite. It doesn't test any of the wallet server code.
+
+command="$1"
+shift
+type="$1"
+if [ "$1" != "keytab" ] ; then
+ echo "Unknown object type $1" >&2
+ exit 1
+fi
+shift
+
+case "$command" in
+get)
+ if [ "$1" = "service/fake-test" ] ; then
+ cat data/fake-keytab
+ exit 0
+ else
+ echo "Unknown keytab $1" >&2
+ exit 1
+ fi
+ ;;
+show)
+ if [ "$1" = "service/fake-test" ] ; then
+ echo "Some stuff about $1"
+ exit 0
+ else
+ echo "Unknown keytab $1" >&2
+ exit 1
+ fi
+ ;;
+*)
+ echo "Unknown command $command" >&2
+ exit 1
+ ;;
+esac
diff --git a/tests/data/fake-keytab b/tests/data/fake-keytab
new file mode 100644
index 0000000..92e3caa
--- /dev/null
+++ b/tests/data/fake-keytab
Binary files differ
diff --git a/tests/data/wallet.conf b/tests/data/wallet.conf
new file mode 100644
index 0000000..7ad998f
--- /dev/null
+++ b/tests/data/wallet.conf
@@ -0,0 +1,4 @@
+# remctl configuration for wallet client tests.
+# $Id$
+
+fake-wallet ALL data/cmd-fake ANYUSER