diff options
author | Russ Allbery <rra@stanford.edu> | 2008-01-23 03:33:41 +0000 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2008-01-23 03:33:41 +0000 |
commit | 77b6875f95aa54fe9c648ba114e06d85cf655bb1 (patch) | |
tree | 27a3ce2238ed38894e68ef7242a3b2a71c5e6cdc /perl/t/object.t | |
parent | d94cac7f73b8a0c0a067bc179747426726ab8c31 (diff) |
Refactor database initialization into a new Wallet::Admin module.
Diffstat (limited to 'perl/t/object.t')
-rwxr-xr-x | perl/t/object.t | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/perl/t/object.t b/perl/t/object.t index 101110a..48604bc 100755 --- a/perl/t/object.t +++ b/perl/t/object.t @@ -4,7 +4,7 @@ # t/object.t -- Tests for the basic object implementation. # # Written by Russ Allbery <rra@stanford.edu> -# Copyright 2007 Board of Trustees, Leland Stanford Jr. University +# Copyright 2007, 2008 Board of Trustees, Leland Stanford Jr. University # # See LICENSE for licensing terms. @@ -12,9 +12,9 @@ use POSIX qw(strftime); use Test::More tests => 131; use Wallet::ACL; +use Wallet::Admin; use Wallet::Config; use Wallet::Object::Base; -use Wallet::Server; use lib 't/lib'; use Util; @@ -25,12 +25,12 @@ my $host = 'localhost'; my @trace = ($user, $host, time); my $princ = 'service/test@EXAMPLE.COM'; -# Use Wallet::Server to set up the database. +# Use Wallet::Admin to set up the database. db_setup; -my $server = eval { Wallet::Server->reinitialize ($user) }; -is ($@, '', 'Database initialization did not die'); -ok ($server->isa ('Wallet::Server'), ' and returned the right class'); -my $dbh = $server->dbh; +my $admin = eval { Wallet::Admin->new }; +is ($@, '', 'Database connection succeeded'); +is ($admin->reinitialize ($user), 1, 'Database initialization succeeded'); +my $dbh = $admin->dbh; # Okay, now we have a database. Test create and new. We make believe this is # a keytab object; it won't matter for what we're doing. |