ryantimwilson / rpms / systemd

Forked from rpms/systemd 6 days ago
Clone
8d419f
From 07d0debc02fb8a9f51ff06a03ceb2302e4982166 Mon Sep 17 00:00:00 2001
8d419f
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
8d419f
Date: Wed, 15 Dec 2021 09:14:44 +0100
8d419f
Subject: [PATCH] test: ignore the error about our own libraries missing during
8d419f
 image creation
8d419f
8d419f
19:50:59 F: Missing a shared library required by /var/tmp/systemd-test.NIPT2q/root/lib/systemd/libsystemd-core-250.so.
8d419f
19:50:59 F: Run "ldd /var/tmp/systemd-test.NIPT2q/root/lib/systemd/libsystemd-core-250.so" to find out what it is.
8d419f
19:50:59 F: libsystemd-shared-250.so => not found
8d419f
19:50:59 F: Cannot create a test image.
8d419f
(cherry picked from commit ff254eea8feb55bbea9ec5d731e3dc9299b80b9e)
8d419f
8d419f
Related: #2087652
8d419f
---
8d419f
 test/test-functions | 14 ++++++++------
8d419f
 1 file changed, 8 insertions(+), 6 deletions(-)
8d419f
8d419f
diff --git a/test/test-functions b/test/test-functions
8d419f
index 1b10112329..a0ad8b2fb1 100644
8d419f
--- a/test/test-functions
8d419f
+++ b/test/test-functions
8d419f
@@ -2021,11 +2021,9 @@ inst_libs() {
8d419f
 
8d419f
     while read -r line; do
8d419f
         [[ "$line" = 'not a dynamic executable' ]] && break
8d419f
-        # Skip a harmless error when running the tests on a system with a significantly
8d419f
-        # older systemd version (ldd tries to resolve the unprefixed RPATH for libsystemd.so.0,
8d419f
-        # which is in this case older than the already installed libsystemd.so.0 in $initdir).
8d419f
-        # The issue is triggered by installing test dependencies in install_missing_libraries().
8d419f
-        [[ "$line" =~ libsystemd.so.*:\ version\ .*\ not\ found ]] && continue
8d419f
+        # Ignore errors about our own stuff missing. This is most likely caused
8d419f
+        # by ldd attempting to use the unprefixed RPATH.
8d419f
+        [[ "$line" =~ libsystemd.*\ not\ found ]] && continue
8d419f
 
8d419f
         if [[ "$line" =~ $so_regex ]]; then
8d419f
             file="${BASH_REMATCH[1]}"
8d419f
@@ -2413,7 +2411,7 @@ inst_binary() {
8d419f
     # In certain cases we might attempt to install a binary which is already
8d419f
     # present in the test image, yet it's missing from the host system.
8d419f
     # In such cases, let's check if the binary indeed exists in the image
8d419f
-    # before doing any other chcecks. If it does, immediately return with
8d419f
+    # before doing any other checks. If it does, immediately return with
8d419f
     # success.
8d419f
     if [[ $# -eq 1 ]]; then
8d419f
         for path in "" bin sbin usr/bin usr/sbin; do
8d419f
@@ -2432,6 +2430,10 @@ inst_binary() {
8d419f
     while read -r line; do
8d419f
         [[ "$line" = 'not a dynamic executable' ]] && break
8d419f
 
8d419f
+        # Ignore errors about our own stuff missing. This is most likely caused
8d419f
+        # by ldd attempting to use the unprefixed RPATH.
8d419f
+        [[ "$line" =~ libsystemd.*\ not\ found ]] && continue
8d419f
+
8d419f
         if [[ "$line" =~ $so_regex ]]; then
8d419f
             file="${BASH_REMATCH[1]}"
8d419f
             [[ -e "${initdir}/$file" ]] && continue