Files
libcoap/scripts/build.sh
T
Jon Shallow ff8f8d2c6b Stop valgrind errors when using OpenSSL 1.1.1c
Issue introduced by OpenSSL 1.1.1c causes valgrind errors to be reported.  See
https://www.mail-archive.com/openssl-commits@openssl.org/msg21701.html and
https://github.com/openssl/openssl/pull/8606 which did not make 1.1.1c

scripts/build.sh:
tests/valgrind_suppression:

Temporarily suppress valgrind errors when SSL_CTS_new() is called when running
the tests.

Note: This suppression will also need to be applied when running valgrind
against other CoAP executables using OpenSSL 1.1.1c to prevent the valgrind
errors getting reported.

src/coap_openssl.c:

memset cookie_secret to 0 to stop valgrind warning.
2019-06-25 20:26:43 +01:00

64 lines
1.8 KiB
Bash
Executable File

#! /bin/sh
if test "x$TESTS" = "xyes" -o "x$TESTS" = "xtrue" ; then
WITH_TESTS="`scripts/fix-cunit.sh` --enable-tests"
test -f `pwd`/cunit.pc && echo cat `pwd`/cunit.pc
fi
TEST_LD_LIBRARY_PATH=
case "x${TLS}" in
xno) WITH_TLS="--disable-dtls"
;;
xopenssl) WITH_TLS="--with-openssl"
;;
xgnutls) WITH_TLS="--with-gnutls"
;;
xtinydtls) WITH_TLS="--with-tinydtls"
# Need this as libtinydtls.so has not been installed
# as a part of the travis build
TEST_LD_LIBRARY_PATH="ext/tinydtls"
;;
*) WITH_TLS="--with-gnutls"
;;
esac
case "x${DOCS}" in
xyes) WITH_DOCS="--enable-documentation"
;;
*) WITH_DOCS="--disable-documentation"
;;
esac
config() {
echo "./configure $*"
./configure $* || cat config.log
}
case "${PLATFORM}" in
contiki) config "--disable-tests $WITH_DOCS --disable-examples $WITH_TLS" && \
make -C examples/contiki
;;
lwip) config "--disable-tests $WITH_DOCS --disable-examples $WITH_TLS" && \
make -C examples/lwip
;;
posix|*) config "$WITH_TESTS $WITH_DOCS --enable-examples $WITH_TLS" && \
make && make check
;;
esac
err=$?
if test $err = 0 -a -n "$WITH_TESTS" ; then
EXEC_FILE=tests/testdriver
# then run valgrind on the actual executable
LD_LIBRARY_PATH=$TEST_LD_LIBRARY_PATH libtool --mode=execute valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet --suppressions=tests/valgrind_suppression $EXEC_FILE
err=$?
fi
# invoke OSS-Fuzz syntax checks
if test $err = 0 -a -n "$WITH_TESTS" ; then
make -C tests/oss-fuzz -f Makefile.ci check clean
err=$?
fi
exit $err