diff options
-rwxr-xr-x | tests/test_nsscmds.sh | 2 | ||||
-rw-r--r-- | tests/test_pamcmds.expect | 6 | ||||
-rwxr-xr-x | tests/test_pamcmds.sh | 5 |
3 files changed, 9 insertions, 4 deletions
diff --git a/tests/test_nsscmds.sh b/tests/test_nsscmds.sh index 33efae6..743752e 100755 --- a/tests/test_nsscmds.sh +++ b/tests/test_nsscmds.sh @@ -27,7 +27,7 @@ set -e # find source directory -srcdir="${srcdir-"."}" +srcdir="${srcdir-`dirname "$0"`}" # ensure that we are running in the test environment . "$srcdir/in_testenv.sh" diff --git a/tests/test_pamcmds.expect b/tests/test_pamcmds.expect index bc80b86..586a889 100644 --- a/tests/test_pamcmds.expect +++ b/tests/test_pamcmds.expect @@ -48,13 +48,17 @@ proc reset_password {} { #close } +# find source directory +if { ! [info exists ::env(srcdir) ] } { + set env(srcdir) "." +} # ensure that we are running as root if { [exec id -u] != "0" } { send_user "test_pamcmds.expect: not running as root\n" exit 77 } # ensure that we are running in the test environment -spawn ./in_testenv.sh +spawn $env(srcdir)/in_testenv.sh expect { "in_testenv.sh: using LDAP server" { expect eof } eof { diff --git a/tests/test_pamcmds.sh b/tests/test_pamcmds.sh index cb8bf21..798cafd 100755 --- a/tests/test_pamcmds.sh +++ b/tests/test_pamcmds.sh @@ -22,7 +22,7 @@ set -e # find source directory -srcdir="${srcdir-"."}" +srcdir="${srcdir-`dirname "$0"`}" # ensure that we are running in the test environment . "$srcdir/in_testenv.sh" @@ -35,4 +35,5 @@ then exit 77 fi -"$EXPECT" ./test_pamcmds.expect +export srcdir +"$EXPECT" "$srcdir/test_pamcmds.expect" |