summaryrefslogtreecommitdiff
path: root/testprogs
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-07-04 16:39:17 +0400
committerAndrew Bartlett <abartlet@samba.org>2010-07-15 22:08:20 +1000
commit0496af8341b08ad2b8ceb42892ddde06af279c52 (patch)
tree08f6e8a53fbb23cf3c6adba8e90d6f48a23d39fb /testprogs
parent7ea70f86ac3a34d84082fed8b5f80ec1b46893bf (diff)
downloadsamba-0496af8341b08ad2b8ceb42892ddde06af279c52.tar.gz
samba-0496af8341b08ad2b8ceb42892ddde06af279c52.tar.bz2
samba-0496af8341b08ad2b8ceb42892ddde06af279c52.zip
s4: Unit test update_machine_account_password through kinit
This patch is for testing the chgdcpass script which is mostly a call to update_machine_account_password. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'testprogs')
-rwxr-xr-xtestprogs/blackbox/test_chgdcpass.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/testprogs/blackbox/test_chgdcpass.sh b/testprogs/blackbox/test_chgdcpass.sh
new file mode 100755
index 0000000000..f65296adfb
--- /dev/null
+++ b/testprogs/blackbox/test_chgdcpass.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+# Blackbox tests for kinit and kerberos integration with smbclient etc
+# Copyright (C) 2006-2007 Jelmer Vernooij <jelmer@samba.org>
+# Copyright (C) 2006-2008 Andrew Bartlett <abartlet@samba.org>
+
+if [ $# -lt 4 ]; then
+cat <<EOF
+Usage: test_kinit.sh SERVER USERNAME REALM DOMAIN PREFIX
+EOF
+exit 1;
+fi
+
+SERVER=$1
+USERNAME=$2
+REALM=$3
+DOMAIN=$4
+PREFIX=$5
+ENCTYPE=$6
+PROVDIR=$7
+shift 7
+failed=0
+
+samba4bindir="$BUILDDIR/bin"
+samba4kinit="$samba4bindir/samba4kinit$EXEEXT"
+
+. `dirname $0`/subunit.sh
+
+enctype="-e $ENCTYPE"
+
+KRB5CCNAME="$PREFIX/tmpccache"
+export KRB5CCNAME
+rm -f $KRB5CCNAME
+testit "kinit with keytab" $samba4kinit $enctype -t $PROVDIR/private/secrets.keytab --use-keytab $USERNAME || failed=`expr $failed + 1`
+testit "change dc password" ./scripting/devel/chgtdcpass -s $PROVDIR/etc/smb.conf || failed=`expr $failed + 1`
+testit "kinit with keytab" $samba4kinit $enctype -t $PROVDIR/private/secrets.keytab --use-keytab $USERNAME || failed=`expr $failed + 1`
+rm -f $KRB5CCNAME
+
+rm -f $PREFIX/tmpccache tmpccfile tmppassfile tmpuserpassfile tmpuserccache tmpkpasswdscript
+exit $failed