r21709: Add a list of tests that should be skipped rather than ad-hoc test skipping...
authorJelmer Vernooij <jelmer@samba.org>
Mon, 5 Mar 2007 22:24:21 +0000 (22:24 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:49:16 +0000 (14:49 -0500)
(This used to be commit 01befd52111b8c183d78f9e0d80065fe0825b87c)

source4/main.mk
source4/samba4-skip [new file with mode: 0644]
source4/script/tests/selftest.pl
source4/script/tests/test_local.sh
source4/script/tests/test_posix.sh

index 18ced055f5ba2b125c2e36466fb22f3f09736d09..7807b5f52f51635e07e99d68605ed44ce1a112a1 100644 (file)
@@ -283,7 +283,7 @@ realdistclean: distclean removebackup
 
 check:: test
 
-SELFTEST = $(srcdir)/script/tests/selftest.pl --prefix=${selftest_prefix} --builddir=$(builddir) --srcdir=$(srcdir) --expected-failures=samba4-knownfail 
+SELFTEST = $(srcdir)/script/tests/selftest.pl --prefix=${selftest_prefix} --builddir=$(builddir) --srcdir=$(srcdir) --expected-failures=samba4-knownfail --skip=samba4-skip
 
 test: all libraries
        $(SELFTEST) $(DEFAULT_TEST_OPTIONS) $(TESTS) --immediate
diff --git a/source4/samba4-skip b/source4/samba4-skip
new file mode 100644 (file)
index 0000000..00ad25e
--- /dev/null
@@ -0,0 +1,20 @@
+BASE-CHARSET
+BASE-DEFER_OPEN
+BASE-DELAYWRITE
+RAW-COMPOSITE
+RAW-OPLOCK
+BASE-IOMETER
+BASE-SAMBA3ERROR
+BASE-CASETABLE
+BASE-NTTRANS
+BASE-BENCH-HOLDCON
+BASE-SCAN-MAXFID
+RAW-BENCH-OPLOCK
+RAW-SAMBA3HIDE
+RAW-SAMBA3CLOSEERR
+RAW-SAMBA3CHECKFSP
+RAW-SAMBA3BADPATH
+RAW-SCAN-EAMAX
+SMB2-LOCK
+SMB2-NOTIFY
+LOCAL-RESOLVE
index 6c2ea6d0b1ed7e2c3a3a7460752cbce753390583..e75e5d2c56bfd22d97d58a020e5722d48366c702 100755 (executable)
@@ -69,6 +69,11 @@ The format for the file is, one entry per line:
 
 TESTSUITE-NAME/TEST-NAME
 
+=item I<--skip>
+
+Specify a file containing a list of tests that should be skipped. Possible candidates are
+tests that segfault the server, flip or don't end.
+
 =item I<--one>
 
 Abort as soon as one test fails.
@@ -123,6 +128,7 @@ my $opt_socket_wrapper_pcap = undef;
 my $opt_one = 0;
 my $opt_immediate = 0;
 my $opt_expected_failures = undef;
+my $opt_skip = undef;
 my $opt_verbose = 0;
 
 my $srcdir = ".";
@@ -132,10 +138,12 @@ my $prefix = "st";
 my $suitesfailed = [];
 my $start = time();
 my @expected_failures = ();
+my @skips = ();
 
 my $statistics = {
        SUITES_FAIL => 0,
        SUITES_OK => 0,
+       SUITES_SKIPPED => 0,
 
        TESTS_UNEXPECTED_OK => 0,
        TESTS_EXPECTED_OK => 0,
@@ -148,13 +156,19 @@ sub expecting_failure($)
 {
        my $fullname = shift;
 
-       foreach (@expected_failures) {
-               return 1 if $fullname =~ /^$_$/;
-       }
+       return 1 if (grep(/^$fullname$/, @expected_failures));
 
        return 0;
 }
 
+sub skip($)
+{
+       my $fullname = shift;
+
+       return 1 if (grep(/^$fullname$/, @skips));
+       return 0;
+}
+
 sub run_test_buildfarm($$$$)
 {
        my ($name, $cmd, $i, $suitestotal) = @_;
@@ -310,6 +324,7 @@ my $result = GetOptions (
                'one' => \$opt_one,
                'immediate' => \$opt_immediate,
                'expected-failures=s' => \$opt_expected_failures,
+               'skip=s' => \$opt_skip,
                'srcdir=s' => \$srcdir,
                'builddir=s' => \$builddir,
                'verbose' => \$opt_verbose
@@ -419,6 +434,15 @@ if (defined($opt_expected_failures)) {
        close(KNOWN);
 }
 
+if (defined($opt_skip)) {
+       open(SKIP, "<$opt_skip") or die("unable to read skip file: $!");
+       while (<SKIP>) { 
+               chomp; 
+               s/([ \t]+)\#(.*)$//;
+               push (@skips, $_); }
+       close(SKIP);
+}
+
 my $test_fifo = "$prefix/smbd_test.fifo";
 
 $ENV{SMBD_TEST_FIFO} = $test_fifo;
@@ -496,6 +520,13 @@ foreach (@todo) {
        my $cmd = $$_[1];
        $cmd =~ s/([\(\)])/\\$1/g;
        my $name = $$_[0];
+       
+       if (skip($name)) {
+               print "SKIPPED: $name\n";
+               $statistics->{SUITES_SKIPPED}++;
+               next;
+       }
+
        if ($from_build_farm) {
                run_test_buildfarm($name, $cmd, $i, $suitestotal);
        } else {
index 6a96987b9c33852b5af8f620745e047e07bd02cb..2751c73b110d606d58d0a6d589c7f48c82d7b3ac 100755 (executable)
@@ -21,25 +21,10 @@ incdir=`dirname $0`
 # the local tests don't need smbd
 SMBD_TEST_FIFO=""
 export SMBD_TEST_FIFO
-skipped="LOCAL-RESOLVE"
-
-echo "WARNING: Skipping $skipped"
 
 failed=0
 for t in $local_tests; do
-    skip=0
-    for s in $skipped; do
-       if [ x"$s" = x"$t" ]; then
-           skip=1;
-           break;
-       fi
-    done
-    if [ $skip = 1 ]; then
-       continue;
-    fi
-
-       name="$t"
-       testit "$name" $VALGRIND bin/smbtorture $TORTURE_OPTIONS ncalrpc: $t "$*"
+       testit "$t" $VALGRIND bin/smbtorture $TORTURE_OPTIONS ncalrpc: $t "$*"
 done
 
 testok $0 $failed
index 8f9013df624e7554004c20f0c5ab5d486d8ad8b1..9099fe31a064e981c2f3ab921f1687261cab6ced 100755 (executable)
@@ -25,34 +25,10 @@ raw=`bin/smbtorture --list | grep "^RAW-" | xargs`
 base=`bin/smbtorture --list | grep "^BASE-" | xargs`
 tests="$base $raw $smb2"
 
-#
-# please add tests you want to be skipped here!
-#
-skipped="BASE-CHARSET BASE-DEFER_OPEN BASE-DELAYWRITE RAW-COMPOSITE RAW-OPLOCK BASE-IOMETER"
-skipped="$skipped BASE-SAMBA3ERROR BASE-CASETABLE BASE-NTTRANS BASE-BENCH-HOLDCON BASE-SCAN-MAXFID"
-skipped="$skipped RAW-BENCH-OPLOCK RAW-SAMBA3HIDE RAW-SAMBA3CLOSEERR RAW-SAMBA3CHECKFSP RAW-SAMBA3BADPATH"
-skipped="$skipped RAW-SCAN-EAMAX SMB2-LOCK SMB2-NOTIFY"
-
-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 bin/smbtorture $TORTURE_OPTIONS $ADDARGS $unc -U"$username"%"$password" $t
+    testit "$t" $VALGRIND bin/smbtorture $TORTURE_OPTIONS $ADDARGS $unc -U"$username"%"$password" $t
 done
-
-testok $0 $failed