diff options
Diffstat (limited to 'perl/t')
-rwxr-xr-x | perl/t/acl.t | 3 | ||||
-rwxr-xr-x | perl/t/init.t | 10 | ||||
-rwxr-xr-x | perl/t/keytab.t | 3 | ||||
-rwxr-xr-x | perl/t/object.t | 3 | ||||
-rwxr-xr-x | perl/t/server.t | 4 |
5 files changed, 10 insertions, 13 deletions
diff --git a/perl/t/acl.t b/perl/t/acl.t index 15796d2..59e1071 100755 --- a/perl/t/acl.t +++ b/perl/t/acl.t @@ -227,6 +227,5 @@ is ($acl->name, 'example', ' and the right name'); is ($acl->id, 3, ' and a new ID'); # Clean up. -my $schema = Wallet::Schema->new; -$schema->drop ($dbh); +$setup->destroy; unlink 'wallet-db'; diff --git a/perl/t/init.t b/perl/t/init.t index 9e1b600..df2836b 100755 --- a/perl/t/init.t +++ b/perl/t/init.t @@ -8,7 +8,7 @@ # # See LICENSE for licensing terms. -use Test::More tests => 16; +use Test::More tests => 18; use Wallet::ACL; use Wallet::Admin; @@ -50,7 +50,9 @@ isnt ($entries[0], undef, ' which is a valid entry'); is ($entries[0][0], 'krb5', ' of krb5 scheme'); is ($entries[0][1], 'admin@EXAMPLE.ORG', ' with the right user'); -# Clean up. -my $schema = Wallet::Schema->new; -$schema->drop ($admin->dbh); +# Test cleanup. +is ($admin->destroy, 1, 'Destroying the database works'); +$acl = eval { Wallet::ACL->new ('ADMIN', $admin->dbh) }; +like ($@, qr/^cannot search for ACL ADMIN: /, + ' and now the database is gone'); unlink 'wallet-db'; diff --git a/perl/t/keytab.t b/perl/t/keytab.t index a40332a..503b5c9 100755 --- a/perl/t/keytab.t +++ b/perl/t/keytab.t @@ -892,6 +892,5 @@ EOO } # Clean up. -my $schema = Wallet::Schema->new; -$schema->drop ($dbh); +$admin->destroy; unlink ('wallet-db', 'krb5cc_temp', 'krb5cc_test', 'test-acl', 'test-pid'); diff --git a/perl/t/object.t b/perl/t/object.t index 48604bc..94fe22b 100755 --- a/perl/t/object.t +++ b/perl/t/object.t @@ -320,6 +320,5 @@ EOO is ($object->history, $output, ' and the history is correct'); # Clean up. -my $schema = Wallet::Schema->new; -$schema->drop ($dbh); +$admin->destroy; unlink 'wallet-db'; diff --git a/perl/t/server.t b/perl/t/server.t index 5378969..a7b3cc5 100755 --- a/perl/t/server.t +++ b/perl/t/server.t @@ -31,7 +31,6 @@ db_setup; my $setup = eval { Wallet::Admin->new }; is ($@, '', 'Database initialization did not die'); is ($setup->reinitialize ($admin), 1, 'Database initialization succeeded'); -undef $setup; # Now test the new method. $server = eval { Wallet::Server->new (@trace) }; @@ -936,8 +935,7 @@ is ($server->error, 'base:host/default.stanford.edu rejected: host' ' with the right error'); # Clean up. -$schema = Wallet::Schema->new; -$schema->drop ($server->dbh); +$setup->destroy; unlink 'wallet-db'; # Now test handling of some configuration errors. |