diff options
author | Russ Allbery <rra@stanford.edu> | 2010-02-08 20:08:32 -0800 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2010-02-08 20:08:32 -0800 |
commit | 954151bb1aeb8920b0077692db1705c39ff76eda (patch) | |
tree | b5e27d873be53448b0612cd07945cfdf1c5c7538 | |
parent | c2422d4f762b5db774c6e0fef2cb2de916904f0e (diff) |
Additional cleanup of the keytab test suite
Map the AES enctype to the full enctype name, which will work for both
MIT and Heimdal. Fix the test count. Really test rollback from invalid
enctypes (what we did before made no sense). Skip tests that will just
fail if the enctype stuff is not working, since otherwise it confuses
matters.
-rwxr-xr-x | perl/t/keytab.t | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/perl/t/keytab.t b/perl/t/keytab.t index c3e89d5..93df51c 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 => 212; +use Test::More tests => 213; use Wallet::Admin; use Wallet::Config; @@ -26,7 +26,7 @@ my %enctype = ('triple des cbc mode with hmac/sha1' => 'des3-cbc-sha1', 'des cbc mode with crc-32' => 'des-cbc-crc', 'des cbc mode with rsa-md5' => 'des-cbc-md5', - 'aes-256 cts mode with 96-bit sha-1 hmac' => 'aes256-cts', + 'aes-256 cts mode with 96-bit sha-1 hmac' => 'aes256-cts-hmac-sha1-96', 'arcfour with hmac/md5' => 'rc4-hmac'); # Some global defaults to use. @@ -788,8 +788,7 @@ EOO 'Setting an unrecognized enctype fails'); is ($one->error, 'unknown encryption type foo-bar', ' with the right error message'); - @values = enctypes ($keytab); - is ("@values", "@enctypes", ' and we did rollback properly'); + is ($one->show, $expected, ' and we did rollback properly'); $history .= <<"EOO"; $date get by $user from $host @@ -810,8 +809,12 @@ EOO is ("@values", $enctypes[0], ' and we get back the right value'); $keytab = $one->get (@trace); ok (defined ($keytab), ' and retrieving the keytab still works'); - @values = enctypes ($keytab); - is ("@values", $enctypes[0], ' and it has the right enctype'); + if (defined ($keytab)) { + @values = enctypes ($keytab); + is ("@values", $enctypes[0], ' and it has the right enctype'); + } else { + ok (0, ' and it has the right keytab'); + } is ($one->attr ('enctypes', [ $enctypes[1] ], @trace), 1, 'Setting a different single enctype works'); @values = $one->attr ('enctypes'); |