summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-09-28 22:16:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:31:03 -0500
commit679ef7b6babef0666749bea1d3b722786ce928d9 (patch)
treee042b4b5de1ea41807c7dd6e4b696538c08283de /source3
parent5221ebb299081da6a806362212c6a8ceb9cc70a8 (diff)
downloadsamba-679ef7b6babef0666749bea1d3b722786ce928d9.tar.gz
samba-679ef7b6babef0666749bea1d3b722786ce928d9.tar.bz2
samba-679ef7b6babef0666749bea1d3b722786ce928d9.zip
r25415: Merge the 3.2-perltest branch that switches Samba 3.2 to use Samba 4's selftest code. See the mailing list for details.
(This used to be commit bdc831ddb3a860676c36bbd89e6f748946df68a1)
Diffstat (limited to 'source3')
-rw-r--r--source3/Makefile.in24
-rw-r--r--source3/configure.in20
-rw-r--r--source3/samba3-knownfail21
-rw-r--r--source3/samba3-skip80
-rw-r--r--source3/samba3-skip-nobuildfarm3
-rw-r--r--source3/script/tests/test_functions.sh279
-rwxr-xr-xsource3/script/tests/test_local_s3.sh22
-rwxr-xr-xsource3/script/tests/test_posix_s3.sh80
-rwxr-xr-xsource3/script/tests/test_smbclient_s3.sh22
-rwxr-xr-xsource3/script/tests/test_smbtorture_s3.sh32
-rwxr-xr-xsource3/script/tests/tests_all.sh18
-rw-r--r--source3/script/tests/tests_smbclient_s3.sh1
12 files changed, 174 insertions, 428 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 9de9ea2b78..4ab22abb0c 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -15,7 +15,7 @@ localstatedir=@localstatedir@
datarootdir=@datarootdir@
selftest_prefix=@selftest_prefix@
-smbtorture4_path=@smbtorture4_path@
+samba4srcdir=@samba4srcdir@
LIBS=@LIBS@
CC=@CC@
@@ -52,6 +52,8 @@ PERL=@PERL@
PIDL_ARGS=@PIDL_ARGS@
+SELFTEST_ARGS = @SELFTEST_ARGS@
+
TERMLDFLAGS=@TERMLDFLAGS@
TERMLIBS=@TERMLIBS@
PRINT_LIBS=@PRINT_LIBS@
@@ -2094,16 +2096,32 @@ test_pam_modules: pam_modules
|| exit 1; \
done
+
+SELFTEST = $(PERL) $(samba4srcdir)/selftest/selftest.pl --prefix=${selftest_prefix} \
+ --srcdir="${samba4srcdir}" --bindir=${builddir}/bin --testlist="${srcdir}/script/tests/tests_all.sh|" \
+ --expected-failures=samba3-knownfail --target=samba3 --skip=samba3-skip $(SELFTEST_ARGS)
##
## Targets for 'make test'
##
test: all torture timelimit
@echo Running Test suite
- @sh $(srcdir)/script/tests/selftest.sh ${selftest_prefix}/st all "${smbtorture4_path}"
+ @$(SELFTEST) --socket-wrapper $(TESTS)
+
+htmltest: all torture timelimit
+ @echo Running Test suite
+ @$(SELFTEST) --socket-wrapper --format=html $(TESTS)
valgrindtest: all torture timelimit
@echo Running Test suite with valgrind
@NMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/st/valgrind.log" \
- $(srcdir)/script/tests/selftest.sh ${selftest_prefix}/st all "${smbtorture4_path}"
+ $(SELFTEST) --socket-wrapper
+
+gdbtest: all torture timelimit
+ SMBD_VALGRIND="xterm -n smbd -e $(srcdir)/script/gdb_run " \
+ $(SELFTEST) --immediate --socket-wrapper $(TESTS)
+
+testenv: everything
+ $(SELFTEST) --socket-wrapper --testenv
+
diff --git a/source3/configure.in b/source3/configure.in
index df4d040b0f..5762746c40 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -373,7 +373,7 @@ AC_SUBST(SWAT_INSTALL_TARGETS)
#################################################
# set prefix for 'make test'
-selftest_prefix="./"
+selftest_prefix="./st"
AC_SUBST(selftest_prefix)
AC_ARG_WITH(selftest-prefix,
[ --with-selftest-prefix=DIR The prefix where make test will be runned ($selftest_prefix)],
@@ -418,18 +418,18 @@ fi
#################################################
# set path of samba4's smbtorture
-smbtorture4_path=""
-AC_SUBST(smbtorture4_path)
-AC_ARG_WITH(smbtorture4_path,
-[ --with-smbtorture4-path=PATH The path to a samba4 smbtorture for make test (none)],
+samba4srcdir=""
+AC_SUBST(samba4srcdir)
+AC_ARG_WITH(samba4srcdir,
+[ --with-samba4srcdir=PATH The path to a samba4 source directorhy for make test (none)],
[ case "$withval" in
yes|no)
- AC_MSG_ERROR([--with-smbtorture4-path should take a path])
+ AC_MSG_ERROR([--with-samba4srcdir should take a path])
;;
* )
- smbtorture4_path="$withval"
- if test -z "$smbtorture4_path" -a ! -f $smbtorture4_path; then
- AC_MSG_ERROR(['$smbtorture_path' does not exist!])
+ samba4srcdir="$withval"
+ if test -z "$samba4srcdir" -a ! -f $samba4srcdir; then
+ AC_MSG_ERROR(['$samba4srcdir' does not exist!])
fi
;;
esac
@@ -6420,7 +6420,9 @@ if test x"$RUN_FROM_BUILD_FARM" = x"yes"; then
AC_DEFINE(ENABLE_BUILD_FARM_HACKS, 1, [Defined if running in the build farm])
else
AC_MSG_RESULT(no)
+ SELFTEST_ARGS="$SELFTEST_ARGS --skip=samba3-skip-nobuildfarm"
fi
+AC_SUBST(SELFTEST_ARGS)
#################################################
# check for bad librt/libpthread interactions
diff --git a/source3/samba3-knownfail b/source3/samba3-knownfail
index 94ed188888..582bbbf78a 100644
--- a/source3/samba3-knownfail
+++ b/source3/samba3-knownfail
@@ -2,3 +2,24 @@ BASE-DELETE-deltest16
BASE-DELETE-deltest18
BASE-DELETE-deltest19
BASE-DELETE-deltest20
+NBT-REGISTER.*/refresh_own # Bug in Samba3's WINS server
+RPC-SRVSVC.*/NetShareGetInfo
+RPC-SRVSVC.*/NetTransportEnum
+RPC-SRVSVC.*/NetShareEnumAll
+RPC-SRVSVC.*/NetShareEnum
+RPC-SRVSVC.*/NetCharDevQEnum
+RPC-SRVSVC.*/NetCharDevEnum
+RPC-SRVSVC.*/NetShareGetInfo
+RPC-SAMSYNC
+blackbox.kinit/Test login with kerberos ccache
+blackbox.kinit/kinit with pkinit
+blackbox.kinit/kinit with password
+blackbox.kinit/check time with kerberos ccache
+blackbox.smbclient/domain join
+blackbox.smbclient/Test login with --machine-pass without kerberos
+blackbox.smbclient/Test login with --machine-pass and kerberos
+RAW-SEARCH.*/one file search
+RAW-SEARCH.*/ea list
+RAW-SEARCH.*/many files
+BASE-DELAYWRITE.*/finfo update on close
+blackbox.smbclient/List directory with LANMAN. # Samba 3 disables LANMAN authentication by default now
diff --git a/source3/samba3-skip b/source3/samba3-skip
new file mode 100644
index 0000000000..1632e5b242
--- /dev/null
+++ b/source3/samba3-skip
@@ -0,0 +1,80 @@
+.*ncalrpc.* # transport not supported by samba 3
+.*ncacn_ip_tcp.* # transport not supported by samba 3
+.*LDAP.* # Samba 3 doesn't have it's own LDAP server (yet)
+.*ldap.* # Samba 3 doesn't have it's own LDAP server (yet)
+^samr.js$ # Uses ncalrpc, which isn't available for Samba 3
+^winreg$ # Uses ncalrpc, which isn't available for Samba 3
+^echo.js$ # Uses ncalrpc, which isn't available for Samba 3
+NBT-WINSREPLICATION.* # No WINS replication yet
+NBT-DGRAM.*
+NBT-WINS.*
+.*smb2.* # No SMB2 server yet
+SMB2.* # No SMB2 server yet
+.*RPC-EVENTLOG.* # No eventlog available for eventlog
+.*bigendian.* # Samba 3 doesn't support bigendian stuff
+parse samba3 # Relies on relative paths to the samba4 source tree
+RPC-MGMT # No MGMT interface in Samba 3
+RPC-SCANNER # No MGMT interface in Samba 3 (required for scanner)
+RPC-SAMR # Doesn't work against Samba 3 yet and isn't split up into subtests
+RPC-SECRETS # Doesn't work against Samba 3 yet
+RPC-SAMSYNC # Doesn't work against Samba 3 yet
+RPC-EPMAPPER # No epmapper interface in Samba 3
+RPC-LSA # Doesn't work against Samba 3 yet
+RPC-WKSSVC # Doesn't work against Samba 3 yet
+RPC-WINREG # Doesn't work against Samba 3 yet
+RPC-HANDLES # Doesn't work against Samba 3 yet
+RPC-ATSVC # No atsvc interface on Samba 3 yet
+RPC-OXIDRESOLVE # No oxidresolve on Samba 3 yet
+RPC-REMACT # No remact on Samba 3 yet
+RPC-DFS # Doesn't work against Samba 3 yet
+RPC-ECHO # Sinkone fails against samba3 for some reason and causes a disconnect
+^LOCAL-.* # No point running the LOCAL Samba 4 tests
+.*BASE-BENCH-HOLDCON.* # Very slow
+RPC-COUNTCALLS # Slow, fails
+RPC-DSSETUP # No DSSETUP interface in Samba 3
+BASE-ALIASES
+BASE-UTABLE # Takes a lot of time
+RPC-SVCCTL
+RAW-PING-PONG
+RAW-HOLD-OPLOCK
+RAW-SAMBA3CLOSEER
+ntvfs/cifs.*
+ntvfs/simple.*
+RPC-AUTOIDL # We already have the IDL..
+RPC-SAMLOGON # Doesn't work against Samba 3 yet
+RPC-SCHANNEL # Doesn't work against Samba 3 yet
+RPC-SCHANNEL2 # Doesn't work against Samba 3 yet
+RPC-JOIN # Doesn't work against Samba 3 yet
+RPC-SPOOLSS # Doesn't work against Samba 3 yet
+RPC-ALTERCONTEXT # Doesn't work against Samba 3 yet
+BASE-IOMETER # Doesn't work against Samba 3 yet
+BASE-CASETABLE # Doesn't work against Samba 3 yet
+BASE-NTTRANS # Doesn't work against Samba 3 yet
+BASE-SCAN-MAXFID # Doesn't work against Samba 3 yet
+BASE-TCONDEV # Doesn't work against Samba 3 yet
+RAW-SCAN-EAMAX # Doesn't work against Samba 3 yet
+RAW-BENCH-LOCK # Doesn't work against Samba 3 yet
+BASE-SMB # Doesn't work against Samba 3 yet
+RAW-QFSINFO # Doesn't work against Samba 3 yet
+RAW-QFILEINFO # Doesn't work against Samba 3 yet
+RAW-IOCTL # Doesn't work against Samba 3 yet
+RAW-SFILEINFO # Doesn't work against Samba 3 yet
+RAW-STREAMS # Doesn't work against Samba 3 yet
+RAW-EAS # Doesn't work against Samba 3 yet
+RAW-CONTEXT # Doesn't work against Samba 3 yet
+RAW-STREAMS # Doesn't work against Samba 3 yet
+RAW-ACLS # Doesn't work against Samba 3 yet
+RAW-IOCTL # Doesn't work against Samba 3 yet
+^NET-.* # Convenience wrapper, not protocol-level
+RPC-NETLOGON # Can't create users
+BASE-CHARSET
+BASE-DELAYWRITE
+RAW-SAMBA3POSIXTIMEDLOC
+RAW-BENCH-OPLOCK
+pidl.*
+tdb stress
+RAW-COMPOSITE.*
+BASE-DEFER_OPEN
+BASE-SCAN-IOCTL
+^ldb$
+^samba3sam.js$
diff --git a/source3/samba3-skip-nobuildfarm b/source3/samba3-skip-nobuildfarm
new file mode 100644
index 0000000000..757d8e38aa
--- /dev/null
+++ b/source3/samba3-skip-nobuildfarm
@@ -0,0 +1,3 @@
+RPC-NETLOGSAMBA3 # FIXME: Should only be run on the build farm
+RPC-SAMBA3SESSIONKEY # FIXME: Should only be run on the build farm
+RPC-SAMBA3-GETUSERNAME # FIXME: Should only be run on the build farm
diff --git a/source3/script/tests/test_functions.sh b/source3/script/tests/test_functions.sh
index 1cc9ea1264..9ad1155024 100644
--- a/source3/script/tests/test_functions.sh
+++ b/source3/script/tests/test_functions.sh
@@ -1,276 +1,11 @@
-
-samba3_stop_sig_term() {
- RET=0
- kill -USR1 `cat $PIDDIR/timelimit.nmbd.pid` >/dev/null 2>&1 || \
- kill -ALRM `cat $PIDDIR/timelimit.nmbd.pid` || RET=$?
-
- kill -USR1 `cat $PIDDIR/timelimit.smbd.pid` >/dev/null 2>&1 || \
- kill -ALRM `cat $PIDDIR/timelimit.smbd.pid` || RET=$?
-
- return $RET;
-}
-
-samba3_stop_sig_kill() {
- kill -ALRM `cat $PIDDIR/timelimit.nmbd.pid` >/dev/null 2>&1
- kill -ALRM `cat $PIDDIR/timelimit.smbd.pid` >/dev/null 2>&1
- return 0;
-}
-
-samba3_check_or_start() {
- if [ -n "$SERVER_TEST_FIFO" ];then
-
- trap samba3_stop_sig_kill INT QUIT
- trap samba3_stop_sig_kill TERM
-
- if [ -p "$SERVER_TEST_FIFO" ];then
- return 0;
- fi
-
- if [ -n "$SOCKET_WRAPPER_DIR" ];then
- if [ -d "$SOCKET_WRAPPER_DIR" ]; then
- rm -f $SOCKET_WRAPPER_DIR/*
- else
- mkdir -p $SOCKET_WRAPPER_DIR
- fi
- fi
-
- rm -f $SERVER_TEST_FIFO
- mkfifo $SERVER_TEST_FIFO
-
- rm -f $NMBD_TEST_LOG
- echo -n "STARTING NMBD..."
- ((
- if test x"$NMBD_MAXTIME" = x; then
- NMBD_MAXTIME=2700
- fi
- MAKE_TEST_BINARY=$BINDIR/nmbd
- export MAKE_TEST_BINARY
- timelimit $NMBD_MAXTIME $NMBD_VALGRIND $BINDIR/nmbd -F -S --no-process-group -d0 -s $SERVERCONFFILE > $NMBD_TEST_LOG 2>&1 &
- TIMELIMIT_NMBD_PID=$!
- MAKE_TEST_BINARY=
- echo $TIMELIMIT_NMBD_PID > $PIDDIR/timelimit.nmbd.pid
- wait $TIMELIMIT_NMBD_PID
- ret=$?;
- rm -f $SERVER_TEST_FIFO
- if [ -n "$SOCKET_WRAPPER_DIR" -a -d "$SOCKET_WRAPPER_DIR" ]; then
- rm -f $SOCKET_WRAPPER_DIR/*
- fi
- if [ x"$ret" = x"0" ];then
- echo "nmbd exits with status $ret";
- echo "nmbd exits with status $ret" >>$NMBD_TEST_LOG;
- elif [ x"$ret" = x"137" ];then
- echo "nmbd got SIGXCPU and exits with status $ret!"
- echo "nmbd got SIGXCPU and exits with status $ret!">>$NMBD_TEST_LOG;
- else
- echo "nmbd failed with status $ret!"
- echo "nmbd failed with status $ret!">>$NMBD_TEST_LOG;
- fi
- exit $ret;
- ) || exit $? &) 2>/dev/null || exit $?
- echo "DONE"
-
- rm -f $SMBD_TEST_LOG
- echo -n "STARTING SMBD..."
- ((
- if test x"$SMBD_MAXTIME" = x; then
- SMBD_MAXTIME=2700
- fi
- MAKE_TEST_BINARY=$BINDIR/smbd
- export MAKE_TEST_BINARY
- timelimit $SMBD_MAXTIME $SMBD_VALGRIND $BINDIR/smbd -F -S --no-process-group -d0 -s $SERVERCONFFILE > $SMBD_TEST_LOG 2>&1 &
- TIMELIMIT_SMBD_PID=$!
- MAKE_TEST_BINARY=
- echo $TIMELIMIT_SMBD_PID > $PIDDIR/timelimit.smbd.pid
- wait $TIMELIMIT_SMBD_PID
- ret=$?;
- rm -f $SERVER_TEST_FIFO
- if [ -n "$SOCKET_WRAPPER_DIR" -a -d "$SOCKET_WRAPPER_DIR" ]; then
- rm -f $SOCKET_WRAPPER_DIR/*
- fi
- if [ x"$ret" = x"0" ];then
- echo "smbd exits with status $ret";
- echo "smbd exits with status $ret" >>$SMBD_TEST_LOG;
- elif [ x"$ret" = x"137" ];then
- echo "smbd got SIGXCPU and exits with status $ret!"
- echo "smbd got SIGXCPU and exits with status $ret!">>$SMBD_TEST_LOG;
- else
- echo "smbd failed with status $ret!"
- echo "smbd failed with status $ret!">>$SMBD_TEST_LOG;
- fi
- exit $ret;
- ) || exit $? &) 2>/dev/null || exit $?
- echo "DONE"
- fi
- return 0;
-}
-
-samba3_nmbd_test_log() {
- if [ -n "$NMBD_TEST_LOG" ];then
- if [ -r "$NMBD_TEST_LOG" ];then
- return 0;
- fi
- fi
- return 1;
-}
-
-samba3_smbd_test_log() {
- if [ -n "$SMBD_TEST_LOG" ];then
- if [ -r "$SMBD_TEST_LOG" ];then
- return 0;
- fi
- fi
- return 1;
-}
-
-samba3_check_only() {
- if [ -n "$SERVER_TEST_FIFO" ];then
- if [ -p "$SERVER_TEST_FIFO" ];then
- return 0;
- fi
- return 1;
- fi
- return 0;
-}
-
-testit() {
- if [ -z "$PREFIX" ]; then
- PREFIX=test_prefix
- mkdir -p $PREFIX
- fi
+plantest() {
name=$1
- shift 1
- binary=$1
+ env=$2
+ shift 2
cmdline="$*"
-
- SERVERS_ARE_UP="no"
-
- shname=`echo $name | \
- sed -e 's%[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\-]%_%g'`
-
- UNIQUE_PID=`/bin/sh -c 'echo $$'`
- TEST_LOG="$PREFIX/test_log.${UNIQUE_PID}"
- TEST_PCAP="$PREFIX/test_${shname}_${UNIQUE_PID}.pcap"
- trap "rm -f $TEST_LOG $TEST_PCAP" EXIT
-
- if [ -z "$nmbd_log_size" ]; then
- nmbd_log_size=`wc -l < $NMBD_TEST_LOG`;
- fi
- if [ -z "$smbd_log_size" ]; then
- smbd_log_size=`wc -l < $SMBD_TEST_LOG`;
- fi
-
- if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
- echo "--==--==--==--==--==--==--==--==--==--==--"
- echo "Running test $name (level 0 stdout)"
- echo "--==--==--==--==--==--==--==--==--==--==--"
- date
- echo "Testing $name"
- else
- echo "Testing $name ($failed)"
- fi
-
- samba3_check_only && SERVERS_ARE_UP="yes"
- if [ x"$SERVERS_ARE_UP" != x"yes" ];then
- if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
- echo "SERVERS are down! Skipping: $cmdline"
- echo "=========================================="
- echo "TEST SKIPPED: $name (reason SERVERS are down)"
- echo "=========================================="
- else
- echo "TEST SKIPPED: $name (reason SERVERS are down)"
- fi
- return 1
- fi
-
- if [ x"$MAKE_TEST_ENABLE_PCAP" = x"yes" ];then
- SOCKET_WRAPPER_PCAP_FILE=$TEST_PCAP
- export SOCKET_WRAPPER_PCAP_FILE
- fi
-
- MAKE_TEST_BINARY=$binary
- export MAKE_TEST_BINARY
- ( $cmdline > $TEST_LOG 2>&1 )
- status=$?
- MAKE_TEST_BINARY=
- # show any additional output from smbd that has happened in this test
- samba3_nmbd_test_log && {
- new_log_size=`wc -l < $NMBD_TEST_LOG`;
- test "$new_log_size" = "$nmbd_log_size" || {
- echo "NMBD OUTPUT:";
- incr_log_size=`expr $new_log_size - $nmbd_log_size`;
- tail -$incr_log_size $NMBD_TEST_LOG;
- nmbd_log_size=$new_log_size;
- }
- }
- samba3_smbd_test_log && {
- new_log_size=`wc -l < $SMBD_TEST_LOG`;
- test "$new_log_size" = "$smbd_log_size" || {
- echo "SMBD OUTPUT:";
- incr_log_size=`expr $new_log_size - $smbd_log_size`;
- tail -$incr_log_size $SMBD_TEST_LOG;
- smbd_log_size=$new_log_size;
- }
- }
-
- if [ x"$status" != x"0" ]; then
- echo "TEST OUTPUT:"
- cat $TEST_LOG;
- rm -f $TEST_LOG;
- if [ x"$MAKE_TEST_ENABLE_PCAP" = x"yes" ];then
- echo "TEST PCAP: $TEST_PCAP"
- fi
- if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
- echo "=========================================="
- echo "TEST FAILED: $name (status $status)"
- echo "=========================================="
- else
- echo "TEST FAILED: $cmdline (status $status)"
- fi
- trap "" EXIT
- return 1;
- fi
- rm -f $TEST_LOG;
- if [ x"$MAKE_TEST_KEEP_PCAP" = x"yes" ];then
- echo "TEST PCAP: $TEST_PCAP"
- else
- rm -f $TEST_PCAP;
- fi
- if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
- echo "ALL OK: $cmdline"
- echo "=========================================="
- echo "TEST PASSED: $name"
- echo "=========================================="
- fi
- trap "" EXIT
- return 0;
-}
-
-testok() {
- name=`basename $1`
- failed=$2
-
- if [ x"$failed" = x"0" ];then
- :
- else
- echo "$failed TESTS FAILED or SKIPPED ($name)";
- fi
- exit $failed
+ echo "-- TEST --"
+ echo $name
+ echo $env
+ echo $cmdline
}
-teststatus() {
- name=`basename $1`
- failed=$2
-
- if [ x"$failed" = x"0" ];then
- echo "TEST STATUS: $failed";
- else
- echo "TEST STATUS: $failed";
- fi
- exit $failed
-}
-
-if [ -z "$VALGRIND" ]; then
- MALLOC_CHECK_=2
- export MALLOC_CHECK_
-fi
-
diff --git a/source3/script/tests/test_local_s3.sh b/source3/script/tests/test_local_s3.sh
index 6117106c8a..f016e5d28f 100755
--- a/source3/script/tests/test_local_s3.sh
+++ b/source3/script/tests/test_local_s3.sh
@@ -2,25 +2,11 @@
# this runs the file serving tests that are expected to pass with samba3
-if [ $# != 0 ]; then
-cat <<EOF
-Usage: test_local_s3.sh
-EOF
-exit 1;
-fi
-
incdir=`dirname $0`
. $incdir/test_functions.sh
-failed=0
-
-testit "talloctort" $VALGRIND $BINDIR/talloctort || \
- failed=`expr $failed + 1`
-
-testit "replacetort" $VALGRIND $BINDIR/replacetort || \
- failed=`expr $failed + 1`
-
-testit "tdbtorture" $VALGRIND $BINDIR/tdbtorture || \
- failed=`expr $failed +1`
+BINDIR=$incdir/../../bin
-testok $0 $failed
+plantest "talloctort" none $VALGRIND $BINDIR/talloctort
+plantest "replacetort" none $VALGRIND $BINDIR/replacetort
+plantest "tdbtorture" none $VALGRIND $BINDIR/tdbtorture
diff --git a/source3/script/tests/test_posix_s3.sh b/source3/script/tests/test_posix_s3.sh
deleted file mode 100755
index 1a4c4d11cc..0000000000
--- a/source3/script/tests/test_posix_s3.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/sh
-
-# this runs the file serving tests that are expected to pass with samba3
-
-if [ $# -lt 3 ]; then
-cat <<EOF
-Usage: test_posix_s3.sh UNC USERNAME PASSWORD <first> <smbtorture args>
-EOF
-exit 1;
-fi
-
-unc="$1"
-username="$2"
-password="$3"
-start="$4"
-shift 4
-ADDARGS="$*"
-
-incdir=`dirname $0`
-. $incdir/test_functions.sh
-
-base="BASE-ATTR BASE-CHARSET BASE-CHKPATH BASE-DEFER_OPEN BASE-DELAYWRITE BASE-DELETE"
-base="$base BASE-DENY1 BASE-DENY2 BASE-DENY3 BASE-DENYDOS BASE-DIR1 BASE-DIR2"
-base="$base BASE-DISCONNECT BASE-FDPASS BASE-LOCK"
-base="$base BASE-MANGLE BASE-NEGNOWAIT BASE-NTDENY1"
-base="$base BASE-NTDENY2 BASE-OPEN BASE-OPENATTR BASE-PROPERTIES BASE-RENAME BASE-RW1"
-base="$base BASE-SECLEAK BASE-TCON BASE-TCONDEV BASE-TRANS2 BASE-UNLINK BASE-VUID"
-base="$base BASE-XCOPY BASE-SAMBA3ERROR"
-
-raw="RAW-ACLS RAW-CHKPATH RAW-CLOSE RAW-COMPOSITE RAW-CONTEXT RAW-EAS"
-raw="$raw RAW-IOCTL RAW-LOCK RAW-MKDIR RAW-MUX RAW-NOTIFY RAW-OPEN RAW-OPLOCK"
-raw="$raw RAW-QFILEINFO RAW-QFSINFO RAW-READ RAW-RENAME RAW-SEARCH RAW-SEEK"
-raw="$raw RAW-SFILEINFO RAW-SFILEINFO-BUG RAW-STREAMS RAW-UNLINK RAW-WRITE"
-raw="$raw RAW-SAMBA3HIDE RAW-SAMBA3BADPATH RAW-SFILEINFO-RENAME"
-raw="$raw RAW-SAMBA3CASEINSENSITIVE RAW-SAMBA3POSIXTIMEDLOCK"
-raw="$raw RAW-SAMBA3ROOTDIRFID"
-
-rpc="RPC-AUTHCONTEXT RPC-BINDSAMBA3 RPC-SAMBA3-SRVSVC RPC-SAMBA3-SHARESEC"
-rpc="$rpc RPC-UNIXINFO RPC-SAMBA3-SPOOLSS RPC-SAMBA3-WKSSVC"
-
-# NOTE: to enable the UNIX-WHOAMI test, we need to change the default share
-# config to allow guest access. I'm not sure whether this would break other
-# tests, so leaving it alone for now -- jpeach
-unix="UNIX-INFO2"
-
-if test x$RUN_FROM_BUILD_FARM = xyes; then
- rpc="$rpc RPC-NETLOGSAMBA3 RPC-SAMBA3SESSIONKEY RPC-SAMBA3-GETUSERNAME"
-fi
-
-tests="$base $raw $rpc $unix"
-
-skipped="BASE-CHARSET BASE-DEFER_OPEN BASE-DELAYWRITE BASE-OPENATTR BASE-TCONDEV"
-skipped="$skipped RAW-ACLS RAW-COMPOSITE RAW-CONTEXT RAW-EAS"
-skipped="$skipped RAW-IOCTL RAW-MUX"
-skipped="$skipped RAW-QFILEINFO RAW-QFSINFO RAW-SEARCH"
-skipped="$skipped RAW-SFILEINFO RAW-STREAMS RAW-WRITE"
-
-echo "WARNING: Skipping tests $skipped"
-
-failed=0
-for t in $tests; do
- if [ ! -z "$start" -a "$start" != $t ]; then
- continue;
- fi
- skip=0
- for s in $skipped; do
- if [ x"$s" = x"$t" ]; then
- skip=1;
- break;
- fi
- done
- if [ $skip = 1 ]; then
- continue;
- fi
- start=""
- name="$t"
- testit "$name" $VALGRIND $SMBTORTURE4 $TORTURE4_OPTIONS $ADDARGS $unc -U"$username"%"$password" $t || failed=`expr $failed + 1`
-done
-
-testok $0 $failed
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
index 3a8f3bd5b6..762b0c37a5 100755
--- a/source3/script/tests/test_smbclient_s3.sh
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -9,15 +9,29 @@ EOF
exit 1;
fi
+BINDIR=`dirname $0`/../../bin
+
SERVER="$1"
SERVER_IP="$2"
SMBCLIENT="$VALGRIND ${SMBCLIENT:-$BINDIR/smbclient} $CONFIGURATION"
-incdir=`dirname $0`
-. $incdir/test_functions.sh
-
failed=0
+testit() {
+ name="$1"
+ shift
+ cmdline="$*"
+ echo "test: $name"
+ $cmdline
+ status=$?
+ if [ x$status = x0 ]; then
+ echo "success: $name"
+ else
+ echo "failure: $name"
+ fi
+ return $status
+}
+
# Test that a noninteractive smbclient does not prompt
test_noninteractive_no_prompt()
{
@@ -82,4 +96,4 @@ testit "interactive smbclient -l prompts on stdout" \
test_interactive_prompt_stdout -l /tmp || \
failed=`expr $failed + 1`
-testok $0 $failed
+exit $failed
diff --git a/source3/script/tests/test_smbtorture_s3.sh b/source3/script/tests/test_smbtorture_s3.sh
index 38ab40f09d..21c0fca445 100755
--- a/source3/script/tests/test_smbtorture_s3.sh
+++ b/source3/script/tests/test_smbtorture_s3.sh
@@ -2,23 +2,13 @@
# this runs the file serving tests that are expected to pass with samba3
-if [ $# -lt 3 ]; then
-cat <<EOF
-Usage: test_smbtorture_s3.sh UNC USERNAME PASSWORD <first> <smbtorture args>
-EOF
-exit 1;
-fi
-
-unc="$1"
-username="$2"
-password="$3"
-start="$4"
-shift 4
ADDARGS="$*"
incdir=`dirname $0`
. $incdir/test_functions.sh
+BINDIR=$incdir/../../bin
+
tests="FDPASS LOCK1 LOCK2 LOCK3 LOCK4 LOCK5 LOCK6 LOCK7"
tests="$tests UNLINK BROWSE ATTR TRANS2 MAXFID TORTURE "
tests="$tests OPLOCK1 OPLOCK2 OPLOCK3"
@@ -26,22 +16,6 @@ tests="$tests DIR DIR1 TCON TCONDEV RW1 RW2 RW3"
tests="$tests OPEN XCOPY RENAME DELETE PROPERTIES W2K"
tests="$tests TCON2 IOCTL CHKPATH FDSESS LOCAL-SUBSTITUTE"
-skipped1="RANDOMIPC NEGNOWAIT NBENCH ERRMAPEXTRACT TRANS2SCAN NTTRANSSCAN"
-skipped2="DENY1 DENY2 OPENATTR CASETABLE EATEST"
-skipped3="MANGLE UTABLE PIPE_NUMBER"
-echo "Skipping the following tests:"
-echo "$skipped1"
-echo "$skipped2"
-echo "$skipped3"
-
-failed=0
for t in $tests; do
- if [ ! -z "$start" -a "$start" != $t ]; then
- continue;
- fi
- start=""
- name="$t"
- testit "$name" $VALGRIND $BINDIR/smbtorture $ADDARGS $unc -U"$username"%"$password" $t || failed=`expr $failed + 1`
+ plantest "SAMBA3-$t" dc $VALGRIND $BINDIR/smbtorture $ADDARGS //\$SERVER_IP/tmp -U"\$USERNAME"%"\$PASSWORD" $t
done
-
-testok $0 $failed
diff --git a/source3/script/tests/tests_all.sh b/source3/script/tests/tests_all.sh
index dd593899e4..d001569c08 100755
--- a/source3/script/tests/tests_all.sh
+++ b/source3/script/tests/tests_all.sh
@@ -1,13 +1,7 @@
+#!/bin/sh
+SCRIPTDIR=`dirname $0`
+. $SCRIPTDIR/test_functions.sh
-$SCRIPTDIR/test_local_s3.sh || failed=`expr $failed + $?`
-$SCRIPTDIR/test_smbtorture_s3.sh //$SERVER_IP/tmp $USERNAME $PASSWORD "" || failed=`expr $failed + $?`
-$SCRIPTDIR/test_smbclient_s3.sh $SERVER $SERVER_IP || failed=`expr $failed + $?`
-
-SMBTORTURE4VERSION=`$SMBTORTURE4 --version`
-if [ -n "$SMBTORTURE4" -a -n "$SMBTORTURE4VERSION" ];then
- echo "Running Tests with Samba4's smbtorture"
- echo $SMBTORTURE4VERSION
- $SCRIPTDIR/test_posix_s3.sh //$SERVER_IP/tmp $USERNAME $PASSWORD "" || failed=`expr $failed + $?`
-else
- echo "Skip Tests with Samba4's smbtorture"
-fi
+$SCRIPTDIR/test_local_s3.sh
+$SCRIPTDIR/test_smbtorture_s3.sh
+plantest "smbclient" dc $SCRIPTDIR/test_smbclient_s3.sh \$SERVER \$SERVER_IP
diff --git a/source3/script/tests/tests_smbclient_s3.sh b/source3/script/tests/tests_smbclient_s3.sh
deleted file mode 100644
index d48a692d4b..0000000000
--- a/source3/script/tests/tests_smbclient_s3.sh
+++ /dev/null
@@ -1 +0,0 @@
-. $SCRIPTDIR/test_smbclient_s3.sh $SERVER $SERVER_IP