1
0
mirror of https://github.com/systemd/systemd synced 2025-10-06 00:13:24 +02:00

test: also edit /etc/os-release if it's not a symlink when patching /usr/lib/os-release (#38628)

mkosi patches up /etc/os-release to add local IDs and fixup certain
issues, so when tests patch /usr/lib/ on the fly, copy to the version in
/etc/ too to avoid test failures when querying

6370s 10/98 systemd:integration-tests / TEST-07-PID1 FAIL 31.03s exit
status 1
6370s 25/98 systemd:integration-tests / TEST-29-PORTABLE FAIL 12.76s
exit status 1
6370s 33/98 systemd:integration-tests / TEST-43-PRIVATEUSER-UNPRIV FAIL
6.57s exit status 1
6370s 37/98 systemd:integration-tests / TEST-50-DISSECT FAIL 16.97s exit
status 1

This is particularly an issue when running these tests on debian unstable,
where mkosi has to fixup os-release to make it valid and avoid further
breakages:

https://github.com/systemd/mkosi/blob/main/mkosi/distributions/debian.py#L234
This commit is contained in:
Luca Boccassi
2025-08-19 12:32:00 +01:00
committed by GitHub
parent 265386ba35
commit b1cd38e893
3 changed files with 16 additions and 0 deletions

View File

@@ -8,4 +8,7 @@ cat >>"$BUILDROOT/usr/lib/os-release" <<EOF
MARKER=1
PORTABLE_PREFIXES=app0 minimal minimal-app0
EOF
if [ ! -L "$BUILDROOT/etc/os-release" ]; then
cp "$BUILDROOT/usr/lib/os-release" "$BUILDROOT/etc/os-release"
fi
cp "$BUILDROOT/usr/lib/systemd/system/minimal-app0.service" "$BUILDROOT/usr/lib/systemd/system/minimal-app0-foo.service"

View File

@@ -8,4 +8,7 @@ cat >>"$BUILDROOT/usr/lib/os-release" <<EOF
MARKER=2
PORTABLE_PREFIXES=app0 minimal minimal-app0
EOF
if [ ! -L "$BUILDROOT/etc/os-release" ]; then
cp "$BUILDROOT/usr/lib/os-release" "$BUILDROOT/etc/os-release"
fi
cp "$BUILDROOT/usr/lib/systemd/system/minimal-app0.service" "$BUILDROOT/usr/lib/systemd/system/minimal-app0-bar.service"