2 # Blackbox tests for kinit and kerberos integration with smbclient etc
3 # Copyright (C) 2006-2007 Jelmer Vernooij <jelmer@samba.org>
4 # Copyright (C) 2006-2007 Andrew Bartlett <abartlet@samba.org>
8 Usage: test_kinit.sh SERVER USERNAME PASSWORD REALM DOMAIN PREFIX
29 if [ x$status = x0 ]; then
44 $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp -c "$cmd" -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@
46 if [ x$status = x0 ]; then
54 KRB5CCNAME=`pwd`/tmpccache
57 echo $PASSWORD > ./tmppassfile
58 testit "kinit with password" bin/samba4kinit --password-file=./tmppassfile --request-pac $USERNAME@$REALM || failed=`expr $failed + 1`
59 testit "kinit with pkinit" bin/samba4kinit --request-pac --pk-user=FILE:$PREFIX/dc/private/tls/admincert.pem,$PREFIX/dc/private/tls/adminkey.pem $USERNAME@$REALM || failed=`expr $failed + 1`
61 test_smbclient "Test login with kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1`
63 testit "domain join with kerberos ccache" $VALGRIND bin/net join $DOMAIN $CONFIGURATION -W "$DOMAIN" -k yes $@ || failed=`expr $failed + 1`
65 testit "add user with kerberos ccache" $VALGRIND bin/net user add nettestuser $CONFIGURATION -k yes $@ || failed=`expr $failed + 1`
68 testit "set user password with kerberos ccache" $VALGRIND bin/net password set $DOMAIN\\nettestuser $USERPASS $CONFIGURATION -k yes $@ || failed=`expr $failed + 1`
70 #KRB5CCNAME=`pwd`/tmpuserccache
73 #testit "kinit with user password" bin/samba4kinit --password-file=./tmpuserpassfile --request-pac nettestuser@$REALM || failed=`expr $failed + 1`
75 #KRB5CCNAME=`pwd`/tmpccache
78 testit "del user with kerberos ccache" $VALGRIND bin/net user delete nettestuser $CONFIGURATION -k yes $@ || failed=`expr $failed + 1`
80 rm -f tmpccfile tmppassfile tmpuserccache