diff options
| author | Russ Allbery <rra@stanford.edu> | 2007-09-26 18:55:03 +0000 | 
|---|---|---|
| committer | Russ Allbery <rra@stanford.edu> | 2007-09-26 18:55:03 +0000 | 
| commit | 7ec47028dbfe6df70d4c07e9546ae1680cf4e91f (patch) | |
| tree | a962f796c0ee3b1393d8a6af882d83f498c3a528 /perl/t | |
| parent | 50d3cd92ea42f76d5a76ec43d869dd8d721ff5f4 (diff) | |
Include the synchronization configuration in show() output.  Provide a
new object method that subclasses can override to add attribute
information to show() and remove the documentation about overriding
show().
Diffstat (limited to 'perl/t')
| -rwxr-xr-x | perl/t/keytab.t | 25 | 
1 files changed, 23 insertions, 2 deletions
diff --git a/perl/t/keytab.t b/perl/t/keytab.t index 14e1df7..c419806 100755 --- a/perl/t/keytab.t +++ b/perl/t/keytab.t @@ -3,7 +3,7 @@  #  # t/keytab.t -- Tests for the keytab object implementation. -use Test::More tests => 158; +use Test::More tests => 160;  use Wallet::Config;  use Wallet::Object::Keytab; @@ -397,7 +397,7 @@ SKIP: {  # Tests for kaserver synchronization support.  SKIP: { -    skip 'no keytab configuration', 92 unless -f 't/data/test.keytab'; +    skip 'no keytab configuration', 94 unless -f 't/data/test.keytab';      # Test the principal mapping.  We can do this without having a kaserver      # configuration.  We only need a basic keytab object configuration.  Do @@ -444,6 +444,16 @@ SKIP: {      # Test setting synchronization attributes, which can also be done without      # configuration. +    my $show = $one->show; +    $show =~ s/^(\s*Created on:) \d+$/$1 0/mg; +    my $expected = <<"EOO"; +           Type: keytab +           Name: wallet/one +     Created by: $user +   Created from: $host +     Created on: 0 +EOO +    is ($show, $expected, 'Show output displays no attributes');      is ($one->attr ('foo', [ 'bar' ], @trace), undef,          'Setting unknown attribute fails');      is ($one->error, 'unknown attribute foo', ' with the right error'); @@ -464,6 +474,17 @@ SKIP: {      is (scalar (@targets), 1, ' and now one target is set');      is ($targets[0], 'kaserver', ' and it is correct');      is ($one->error, undef, ' and there is no error'); +    $show = $one->show; +    $show =~ s/^(\s*Created on:) \d+$/$1 0/mg; +    $expected = <<"EOO"; +           Type: keytab +           Name: wallet/one +    Synced with: kaserver +     Created by: $user +   Created from: $host +     Created on: 0 +EOO +    is ($show, $expected, ' and show now displays the attribute');      # Set up our configuration.      skip 'no AFS kaserver configuration', 27 unless -f 't/data/test.srvtab';  | 
