2007-10-26 00:20:52 +04:00
#!/bin/sh
if [ ! -n " $PERL " ]
then
PERL = perl
fi
incdir = ` dirname $0 `
plantest( ) {
name = $1
env = $2
shift 2
cmdline = " $* "
echo "-- TEST --"
2007-10-26 19:13:42 +04:00
if [ " $env " = "none" ] ; then
echo " samba4. $name "
else
echo " samba4. $name ( $env ) "
fi
2007-10-26 00:20:52 +04:00
echo $env
echo $cmdline
}
$incdir /../bin/smbtorture -V
samba4srcdir = $incdir /..
samba4bindir = $samba4srcdir /bin
SCRIPTDIR = $samba4srcdir /../testprogs/ejs
2007-12-10 06:33:33 +03:00
smb4torture = " $samba4bindir /smbtorture $TORTURE_OPTIONS "
2007-10-26 00:20:52 +04:00
2007-10-26 19:13:42 +04:00
plantest "js.base" dc " $SCRIPTDIR /base.js " $CONFIGURATION
plantest "js.samr" dc " $SCRIPTDIR /samr.js " $CONFIGURATION ncalrpc: -U\$ USERNAME%\$ PASSWORD
plantest "js.echo" dc " $SCRIPTDIR /echo.js " $CONFIGURATION ncalrpc: -U\$ USERNAME%\$ PASSWORD
2007-10-26 00:20:52 +04:00
#plantest "ejsnet.js" dc "$SCRIPTDIR/ejsnet.js" $CONFIGURATION -U\$USERNAME%\$PASSWORD \$DOMAIN ejstestuser
2007-11-07 03:32:25 +03:00
plantest "js.ldb" none " $SCRIPTDIR /ldb.js " ` pwd ` $CONFIGURATION -d 10
2007-10-26 19:13:42 +04:00
plantest "js.winreg" dc $samba4srcdir /scripting/bin/winreg $CONFIGURATION ncalrpc: 'HKLM' -U\$ USERNAME%\$ PASSWORD
2007-10-26 00:20:52 +04:00
# Simple tests for LDAP and CLDAP
for options in "" "--option=socket:testnonblock=true" "-U\$USERNAME%\$PASSWORD --option=socket:testnonblock=true" "-U\$USERNAME%\$PASSWORD" ; do
2007-10-26 19:13:42 +04:00
plantest " ldb.ldap with options $options " dc $samba4srcdir /../testprogs/blackbox/test_ldb.sh ldap \$ SERVER_IP $options
2007-10-26 00:20:52 +04:00
done
# see if we support ldaps
if grep ENABLE_GNUTLS.1 include/config.h > /dev/null; then
for options in "" "-U\$USERNAME%\$PASSWORD" ; do
2007-10-26 19:13:42 +04:00
plantest " ldb.ldaps with options $options " dc $samba4srcdir /../testprogs/blackbox/test_ldb.sh ldaps \$ SERVER_IP $options
2007-10-26 00:20:52 +04:00
done
fi
for t in LDAP-CLDAP LDAP-BASIC LDAP-SCHEMA LDAP-UPTODATEVECTOR
do
2007-12-10 06:33:33 +03:00
plantest " $t " dc $smb4torture "-U\$USERNAME%\$PASSWORD" //\$ SERVER_IP/_none_ $t
2007-10-26 00:20:52 +04:00
done
# only do the ldb tests when not in quick mode - they are quite slow, and ldb
# is now pretty well tested by the rest of the quick tests anyway
LDBDIR = $samba4srcdir /lib/ldb
export LDBDIR
plantest "ldb" none $LDBDIR /tests/test-tdb.sh
2007-11-07 03:32:25 +03:00
plantest "js.ldap" dc $SCRIPTDIR /ldap.js $CONFIGURATION -d 10 \$ SERVER -U\$ USERNAME%\$ PASSWORD
2007-10-26 00:20:52 +04:00
# Tests for RPC
# add tests to this list as they start passing, so we test
# that they stay passing
ncacn_np_tests = "RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON RPC-HANDLES RPC-SAMSYNC RPC-SAMBA3SESSIONKEY RPC-SAMBA3-GETUSERNAME RPC-SAMBA3-LSA RPC-BINDSAMBA3 RPC-NETLOGSAMBA3 RPC-ASYNCBIND RPC-LSALOOKUP RPC-LSA-GETUSER RPC-SCHANNEL2 RPC-AUTHCONTEXT"
ncalrpc_tests = "RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON RPC-DRSUAPI RPC-ASYNCBIND RPC-LSALOOKUP RPC-LSA-GETUSER RPC-SCHANNEL2 RPC-AUTHCONTEXT"
ncacn_ip_tcp_tests = "RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON RPC-HANDLES RPC-DSSYNC RPC-ASYNCBIND RPC-LSALOOKUP RPC-LSA-GETUSER RPC-SCHANNEL2 RPC-AUTHCONTEXT"
slow_ncacn_np_tests = "RPC-SAMLOGON RPC-SAMR RPC-SAMR-USERS RPC-SAMR-PASSWORDS"
slow_ncalrpc_tests = "RPC-SAMR RPC-SAMR-PASSWORDS"
slow_ncacn_ip_tcp_tests = "RPC-SAMR RPC-SAMR-PASSWORDS RPC-CRACKNAMES"
all_tests = " $ncalrpc_tests $ncacn_np_tests $ncacn_ip_tcp_tests $slow_ncalrpc_tests $slow_ncacn_np_tests $slow_ncacn_ip_tcp_tests RPC-SECRETS RPC-SAMBA3-SHARESEC "
# Make sure all tests get run
2007-12-10 06:33:33 +03:00
for t in ` $smb4torture --list | grep "^RPC-" `
2007-10-26 00:20:52 +04:00
do
echo $all_tests | grep $t > /dev/null
if [ $? -ne 0 ]
then
auto_rpc_tests = " $auto_rpc_tests $t "
fi
done
for bindoptions in seal,padcheck $VALIDATE bigendian; do
for transport in ncalrpc ncacn_np ncacn_ip_tcp; do
case $transport in
ncalrpc) tests = $ncalrpc_tests ; ;
ncacn_np) tests = $ncacn_np_tests ; ;
ncacn_ip_tcp) tests = $ncacn_ip_tcp_tests ; ;
esac
for t in $tests ; do
2007-12-10 06:33:33 +03:00
plantest " $t on $transport with $bindoptions " dc $VALGRIND $smb4torture $transport :" \$SERVER[ $bindoptions ] " -U"\$USERNAME" %"\$PASSWORD" -W \$ DOMAIN $t " $* "
2007-10-26 00:20:52 +04:00
done
2007-12-10 06:33:33 +03:00
plantest " RPC-SAMBA3-SHARESEC on $transport with $bindoptions " dc $VALGRIND $smb4torture $transport :" \$SERVER[ $bindoptions ] " -U"\$USERNAME" %"\$PASSWORD" -W \$ DOMAIN --option= torture:share= tmp $t " $* "
2007-10-26 00:20:52 +04:00
done
done
for bindoptions in "" $VALIDATE bigendian; do
for t in $auto_rpc_tests ; do
2007-12-10 06:33:33 +03:00
plantest " $t with $bindoptions " dc $VALGRIND $smb4torture " \$SERVER[ $bindoptions ] " -U"\$USERNAME" %"\$PASSWORD" -W \$ DOMAIN $t " $* "
2007-10-26 00:20:52 +04:00
done
done
for bindoptions in connect $VALIDATE ; do
for transport in ncalrpc ncacn_np ncacn_ip_tcp; do
case $transport in
ncalrpc) tests = $slow_ncalrpc_tests ; ;
ncacn_np) tests = $slow_ncacn_np_tests ; ;
ncacn_ip_tcp) tests = $slow_ncacn_ip_tcp_tests ; ;
esac
for t in $tests ; do
2007-12-10 06:33:33 +03:00
plantest " $t on $transport with $bindoptions " dc $VALGRIND $smb4torture $transport :" \$SERVER[ $bindoptions ] " -U"\$USERNAME" %"\$PASSWORD" -W \$ DOMAIN $t " $* "
2007-10-26 00:20:52 +04:00
done
done
done
# Tests for the NET API
2007-12-10 06:33:33 +03:00
net = ` $smb4torture --list | grep ^NET-`
2007-10-26 00:20:52 +04:00
for t in $net ; do
2007-12-10 06:33:33 +03:00
plantest " $t " dc $VALGRIND $smb4torture " \$SERVER[ $VALIDATE ] " -U"\$USERNAME" %"\$PASSWORD" -W "\$DOMAIN" $t " $* "
2007-10-26 00:20:52 +04:00
done
# Tests for session keys
bindoptions = ""
transport = "ncacn_np"
for ntlmoptions in \
"-k no --option=usespnego=yes" \
"-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no" \
"-k no --option=usespnego=yes --option=ntlmssp_client:56bit=yes" \
"-k no --option=usespnego=yes --option=ntlmssp_client:56bit=no" \
"-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes" \
"-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=no" \
"-k no --option=usespnego=yes --option=clientntlmv2auth=yes" \
"-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no" \
"-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes" \
"-k no --option=usespnego=no --option=clientntlmv2auth=yes" \
"-k no --option=gensec:spnego=no --option=clientntlmv2auth=yes" \
"-k no --option=usespnego=no" ; do
name = " RPC-SECRETS on $transport with $bindoptions with $ntlmoptions "
2007-12-10 06:33:33 +03:00
plantest " $name " dc $smb4torture $transport :" \$SERVER[ $bindoptions ] " $ntlmoptions -U"\$USERNAME" %"\$PASSWORD" -W \$ DOMAIN --option= gensec:target_hostname= \$ NETBIOSNAME RPC-SECRETS " $* "
2007-10-26 00:20:52 +04:00
done
2007-12-10 06:33:33 +03:00
plantest " RPC-SECRETS on $transport with $bindoptions with Kerberos " dc $smb4torture $transport :" \$SERVER[ $bindoptions ] " -k yes -U"\$USERNAME" %"\$PASSWORD" -W \$ DOMAIN "--option=gensec:target_hostname=\$NETBIOSNAME" RPC-SECRETS " $* "
plantest " RPC-SECRETS on $transport with $bindoptions with Kerberos - use target principal " dc $smb4torture $transport :" \$SERVER[ $bindoptions ] " -k yes -U"\$USERNAME" %"\$PASSWORD" -W \$ DOMAIN "--option=clientusespnegoprincipal=yes" "--option=gensec:target_hostname=\$NETBIOSNAME" RPC-SECRETS " $* "
plantest " RPC-SECRETS on $transport with Kerberos - use Samba3 style login " dc $smb4torture $transport :"\$SERVER" -k yes -U"\$USERNAME" %"\$PASSWORD" -W "\$DOMAIN" "--option=gensec:fake_gssapi_krb5=yes" "--option=gensec:gssapi_krb5=no" "--option=gensec:target_hostname=\$NETBIOSNAME" "RPC-SECRETS-none*" " $* "
plantest " RPC-SECRETS on $transport with Kerberos - use Samba3 style login, use target principal " dc $smb4torture $transport :"\$SERVER" -k yes -U"\$USERNAME" %"\$PASSWORD" -W "\$DOMAIN" "--option=clientusespnegoprincipal=yes" "--option=gensec:fake_gssapi_krb5=yes" "--option=gensec:gssapi_krb5=no" "--option=gensec:target_hostname=\$NETBIOSNAME" "RPC-SECRETS-none*" " $* "
2007-10-26 00:20:52 +04:00
# Echo tests
transports = "ncacn_np ncacn_ip_tcp ncalrpc"
for transport in $transports ; do
for bindoptions in connect spnego spnego,sign spnego,seal $VALIDATE padcheck bigendian bigendian,seal; do
for ntlmoptions in \
"--option=socket:testnonblock=True --option=torture:quick=yes" ; do
2007-12-10 06:33:33 +03:00
plantest " RPC-ECHO on $transport with $bindoptions and $ntlmoptions " dc $smb4torture $transport :" \$SERVER[ $bindoptions ] " $ntlmoptions -U"\$USERNAME" %"\$PASSWORD" -W "\$DOMAIN" RPC-ECHO " $* "
2007-10-26 00:20:52 +04:00
done
done
done
for transport in $transports ; do
for bindoptions in sign seal; do
for ntlmoptions in \
"--option=ntlmssp_client:ntlm2=yes --option=torture:quick=yes" \
"--option=ntlmssp_client:ntlm2=no --option=torture:quick=yes" \
"--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:128bit=no --option=torture:quick=yes" \
"--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:128bit=no --option=torture:quick=yes" \
"--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes" \
"--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes" \
"--option=clientntlmv2auth=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes" \
"--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=yes --option=torture:quick=yes" \
"--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes" \
; do
2007-12-10 06:33:33 +03:00
plantest " RPC-ECHO on $transport with $bindoptions and $ntlmoptions " dc $smb4torture $transport :" \$SERVER[ $bindoptions ] " $ntlmoptions -U"\$USERNAME" %"\$PASSWORD" -W \$ DOMAIN RPC-ECHO " $* "
2007-10-26 00:20:52 +04:00
done
done
done
2007-12-10 06:33:33 +03:00
plantest "RPC-ECHO on ncacn_np over smb2" dc $smb4torture ncacn_np:"\$SERVER[smb2]" -U"\$USERNAME" %"\$PASSWORD" -W \$ DOMAIN RPC-ECHO " $* "
2007-10-26 00:20:52 +04:00
# Tests against the NTVFS POSIX backend
2007-12-10 06:33:33 +03:00
smb2 = ` $smb4torture --list | grep "^SMB2-" | xargs`
raw = ` $smb4torture --list | grep "^RAW-" | xargs`
base = ` $smb4torture --list | grep "^BASE-" | xargs`
2007-10-26 00:20:52 +04:00
for t in $base $raw $smb2 ; do
2007-12-10 06:33:33 +03:00
plantest " $t " dc $VALGRIND $smb4torture $ADDARGS //\$ SERVER/tmp -U"\$USERNAME" %"\$PASSWORD" $t
2007-10-26 00:20:52 +04:00
done
# Tests against the NTVFS CIFS backend
for t in $base $raw ; do
2007-12-10 06:33:33 +03:00
plantest " ntvfs.cifs. $t " dc $VALGRIND $smb4torture //\$ NETBIOSNAME/cifs -U"\$USERNAME" %"\$PASSWORD" $t
2007-10-26 00:20:52 +04:00
done
# Local tests
2007-12-10 06:33:33 +03:00
for t in ` $smb4torture --list | grep "^LOCAL-" | xargs` ; do
plantest " $t " none $VALGRIND $smb4torture ncalrpc: $t " $* "
2007-10-26 00:20:52 +04:00
done
if test -f $samba4bindir /tdbtorture
then
plantest "tdb stress" none $VALGRIND $samba4bindir /tdbtorture
fi
# Pidl tests
if test x" ${ PIDL_TESTS_SKIP } " = x"yes" ; then
echo "Skipping pidl tests - PIDL_TESTS_SKIP=yes"
elif $PERL -e 'eval require Test::More;' > /dev/null 2>& 1; then
for f in $samba4srcdir /pidl/tests/*.pl; do
plantest " pidl/`basename $f ` " none $PERL $f "|" $samba4srcdir /script/harness2subunit.pl
done
else
echo "Skipping pidl tests - Test::More not installed"
fi
# Blackbox Tests:
# tests that interact directly with the command-line tools rather than using
# the API
bbdir = $incdir /../../testprogs/blackbox
plantest "blackbox.smbclient" dc $bbdir /test_smbclient.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" " $PREFIX "
plantest "blackbox.kinit" dc $bbdir /test_kinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" " $PREFIX "
plantest "blackbox.cifsdd" dc $bbdir /test_cifsdd.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN"
2007-10-26 19:13:42 +04:00
plantest "blackbox.nmblookup" dc $bbdir /test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP"
plantest "blackbox.nmblookup" member $bbdir /test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP"
2007-10-26 00:20:52 +04:00
# Tests using the "Simple" NTVFS backend
for t in "BASE-RW1" ; do
2007-12-10 06:33:33 +03:00
plantest " ntvfs/simple $t " dc $VALGRIND $smb4torture $ADDARGS //\$ SERVER/simple -U"\$USERNAME" %"\$PASSWORD" $t
2007-10-26 00:20:52 +04:00
done
DATADIR = $samba4srcdir /../testdata
plantest "parse samba3" none $samba4bindir /smbscript $DATADIR /samba3/verify $CONFIGURATION $DATADIR /samba3
2007-10-26 19:13:42 +04:00
plantest "js.samba3sam" none $SCRIPTDIR /samba3sam.js $CONFIGURATION ` pwd ` $DATADIR /samba3/
2007-10-26 00:20:52 +04:00
rm -rf $PREFIX /upgrade
mkdir -p $PREFIX /upgrade
#plantest "upgrade" none $samba4bindir/smbscript setup/upgrade $CONFIGURATION --verify --targetdir=$PREFIX ../testdata/samba3 ../testdata/samba3/smb.conf
# Domain Member Tests
2007-12-10 06:33:33 +03:00
plantest "RPC-ECHO against member server with local creds" member $VALGRIND $smb4torture ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME" %"\$PASSWORD" RPC-ECHO " $* "
plantest "RPC-ECHO against member server with domain creds" member $VALGRIND $smb4torture ncacn_np:"\$NETBIOSNAME" -U"\$DOMAIN/\$DC_USERNAME" %"\$DC_PASSWORD" RPC-ECHO " $* "
plantest "RPC-SAMR against member server with local creds" member $VALGRIND $smb4torture ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME" %"\$PASSWORD" "RPC-SAMR" " $* "
plantest "RPC-SAMR-USERS against member server with local creds" member $VALGRIND $smb4torture ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME" %"\$PASSWORD" "RPC-SAMR-USERS" " $* "
plantest "RPC-SAMR-PASSWORDS against member server with local creds" member $VALGRIND $smb4torture ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME" %"\$PASSWORD" "RPC-SAMR-PASSWORDS" " $* "
2007-10-26 00:20:52 +04:00
plantest "wbinfo -a against member server with domain creds" member $VALGRIND $samba4bindir /wbinfo -a "\$DOMAIN/\$DC_USERNAME" %"\$DC_PASSWORD"
2007-12-10 06:33:33 +03:00
NBT_TESTS = ` $smb4torture --list | grep "^NBT-" | xargs`
2007-10-26 00:20:52 +04:00
for f in $NBT_TESTS ; do
2007-12-10 06:33:33 +03:00
plantest $f dc $smb4torture //\$ SERVER/_none_ $f -U\$ USERNAME%\$ PASSWORD
2007-10-26 00:20:52 +04:00
done
2007-12-10 06:33:33 +03:00
WB_OPTS = "--option=\"torture:strict mode=yes\""
2007-10-26 00:20:52 +04:00
WB_OPTS = " ${ WB_OPTS } --option=\"torture:timelimit=1\" "
WB_OPTS = " ${ WB_OPTS } --option=\"torture:winbindd separator=\\\\\" "
WB_OPTS = " ${ WB_OPTS } --option=\"torture:winbindd private pipe dir=\$WINBINDD_PRIV_PIPE_DIR\" "
WB_OPTS = " ${ WB_OPTS } --option=\"torture:winbindd netbios name=\$SERVER\" "
WB_OPTS = " ${ WB_OPTS } --option=\"torture:winbindd netbios domain=\$DOMAIN\" "
2007-12-10 06:33:33 +03:00
WINBIND_STRUCT_TESTS = ` $smb4torture --list | grep "^WINBIND-STRUCT" | xargs`
WINBIND_NDR_TESTS = ` $smb4torture --list | grep "^WINBIND-NDR" | xargs`
2007-10-26 00:20:52 +04:00
for env in dc member; do
for t in $WINBIND_STRUCT_TESTS ; do
2007-12-10 06:33:33 +03:00
plantest $t $env $smb4torture $WB_OPTS //_none_/_none_ $t
2007-10-26 00:20:52 +04:00
done
for t in $WINBIND_NDR_TESTS ; do
2007-12-10 06:33:33 +03:00
plantest $t $env $smb4torture $WB_OPTS //_none_/_none_ $t
2007-10-26 00:20:52 +04:00
done
done
# Tests for SWIG
# export PYTHONPATH=lib/tdb/swig:lib/ldb/swig:scripting/swig:$PYTHONPATH
# export LD_LIBRARY_PATH=bin:$LD_LIBRARY_PATH
# plantest "tdb wrappers" scripting/swig/torture/torture_tdb.py
# plantest "ldb wrappers" scripting/swig/torture/torture_ldb.py
if test -f $samba4bindir /nsstest
then
plantest "NSS-TEST using winbind" member $VALGRIND $samba4bindir /nsstest $samba4bindir /shared/libnss_winbind.so
fi
2007-11-21 13:47:55 +03:00
2007-11-29 03:36:41 +03:00
# if python is available, run the python tests:
if which python 2>/dev/null >/dev/null
2007-11-21 13:47:55 +03:00
then
2007-11-29 03:36:41 +03:00
plantest "ldb.python" none PYTHONPATH = bin/python:scripting/python:lib/ldb/tests/python/ scripting/bin/subunitrun api
plantest "credentials.python" none PYTHONPATH = bin/python:scripting/python:auth/credentials/tests scripting/bin/subunitrun bindings
plantest "registry.python" none PYTHONPATH = bin/python:scripting/python:lib/registry/tests/ scripting/bin/subunitrun bindings
plantest "tdb.python" none PYTHONPATH = bin/python:scripting/python:lib/tdb/python/tests scripting/bin/subunitrun simple
plantest "auth.python" none PYTHONPATH = bin/python:scripting/python:auth/tests/ scripting/bin/subunitrun bindings
2007-11-29 16:49:47 +03:00
plantest "security.python" none PYTHONPATH = bin/python:scripting/python:libcli/security/tests/ scripting/bin/subunitrun bindings
2007-12-14 03:26:25 +03:00
plantest "param.python" none PYTHONPATH = bin/python:scripting/python:param/tests scripting/bin/subunitrun bindings
2007-11-21 13:47:55 +03:00
fi