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_extract_keytab.sh SERVER USERNAME REALM DOMAIN PREFIX
21 samba4bindir
="$BUILDDIR/bin"
22 smbclient
="$samba4bindir/smbclient$EXEEXT"
23 samba4kinit
="$samba4bindir/samba4kinit$EXEEXT"
24 net
="$samba4bindir/net$EXEEXT"
25 newuser
="$PYTHON `dirname $0`/../../source4/setup/newuser"
27 .
`dirname $0`/subunit.sh
35 $VALGRIND $smbclient //$SERVER/tmp
-c "$cmd" -W "$DOMAIN" $@
37 if [ x
$status = x0
]; then
47 testit
"create user locally" $VALGRIND $newuser nettestuser
$USERPASS $@ || failed
=`expr $failed + 1`
49 testit
"export keytab from domain" $VALGRIND $net export keytab
$PREFIX/tmpkeytab $@ || failed
=`expr $failed + 1`
50 testit
"export keytab from domain (2nd time)" $VALGRIND $net export keytab
$PREFIX/tmpkeytab $@ || failed
=`expr $failed + 1`
52 KRB5CCNAME
="$PREFIX/tmpuserccache"
55 testit
"kinit with keytab as user" $samba4kinit --keytab=$PREFIX/tmpkeytab
--request-pac nettestuser@
$REALM || failed
=`expr $failed + 1`
57 test_smbclient
"Test login with user kerberos ccache" 'ls' -k yes || failed
=`expr $failed + 1`
59 KRB5CCNAME
="$PREFIX/tmpadminccache"
62 testit
"kinit with keytab as $USERNAME" $samba4kinit --keytab=$PREFIX/tmpkeytab
--request-pac $USERNAME@
$REALM || failed
=`expr $failed + 1`
64 testit
"del user" $VALGRIND $net user delete nettestuser
-k yes $@ || failed
=`expr $failed + 1`
66 rm -f tmpadminccache tmpuserccache tmpkeytab