aboutsummaryrefslogtreecommitdiff
path: root/tests/data/fake-kadmin
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/fake-kadmin
parent4c4cb52999c9f4d7bbd31b958decfbf8a5012cbc (diff)
Add a test suite for keytab-backend.
Diffstat (limited to 'tests/data/fake-kadmin')
-rwxr-xr-xtests/data/fake-kadmin20
1 files changed, 20 insertions, 0 deletions
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;