summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-17 12:23:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:29:35 -0500
commit1735037d5f2b3dc1fa9f5d21721a7dc00c869172 (patch)
tree9cf024480ffec80df154c60872f069036ac34c93
parent039393d6620816789b4ebd131974b23b6420f4dc (diff)
downloadsamba-1735037d5f2b3dc1fa9f5d21721a7dc00c869172.tar.gz
samba-1735037d5f2b3dc1fa9f5d21721a7dc00c869172.tar.bz2
samba-1735037d5f2b3dc1fa9f5d21721a7dc00c869172.zip
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 af36bc401154d278dbe272628110634f62fdba25)
-rw-r--r--source4/build/smb_build/makefile.pm11
-rwxr-xr-xsource4/script/tests/selftest.sh24
-rw-r--r--source4/script/tests/test_functions.sh2
-rwxr-xr-xsource4/script/tests/test_ldap.sh3
-rw-r--r--source4/script/tests/test_rpc_quick.sh40
-rw-r--r--source4/script/tests/tests_all.sh9
-rw-r--r--source4/script/tests/tests_quick.sh3
7 files changed, 78 insertions, 14 deletions
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index 013140298c..820ccfaf6c 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -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__
}
diff --git a/source4/script/tests/selftest.sh b/source4/script/tests/selftest.sh
index ca35ae78a2..ca7ffe451f 100755
--- a/source4/script/tests/selftest.sh
+++ b/source4/script/tests/selftest.sh
@@ -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=$?
diff --git a/source4/script/tests/test_functions.sh b/source4/script/tests/test_functions.sh
index 2ddf1edb8f..366b4c1c48 100644
--- a/source4/script/tests/test_functions.sh
+++ b/source4/script/tests/test_functions.sh
@@ -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
diff --git a/source4/script/tests/test_ldap.sh b/source4/script/tests/test_ldap.sh
index 8d5a7b4ccf..a6a5a77662 100755
--- a/source4/script/tests/test_ldap.sh
+++ b/source4/script/tests/test_ldap.sh
@@ -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"
diff --git a/source4/script/tests/test_rpc_quick.sh b/source4/script/tests/test_rpc_quick.sh
new file mode 100644
index 0000000000..5f74ba5af3
--- /dev/null
+++ b/source4/script/tests/test_rpc_quick.sh
@@ -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
diff --git a/source4/script/tests/tests_all.sh b/source4/script/tests/tests_all.sh
new file mode 100644
index 0000000000..2083abe796
--- /dev/null
+++ b/source4/script/tests/tests_all.sh
@@ -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 + $?`
diff --git a/source4/script/tests/tests_quick.sh b/source4/script/tests/tests_quick.sh
new file mode 100644
index 0000000000..b4b67eebd4
--- /dev/null
+++ b/source4/script/tests/tests_quick.sh
@@ -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 + $?`