lib/fuzzing: Add oss-fuzz info to README.md
[samba.git] / testprogs / blackbox / test_ktpass.sh
1 #!/bin/sh
2
3 if [ $# -lt 1 ]; then
4 cat <<EOF
5 Usage: blackbox_newuser.sh PREFIX
6 EOF
7 exit 1;
8 fi
9
10 PREFIX="$1"
11 shift 1
12
13 . `dirname $0`/subunit.sh
14
15
16 samba_tool="$BINDIR/samba-tool"
17 samba4bindir="$BINDIR"
18 samba4srcdir="$SRCDIR/source4"
19 samba4kinit=kinit
20 if test -x $BINDIR/samba4kinit; then
21         samba4kinit=$BINDIR/samba4kinit
22 fi
23
24 CONFIG="--configfile=$PREFIX/etc/smb.conf"
25
26 TESTUSER="ktpassUser"
27
28 testit "user create" $PYTHON $samba_tool user create $CONFIG $TESTUSER testp@ssw0Rd || failed=`expr $failed + 1`
29
30 KRB5CCNAME="$PREFIX/tmpccache"
31 export KRB5CCNAME
32 echo "testp@ssw0Rd" >$PREFIX/tmppassfile
33 testit "kinit with passwd" $samba4kinit -e arcfour-hmac-md5 --password-file=$PREFIX/tmppassfile   $TESTUSER@SAMBA.EXAMPLE.COM   || failed=`expr $failed + 1`
34 testit "ktpass" $samba4srcdir/scripting/bin/ktpass.sh --host LOCALDC --out $PREFIX/testuser.kt --princ $TESTUSER --pass "testp@ssw0Rd" --path-to-ldbsearch=$BINDIR/bin|| failed=`expr $failed + 1`
35
36 rm -f $KRB5CCNAME
37
38 testit "kinit with keytab" $samba4kinit -e arcfour-hmac-md5 --use-keytab -t $PREFIX/testuser.kt $TESTUSER@SAMBA.EXAMPLE.COM   || failed=`expr $failed + 1`
39
40 rm -f $PREFIX/tmpccache $PREFIX/testuser.kt
41 exit $failed