diff options
Diffstat (limited to 'tests/client')
-rw-r--r-- | tests/client/basic-t.in | 15 | ||||
-rw-r--r-- | tests/client/full-t.in | 23 | ||||
-rw-r--r-- | tests/client/prompt-t.in | 23 | ||||
-rw-r--r-- | tests/client/rekey-t.in | 15 |
4 files changed, 40 insertions, 36 deletions
diff --git a/tests/client/basic-t.in b/tests/client/basic-t.in index 974b636..f9dc6dd 100644 --- a/tests/client/basic-t.in +++ b/tests/client/basic-t.in @@ -3,16 +3,17 @@ # Test suite for the wallet command-line client. # # Written by Russ Allbery <eagle@eyrie.org> -# Copyright 2006, 2007, 2008, 2010 +# Copyright 2018 Russ Allbery <eagle@eyrie.org> +# Copyright 2006-2008, 2010 # The Board of Trustees of the Leland Stanford Junior University # # See LICENSE for licensing terms. # Load the test library. -. "$SOURCE/tap/libtap.sh" -. "$SOURCE/tap/kerberos.sh" -. "$SOURCE/tap/remctl.sh" -cd "$SOURCE" +. "$C_TAP_SOURCE/tap/libtap.sh" +. "$C_TAP_SOURCE/tap/kerberos.sh" +. "$C_TAP_SOURCE/tap/remctl.sh" +cd "$C_TAP_SOURCE" # We need a modified krb5.conf file to test wallet configuration settings in # krb5.conf. Despite the hard-coding of test-k5.stanford.edu, this test isn't @@ -54,8 +55,8 @@ elif [ -z '@REMCTLD@' ] ; then else plan 36 fi -remctld_start '@REMCTLD@' "$SOURCE/data/basic.conf" -wallet="$BUILD/../client/wallet" +remctld_start '@REMCTLD@' "$C_TAP_SOURCE/data/basic.conf" +wallet="$C_TAP_BUILD/../client/wallet" # Make sure everything's clean. rm -f output output.bak keytab keytab.bak srvtab srvtab.bak autocreated diff --git a/tests/client/full-t.in b/tests/client/full-t.in index 80bb20f..1ad486c 100644 --- a/tests/client/full-t.in +++ b/tests/client/full-t.in @@ -4,6 +4,7 @@ # End-to-end tests for the wallet client. # # Written by Russ Allbery <eagle@eyrie.org> +# Copyright 2018 Russ Allbery <eagle@eyrie.org> # Copyright 2008, 2010, 2014 # The Board of Trustees of the Leland Stanford Junior University # @@ -14,14 +15,14 @@ use warnings; # 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} = "$ENV{SOURCE}/data/wallet.conf" } +BEGIN { $ENV{WALLET_CONFIG} = "$ENV{C_TAP_SOURCE}/data/wallet.conf" } use Test::More tests => 59; -use lib "$ENV{SOURCE}/../perl/lib"; +use lib "$ENV{C_TAP_SOURCE}/../perl/lib"; use Wallet::Admin; -use lib "$ENV{SOURCE}/../perl/t/lib"; +use lib "$ENV{C_TAP_SOURCE}/../perl/t/lib"; use Util; # Make a call to the wallet client. Takes the principal used by the server @@ -37,9 +38,9 @@ sub wallet { or die "cannot create wallet.out: $!\n"; open (STDERR, '>', 'wallet.err') or die "cannot create wallet.err: $!\n"; - exec ("$ENV{BUILD}/../client/wallet", '-k', $principal, '-p', + exec ("$ENV{C_TAP_BUILD}/../client/wallet", '-k', $principal, '-p', '14373', '-s', 'localhost', @command) - or die "cannot run $ENV{BUILD}/client/wallet: $!\n"; + or die "cannot run $ENV{C_TAP_BUILD}/client/wallet: $!\n"; } else { waitpid ($pid, 0); } @@ -56,23 +57,23 @@ sub wallet { } # cd to the correct directory. -chdir "$ENV{SOURCE}" or die "Cannot chdir to $ENV{SOURCE}: $!\n"; +chdir "$ENV{C_TAP_SOURCE}" or die "Cannot chdir to $ENV{C_TAP_SOURCE}: $!\n"; SKIP: { skip 'no keytab configuration', 59 - unless -f "$ENV{BUILD}/config/keytab"; + unless -f "$ENV{C_TAP_BUILD}/config/keytab"; my $remctld = '@REMCTLD@'; skip 'remctld not found', 59 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 ("$ENV{BUILD}/config/principal"); + my $principal = contents ("$ENV{C_TAP_BUILD}/config/principal"); remctld_spawn ($remctld, $principal, - "$ENV{BUILD}/config/keytab", - "$ENV{SOURCE}/data/full.conf"); + "$ENV{C_TAP_BUILD}/config/keytab", + "$ENV{C_TAP_SOURCE}/data/full.conf"); $ENV{KRB5CCNAME} = 'krb5cc_test'; - getcreds ("$ENV{BUILD}/config/keytab", $principal); + getcreds ("$ENV{C_TAP_BUILD}/config/keytab", $principal); # Use Wallet::Admin to set up the database. db_setup; diff --git a/tests/client/prompt-t.in b/tests/client/prompt-t.in index d3a1eac..d5e9f17 100644 --- a/tests/client/prompt-t.in +++ b/tests/client/prompt-t.in @@ -4,6 +4,7 @@ # Password prompting tests for the wallet client. # # Written by Russ Allbery <eagle@eyrie.org> +# Copyright 2018 Russ Allbery <eagle@eyrie.org> # Copyright 2008, 2010, 2014 # The Board of Trustees of the Leland Stanford Junior University # @@ -14,18 +15,18 @@ use warnings; use Test::More tests => 5; -use lib "$ENV{SOURCE}/../perl/lib"; +use lib "$ENV{C_TAP_SOURCE}/../perl/lib"; use Wallet::Admin; -use lib "$ENV{SOURCE}/../perl/t/lib"; +use lib "$ENV{C_TAP_SOURCE}/../perl/t/lib"; use Util; # cd to the correct directory. -chdir "$ENV{SOURCE}" or die "Cannot chdir to $ENV{SOURCE}: $!\n"; +chdir "$ENV{C_TAP_SOURCE}" or die "Cannot chdir to $ENV{C_TAP_SOURCE}: $!\n"; SKIP: { skip 'no password configuration', 5 - unless -f "$ENV{BUILD}/config/password"; + unless -f "$ENV{C_TAP_BUILD}/config/password"; my $remctld = '@REMCTLD@'; skip 'remctld not found', 5 unless $remctld; eval { require Expect }; @@ -38,21 +39,21 @@ SKIP: { # Spawn remctld and set up with a different ticket cache. unlink ('krb5cc_test', 'test-pid'); - my $principal = contents ("$ENV{BUILD}/config/principal"); - remctld_spawn ($remctld, $principal, "$ENV{BUILD}/config/keytab", - "$ENV{SOURCE}/data/basic.conf"); + my $principal = contents ("$ENV{C_TAP_BUILD}/config/principal"); + remctld_spawn ($remctld, $principal, "$ENV{C_TAP_BUILD}/config/keytab", + "$ENV{C_TAP_SOURCE}/data/basic.conf"); $ENV{KRB5CCNAME} = 'krb5cc_test'; # Read in the principal and password. - open (PASS, '<', "$ENV{BUILD}/config/password") - or die "Cannot open $ENV{BUILD}/config/password: $!\n"; + open (PASS, '<', "$ENV{C_TAP_BUILD}/config/password") + or die "Cannot open $ENV{C_TAP_BUILD}/config/password: $!\n"; my $user = <PASS>; my $password = <PASS>; close PASS; chomp ($user, $password); # Spawn wallet and check an invalid password. - my $wallet = Expect->spawn ("$ENV{BUILD}/../client/wallet", '-k', + my $wallet = Expect->spawn ("$ENV{C_TAP_BUILD}/../client/wallet", '-k', $principal, '-p', 14373, '-s', 'localhost', '-c', 'fake-wallet', '-u', $user, 'get', 'keytab', 'service/fake-output'); @@ -63,7 +64,7 @@ SKIP: { $wallet->soft_close; # Now check a valid password. - $wallet = Expect->spawn ("$ENV{BUILD}/../client/wallet", '-k', + $wallet = Expect->spawn ("$ENV{C_TAP_BUILD}/../client/wallet", '-k', $principal, '-p', 14373, '-s', 'localhost', '-c', 'fake-wallet', '-u', $user, 'get', 'keytab', 'service/fake-output'); diff --git a/tests/client/rekey-t.in b/tests/client/rekey-t.in index c93b8eb..2e95a4e 100644 --- a/tests/client/rekey-t.in +++ b/tests/client/rekey-t.in @@ -3,16 +3,17 @@ # Test suite for the wallet-rekey command-line client. # # Written by Russ Allbery <eagle@eyrie.org> -# Copyright 2006, 2007, 2008, 2010 +# Copyright 2018 Russ Allbery <eagle@eyrie.org> +# Copyright 2006-2008, 2010 # The Board of Trustees of the Leland Stanford Junior University # # See LICENSE for licensing terms. # Load the test library. -. "$SOURCE/tap/libtap.sh" -. "$SOURCE/tap/kerberos.sh" -. "$SOURCE/tap/remctl.sh" -cd "$SOURCE" +. "$C_TAP_SOURCE/tap/libtap.sh" +. "$C_TAP_SOURCE/tap/kerberos.sh" +. "$C_TAP_SOURCE/tap/remctl.sh" +cd "$C_TAP_SOURCE" # We need a modified krb5.conf file to test wallet configuration settings in # krb5.conf. Despite the hard-coding of test-k5.stanford.edu, this test isn't @@ -47,8 +48,8 @@ elif [ -z '@REMCTLD@' ] ; then else plan 8 fi -remctld_start '@REMCTLD@' "$SOURCE/data/basic.conf" -wallet="$BUILD/../client/wallet-rekey" +remctld_start '@REMCTLD@' "$C_TAP_SOURCE/data/basic.conf" +wallet="$C_TAP_BUILD/../client/wallet-rekey" # Rekeying should result in a merged keytab with both the old and new keys. cp data/fake-keytab-old keytab |