Skip to content

Commit 4a4e4c6

Browse files
committed
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. (cherry picked from commit 6fd3496) (cherry picked from commit 2d975f6) (cherry picked from commit 37e27ee) (cherry picked from commit 464d495)
1 parent 49e993e commit 4a4e4c6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/units/testsuite-22.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
set -eux
44
set -o pipefail
55

6+
if systemd-detect-virt --quiet --container; then
7+
# This comes from the selinux package and tries to write
8+
# some files under sysfs, which will be read-only in a container,
9+
# so mask it. It's not our tmpfiles.d file anyway.
10+
mkdir -p /run/tmpfiles.d/
11+
ln -s /dev/null /run/tmpfiles.d/selinux-policy.conf
12+
fi
13+
614
: >/failed
715

816
for t in "${0%.sh}".*.sh; do

0 commit comments

Comments
 (0)