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-2008 Andrew Bartlett <abartlet@samba.org>
8 Usage: test_kinit.sh SERVER USERNAME PASSWORD REALM DOMAIN PREFIX
23 samba4bindir
="$BUILDDIR/bin"
24 smbclient
="$samba4bindir/smbclient$EXEEXT"
25 samba4kinit
="$samba4bindir/samba4kinit$EXEEXT"
26 samba_tool
="$samba4bindir/samba-tool$EXEEXT"
27 ldbmodify
="$samba4bindir/ldbmodify$EXEEXT"
28 ldbsearch
="$samba4bindir/ldbsearch$EXEEXT"
29 rkpty
="$samba4bindir/rkpty$EXEEXT"
30 samba4kpasswd
="$samba4bindir/samba4kpasswd$EXEEXT"
31 enableaccount
="$samba_tool enableaccount"
32 machineaccountccache
="$BUILDDIR/scripting/bin/machineaccountccache"
34 .
`dirname $0`/subunit.sh
42 $VALGRIND $smbclient $CONFIGURATION //$SERVER/tmp
-c "$cmd" -W "$DOMAIN" $@
44 if [ x
$status = x0
]; then
54 KRB5CCNAME
="$PREFIX/tmpccache"
57 testit
"kinit with pkinit (name specified)" $samba4kinit $enctype --request-pac --renewable --pk-user=FILE
:$PREFIX/dc
/private
/tls
/admincert.pem
,$PREFIX/dc
/private
/tls
/adminkey.pem
$USERNAME@
$REALM || failed
=`expr $failed + 1`
58 testit
"kinit with pkinit (enterprise name specified)" $samba4kinit $enctype --request-pac --renewable --pk-user=FILE
:$PREFIX/dc
/private
/tls
/admincert.pem
,$PREFIX/dc
/private
/tls
/adminkey.pem
--enterprise $USERNAME@
$REALM || failed
=`expr $failed + 1`
59 testit
"kinit with pkinit (enterprise name in cert)" $samba4kinit $enctype --request-pac --renewable --pk-user=FILE
:$PREFIX/dc
/private
/tls
/admincertupn.pem
,$PREFIX/dc
/private
/tls
/adminkey.pem
--pk-enterprise || failed
=`expr $failed + 1`
60 testit
"kinit renew ticket" $samba4kinit --request-pac -R
62 test_smbclient
"Test login with kerberos ccache" 'ls' -k yes || failed
=`expr $failed + 1`
64 rm -f $PREFIX/tmpccache