From dec109fd9773d0d4581b5698686997b8d7db54bc Mon Sep 17 00:00:00 2001 From: Evgeny Vereshchagin Date: Apr 07 2021 22:35:32 +0000 Subject: tests: redirect ASAN reports on journald to a file Otherwise, they will end up in /dev/null. (cherry picked from commit 88ed0f261ba8164a689395ddee8b92d00e073515) patch_name: 0101-tests-redirect-ASAN-reports-on-journald-to-a-file.patch present_in_specfile: true location_in_specfile: 101 squash_commits: true --- diff --git a/test/test-functions b/test/test-functions index a6f88e4..8221369 100644 --- a/test/test-functions +++ b/test/test-functions @@ -343,6 +343,12 @@ echo DefaultEnvironment=\$DEFAULT_ENVIRONMENT >>/etc/systemd/system.conf # ASAN and syscall filters aren't compatible with each other. find / -name '*.service' -type f | xargs sed -i 's/^\\(MemoryDeny\\|SystemCall\\)/#\\1/' +# The redirection of ASAN reports to a file prevents them from ending up in /dev/null. +# But, apparently, sometimes it doesn't work: https://github.com/google/sanitizers/issues/886. +JOURNALD_CONF_DIR=/etc/systemd/system/systemd-journald.service.d +mkdir -p "\$JOURNALD_CONF_DIR" +printf "[Service]\nEnvironment=ASAN_OPTIONS=\$DEFAULT_ASAN_OPTIONS:log_path=/systemd-journald.asan.log\n" >"\$JOURNALD_CONF_DIR/env.conf" + export ASAN_OPTIONS=\$DEFAULT_ASAN_OPTIONS:log_path=/systemd.asan.log exec $ROOTLIBDIR/systemd "\$@" EOF