Rev 11673: Add a list of tests that should be skipped rather than
ad-hoc test skipping in various places. in
file:///home/jelmer/bzr.samba/SAMBA_4_0/
Jelmer Vernooij
jelmer at samba.org
Mon Mar 5 22:21:04 GMT 2007
At file:///home/jelmer/bzr.samba/SAMBA_4_0/
------------------------------------------------------------
revno: 11673
revision-id: jelmer at samba.org-20070305221827-mvgf9d4dmvjbfltx
parent: svn-v2:21707 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: SAMBA_4_0
timestamp: Mon 2007-03-05 23:18:27 +0100
message:
Add a list of tests that should be skipped rather than ad-hoc test skipping in various places.
added:
source/samba4-skip samba4skip-20070305215506-3rjqkj2yrp2cq0vp-1
modified:
source/main.mk svn-v2:8991 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fmain.mk
source/script/tests/selftest.pl svn-v2:20693 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fscript%2ftests%2fselftest.pl
source/script/tests/test_local.sh svn-v2:7434 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fscript%2ftests%2ftest_local.sh
source/script/tests/test_posix.sh svn-v2:3176 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fscript%2ftests%2ftest_posix.sh
=== added file 'source/samba4-skip'
--- a/source/samba4-skip 1970-01-01 00:00:00 +0000
+++ b/source/samba4-skip 2007-03-05 22:18:27 +0000
@@ -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
=== modified file 'source/main.mk'
--- a/source/main.mk 2007-03-05 21:28:55 +0000
+++ b/source/main.mk 2007-03-05 22:18:27 +0000
@@ -283,7 +283,7 @@
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
=== modified file 'source/script/tests/selftest.pl'
--- a/source/script/tests/selftest.pl 2007-03-05 21:28:55 +0000
+++ b/source/script/tests/selftest.pl 2007-03-05 22:18:27 +0000
@@ -69,6 +69,11 @@
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_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 $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,10 +156,16 @@
{
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;
}
@@ -310,6 +324,7 @@
'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 @@
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 @@
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 {
=== modified file 'source/script/tests/test_local.sh'
--- a/source/script/tests/test_local.sh 2007-03-04 19:52:16 +0000
+++ b/source/script/tests/test_local.sh 2007-03-05 22:18:27 +0000
@@ -21,25 +21,10 @@
# 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
=== modified file 'source/script/tests/test_posix.sh'
--- a/source/script/tests/test_posix.sh 2007-02-26 05:37:19 +0000
+++ b/source/script/tests/test_posix.sh 2007-03-05 22:18:27 +0000
@@ -25,34 +25,10 @@
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
More information about the samba-cvs
mailing list