summaryrefslogtreecommitdiff
path: root/perl/t/init.t
diff options
context:
space:
mode:
Diffstat (limited to 'perl/t/init.t')
-rwxr-xr-xperl/t/init.t19
1 files changed, 18 insertions, 1 deletions
diff --git a/perl/t/init.t b/perl/t/init.t
index 3fa026f..81c034d 100755
--- a/perl/t/init.t
+++ b/perl/t/init.t
@@ -8,7 +8,7 @@
#
# See LICENSE for licensing terms.
-use Test::More tests => 8;
+use Test::More tests => 16;
use Wallet::ACL;
use Wallet::Config;
@@ -34,5 +34,22 @@ isnt ($entries[0], undef, ' which is a valid entry');
is ($entries[0][0], 'krb5', ' of krb5 scheme');
is ($entries[0][1], 'admin@EXAMPLE.COM', ' with the right user');
+# Test reinitialization.
+$server = eval { Wallet::Server->reinitialize ('admin@EXAMPLE.COM') };
+is ($@, '', 'Reinitialization did not die');
+ok ($server->isa ('Wallet::Server'), ' and returned the right class');
+
+# Now repeat the database content checks.
+$acl = eval { Wallet::ACL->new ('ADMIN', $server->dbh) };
+is ($@, '', 'Retrieving ADMIN ACL successful');
+ok ($acl->isa ('Wallet::ACL'), ' and is the right class');
+@entries = $acl->list;
+is (scalar (@entries), 1, ' and has only one entry');
+isnt ($entries[0], undef, ' which is a valid entry');
+is ($entries[0][0], 'krb5', ' of krb5 scheme');
+is ($entries[0][1], 'admin@EXAMPLE.COM', ' with the right user');
+
# Clean up.
+my $schema = Wallet::Schema->new;
+$schema->drop ($server->dbh);
unlink 'wallet-db';