Merge branch 'selftest' of git://git.samba.org/jelmer/samba
authorJelmer Vernooij <jelmer@samba.org>
Tue, 21 Oct 2008 15:19:23 +0000 (17:19 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 21 Oct 2008 15:19:23 +0000 (17:19 +0200)
selftest/selftest.pl
source3/Makefile.in
source3/selftest/knownfail [new file with mode: 0644]
source3/selftest/quick [new file with mode: 0644]
source3/selftest/skip [new file with mode: 0644]
source3/selftest/slow [new file with mode: 0644]
source3/selftest/tests.sh [new file with mode: 0755]

index 60eabe41d6669a86c502a726aec9f996b7428072..b1908d456cbd28c54241b08d848cac2b1d20e039 100755 (executable)
@@ -434,7 +434,9 @@ if ($opt_socket_wrapper) {
        $socket_wrapper_dir = SocketWrapper::setup_dir("$prefix/w", $opt_socket_wrapper_pcap);
        print "SOCKET_WRAPPER_DIR=$socket_wrapper_dir\n";
 } else {
-       warn("Not using socket wrapper, but also not running as root. Will not be able to listen on proper ports") unless $< == 0;
+        unless ($< == 0) { 
+                print "WARNING: Not using socket wrapper, but also not running as root. Will not be able to listen on proper ports\n";
+        }
 }
 
 my $target;
index 0e1d17f29e8cfb10c347a5f71959287c5b75066d..a0151d12f932017b8b9d95882a823fef35b10d28 100644 (file)
@@ -2807,6 +2807,9 @@ valgrindtest:: all torture timelimit
         VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
         PERL="$(PERL)" $(srcdir)/script/tests/selftest.sh ${selftest_prefix} all "${smbtorture4_path}"
 
+selftest::
+       ../selftest/selftest.pl --prefix=st --target=samba3 --testlist="`pwd`/selftest/tests.sh|" 
+
 # Check for Winbind struct 32/64bit padding
 test_wbpad:
        @echo "Testing winbind request/response structure for 32/64bit padding"
diff --git a/source3/selftest/knownfail b/source3/selftest/knownfail
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/source3/selftest/quick b/source3/selftest/quick
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/source3/selftest/skip b/source3/selftest/skip
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/source3/selftest/slow b/source3/selftest/slow
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/source3/selftest/tests.sh b/source3/selftest/tests.sh
new file mode 100755 (executable)
index 0000000..3ded568
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/sh
+# This script generates a list of testsuites that should be run as part of 
+# the Samba 3 test suite.
+
+# The output of this script is parsed by selftest.pl, which then decides 
+# which of the tests to actually run. It will, for example, skip all tests 
+# listed in selftest/skip or only run a subset during "make quicktest".
+
+# The idea is that this script outputs all of the tests of Samba 3, not 
+# just those that are known to pass, and list those that should be skipped 
+# or are known to fail in selftest/skip or selftest/samba4-knownfail. This makes it 
+# very easy to see what functionality is still missing in Samba 3 and makes 
+# it possible to run the testsuite against other servers, such as Samba 4 or 
+# Windows that have a different set of features.
+
+# The syntax for a testsuite is "-- TEST --" on a single line, followed 
+# by the name of the test, the environment it needs and the command to run, all 
+# three separated by newlines. All other lines in the output are considered 
+# comments.
+
+if [ ! -n "$PERL" ]
+then
+       PERL=perl
+fi
+
+plantest() {
+       name=$1
+       env=$2
+       shift 2
+       cmdline="$*"
+       echo "-- TEST --"
+       if [ "$env" = "none" ]; then
+               echo "samba3.$name"
+       else
+               echo "samba3.$name ($env)"
+       fi
+       echo $env
+       echo $cmdline
+}
+
+normalize_testname() {
+       name=$1
+       shift 1
+       echo $name | tr "A-Z-" "a-z."
+}
+
+BINDIR=`dirname $0`/../bin
+
+plantest "talloctort" none $VALGRIND $BINDIR/talloctort 
+plantest "replacetort" none $VALGRIND $BINDIR/replacetort
+plantest "tdbtorture" none $VALGRIND $BINDIR/tdbtorture
+plantest "smbconftort" none $VALGRIND $BINDIR/smbconftort $CONFIGURATION