aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2010-02-09 19:55:12 -0800
committerRuss Allbery <rra@stanford.edu>2010-02-09 19:55:12 -0800
commitff2d5ac3c63af9833d884d4840c772e60e45da7d (patch)
tree3d72086a5dae6425699c444263b8abc9f16ade64 /tests
parent99448954f4f9504796226bf05e76df22231d51ca (diff)
Use the $SOURCE and $BUILD test suite variables
Now that runtests has been updated to a version that sets $SOURCE and $BUILD, use that in the test cases rather than Autoconf substitutions.
Diffstat (limited to 'tests')
-rw-r--r--tests/client/full-t.in20
-rw-r--r--tests/client/pod-t.in4
-rw-r--r--tests/client/prompt-t.in28
-rw-r--r--tests/server/admin-t.in4
-rw-r--r--tests/server/backend-t.in4
-rw-r--r--tests/server/keytab-t.in9
-rw-r--r--tests/server/pod-t.in6
7 files changed, 36 insertions, 39 deletions
diff --git a/tests/client/full-t.in b/tests/client/full-t.in
index 3240563..a4ca19d 100644
--- a/tests/client/full-t.in
+++ b/tests/client/full-t.in
@@ -1,23 +1,23 @@
#!/usr/bin/perl -w
#
-# tests/client/full-t -- End-to-end tests for the wallet client.
+# End-to-end tests for the wallet client.
#
# Written by Russ Allbery <rra@stanford.edu>
-# Copyright 2008 Board of Trustees, Leland Stanford Jr. University
+# Copyright 2008, 2010 Board of Trustees, Leland Stanford Jr. University
#
# See LICENSE for licensing terms.
# Point to our server configuration. This must be done before Wallet::Config
# is loaded, and it's pulled in as a prerequisite for Wallet::Admin.
-BEGIN { $ENV{WALLET_CONFIG} = '@abs_top_srcdir@/tests/data/wallet.conf' }
+BEGIN { $ENV{WALLET_CONFIG} = "$ENV{SOURCE}/data/wallet.conf" }
BEGIN { our $total = 53 }
use Test::More tests => $total;
-use lib '@abs_top_srcdir@/perl';
+use lib "$ENV{SOURCE}/../perl";
use Wallet::Admin;
-use lib '@abs_top_srcdir@/perl/t/lib';
+use lib "$ENV{SOURCE}/../perl/t/lib";
use Util;
# Make a call to the wallet client. Takes the principal used by the server
@@ -33,9 +33,9 @@ sub wallet {
or die "cannot create wallet.out: $!\n";
open (STDERR, '>', 'wallet.err')
or die "cannot create wallet.err: $!\n";
- exec ('@abs_top_builddir@/client/wallet', '-k', $principal, '-p',
+ exec ("$ENV{BUILD}/../client/wallet", '-k', $principal, '-p',
'14373', '-s', 'localhost', @command)
- or die "cannot run @abs_top_builddir@/client/wallet: $!\n";
+ or die "cannot run $ENV{BUILD}/client/wallet: $!\n";
} else {
waitpid ($pid, 0);
}
@@ -53,19 +53,19 @@ sub wallet {
SKIP: {
skip 'no keytab configuration', $total
- unless -f '@abs_top_builddir@/tests/data/test.keytab';
+ unless -f "$ENV{BUILD}/data/test.keytab";
my $remctld = '@REMCTLD@';
skip 'remctld not found', $total unless $remctld;
# Spawn remctld and get local tickets. Don't destroy the user's Kerberos
# ticket cache.
unlink ('krb5cc_test', 'test-pid');
- my $principal = contents ('@abs_top_builddir@/tests/data/test.principal');
+ my $principal = contents ("$ENV{BUILD}/data/test.principal");
remctld_spawn ($remctld, $principal,
'@abs_top_builddir@/tests/data/test.keytab',
'@abs_top_builddir@/tests/data/full.conf');
$ENV{KRB5CCNAME} = 'krb5cc_test';
- getcreds ('@abs_top_builddir@/tests/data/test.keytab', $principal);
+ getcreds ("$ENV{BUILD}/data/test.keytab", $principal);
# Use Wallet::Admin to set up the database.
db_setup;
diff --git a/tests/client/pod-t.in b/tests/client/pod-t.in
index db995f7..9963567 100644
--- a/tests/client/pod-t.in
+++ b/tests/client/pod-t.in
@@ -3,7 +3,7 @@
# Test POD formatting for client documentation.
#
# Written by Russ Allbery <rra@stanford.edu>
-# Copyright 2008 Board of Trustees, Leland Stanford Jr. University
+# Copyright 2008, 2010 Board of Trustees, Leland Stanford Jr. University
#
# See LICENSE for licensing terms.
@@ -17,6 +17,6 @@ eval 'use Test::Pod 1.00';
SKIP: {
skip $total, 'Test::Pod 1.00 required for testing POD' if $@;
for my $file (@files) {
- pod_file_ok ("@abs_top_srcdir@/client/$file", "client/$file");
+ pod_file_ok ("$ENV{SOURCE}/../client/$file", "client/$file");
}
}
diff --git a/tests/client/prompt-t.in b/tests/client/prompt-t.in
index 7988fc9..e037b3f 100644
--- a/tests/client/prompt-t.in
+++ b/tests/client/prompt-t.in
@@ -1,28 +1,27 @@
#!/usr/bin/perl -w
#
-# tests/client/prompt-t -- Password prompting tests for the wallet client.
+# Password prompting tests for the wallet client.
#
# Written by Russ Allbery <rra@stanford.edu>
-# Copyright 2008 Board of Trustees, Leland Stanford Jr. University
+# Copyright 2008, 2010 Board of Trustees, Leland Stanford Jr. University
#
# See LICENSE for licensing terms.
BEGIN { our $total = 5 }
use Test::More tests => $total;
-use lib '@abs_top_srcdir@/perl';
+use lib "$ENV{SOURCE}/..//perl";
use Wallet::Admin;
-use lib '@abs_top_srcdir@/perl/t/lib';
+use lib "$ENV{SOURCE}/../perl/t/lib";
use Util;
# cd to the correct directory.
-chdir '@abs_top_srcdir@/tests'
- or die "Cannot chdir to @abs_top_srcdir@/tests: $!\n";
+chdir "$ENV{SOURCE}" or die "Cannot chdir to $ENV{SOURCE}: $!\n";
SKIP: {
skip 'no password configuration', $total
- unless -f '@abs_top_builddir@/tests/data/test.password';
+ unless -f "$ENV{BUILD}/data/test.password";
my $remctld = '@REMCTLD@';
skip 'remctld not found', $total unless $remctld;
eval { require Expect };
@@ -35,22 +34,21 @@ SKIP: {
# Spawn remctld and set up with a different ticket cache.
unlink ('krb5cc_test', 'test-pid');
- my $principal = contents ('@abs_top_builddir@/tests/data/test.principal');
- remctld_spawn ($remctld, $principal,
- '@abs_top_builddir@/tests/data/test.keytab',
- '@abs_top_builddir@/tests/data/basic.conf');
+ my $principal = contents ("$ENV{BUILD}/data/test.principal");
+ remctld_spawn ($remctld, $principal, "$ENV{BUILD}/data/test.keytab",
+ "$ENV{BUILD}/data/basic.conf");
$ENV{KRB5CCNAME} = 'krb5cc_test';
# Read in the principal and password.
- open (PASS, '<', '@abs_top_builddir@/tests/data/test.password')
- or die "Cannot open @abs_top_builddir@/tests/data/test.password: $!\n";
+ open (PASS, '<', "$ENV{BUILD}/data/test.password")
+ or die "Cannot open $ENV{BUILD}/data/test.password: $!\n";
my $user = <PASS>;
my $password = <PASS>;
close PASS;
chomp ($user, $password);
# Spawn wallet and check an invalid password.
- my $wallet = Expect->spawn ('@abs_top_builddir@/client/wallet', '-k',
+ my $wallet = Expect->spawn ("$ENV{BUILD}/../client/wallet", '-k',
$principal, '-p', 14373, '-s', 'localhost',
'-c', 'fake-wallet', '-u', $user, 'get',
'keytab', 'service/fake-output');
@@ -61,7 +59,7 @@ SKIP: {
$wallet->soft_close;
# Now check a valid password.
- $wallet = Expect->spawn ('@abs_top_builddir@/client/wallet', '-k',
+ $wallet = Expect->spawn ("$ENV{BUILD}/../client/wallet", '-k',
$principal, '-p', 14373, '-s', 'localhost',
'-c', 'fake-wallet', '-u', $user, 'get',
'keytab', 'service/fake-output');
diff --git a/tests/server/admin-t.in b/tests/server/admin-t.in
index 11d2883..570dc52 100644
--- a/tests/server/admin-t.in
+++ b/tests/server/admin-t.in
@@ -3,7 +3,7 @@
# Tests for the wallet-admin dispatch code.
#
# Written by Russ Allbery <rra@stanford.edu>
-# Copyright 2008, 2009 Board of Trustees, Leland Stanford Jr. University
+# Copyright 2008, 2009, 2010 Board of Trustees, Leland Stanford Jr. University
#
# See LICENSE for licensing terms.
@@ -82,7 +82,7 @@ sub report_owners {
# Wallet::Admin package has already been loaded.
package main;
$INC{'Wallet/Admin.pm'} = 'FAKE';
-eval { do '@abs_top_srcdir@/server/wallet-admin' };
+eval { do "$ENV{SOURCE}/../server/wallet-admin" };
# Run the wallet admin client. This fun hack takes advantage of the fact that
# the wallet admin client is written in Perl so that we can substitute our own
diff --git a/tests/server/backend-t.in b/tests/server/backend-t.in
index 0c6ac60..2fc6a53 100644
--- a/tests/server/backend-t.in
+++ b/tests/server/backend-t.in
@@ -3,7 +3,7 @@
# Tests for the wallet-backend dispatch code.
#
# Written by Russ Allbery <rra@stanford.edu>
-# Copyright 2006, 2007, 2008, 2009
+# Copyright 2006, 2007, 2008, 2009, 2010
# Board of Trustees, Leland Stanford Jr. University
#
# See LICENSE for licensing terms.
@@ -163,7 +163,7 @@ package main;
$INC{'Wallet/Server.pm'} = 'FAKE';
my $OUTPUT;
our $SYSLOG = \$OUTPUT;
-eval { do '@abs_top_srcdir@/server/wallet-backend' };
+eval { do "$ENV{SOURCE}/../server/wallet-backend" };
# Run the wallet backend. This fun hack takes advantage of the fact that the
# wallet backend is written in Perl so that we can substitute our own
diff --git a/tests/server/keytab-t.in b/tests/server/keytab-t.in
index f74267d..2a0ceed 100644
--- a/tests/server/keytab-t.in
+++ b/tests/server/keytab-t.in
@@ -1,10 +1,9 @@
#!/usr/bin/perl -w
-# $Id: backend-t.in 3547 2007-09-14 23:18:48Z rra $
#
# Tests for the keytab-backend dispatch code.
#
# Written by Russ Allbery <rra@stanford.edu>
-# Copyright 2006, 2007 Board of Trustees, Leland Stanford Jr. University
+# Copyright 2006, 2007, 2010 Board of Trustees, Leland Stanford Jr. University
#
# See LICENSE for licensing terms.
@@ -16,9 +15,9 @@ use Test::More tests => 63;
# Load the keytab-backend code and override various settings.
my $OUTPUT;
$SYSLOG = \$OUTPUT;
-eval { do '@abs_top_srcdir@/server/keytab-backend' };
-$CONFIG = '@abs_top_srcdir@/tests/data/allow-extract';
-$KADMIN = '@abs_top_srcdir@/tests/data/fake-kadmin';
+eval { do "$ENV{SOURCE}/../server/keytab-backend" };
+$CONFIG = "$ENV{SOURCE}/data/allow-extract";
+$KADMIN = "$ENV{SOURCE}/data/fake-kadmin";
$TMP = '.';
# Run the keytab backend.
diff --git a/tests/server/pod-t.in b/tests/server/pod-t.in
index 4575ecb..52d81eb 100644
--- a/tests/server/pod-t.in
+++ b/tests/server/pod-t.in
@@ -1,9 +1,9 @@
#!/usr/bin/perl
#
-# tests/server/pod-t -- Test POD formatting for client documentation.
+# Test POD formatting for client documentation.
#
# Written by Russ Allbery <rra@stanford.edu>
-# Copyright 2008 Board of Trustees, Leland Stanford Jr. University
+# Copyright 2008, 2010 Board of Trustees, Leland Stanford Jr. University
#
# See LICENSE for licensing terms.
@@ -17,6 +17,6 @@ eval 'use Test::Pod 1.00';
SKIP: {
skip 'Test::Pod 1.00 required for testing POD', $total if $@;
for my $file (@files) {
- pod_file_ok ("@abs_top_srcdir@/server/$file", "server/$file");
+ pod_file_ok ("$ENV{SOURCE}/../server/$file", "server/$file");
}
}