svn commit: samba r22235 - in branches/SAMBA_4_0: source/script/tests testprogs/blackbox

abartlet at samba.org abartlet at samba.org
Mon Apr 16 04:55:53 GMT 2007


Author: abartlet
Date: 2007-04-16 04:55:52 +0000 (Mon, 16 Apr 2007)
New Revision: 22235

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22235

Log:
Test kinit, and PKINIT functionality by means of a new blackbox test.

Andrew Bartlett

Added:
   branches/SAMBA_4_0/testprogs/blackbox/test_kinit.sh
Modified:
   branches/SAMBA_4_0/source/script/tests/tests_all.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/tests_all.sh
===================================================================
--- branches/SAMBA_4_0/source/script/tests/tests_all.sh	2007-04-16 04:47:11 UTC (rev 22234)
+++ branches/SAMBA_4_0/source/script/tests/tests_all.sh	2007-04-16 04:55:52 UTC (rev 22235)
@@ -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

Added: branches/SAMBA_4_0/testprogs/blackbox/test_kinit.sh
===================================================================
--- branches/SAMBA_4_0/testprogs/blackbox/test_kinit.sh	2007-04-16 04:47:11 UTC (rev 22234)
+++ branches/SAMBA_4_0/testprogs/blackbox/test_kinit.sh	2007-04-16 04:55:52 UTC (rev 22235)
@@ -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



More information about the samba-cvs mailing list