]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: mount ld.so.cache in minimal nspawn container if present
authorLuca Boccassi <bluca@debian.org>
Wed, 28 Aug 2024 21:08:33 +0000 (22:08 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 29 Aug 2024 05:27:16 +0000 (07:27 +0200)
In some cases (SUSE Tumbleweed) this is needed as a library (libz) is
not in the default path, so it fails to run.

test/units/TEST-13-NSPAWN.nspawn.sh

index ad11468886f147a427cc924c0a8b053a1763c502..7c21825d63cd0bcc478de9c40bad6632b9a5067b 100755 (executable)
@@ -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[@]}")