diff options
-rwxr-xr-x | source4/script/tests/tests_all.sh | 2 | ||||
-rw-r--r-- | testprogs/blackbox/test_kinit.sh | 45 |
2 files changed, 46 insertions, 1 deletions
diff --git a/source4/script/tests/tests_all.sh b/source4/script/tests/tests_all.sh index 95968780cd..68ec5ba224 100755 --- a/source4/script/tests/tests_all.sh +++ b/source4/script/tests/tests_all.sh @@ -11,6 +11,6 @@ $SRCDIR/script/tests/test_cifs.sh $SRCDIR/script/tests/test_local.sh $SRCDIR/script/tests/test_pidl.sh - $SRCDIR/script/tests/test_blackbox.sh $PREFIX/blackbox + $SRCDIR/script/tests/test_blackbox.sh $PREFIX $SRCDIR/script/tests/test_simple.sh $SRCDIR/script/tests/test_s3upgrade.sh $PREFIX/upgrade diff --git a/testprogs/blackbox/test_kinit.sh b/testprogs/blackbox/test_kinit.sh new file mode 100644 index 0000000000..635662a550 --- /dev/null +++ b/testprogs/blackbox/test_kinit.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +if [ $# -lt 5 ]; then +cat <<EOF +Usage: test_kinit.sh SERVER USERNAME PASSWORD REALM PREFIX +EOF +exit 1; +fi + +SERVER=$1 +USERNAME=$2 +PASSWORD=$3 +REALM=$4 +PREFIX=$5 +shift 5 +failed=0 + +testit() { + name="$1" + shift + cmdline="$*" + echo "test: $name" + $cmdline + status=$? + if [ x$status = x0 ]; then + echo "success: $name" + else + echo "failure: $name" + fi + return $status +} + +KRB5CCNAME=`pwd`/tmpccache +export KRB5CCNAME + +echo $PASSWORD > ./tmppassfile +testit "kinit with password" samba4kinit --password-file=./tmppassfile --request-pac $USERNAME@$REALM || failed=`expr $failed + 1` +testit "kinit with pkinit" samba4kinit --request-pac --pk-user=FILE:$PREFIX/dc/private/tls/admincert.pem,$PREFIX/dc/private/tls/adminkey.pem $USERNAME@$REALM || failed=`expr $failed + 1` + +echo ls | testit "Test login with kerberos ccache" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp -k yes || failed=`expr $failed + 1` + +testit "domain join with kerberos ccache" $VALGRIND bin/net join $DOMAIN $CONFIGURATION -W "$DOMAIN" -k yes $@ + +rm -f tmpccfile tmppassfile +exit $failed |