2
# $Id: afs-t.in 4094 2008-04-10 23:35:48Z rra $
4
# Tests for k5start with AFS.
6
# Written by Russ Allbery <rra@stanford.edu>
7
# Copyright 2008 Board of Trustees, Leland Stanford Jr. University
9
# See LICENSE for licensing terms.
11
BEGIN { our $total = 7 }
12
use Test::More tests => $total;
14
# Load our test utility programs.
15
require '@abs_top_builddir@/tests/libtest.pl';
17
# The full path to the newly-built k5start client.
18
our $K5START = '@abs_top_builddir@/k5start';
20
# The path to our data directory, which contains the keytab to use to test.
21
our $DATA = '@abs_top_builddir@/tests/data';
24
skip 'no keytab configuration', $total unless -f "$DATA/test.keytab";
25
skip 'no current AFS tokens', $total unless tokens();
26
my $principal = contents ("$DATA/test.principal");
28
# Don't overwrite the user's ticket cache.
29
$ENV{KRB5CCNAME} = 'krb5cc_test';
33
my ($out, $err, $status)
34
= command ($K5START, '-tqUf', "$DATA/test.keytab", '--', 'tokens');
35
skip 'not built with AFS support', $total
37
"k5start: cannot create PAG: AFS support is not available\n");
38
is ($status, 0, 'k5start -t succeeds');
39
is ($err, '', ' with no errors');
40
like ($out, qr/^(User\'s \([^\)]+\) )?[Tt]okens for /m,
41
' and the right output');
42
my ($default, $service) = klist ();
43
is ($default, undef, ' and the normal ticket cache is untouched');
45
# Set the token program to something that doesn't obtain tokens.
46
# Everything should still work, but we should have no tokens.
47
$ENV{KINIT_PROG} = '/bin/true';
49
= command ($K5START, '-tqUf', "$DATA/test.keytab", '--', 'tokens');
50
is ($status, 0, 'k5start -t succeeds with no aklog');
51
is ($err, '', ' with no errors');
52
unlike ($out, qr/^(User\'s \([^\)]+\) )?[Tt]okens for /m,
53
' and we have no tokens');