diff options
author | Luca Boccassi <luca.boccassi@gmail.com> | 2024-11-23 14:28:03 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-11-25 07:25:55 +0100 |
commit | 6fd3496cfd0d28808b5489ee87f826c2130f5f0b (patch) | |
tree | f552ab75eb66ac2ca083d2ea214e56477f0e3e62 /test | |
parent | mkosi: Use shared extra tree between initrd and main image (diff) | |
download | systemd-6fd3496cfd0d28808b5489ee87f826c2130f5f0b.tar.xz systemd-6fd3496cfd0d28808b5489ee87f826c2130f5f0b.zip |
test: mask tmpfiles.d file shipped by selinux policy package in containers
This tmpfiles.d wants to write to sysfs, which is read-only in containers,
so systemd-tmpfiles --create fails in TEST-22-TMPFILES when ran in nspawn
if the selinux policy package is instealled. Mask it, as it's not our
config file, we don't need it in the test.
Diffstat (limited to 'test')
-rwxr-xr-x | test/units/TEST-22-TMPFILES.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/units/TEST-22-TMPFILES.sh b/test/units/TEST-22-TMPFILES.sh index 9c2a033aa9..85109a1ad5 100755 --- a/test/units/TEST-22-TMPFILES.sh +++ b/test/units/TEST-22-TMPFILES.sh @@ -6,6 +6,14 @@ set -o pipefail # shellcheck source=test/units/test-control.sh . "$(dirname "$0")"/test-control.sh +if systemd-detect-virt --quiet --container; then + # This comes from the selinux package and tries to write + # some files under sysfs, which will be read-only in a container, + # so mask it. It's not our tmpfiles.d file anyway. + mkdir -p /run/tmpfiles.d/ + ln -s /dev/null /run/tmpfiles.d/selinux-policy.conf +fi + run_subtests touch /testok |