]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: reproduce https://github.com/systemd/systemd/issues/11251
authorEvgeny Vereshchagin <evvers@ya.ru>
Sun, 23 Dec 2018 13:46:00 +0000 (14:46 +0100)
committerEvgeny Vereshchagin <evvers@ya.ru>
Sat, 29 Dec 2018 18:14:28 +0000 (19:14 +0100)
src/core/main.c
test/TEST-01-BASIC/test.sh
test/test-functions

index 839dc062ff780700c9213beec517468c6ed66bcb..d4b19c9fff959cdc59c5527968690886b4e77524 100644 (file)
 #include "virt.h"
 #include "watchdog.h"
 
+#if HAS_FEATURE_ADDRESS_SANITIZER
+#include <sanitizer/lsan_interface.h>
+#endif
+
 static enum {
         ACTION_RUN,
         ACTION_HELP,
@@ -2612,6 +2616,10 @@ finish:
         }
 #endif
 
+#if HAS_FEATURE_ADDRESS_SANITIZER
+        __lsan_do_leak_check();
+#endif
+
         if (shutdown_verb) {
                 r = become_shutdown(shutdown_verb, retval);
                 log_error_errno(r, "Failed to execute shutdown binary, %s: %m", getpid_cached() == 1 ? "freezing" : "quitting");
index d74a2e00c1d5ec0c77c9310abc82d7d75c126efb..7aa21ff9997fea195798b74b51d325ed27df2850 100755 (executable)
@@ -26,7 +26,7 @@ Description=Testsuite service
 After=multi-user.target
 
 [Service]
-ExecStart=/bin/sh -x -c 'systemctl --state=failed --no-legend --no-pager > /failed ; echo OK > /testok'
+ExecStart=/bin/sh -x -c 'systemctl --state=failed --no-legend --no-pager > /failed ; systemctl daemon-reload ; echo OK > /testok'
 Type=oneshot
 EOF
 
index 169ecdbf137de5af621687de0da4952b6c8a3dad..9aa99140cd7ff28f9e9fed8e26b8046dffdee63d 100644 (file)
@@ -462,6 +462,14 @@ check_result_nspawn() {
     ls -l $TESTDIR/journal/*/*.journal
     test -s $TESTDIR/failed && ret=$(($ret+1))
     [ -n "$TIMED_OUT" ] && ret=$(($ret+1))
+    if [[ "$IS_BUILT_WITH_ASAN" = "yes" ]]; then
+        ls -l "$TESTDIR/$1"
+        if [[ -e "$TESTDIR/$1/systemd.asan.log.1" ]]; then
+            cat "$TESTDIR/$1/systemd.asan.log.1"
+            ret=$(($ret+1))
+        fi
+    fi
+
     return $ret
 }