From 7f14776ba7704bdefcbd6ad71856b6efdeacf052 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 19 Sep 2016 13:27:30 +0200 Subject: [PATCH] nsswitch: Use own credential cache for wbinfo tests If we do not set it will add the credentials to the system default credential cache, which is e.g. FILE:/tmp/krb5cc_1000. Signed-off-by: Andreas Schneider Reviewed-by: Stefan Metzmacher --- nsswitch/tests/test_wbinfo.sh | 10 +++++++++- nsswitch/tests/test_wbinfo_simple.sh | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/nsswitch/tests/test_wbinfo.sh b/nsswitch/tests/test_wbinfo.sh index 1d14ca3919f..69cc437f821 100755 --- a/nsswitch/tests/test_wbinfo.sh +++ b/nsswitch/tests/test_wbinfo.sh @@ -51,6 +51,12 @@ knownfail() { return $status } +KRB5CCNAME_PATH="$PREFIX/test_wbinfo_krb5ccache" +rm -f $KRB5CCNAME_PATH + +KRB5CCNAME="FILE:$KRB5CCNAME_PATH" +export KRB5CCNAME + # List users testit "wbinfo -u against $TARGET" $wbinfo -u || failed=`expr $failed + 1` # List groups @@ -244,8 +250,10 @@ testit "wbinfo --getdcname against $TARGET" $wbinfo --getdcname=$DOMAIN testit "wbinfo -p against $TARGET" $wbinfo -p || failed=`expr $failed + 1` -testit "wbinfo -K against $TARGET with domain creds" $wbinfo -K "$DOMAIN/$USERNAME"%"$PASSWORD" || failed=`expr $failed + 1` +testit "wbinfo -K against $TARGET with domain creds" $wbinfo --krb5ccname=$KRB5CCNAME --krb5auth="$DOMAIN/$USERNAME"%"$PASSWORD" || failed=`expr $failed + 1` testit "wbinfo --separator against $TARGET" $wbinfo --separator || failed=`expr $failed + 1` +rm -f $KRB5CCNAME_PATH + exit $failed diff --git a/nsswitch/tests/test_wbinfo_simple.sh b/nsswitch/tests/test_wbinfo_simple.sh index dc90ddcadf0..35adb6c6d72 100755 --- a/nsswitch/tests/test_wbinfo_simple.sh +++ b/nsswitch/tests/test_wbinfo_simple.sh @@ -12,6 +12,14 @@ ADDARGS="$*" incdir=`dirname $0`/../../testprogs/blackbox . $incdir/subunit.sh -testit "wbinfo" $VALGRIND $BINDIR/wbinfo $ADDARGS || failed=`expr $failed + 1` +KRB5CCNAME_PATH="$PREFIX/test_wbinfo_simple_krb5ccname" +rm -f $KRB5CCNAME_PATH + +KRB5CCNAME="FILE:$KRB5CCNAME_PATH" +export KRB5CCNAME + +testit "wbinfo" $VALGRIND $BINDIR/wbinfo --krb5ccname="$KRB5CCNAME" $ADDARGS || failed=`expr $failed + 1` + +rm -f $KRB5CCNAME_PATH testok $0 $failed -- 2.11.4.GIT