diff options
Diffstat (limited to 'infrastructure')
-rw-r--r-- | infrastructure/buildenv-testmain-template.cpp | 12 | ||||
-rw-r--r-- | infrastructure/m4/boxbackup_tests.m4 | 1 | ||||
-rwxr-xr-x | infrastructure/setup-debian-chroot.sh | 18 |
3 files changed, 31 insertions, 0 deletions
diff --git a/infrastructure/buildenv-testmain-template.cpp b/infrastructure/buildenv-testmain-template.cpp index d946c25d..6aba82c5 100644 --- a/infrastructure/buildenv-testmain-template.cpp +++ b/infrastructure/buildenv-testmain-template.cpp @@ -44,6 +44,10 @@ #include <list> #include <string> +#ifdef HAVE_OPENSSL_CLEANUP +# include <openssl/crypto.h> +#endif + #include "box_getopt.h" #include "depot.h" #include "Logging.h" @@ -392,6 +396,14 @@ int main(int argc, char * const * argv) { Logging::GetSyslog().Shutdown(); + // On Ubuntu 18.04, initialising OpenSSL 1.1.1 leaves open file handles to + // /dev/[u]random which are not easy to close (the docs for OPENSSL_cleanup + // recommend not to call it), but we want to avoid detecting those as + // leaking file descriptors +#ifdef HAVE_OPENSSL_CLEANUP + OPENSSL_cleanup(); +#endif + bool filesleftopen = !checkfilesleftopen(); fflush(stdout); diff --git a/infrastructure/m4/boxbackup_tests.m4 b/infrastructure/m4/boxbackup_tests.m4 index 61cd34c2..15f132cb 100644 --- a/infrastructure/m4/boxbackup_tests.m4 +++ b/infrastructure/m4/boxbackup_tests.m4 @@ -145,6 +145,7 @@ Upgrade or read the documentation for alternatives]]) ]) AC_CHECK_FUNCS([SSL_CTX_set_security_level], [HAVE_SSL_CTX_SET_SECURITY_LEVEL=1]) AC_SUBST([HAVE_SSL_CTX_SET_SECURITY_LEVEL]) +AC_CHECK_FUNCS([OPENSSL_cleanup]) ### Checks for header files. diff --git a/infrastructure/setup-debian-chroot.sh b/infrastructure/setup-debian-chroot.sh new file mode 100755 index 00000000..1e03bd75 --- /dev/null +++ b/infrastructure/setup-debian-chroot.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +set -ex + +CHROOT_BASE=/var/chroot +LSB_RELEASE=$(lsb_release -s -c) + +apt-get update +apt-get install -y debootstrap schroot + +mkdir -p ${CHROOT_BASE} +debootstrap --arch=i386 --variant=buildd "${LSB_RELEASE}" "${CHROOT_BASE}/${LSB_RELEASE}-i386" http://deb.debian.org/debian +cat > /etc/schroot/chroot.d/ci <<EOF +[${LSB_RELEASE}] +type=directory +directory=${CHROOT_BASE}/${LSB_RELEASE}-i386 +personality=linux32 +EOF |