diff options
| author | Russ Allbery <rra@stanford.edu> | 2007-10-10 23:20:53 +0000 | 
|---|---|---|
| committer | Russ Allbery <rra@stanford.edu> | 2007-10-10 23:20:53 +0000 | 
| commit | c940a0f4716b0c8048c46ab3e783f543d190eed6 (patch) | |
| tree | 0354ade71a91d1c3cb1f78bc2ee12e8e4284c0b6 /perl/t | |
| parent | 5370a35b615d5d868829ba52748208d9f1b129a5 (diff) | |
Add a history method to the Wallet::ACL API.
Diffstat (limited to 'perl/t')
| -rwxr-xr-x | perl/t/acl.t | 25 | 
1 files changed, 23 insertions, 2 deletions
diff --git a/perl/t/acl.t b/perl/t/acl.t index 644ea3e..bd055d2 100755 --- a/perl/t/acl.t +++ b/perl/t/acl.t @@ -8,7 +8,8 @@  #  # See LICENSE for licensing terms. -use Test::More tests => 100; +use POSIX qw(strftime); +use Test::More tests => 101;  use Wallet::ACL;  use Wallet::Config; @@ -24,7 +25,7 @@ my $admin = 'admin@EXAMPLE.COM';  my $user1 = 'alice@EXAMPLE.COM';  my $user2 = 'bob@EXAMPLE.COM';  my $host = 'localhost'; -my @trace = ($admin, $host); +my @trace = ($admin, $host, time);  # Use Wallet::Server to set up the database.  my $server = eval { Wallet::Server->initialize ($admin) }; @@ -187,6 +188,26 @@ is ($acl->show, "Members of ACL example (id: 2) are:\n", ' and show concurs');  is ($acl->check ($user2), 0, ' and the second user check fails');  is (scalar ($acl->check_errors), '', ' with no error message'); +# Test history. +my $date = strftime ('%Y-%m-%d %H:%M:%S', localtime $trace[2]); +my $history = <<"EOO"; +$date  create +    by $admin from $host +$date  add krb5 $user1 +    by $admin from $host +$date  add krb5 $user2 +    by $admin from $host +$date  remove krb5 $user1 +    by $admin from $host +$date  add krb5  +    by $admin from $host +$date  remove krb5 $user2 +    by $admin from $host +$date  remove krb5  +    by $admin from $host +EOO +is ($acl->history, $history, 'History is correct'); +  # Test destroy.  if ($acl->destroy (@trace)) {      ok (1, 'Destroying the ACL works');  | 
