1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
samba-mirror/testprogs/blackbox/test_ktpass.sh
2010-07-31 11:22:15 +02:00

37 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
if [ $# -lt 1 ]; then
cat <<EOF
Usage: blackbox_newuser.sh PREFIX
EOF
exit 1;
fi
PREFIX="$1"
shift 1
. `dirname $0`/subunit.sh
net="$BUILDDIR/bin/net"
samba4bindir="$BUILDDIR/bin"
samba4kinit="$samba4bindir/samba4kinit$EXEEXT"
CONFIG="--configfile=$PREFIX/dc/etc/smb.conf"
TESTUSER="ktpassUser"
testit "newuser" $net newuser $CONFIG $TESTUSER testp@ssw0Rd || failed=`expr $failed + 1`
KRB5CCNAME="$PREFIX/tmpccache"
export KRB5CCNAME
echo "testp@ssw0Rd" >$PREFIX/tmppassfile
testit "kinit with passwd" $samba4kinit -e arcfour-hmac-md5 --password-file=$PREFIX/tmppassfile $TESTUSER@SAMBA.EXAMPLE.COM || failed=`expr $failed + 1`
testit "ktpass" $BUILDDIR/scripting/bin/ktpass.sh --host LOCALDC --out $PREFIX/testuser.kt --princ $TESTUSER --pass "testp@ssw0Rd" --path-to-ldbsearch=$BUILDDIR/bin|| failed=`expr $failed + 1`
rm -f $KRB5CCNAME
testit "kinit with keytab" $samba4kinit -e arcfour-hmac-md5 --use-keytab -t $PREFIX/testuser.kt $TESTUSER@SAMBA.EXAMPLE.COM || failed=`expr $failed + 1`
rm -f $PREFIX/tmpccache $PREFIX/testuser.kt
exit $failed