nsswitch: Use own credential cache for wbinfo tests
authorAndreas Schneider <asn@samba.org>
Mon, 19 Sep 2016 11:27:30 +0000 (13:27 +0200)
committerStefan Metzmacher <metze@samba.org>
Sun, 25 Sep 2016 07:05:27 +0000 (09:05 +0200)
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 <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
nsswitch/tests/test_wbinfo.sh
nsswitch/tests/test_wbinfo_simple.sh

index 1d14ca3..69cc437 100755 (executable)
@@ -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 -"$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
index dc90ddc..35adb6c 100755 (executable)
@@ -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