summaryrefslogtreecommitdiff
path: root/tests/data
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2007-09-15 00:48:20 +0000
committerRuss Allbery <rra@stanford.edu>2007-09-15 00:48:20 +0000
commitb2285aff21d379b680cabb1259d31e5bf5b57a69 (patch)
tree9cdfe75dadb3106b69ea3aef246da4135bf8a2e0 /tests/data
parent4c4cb52999c9f4d7bbd31b958decfbf8a5012cbc (diff)
Add a test suite for keytab-backend.
Diffstat (limited to 'tests/data')
-rw-r--r--tests/data/allow-extract8
-rwxr-xr-xtests/data/fake-kadmin20
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/data/allow-extract b/tests/data/allow-extract
new file mode 100644
index 0000000..abfe816
--- /dev/null
+++ b/tests/data/allow-extract
@@ -0,0 +1,8 @@
+# List of principal regexes that may be extracted.
+ # this is still a comment
+
+^service/foo@EXAMPLE\.ORG$
+.*/bar@EXAMPLE.NET$
+^host/example.org@EXAMPLE\.ORG$
+#.*
+^error@EXAMPLE.ORG$
diff --git a/tests/data/fake-kadmin b/tests/data/fake-kadmin
new file mode 100755
index 0000000..e1e1892
--- /dev/null
+++ b/tests/data/fake-kadmin
@@ -0,0 +1,20 @@
+#!/usr/bin/perl -w
+# $Id$
+#
+# fake-kadmin -- Fake kadmin.local used to test the keytab backend.
+
+unless ($ARGV[0] eq '-q' && @ARGV == 2) {
+ die "invalid arguments\n";
+}
+my @command = split (' ', $ARGV[1]);
+unless ("@command[0..3]" eq 'ktadd -q -norandkey -k') {
+ die "invalid command @command\n";
+}
+if ($command[5] eq 'error@EXAMPLE.ORG') {
+ warn "Some bad stuff\n";
+ exit 1;
+}
+open (OUT, '>', $command[4]) or die "cannot create $command[4]: $!\n";
+print OUT $command[5], "\n";
+close OUT;
+exit 0;