diff options
author | Russ Allbery <rra@stanford.edu> | 2013-04-15 20:46:42 -0700 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2013-04-16 15:53:54 -0700 |
commit | 943ffbebc085e620fb7663f3d7477783f9e86aec (patch) | |
tree | 611d492fd7a3fc9bafd7272a86c688bbd893bc76 | |
parent | 4f641102e701b3ec517a376b511c0a2b603487b1 (diff) |
Improve the keytab enctype test suite
Fix recognition of the syntax error from Heimdal's klist -ke, which
doesn't exit with status 1. Assume that if we didn't see any known
enctypes, we're dealing with Heimdal. Remove the code to populate the
enctype table, since we do that in Wallet::Admin now. Show the error
if adding an enctype fails.
Change-Id: I40da967ef6868e5cd51a1238e1c6324386468134
Reviewed-on: https://gerrit.stanford.edu/1069
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
-rwxr-xr-x | perl/t/keytab.t | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/perl/t/keytab.t b/perl/t/keytab.t index f89b2c6..34da9c9 100755 --- a/perl/t/keytab.t +++ b/perl/t/keytab.t @@ -9,7 +9,7 @@ # See LICENSE for licensing terms. use POSIX qw(strftime); -use Test::More tests => 139; +use Test::More tests => 140; BEGIN { $Wallet::Config::KEYTAB_TMP = '.' } @@ -124,7 +124,7 @@ sub enctypes { # If that failed, we may have a Heimdal user space instead, so try ktutil. # If we try this directly, it will just hang with MIT ktutil. - if ($? != 0) { + if ($? != 0 || !@enctypes) { @enctypes = (); open (KTUTIL, '-|', 'ktutil', '-k', 'keytab', 'list') or die "cannot run ktutil: $!\n"; @@ -619,18 +619,12 @@ EOO is ($one->history, $history, ' and history is still correct'); # No enctypes we recognize? - skip 'no recognized enctypes', 33 unless @enctypes; - - # We can test. Add the enctypes we recognized to the enctypes table so - # that we'll be allowed to use them. - for my $enctype (@enctypes) { - my $sql = 'insert into enctypes (en_name) values (?)'; - $dbh->do ($sql, undef, $enctype); - } + skip 'no recognized enctypes', 34 unless @enctypes; # Set those encryption types and make sure we get back a limited keytab. is ($one->attr ('enctypes', [ @enctypes ], @trace), 1, 'Setting enctypes works'); + is ($one->error, undef, ' with no error'); for my $enctype (@enctypes) { $history .= "$date add $enctype to attribute enctypes\n"; $history .= " by $user from $host\n"; |