1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

r8525: added two more test targets:

- 'make quicktest' for running only quick tests. Finishes in 20
   seconds or so.

 - 'make valgrindtest' runs smbd under valgrind in a xterm window and
   runs the quick tests. Also disables tls as that slows down valgrind
   too much to be usable
(This used to be commit af36bc4011)
This commit is contained in:
Andrew Tridgell 2005-07-17 12:23:40 +00:00 committed by Gerald (Jerry) Carter
parent 039393d662
commit 1735037d5f
7 changed files with 78 additions and 14 deletions

View File

@ -148,10 +148,17 @@ basics: idl proto_exists HEIMDAL_EXTERNAL
test: @DEFAULT_TEST_TARGET@
test-swrap: all
./script/tests/selftest.sh @selftest_prefix@/prefix-test SOCKET_WRAPPER
./script/tests/selftest.sh @selftest_prefix@/prefix-test all SOCKET_WRAPPER
test-noswrap: all
./script/tests/selftest.sh @selftest_prefix@/prefix-test
./script/tests/selftest.sh @selftest_prefix@/prefix-test all
quicktest: all
./script/tests/selftest.sh @selftest_prefix@/prefix-test quick SOCKET_WRAPPER
valgrindtest: all
SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
./script/tests/selftest.sh @selftest_prefix@/prefix-test quick SOCKET_WRAPPER
__EOD__
}

View File

@ -20,6 +20,15 @@ PREFIX=$1
PREFIX=`echo $PREFIX | sed s+//+/+`
export PREFIX
# allow selection of the test lists
TESTS=$2
if [ $TESTS = "all" ]; then
TLS_ENABLED="yes"
else
TLS_ENABLED="no"
fi
mkdir -p $PREFIX || exit $?
OLD_PWD=`pwd`
cd $PREFIX || exit $?
@ -37,13 +46,14 @@ LOCKDIR=$PREFIX_ABS/lockdir
TLSDIR=$PRIVATEDIR/tls
CONFIGURATION="--configfile=$CONFFILE"
export CONFIGURATION
export CONFFILE
SMBD_TEST_FIFO="$PREFIX/smbd_test.fifo"
export SMBD_TEST_FIFO
SMBD_TEST_LOG="$PREFIX/smbd_test.log"
export SMBD_TEST_LOG
DO_SOCKET_WRAPPER=$2
DO_SOCKET_WRAPPER=$3
if [ x"$DO_SOCKET_WRAPPER" = x"SOCKET_WRAPPER" ];then
SOCKET_WRAPPER_DIR="$PREFIX/socket_wrapper_dir"
export SOCKET_WRAPPER_DIR
@ -76,6 +86,7 @@ cat >$CONFFILE<<EOF
js include = $SRCDIR/scripting/libjs
name resolve order = bcast
interfaces = lo*
tls enabled = $TLS_ENABLED
[tmp]
path = $TMPDIR
@ -116,15 +127,8 @@ START=`date`
bin/nmblookup -U localhost localhost
failed=0
$SRCDIR/script/tests/test_ejs.sh localhost $USERNAME $PASSWORD || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_ldap.sh localhost $USERNAME $PASSWORD || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_quick.sh //localhost/cifs $USERNAME $PASSWORD "" || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_rpc.sh localhost $USERNAME $PASSWORD $DOMAIN || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_session_key.sh localhost $USERNAME $PASSWORD $DOMAIN || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_binding_string.sh localhost $USERNAME $PASSWORD $DOMAIN || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_echo.sh localhost $USERNAME $PASSWORD $DOMAIN || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_posix.sh //localhost/tmp $USERNAME $PASSWORD "" || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_local.sh || failed=`expr $failed + $?`
. script/tests/tests_$TESTS.sh
exit $failed
) 9>$SMBD_TEST_FIFO
failed=$?

View File

@ -19,7 +19,7 @@ smbd_check_or_start() {
echo -n "STARTING SMBD..."
((
$SRCDIR/bin/smbd --maximum-runtime=1800 -d1 -s $CONFFILE -M single -i < $SMBD_TEST_FIFO > $SMBD_TEST_LOG 2>&1;
$SMBD_VALGRIND $SRCDIR/bin/smbd --maximum-runtime=1800 -d1 -s $CONFFILE -M single -i < $SMBD_TEST_FIFO > $SMBD_TEST_LOG 2>&1;
ret=$?;
rm -f $SMBD_TEST_FIFO;
if [ -n "$SOCKET_WRAPPER_DIR" -a -d "$SOCKET_WRAPPER_DIR" ]; then

View File

@ -9,7 +9,8 @@ exit 1;
fi
# see if we support ldaps
if grep HAVE_LIBGNUTLS.1 include/config.h > /dev/null; then
if grep HAVE_LIBGNUTLS.1 include/config.h > /dev/null &&
grep tls.enabled.=yes $CONFFILE > /dev/null; then
PROTOCOLS="ldap ldaps"
else
PROTOCOLS="ldap"

View File

@ -0,0 +1,40 @@
#!/bin/sh
# add tests to this list as they start passing, so we test
# that they stay passing
ncacn_np_tests="RPC-ECHO RPC-ALTERCONTEXT"
ncalrpc_tests="RPC-ECHO RPC-ALTERCONTEXT"
ncacn_ip_tcp_tests="RPC-ECHO RPC-ALTERCONTEXT"
if [ $# -lt 4 ]; then
cat <<EOF
Usage: test_rpc_quick.sh SERVER USERNAME PASSWORD DOMAIN
EOF
exit 1;
fi
server="$1"
username="$2"
password="$3"
domain="$4"
shift 4
incdir=`dirname $0`
. $incdir/test_functions.sh
failed=0
for bindoptions in seal,validate,padcheck 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
name="$t on $transport with $bindoptions"
testit "$name" $VALGRIND bin/smbtorture $TORTURE_OPTIONS $transport:"$server[$bindoptions]" -U"$username"%"$password" -W $domain $t "$*" || failed=`expr $failed + 1`
done
done
done
testok $0 $failed

View File

@ -0,0 +1,9 @@
$SRCDIR/script/tests/test_ejs.sh localhost $USERNAME $PASSWORD || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_ldap.sh localhost $USERNAME $PASSWORD || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_quick.sh //localhost/cifs $USERNAME $PASSWORD "" || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_rpc.sh localhost $USERNAME $PASSWORD $DOMAIN || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_session_key.sh localhost $USERNAME $PASSWORD $DOMAIN || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_binding_string.sh localhost $USERNAME $PASSWORD $DOMAIN || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_echo.sh localhost $USERNAME $PASSWORD $DOMAIN || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_posix.sh //localhost/tmp $USERNAME $PASSWORD "" || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_local.sh || failed=`expr $failed + $?`

View File

@ -0,0 +1,3 @@
$SRCDIR/script/tests/test_ejs.sh localhost $USERNAME $PASSWORD || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_ldap.sh localhost $USERNAME $PASSWORD || failed=`expr $failed + $?`
$SRCDIR/script/tests/test_quick.sh //localhost/cifs $USERNAME $PASSWORD "" || failed=`expr $failed + $?`