summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2022-06-26 20:52:12 +0200
committerFrantisek Sumsal <frantisek@sumsal.cz>2022-06-26 22:06:02 +0200
commit71cde065b5492fc1324422710c4d84de51361020 (patch)
tree69c16b5672c25b34caf48bab48cbfee909cbd907
parentsha256: Use stdbool and uintptr_t (diff)
downloadsystemd-71cde065b5492fc1324422710c4d84de51361020.tar.xz
systemd-71cde065b5492fc1324422710c4d84de51361020.zip
test: make TEST-21-DFUZZER work in containers
by avoiding fuzzing networkd and timesyncd when running in a container.
-rwxr-xr-xtest/units/testsuite-21.sh20
1 files changed, 17 insertions, 3 deletions
diff --git a/test/units/testsuite-21.sh b/test/units/testsuite-21.sh
index e9bf18603a..7158688362 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=(