dryang / rpms / systemd

Forked from rpms/systemd a year ago
Clone
ac3a84
From 4dbbdc956cb49804f9b451081eb7c442a689b1f1 Mon Sep 17 00:00:00 2001
ac3a84
From: Frantisek Sumsal <frantisek@sumsal.cz>
ac3a84
Date: Tue, 21 Feb 2023 19:15:13 +0100
ac3a84
Subject: [PATCH] test: add coverage for #26467
ac3a84
ac3a84
(cherry picked from commit 4190124b3ca005830d893303bbc563baaf9984ed)
ac3a84
ac3a84
Related: #2138081
ac3a84
---
ac3a84
 test/units/testsuite-26.sh | 12 ++++++++++++
ac3a84
 1 file changed, 12 insertions(+)
ac3a84
ac3a84
diff --git a/test/units/testsuite-26.sh b/test/units/testsuite-26.sh
ac3a84
index 916a6704d7..debee91dde 100755
ac3a84
--- a/test/units/testsuite-26.sh
ac3a84
+++ b/test/units/testsuite-26.sh
ac3a84
@@ -400,5 +400,17 @@ EOF
ac3a84
     systemctl stop issue-24990
ac3a84
 fi
ac3a84
 
ac3a84
+# %J in WantedBy= causes ABRT (#26467)
ac3a84
+cat >/run/systemd/system/test-WantedBy.service <
ac3a84
+[Service]
ac3a84
+ExecStart=true
ac3a84
+
ac3a84
+[Install]
ac3a84
+WantedBy=user-%i@%J.service
ac3a84
+EOF
ac3a84
+systemctl daemon-reload
ac3a84
+systemctl enable --now test-WantedBy.service || :
ac3a84
+systemctl daemon-reload
ac3a84
+
ac3a84
 touch /testok
ac3a84
 rm /failed