From 1735037d5f2b3dc1fa9f5d21721a7dc00c869172 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 17 Jul 2005 12:23:40 +0000 Subject: 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) --- source4/build/smb_build/makefile.pm | 11 ++++++++-- source4/script/tests/selftest.sh | 24 +++++++++++--------- source4/script/tests/test_functions.sh | 2 +- source4/script/tests/test_ldap.sh | 3 ++- source4/script/tests/test_rpc_quick.sh | 40 ++++++++++++++++++++++++++++++++++ source4/script/tests/tests_all.sh | 9 ++++++++ source4/script/tests/tests_quick.sh | 3 +++ 7 files changed, 78 insertions(+), 14 deletions(-) create mode 100644 source4/script/tests/test_rpc_quick.sh create mode 100644 source4/script/tests/tests_all.sh create mode 100644 source4/script/tests/tests_quick.sh (limited to 'source4') 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<$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 <