summaryrefslogtreecommitdiff
path: root/perl/t
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2010-03-08 10:19:03 -0800
committerRuss Allbery <rra@stanford.edu>2010-03-08 10:19:03 -0800
commitbc105004b8e88e1ede75dae0028d3ef10c15b57a (patch)
treeaf19792633b6b68be1fc01ba95d9eb9313cf6a55 /perl/t
parent29452c3daeeb15670322907c53f5db2b43d2559f (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 'perl/t')
-rwxr-xr-xperl/t/report.t17
1 files changed, 16 insertions, 1 deletions
diff --git a/perl/t/report.t b/perl/t/report.t
index b283576..1dc69f7 100755
--- a/perl/t/report.t
+++ b/perl/t/report.t
@@ -7,7 +7,7 @@
#
# See LICENSE for licensing terms.
-use Test::More tests => 148;
+use Test::More tests => 151;
use Wallet::Admin;
use Wallet::Report;
@@ -224,6 +224,21 @@ is (scalar (@lines), 1, 'Searching for naming violations finds one');
is ($lines[0][0], 'base', ' and the first has the right type');
is ($lines[0][1], 'service/admin', ' and the right name');
+# Set an ACL naming policy and then look for objects that fail that policy.
+# Use the same deactivation trick as above.
+package Wallet::Config;
+sub verify_acl_name {
+ my ($name) = @_;
+ return unless $naming_active;
+ return 'second not allowed' if $name eq 'second';
+ return;
+}
+package main;
+@lines = $report->audit ('acls', 'name');
+is (scalar (@lines), 1, 'Searching for ACL naming violations finds one');
+is ($lines[0][0], 3, ' and the first has the right ID');
+is ($lines[0][1], 'second', ' and the right name');
+
# Clean up.
$admin->destroy;
unlink 'wallet-db';