summaryrefslogtreecommitdiff
path: root/perl/t/data
diff options
context:
space:
mode:
Diffstat (limited to 'perl/t/data')
-rwxr-xr-xperl/t/data/keytab-fake29
-rw-r--r--perl/t/data/keytab.conf10
2 files changed, 39 insertions, 0 deletions
diff --git a/perl/t/data/keytab-fake b/perl/t/data/keytab-fake
new file mode 100755
index 0000000..df21294
--- /dev/null
+++ b/perl/t/data/keytab-fake
@@ -0,0 +1,29 @@
+#!/bin/sh
+# $Id$
+#
+# keytab-fake -- Fake keytab-backend implementation.
+#
+# This keytab-fake script is meant to be run by remctld during testing of
+# the keytab object implementation. It returns a fixed string for
+# wallet/one and returns an error for wallet/two.
+
+set -e
+
+if [ "$1" != "retrieve" ] ; then
+ echo "Invalid command $1" >&2
+ exit 1
+fi
+
+case "$2" in
+wallet/one@*)
+ printf 'Keytab for wallet/one'
+ ;;
+wallet/two@*)
+ echo 'bite me' >&2
+ exit 1
+ ;;
+*)
+ echo "Unknown principal $2" >&2
+ exit 1
+ ;;
+esac
diff --git a/perl/t/data/keytab.conf b/perl/t/data/keytab.conf
new file mode 100644
index 0000000..eb105e2
--- /dev/null
+++ b/perl/t/data/keytab.conf
@@ -0,0 +1,10 @@
+# $Id$
+#
+# This is the remctl configuration used for testing the keytab backend's
+# ability to retrieve existing keytabs through remctl. Currently the only
+# supported and used command is keytab retrieve. The ACL is written on
+# the fly by the test program.
+#
+# Compare to config/keytab.
+
+keytab retrieve t/data/keytab-fake test-acl