diff options
author | Andreas Schneider <asn@samba.org> | 2010-08-25 11:17:33 +0200 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2010-08-25 12:39:52 +0200 |
commit | 2eff142cce536a8966e63bdf9e514bc22d03acc4 (patch) | |
tree | cc2e3eec95b8531c1f3d3d90301e28690c6fec19 /selftest | |
parent | f42af4ea6810c65a37eec08e08acb5d831457bca (diff) | |
download | samba-2eff142cce536a8966e63bdf9e514bc22d03acc4.tar.gz |
s3-build: Use a wrapper script to run the tests.
This fixes the buildfarm and returns the correct exit code of selftest.
Diffstat (limited to 'selftest')
-rwxr-xr-x | selftest/s3-selftest.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/selftest/s3-selftest.sh b/selftest/s3-selftest.sh new file mode 100755 index 00000000000..8b44629bc3c --- /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 |