diff options
Diffstat (limited to 'tests/data/fake-kadmin')
-rwxr-xr-x | tests/data/fake-kadmin | 20 |
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; |