teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

Blame SOURCES/0240-test-ignore-the-error-about-our-own-libraries-missin.patch

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