summaryrefslogtreecommitdiffstats
path: root/test/units/TEST-29-PORTABLE.sh
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-07-12 16:04:22 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-07-15 16:17:33 +0200
commitff8c89aa5a84733dd777f3e9113df33ce6c1ab1e (patch)
treee002a62be8e4740f4489e73572d13bf67370ec0b /test/units/TEST-29-PORTABLE.sh
parentmkosi: Add CI for CentOS Stream 10 (diff)
downloadsystemd-ff8c89aa5a84733dd777f3e9113df33ce6c1ab1e.tar.xz
systemd-ff8c89aa5a84733dd777f3e9113df33ce6c1ab1e.zip
test: do not attempt to set xattr on tmpfs
This is only possible since a recent kernel version, and fails otherwise, like on CentOS 9
Diffstat (limited to '')
-rwxr-xr-xtest/units/TEST-29-PORTABLE.sh15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/units/TEST-29-PORTABLE.sh b/test/units/TEST-29-PORTABLE.sh
index b4dcd5a1a2..41dce4d48a 100755
--- a/test/units/TEST-29-PORTABLE.sh
+++ b/test/units/TEST-29-PORTABLE.sh
@@ -355,15 +355,16 @@ portablectl "${ARGS[@]}" attach --copy=symlink --now --runtime /tmp/rootdir mini
portablectl detach --now --runtime --enable /tmp/rootdir minimal-app0
# The wrong file should be ignored, given the right one has the xattr set
-mkdir -p /tmp/wrongext/usr/lib/extension-release.d /tmp/wrongext/usr/lib/systemd/system/
-echo "[Service]" > /tmp/wrongext/usr/lib/systemd/system/app0.service
-touch /tmp/wrongext/usr/lib/extension-release.d/extension-release.wrongext_somethingwrong.txt
-cp /tmp/rootdir/usr/lib/os-release /tmp/wrongext/usr/lib/extension-release.d/extension-release.app0
-setfattr -n user.extension-release.strict -v "false" /tmp/wrongext/usr/lib/extension-release.d/extension-release.app0
-portablectl "${ARGS[@]}" attach --runtime --extension /tmp/wrongext /tmp/rootdir app0
+trap 'rm -rf /var/cache/wrongext' EXIT
+mkdir -p /var/cache/wrongext/usr/lib/extension-release.d /var/cache/wrongext/usr/lib/systemd/system/
+echo "[Service]" > /var/cache/wrongext/usr/lib/systemd/system/app0.service
+touch /var/cache/wrongext/usr/lib/extension-release.d/extension-release.wrongext_somethingwrong.txt
+cp /tmp/rootdir/usr/lib/os-release /var/cache/wrongext/usr/lib/extension-release.d/extension-release.app0
+setfattr -n user.extension-release.strict -v "false" /var/cache/wrongext/usr/lib/extension-release.d/extension-release.app0
+portablectl "${ARGS[@]}" attach --runtime --extension /var/cache/wrongext /tmp/rootdir app0
status="$(portablectl is-attached --extension wrongext rootdir)"
[[ "${status}" == "attached-runtime" ]]
-portablectl detach --runtime --extension /tmp/wrongext /tmp/rootdir app0
+portablectl detach --runtime --extension /var/cache/wrongext /tmp/rootdir app0
umount /tmp/rootdir
umount /tmp/app0