summaryrefslogtreecommitdiffstats
path: root/test/units
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2024-08-28 23:08:33 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-08-29 07:27:16 +0200
commit1e17e48b96bb509754a0a11ea8bd0394965564c6 (patch)
treea16c81ed42fcfb5e30906633bc249e5dee1ed53a /test/units
parentMerge pull request #34160 from weblate/weblate-systemd-main (diff)
downloadsystemd-1e17e48b96bb509754a0a11ea8bd0394965564c6.tar.xz
systemd-1e17e48b96bb509754a0a11ea8bd0394965564c6.zip
test: mount ld.so.cache in minimal nspawn container if present
In some cases (SUSE Tumbleweed) this is needed as a library (libz) is not in the default path, so it fails to run.
Diffstat (limited to 'test/units')
-rwxr-xr-xtest/units/TEST-13-NSPAWN.nspawn.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/units/TEST-13-NSPAWN.nspawn.sh b/test/units/TEST-13-NSPAWN.nspawn.sh
index ad11468886..7c21825d63 100755
--- a/test/units/TEST-13-NSPAWN.nspawn.sh
+++ b/test/units/TEST-13-NSPAWN.nspawn.sh
@@ -969,6 +969,11 @@ testcase_check_os_release() {
--bind-ro="$base/usr:/usr"
)
+ # Might be needed to find libraries
+ if [ -f "$base/etc/ld.so.cache" ]; then
+ common_opts+=("--bind-ro=$base/etc/ld.so.cache:/etc/ld.so.cache")
+ fi
+
# Empty /etc/ & /usr/
(! systemd-nspawn "${common_opts[@]}")
(! SYSTEMD_NSPAWN_CHECK_OS_RELEASE=1 systemd-nspawn "${common_opts[@]}")