]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: skip test_exec_ambientcapabilities on Travis CI under ASan
authorEvgeny Vereshchagin <evvers@ya.ru>
Tue, 20 Nov 2018 14:47:11 +0000 (15:47 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 20 Nov 2018 19:23:19 +0000 (20:23 +0100)
Let's not bother contributors with spurious failures nobody can't
seem to reproduce. There is an issue about that where we're trying
to figure out what's going on: https://github.com/systemd/systemd/issues/10696.

src/test/test-execute.c
src/test/test-helper.c
src/test/test-helper.h
travis-ci/managers/fedora.sh

index 0f66df66c7afd47a3e3328ca89d044d37786ba19..9d35e4e00a5fa3ed67c1826c16e851cd7f69fe82 100644 (file)
@@ -616,6 +616,13 @@ static void test_exec_ambientcapabilities(Manager *m) {
                 return;
         }
 
+#ifdef __SANITIZE_ADDRESS__
+        if (is_run_on_travis_ci()) {
+                log_notice("Skipping %s, see https://github.com/systemd/systemd/issues/10696", __func__);
+                return;
+        }
+#endif
+
         test(m, "exec-ambientcapabilities.service", 0, CLD_EXITED);
         test(m, "exec-ambientcapabilities-merge.service", 0, CLD_EXITED);
 
index 9cf9972380630028927cb4f374f45611bf9dd8f2..5b79d12f0785ecaabb3fc08d580b432f63d5ee25 100644 (file)
@@ -4,6 +4,7 @@
 #include "random-util.h"
 #include "alloc-util.h"
 #include "cgroup-util.h"
+#include "string-util.h"
 
 int enter_cgroup_subroot(void) {
         _cleanup_free_ char *cgroup_root = NULL, *cgroup_subroot = NULL;
@@ -27,3 +28,8 @@ int enter_cgroup_subroot(void) {
 
         return cg_attach_everywhere(supported, cgroup_subroot, 0, NULL, NULL);
 }
+
+/* https://docs.travis-ci.com/user/environment-variables#default-environment-variables */
+bool is_run_on_travis_ci(void) {
+        return streq_ptr(getenv("TRAVIS"), "true");
+}
index 3e8ccd90495449c5516adcdbd5603ea727ee872b..77af40d55597a4dc73f71172b49256c31b1aed86 100644 (file)
@@ -27,3 +27,5 @@
                )
 
 int enter_cgroup_subroot(void);
+
+bool is_run_on_travis_ci(void);
index 09122f723231d4e2c442a35cad4f6373be323087..c84d10bbe6efed84b22eb089005e5b320889c884 100755 (executable)
@@ -60,6 +60,7 @@ for phase in "${PHASES[@]}"; do
             travis_wait docker exec --interactive=false \
                 -e UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1 \
                 -e ASAN_OPTIONS=strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1 \
+                -e "TRAVIS=$TRAVIS" \
                 -t $CONT_NAME \
                 meson test --timeout-multiplier=3 -C ./build/ --print-errorlogs
             ;;