summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2010-08-25 11:17:33 +0200
committerAndreas Schneider <asn@samba.org>2010-08-25 12:39:52 +0200
commit2eff142cce536a8966e63bdf9e514bc22d03acc4 (patch)
treecc2e3eec95b8531c1f3d3d90301e28690c6fec19
parentf42af4ea6810c65a37eec08e08acb5d831457bca (diff)
downloadsamba-2eff142cce536a8966e63bdf9e514bc22d03acc4.tar.gz
samba-2eff142cce536a8966e63bdf9e514bc22d03acc4.tar.bz2
samba-2eff142cce536a8966e63bdf9e514bc22d03acc4.zip
s3-build: Use a wrapper script to run the tests.
This fixes the buildfarm and returns the correct exit code of selftest.
-rwxr-xr-xselftest/s3-selftest.sh44
-rw-r--r--source3/Makefile.in29
2 files changed, 49 insertions, 24 deletions
diff --git a/selftest/s3-selftest.sh b/selftest/s3-selftest.sh
new file mode 100755
index 0000000000..8b44629bc3
--- /dev/null
+++ b/selftest/s3-selftest.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+FILTER_XFAIL="${PYTHON} -u ${SELFTESTDIR}/filter-subunit --expected-failures=${SOURCEDIR}/selftest/knownfail"
+SUBUNIT_FORMATTER="${PYTHON} -u ${SELFTESTDIR}/format-subunit --prefix=${SELFTESTPREFIX} --immediate"
+FORMAT_TEST_OUTPUT="${FILTER_XFAIL} | ${SUBUNIT_FORMATTER}"
+
+cleanup_and_exit() {
+ if test "$1" = 0 -o -z "$1"; then
+ exit 0
+ else
+ exit $1
+ fi
+}
+
+st_test_done() {
+ test -f ${SELFTESTPREFIX}/st_done || { echo "SELFTEST FAILED"; cleanup_and_exit 1; }
+}
+
+if [ "x${RUN_FROM_BUILD_FARM}" = "xyes" ]; then
+ ( rm -f ${SELFTESTPREFIX}/st_done && \
+ ${PERL} ${SELFTESTDIR}/selftest.pl \
+ --prefix=${SELFTESTPREFIX} --target=samba3 \
+ --testlist="${SOURCEDIR}/selftest/tests.sh|" \
+ --exclude=${SOURCEDIR}/selftest/skip \
+ --socket-wrapper ${TESTS} \
+ && touch ${SELFTESTPREFIX}/st_done ) | \
+ ${FILTER_XFAIL} --strip-passed-output
+
+ st_test_done
+ test -f ${SELFTESTPREFIX}/summary && cat ${SELFTESTPREFIX}/summary
+else
+ ( rm -f ${SELFTESTPREFIX}/st_done && \
+ ${PERL} ${SELFTESTDIR}/selftest.pl \
+ --prefix=${SELFTESTPREFIX} --target=samba3 \
+ --testlist="${SOURCEDIR}/selftest/tests.sh|" \
+ --exclude=${SOURCEDIR}/selftest/skip \
+ --socket-wrapper ${TESTS} \
+ && touch ${SELFTESTPREFIX}/st_done ) | \
+ ${SUBUNIT_FORMATTER}
+
+ st_test_done
+fi
+
+cleanup_and_exit
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 96cf44f74c..1d31f1a273 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -3294,34 +3294,15 @@ selftestdir = ../selftest
S3_LD_LIBPATH_OVERRIDE = $(LIB_PATH_VAR)="$(builddir)/bin:$$$(LIB_PATH_VAR)"
-FILTER_XFAIL = $(PYTHON) -u $(selftestdir)/filter-subunit --expected-failures=$(srcdir)/selftest/knownfail
-SUBUNIT_FORMATTER = $(PYTHON) -u $(selftestdir)/format-subunit --immediate
-FORMAT_TEST_OUTPUT = $(FILTER_XFAIL) | $(SUBUNIT_FORMATTER)
-
-test-buildfarm:: all torture timelimit
- @LIB_PATH_VAR=$(LIB_PATH_VAR) $(S3_LD_LIBPATH_OVERRIDE) \
- SAMBA4SHAREDDIR="$(builddir)/bin/shared" SMBTORTURE4=$(smbtorture4_path) \
- PERL="$(PERL)" PYTHON="$(PYTHON)" \
- NSS_WRAPPER_WINBIND_SO_PATH="$(srcdir)/@WINBIND_NSS@" \
- $(PERL) $(selftestdir)/selftest.pl \
- --prefix=${selftest_prefix} --target=samba3 \
- --testlist="$(srcdir)/selftest/tests.sh|" \
- --exclude=$(srcdir)/selftest/skip \
- --socket-wrapper $(TESTS) | \
- $(FILTER_XFAIL) --strip-passed-output
- test -f ${selftest_prefix}/summary && cat ${selftest_prefix}/summary
-
test:: all torture timelimit
@LIB_PATH_VAR=$(LIB_PATH_VAR) $(S3_LD_LIBPATH_OVERRIDE) \
SAMBA4SHAREDDIR="$(builddir)/bin/shared" SMBTORTURE4=$(smbtorture4_path) \
+ NSS_WRAPPER_WINBIND_SO_PATH="$(srcdir)/../nsswitch/libnss_winbind.so" \
+ SELFTESTDIR="$(selftestdir)" SELFTESTPREFIX="$(selftest_prefix)" \
+ SOURCEDIR="$(srcdir)" \
+ RUN_FROM_BUILD_FARM="$(RUN_FROM_BUILD_FARM)" \
PERL="$(PERL)" PYTHON="$(PYTHON)" \
- NSS_WRAPPER_WINBIND_SO_PATH="$(srcdir)/@WINBIND_NSS@" \
- $(PERL) $(selftestdir)/selftest.pl \
- --prefix=${selftest_prefix} --target=samba3 \
- --testlist="$(srcdir)/selftest/tests.sh|" \
- --exclude=$(srcdir)/selftest/skip \
- --socket-wrapper $(TESTS) | \
- $(FORMAT_TEST_OUTPUT)
+ $(selftestdir)/s3-selftest.sh
test-%:
$(MAKE) test TESTS=$*