From 954151bb1aeb8920b0077692db1705c39ff76eda Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Mon, 8 Feb 2010 20:08:32 -0800 Subject: 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. --- perl/t/keytab.t | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'perl/t/keytab.t') 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'); -- cgit v1.2.3