From: Zbigniew Jędrzejewski-Szmek Date: Tue, 26 Mar 2019 11:01:00 +0000 (+0100) Subject: test-execute: skip flaky test when we can't unshare namespaces X-Git-Tag: v242-rc1~59^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ca58284756a4e10fd7913741f24ab3e3cc0f161;p=thirdparty%2Fsystemd.git test-execute: skip flaky test when we can't unshare namespaces When running in Fedora "mock", / is a tmpfs and /home is not mounted. The test assumes that /home will be a tmpfs only and only if we can unshare. Obviously, this does not hold in this case, because unsharing is not possible, but /home is still a tmpfs. Let's just skip the test, since it's fully legitimate to mount either or both of / and /home as tmpfs. --- diff --git a/src/test/test-execute.c b/src/test/test-execute.c index 9fd909df6ab..9f1cb0ca389 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -280,7 +280,12 @@ static void test_exec_privatedevices(Manager *m) { } static void test_exec_protecthome(Manager *m) { - test(__func__, m, "exec-protecthome-tmpfs-vs-protectsystem-strict.service", can_unshare ? 0 : EXIT_FAILURE, CLD_EXITED); + if (!can_unshare) { + log_notice("Cannot reliably unshare, skipping %s", __func__); + return; + } + + test(__func__, m, "exec-protecthome-tmpfs-vs-protectsystem-strict.service", 0, CLD_EXITED); } static void test_exec_protectkernelmodules(Manager *m) {