From: Daan De Meyer Date: Thu, 27 Mar 2025 14:49:06 +0000 (+0100) Subject: TEST-06-SELINUX: Only enable if meson was invoked as root X-Git-Tag: v258-rc1~995^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2d2b382b6440dbb3795a3982260cf9534bbf2de;p=thirdparty%2Fsystemd.git TEST-06-SELINUX: Only enable if meson was invoked as root This test only works if the image was built as root. Since that's impossible to check as meson generally runs before we build the image, let's use whether meson is run as root as a proxy. --- diff --git a/test/integration-tests/TEST-06-SELINUX/meson.build b/test/integration-tests/TEST-06-SELINUX/meson.build index e2f329d17c1..22f306260db 100644 --- a/test/integration-tests/TEST-06-SELINUX/meson.build +++ b/test/integration-tests/TEST-06-SELINUX/meson.build @@ -1,5 +1,8 @@ # SPDX-License-Identifier: LGPL-2.1-or-later +id = find_program('id', required : true) +uid = run_command(id, '-u', check : true).stdout().strip().to_int() + integration_tests += [ integration_test_template + { 'name' : fs.name(meson.current_source_dir()), @@ -11,5 +14,6 @@ integration_tests += [ # Make sure we don't mount anything with virtiofs as otherwise fixfiles will try to relabel # it. 'mkosi-args' : integration_test_template['mkosi-args'] + ['--runtime-build-sources=no'], + 'enabled' : uid == 0, }, ]