aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README11
-rwxr-xr-xperl/t/admin.t41
2 files changed, 29 insertions, 23 deletions
diff --git a/README b/README
index 2a96bd0..9a94d83 100644
--- a/README
+++ b/README
@@ -117,11 +117,12 @@ REQUIREMENTS
should be skipped, but not all the permutations have been checked. The
full test suite also requires the Test::Pod Perl module (available from
CPAN), that remctld be installed and available on the user's path or in
- /usr/local/sbin or /usr/sbin, that test cases can run services on and
- connect to port 14373 on 127.0.0.1, and that kinit and either kvno or
- kgetcred (which come with Kerberos) be installed and available on the
- user's path. The full test suite also requires a local keytab and some
- additional configuration.
+ /usr/local/sbin or /usr/sbin, that sqlite3 be installed and available on
+ the user's path, that test cases can run services on and connect to port
+ 14373 on 127.0.0.1, and that kinit and either kvno or kgetcred (which
+ come with Kerberos) be installed and available on the user's path. The
+ full test suite also requires a local keytab and some additional
+ configuration.
To bootstrap from a Git checkout, or if you change the Automake files
and need to regenerate Makefile.in, you will need Automake 1.11 or
diff --git a/perl/t/admin.t b/perl/t/admin.t
index bf6ebce..740c79e 100755
--- a/perl/t/admin.t
+++ b/perl/t/admin.t
@@ -3,7 +3,7 @@
# Tests for wallet administrative interface.
#
# Written by Russ Allbery <rra@stanford.edu>
-# Copyright 2008, 2009, 2010, 2011
+# Copyright 2008, 2009, 2010, 2011, 2013
# The Board of Trustees of the Leland Stanford Junior University
#
# See LICENSE for licensing terms.
@@ -63,24 +63,29 @@ is ($admin->reinitialize ('admin@EXAMPLE.COM'), 1,
' and re-initialization succeeds');
$Wallet::Schema::VERSION = '0.08';
-# Delete all tables and then redump them straight from the SQL file to avoid
-# getting the version table.
-unlink 'wallet-db';
-$admin = eval { Wallet::Admin->new };
-my $status = system ('/usr/bin/sqlite3', 'wallet-db',
- '.read sql/Wallet-Schema-0.07-SQLite.sql');
-is ($status, 0, 'Reinstalling database from non-versioned version succeds');
+# Test an upgrade. Reinitialize to an older version, then test upgrade to the
+# current version.
+SKIP: {
+ my @path = (split (':', $ENV{PATH}));
+ my ($sqlite) = grep { -x $_ } map { "$_/sqlite3" } @path;
+ skip 'sqlite3 not found', 5 unless $sqlite;
-# Test an upgrade. Reinitialize to an older version, then test upgrade to
-# the current version.
-my $retval = $admin->upgrade;
-is ($retval, 1, ' and performing an upgrade succeeds');
-my $sql = "select version from dbix_class_schema_versions order by version "
- ."DESC";
-$version = $admin->dbh->selectall_arrayref ($sql);
-is (@$version, 2, ' and versions table has correct number of rows');
-is (@{ $version->[0] }, 1, ' and correct number of columns');
-is ($version->[0][0], '0.08', ' and the schema version is correct');
+ # Delete all tables and then redump them straight from the SQL file to
+ # avoid getting the version table.
+ unlink 'wallet-db';
+ $admin = eval { Wallet::Admin->new };
+ my $status = system ('sqlite3', 'wallet-db',
+ '.read sql/Wallet-Schema-0.07-SQLite.sql');
+ is ($status, 0, 'Reinstalling database from non-versioned SQL succeds');
+ my $retval = $admin->upgrade;
+ is ($retval, 1, ' and performing an upgrade succeeds');
+ my $sql = "select version from dbix_class_schema_versions order by"
+ . " version DESC";
+ $version = $admin->dbh->selectall_arrayref ($sql);
+ is (@$version, 2, ' and versions table has correct number of rows');
+ is (@{ $version->[0] }, 1, ' and correct number of columns');
+ is ($version->[0][0], '0.08', ' and the schema version is correct');
+}
# Clean up.
is ($admin->destroy, 1, 'Destruction succeeds');