From: Lennart Poettering Date: Fri, 4 Jun 2021 08:35:43 +0000 (+0200) Subject: test: don't expect that clone() always makes it to the kernel X-Git-Tag: v249-rc1~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d414f415358846717c2260a1d931fe75d6c5f0e3;p=thirdparty%2Fsystemd.git test: don't expect that clone() always makes it to the kernel We might get EPERM on certain clone() flag combinations. Apparently in Docker for example. Prompted by: https://github.com/systemd/systemd/pull/19800#issuecomment-854196491 --- diff --git a/src/test/test-util.c b/src/test/test-util.c index 0fe7a381c70..3eef2c30198 100644 --- a/src/test/test-util.c +++ b/src/test/test-util.c @@ -316,7 +316,7 @@ static void test_raw_clone(void) { errno = 0; assert_se(raw_clone(CLONE_FS|CLONE_NEWNS) == -1); - assert_se(errno == EINVAL); + assert_se(errno == EINVAL || ERRNO_IS_PRIVILEGE(errno)); /* Certain container environments prohibit namespaces to us, don't fail in that case */ } static void test_physical_memory(void) {