From: Frantisek Sumsal Date: Sun, 26 Jun 2022 18:52:12 +0000 (+0200) Subject: test: make TEST-21-DFUZZER work in containers X-Git-Tag: v252-rc1~769^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=71cde065b5492fc1324422710c4d84de51361020;p=thirdparty%2Fsystemd.git test: make TEST-21-DFUZZER work in containers by avoiding fuzzing networkd and timesyncd when running in a container. --- diff --git a/test/units/testsuite-21.sh b/test/units/testsuite-21.sh index e9bf18603a2..71586883623 100755 --- a/test/units/testsuite-21.sh +++ b/test/units/testsuite-21.sh @@ -33,17 +33,31 @@ BUS_LIST=( org.freedesktop.locale1 org.freedesktop.login1 org.freedesktop.machine1 - org.freedesktop.network1 org.freedesktop.portable1 org.freedesktop.resolve1 org.freedesktop.systemd1 org.freedesktop.timedate1 - org.freedesktop.timesync1 ) # systemd-oomd requires PSI if tail -n +1 /proc/pressure/{cpu,io,memory}; then - BUS_LIST+=(org.freedesktop.oom1) + BUS_LIST+=( + org.freedesktop.oom1 + ) +fi + +# Some services require specific conditions: +# - systemd-timesyncd can't run in a container +# - systemd-networkd can run in a container if it has CAP_NET_ADMIN capability +if ! systemd-detect-virt --container; then + BUS_LIST+=( + org.freedesktop.network1 + org.freedesktop.timesync1 + ) +elif busctl introspect org.freedesktop.network1 / &>/dev/null; then + BUS_LIST+=( + org.freedesktop.network1 + ) fi SESSION_BUS_LIST=(