dryang / rpms / systemd

Forked from rpms/systemd a year ago
Clone
8d419f
From c81dea716e04419f8f7b83346015ae8f834ec30c Mon Sep 17 00:00:00 2001
8d419f
From: Frantisek Sumsal <frantisek@sumsal.cz>
8d419f
Date: Mon, 20 Jun 2022 12:27:39 +0200
8d419f
Subject: [PATCH] test: use saved process PID instead of %%
8d419f
8d419f
As the `%%` specifier might fail if the current job (i.e. the last
8d419f
background job) already finished:
8d419f
8d419f
```
8d419f
[   61.692196] testsuite-04.sh[656]: ++ systemd-id128 new
8d419f
[   61.705407] testsuite-04.sh[263]: + ID=912cb8f8ef304153a123f772bb0fe9e0
8d419f
[   61.706318] testsuite-04.sh[657]: + systemd-cat -t 912cb8f8ef304153a123f772bb0fe9e0 bash -c 'echo parent; (echo child) & wait'
8d419f
[   61.720940] testsuite-04.sh[263]: + PID=657
8d419f
[   61.721126] testsuite-04.sh[263]: + wait %%
8d419f
[   61.723014] testsuite-04.sh[263]: /usr/lib/systemd/tests/testdata/units/testsuite-04.sh: line 96: wait: %%: no such job
8d419f
```
8d419f
8d419f
(cherry picked from commit 08970485003c25ce2c4adfaeea2d58558d311d42)
8d419f
8d419f
Related: #2087652
8d419f
---
8d419f
 test/units/testsuite-04.sh | 2 +-
8d419f
 1 file changed, 1 insertion(+), 1 deletion(-)
8d419f
8d419f
diff --git a/test/units/testsuite-04.sh b/test/units/testsuite-04.sh
8d419f
index 7521a6d2e5..b5468cbea4 100755
8d419f
--- a/test/units/testsuite-04.sh
8d419f
+++ b/test/units/testsuite-04.sh
8d419f
@@ -93,7 +93,7 @@ cmp /expected /output
8d419f
 ID=$(systemd-id128 new)
8d419f
 systemd-cat -t "$ID" bash -c 'echo parent; (echo child) & wait' &
8d419f
 PID=$!
8d419f
-wait %%
8d419f
+wait $PID
8d419f
 journalctl --sync
8d419f
 # We can drop this grep when https://github.com/systemd/systemd/issues/13937
8d419f
 # has a fix.