dcavalca / rpms / systemd

Forked from rpms/systemd 4 months ago
Clone
2aacef
From ca92c2e035d5702f23f9a8d1cd705425b5605822 Mon Sep 17 00:00:00 2001
2aacef
From: Frantisek Sumsal <frantisek@sumsal.cz>
2aacef
Date: Mon, 7 Nov 2022 11:55:29 +0100
2aacef
Subject: [PATCH] test: don't ignore non-existent paths in inst_recursive()
2aacef
2aacef
The process substitution in the while loop hides errors raised by the
2aacef
find utility, which might (and did), in turn, hide errors in test setup.
2aacef
2aacef
(cherry picked from commit eb5d7730e1b3b1bddecb80be37e5a4c938183f61)
2aacef
2aacef
Related #2138081
2aacef
---
2aacef
 test/test-functions | 4 ++++
2aacef
 1 file changed, 4 insertions(+)
2aacef
2aacef
diff --git a/test/test-functions b/test/test-functions
2aacef
index 16d9da637b..80ce383e64 100644
2aacef
--- a/test/test-functions
2aacef
+++ b/test/test-functions
2aacef
@@ -2773,6 +2773,10 @@ inst_recursive() {
2aacef
     local p item
2aacef
 
2aacef
     for p in "$@"; do
2aacef
+        # Make sure the source exists, as the process substitution below
2aacef
+        # suppresses errors
2aacef
+        stat "$p" >/dev/null || return 1
2aacef
+
2aacef
         while read -r item; do
2aacef
             if [[ -d "$item" ]]; then
2aacef
                 inst_dir "$item"