s4-repl: Use NULL for pointer test when checking for ldb_msg_new() failure
[Samba.git] / source3 / selftest / s3-selftest.sh
blob335398a466bc40195fc9a5347e60ce5361ceec68
1 #!/bin/sh
3 FILTER_XFAIL="${PYTHON} -u ${SELFTESTDIR}/filter-subunit --expected-failures=${SELFTESTDIR}/knownfail --flapping=${SELFTESTDIR}/flapping"
4 if [ "x${SUBUNIT_FORMATTER}" = x"" ]; then
5 SUBUNIT_FORMATTER="${PYTHON} -u ${SELFTESTDIR}/format-subunit --prefix=${SELFTESTPREFIX} --immediate"
6 fi
8 if [ x"${FAIL_IMMEDIATELY}" != x"" ]; then
9 FILTER_XFAIL="${FILTER_XFAIL} --fail-immediately"
12 cleanup_and_exit() {
13 if test "$1" = 0 -o -z "$1"; then
14 exit 0
15 else
16 exit $1
20 st_test_done() {
21 test -f ${SELFTESTPREFIX}/st_done || { echo "SELFTEST FAILED"; cleanup_and_exit 1; }
24 if [ "x${RUN_FROM_BUILD_FARM}" = "xyes" ]; then
25 ( rm -f ${SELFTESTPREFIX}/st_done && \
26 ${PERL} ${SELFTESTDIR}/selftest.pl \
27 --binary-mapping=smbtorture3:smbtorture,nmblookup3:nmblookup,nmblookup4:nmblookup4,smbclient3:smbclient,smbclient4:smbclient4,ntlm_auth3:ntlm_auth \
28 --prefix=${SELFTESTPREFIX} --target=samba3 \
29 --testlist="${PYTHON} ${SOURCEDIR}/selftest/tests.py|" \
30 --exclude=${SELFTESTDIR}/skip \
31 --srcdir="${SOURCEDIR}/.." \
32 --socket-wrapper ${TESTS} \
33 && touch ${SELFTESTPREFIX}/st_done ) | \
34 ${FILTER_XFAIL} --strip-passed-output
35 EXIT_STATUS=$?
37 st_test_done
38 else
39 ( rm -f ${SELFTESTPREFIX}/st_done && \
40 ${PERL} ${SELFTESTDIR}/selftest.pl \
41 --binary-mapping=smbtorture3:smbtorture,nmblookup3:nmblookup,nmblookup4:nmblookup4,smbclient3:smbclient,smbclient4:smbclient4,ntlm_auth3:ntlm_auth \
42 --prefix=${SELFTESTPREFIX} --target=samba3 \
43 --testlist="${PYTHON} ${SOURCEDIR}/selftest/tests.py|" \
44 --exclude=${SELFTESTDIR}/skip \
45 --srcdir="${SOURCEDIR}/.." \
46 --socket-wrapper ${TESTS} \
47 && touch ${SELFTESTPREFIX}/st_done ) | \
48 ${FILTER_XFAIL} | ${SUBUNIT_FORMATTER}
49 EXIT_STATUS=$?
51 st_test_done
54 cleanup_and_exit ${EXIT_STATUS}