richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
594167
From 87e45d9c58c74ae7ba46f99a3f0e2db39cf345ff Mon Sep 17 00:00:00 2001
594167
From: Michal Sekletar <msekleta@redhat.com>
594167
Date: Thu, 24 Mar 2022 19:24:16 +0100
594167
Subject: [PATCH] tests: reflect that we can now handle devices with very long
594167
 sysfs paths
594167
594167
(cherry picked from commit b26f4f0028e27b6ad46ef9af56aac7571caa3a25)
594167
594167
Related: #2083493
594167
---
594167
 test/units/testsuite-64.sh | 5 +++--
594167
 1 file changed, 3 insertions(+), 2 deletions(-)
594167
594167
diff --git a/test/units/testsuite-64.sh b/test/units/testsuite-64.sh
594167
index dc8b263b10..218b2ee8d1 100755
594167
--- a/test/units/testsuite-64.sh
594167
+++ b/test/units/testsuite-64.sh
594167
@@ -674,6 +674,7 @@ testcase_long_sysfs_path() {
594167
     echo "UUID=deadbeef-dead-dead-beef-222222222222 $mpoint ext4 defaults 0 0" >>/etc/fstab
594167
     systemctl daemon-reload
594167
     mount "$mpoint"
594167
+    systemctl status "$mpoint"
594167
     test -e "$mpoint/test"
594167
     umount "$mpoint"
594167
 
594167
@@ -684,9 +685,9 @@ testcase_long_sysfs_path() {
594167
     udevadm settle
594167
 
594167
     logfile="$(mktemp)"
594167
-    journalctl -b -q --no-pager -o short-monotonic -p info --grep "Device path.*vda.?' too long to fit into unit name"
594167
+    [[ "$(journalctl -b -q --no-pager -o short-monotonic -p info --grep "Device path.*vda.?' too long to fit into unit name" | wc -l)" -eq 0 ]]
594167
     # Make sure we don't unnecessarily spam the log
594167
-    journalctl -b -q --no-pager -o short-monotonic -p info --grep "/sys/devices/.+/vda[0-9]?" _PID=1 + UNIT=systemd-udevd.service | tee "$logfile"
594167
+    { journalctl -b -q --no-pager -o short-monotonic -p info --grep "/sys/devices/.+/vda[0-9]?" _PID=1 + UNIT=systemd-udevd.service || :;} | tee "$logfile"
594167
     [[ "$(wc -l <"$logfile")" -lt 10 ]]
594167
 
594167
     : >/etc/fstab