From 5f934ae22066c39d249bad085b6a007eecfee2ca Mon Sep 17 00:00:00 2001
From: Luca Boccassi <bluca@debian.org>
Date: Wed, 28 Aug 2024 22:08:33 +0100
Subject: [PATCH 0873/1160] 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.
(cherry picked from commit 1e17e48b96bb509754a0a11ea8bd0394965564c6)
(cherry picked from commit a2c84836efc5216e99af4c3e4ba3f6c2be7e67e1)
test/units/testsuite-13.nspawn.sh | 5 +++++
1 file changed, 5 insertions(+)
@@ -870,6 +870,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[@]}")
--
2.33.0