aboutsummaryrefslogtreecommitdiff
path: root/perl/t
diff options
context:
space:
mode:
authorJon Robertson <jonrober@stanford.edu>2015-02-17 14:32:59 -0800
committerJon Robertson <jonrober@stanford.edu>2015-06-08 15:24:34 -0700
commit1575e25c9e9edc8d577a0f1118732c98871984e0 (patch)
tree3adaaba7c8da2d374b5e04c9ac73ab54c4aa66b6 /perl/t
parented628d6c89d63fdcbf038ce19776e3047c1105e2 (diff)
Added reports to list all types and acl schemes
Two new reports, 'types' and 'schemes'. These will print out all configured types and acl schemes. Change-Id: Ib06d37755fe80c168a6f723c9a1e683fdf5dfcde
Diffstat (limited to 'perl/t')
-rwxr-xr-xperl/t/general/report.t26
1 files changed, 25 insertions, 1 deletions
diff --git a/perl/t/general/report.t b/perl/t/general/report.t
index 8d348ed..a63ab79 100755
--- a/perl/t/general/report.t
+++ b/perl/t/general/report.t
@@ -11,7 +11,7 @@
use strict;
use warnings;
-use Test::More tests => 197;
+use Test::More tests => 215;
use Wallet::Admin;
use Wallet::Report;
@@ -41,6 +41,30 @@ is (scalar (@acls), 1, 'One ACL in the database');
is ($acls[0][0], 1, ' and that is ACL ID 1');
is ($acls[0][1], 'ADMIN', ' with the right name');
+# Check to see that we have all types that we expect.
+my @types = $report->types;
+is (scalar (@types), 10, 'There are ten types created');
+is ($types[0][0], 'base', ' and the first member is correct');
+is ($types[1][0], 'duo', ' and the second member is correct');
+is ($types[2][0], 'duo-ldap', ' and the third member is correct');
+is ($types[3][0], 'duo-pam', ' and the fourth member is correct');
+is ($types[4][0], 'duo-radius', ' and the fifth member is correct');
+is ($types[5][0], 'duo-rdp', ' and the sixth member is correct');
+is ($types[6][0], 'file', ' and the seventh member is correct');
+is ($types[7][0], 'keytab', ' and the eighth member is correct');
+is ($types[8][0], 'password', ' and the nineth member is correct');
+is ($types[9][0], 'wa-keyring', ' and the tenth member is correct');
+
+# And that we have all schemes that we expect.
+my @schemes = $report->acl_schemes;
+is (scalar (@schemes), 6, 'There are six acl schemes created');
+is ($schemes[0][0], 'base', ' and the first member is correct');
+is ($schemes[1][0], 'krb5', ' and the second member is correct');
+is ($schemes[2][0], 'krb5-regex', ' and the third member is correct');
+is ($schemes[3][0], 'ldap-attr', ' and the fourth member is correct');
+is ($schemes[4][0], 'netdb', ' and the fifth member is correct');
+is ($schemes[5][0], 'netdb-root', ' and the sixth member is correct');
+
# Create an object.
my $server = eval { Wallet::Server->new ('admin@EXAMPLE.COM', 'localhost') };
is ($@, '', 'Creating a server instance did not die');