diff options
author | Russ Allbery <rra@stanford.edu> | 2010-03-08 10:19:03 -0800 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2010-03-08 10:19:03 -0800 |
commit | bc105004b8e88e1ede75dae0028d3ef10c15b57a (patch) | |
tree | af19792633b6b68be1fc01ba95d9eb9313cf6a55 /tests | |
parent | 29452c3daeeb15670322907c53f5db2b43d2559f (diff) |
Add an ACL name audit to wallet-report and Wallet::Report
Parallel to objects name, add an acls name audit that returns all ACLs
that do not follow the site naming standard.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/server/report-t | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/server/report-t b/tests/server/report-t index 61cfd9b..394a869 100755 --- a/tests/server/report-t +++ b/tests/server/report-t @@ -8,7 +8,7 @@ # See LICENSE for licensing terms. use strict; -use Test::More tests => 42; +use Test::More tests => 44; # Create a dummy class for Wallet::Report that prints what method was called # with its arguments and returns data for testing. @@ -42,7 +42,13 @@ sub audit { shift; print "audit @_\n"; return if ($error or $empty); - return ([ file => 'unix-wallet-password' ]); + if ($_[0] eq 'objects') { + return ([ file => 'unix-wallet-password' ]); + } elsif ($_[0] eq 'acls') { + return ([ 2, 'group/admins' ]); + } else { + return; + } } sub objects { @@ -119,9 +125,13 @@ is ($out, "new\nacls entry foo foo\n" . "ADMIN (ACL ID: 1)\ngroup/admins (ACL ID: 2)\ngroup/users (ACL ID: 4)\n", ' and returns the right output'); ($out, $err) = run_report ('audit', 'objects', 'name'); -is ($err, '', 'Audit report succeeds'); +is ($err, '', 'Object audit report succeeds'); is ($out, "new\naudit objects name\nfile unix-wallet-password\n", ' and returns the right output'); +($out, $err) = run_report ('audit', 'acls', 'name'); +is ($err, '', 'ACL audit report succeeds'); +is ($out, "new\naudit acls name\ngroup/admins (ACL ID: 2)\n", + ' and returns the right output'); ($out, $err) = run_report ('objects'); is ($err, '', 'List succeeds for objects'); is ($out, "new\nobjects \n" |