]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: reflect that we can now handle devices with very long sysfs paths 22759/head
authorMichal Sekletar <msekleta@redhat.com>
Thu, 24 Mar 2022 18:24:16 +0000 (19:24 +0100)
committerMichal Sekletar <msekleta@redhat.com>
Wed, 13 Apr 2022 15:46:52 +0000 (17:46 +0200)
test/units/testsuite-64.sh

index 5f50131dd5db0399856bd5538b98653f66649d2d..efe254419aae9733bf7f04cc9b3b50e1d11b12bb 100755 (executable)
@@ -515,6 +515,7 @@ testcase_long_sysfs_path() {
     echo "UUID=deadbeef-dead-dead-beef-222222222222 $mpoint ext4 defaults 0 0" >>/etc/fstab
     systemctl daemon-reload
     mount "$mpoint"
+    systemctl status "$mpoint"
     test -e "$mpoint/test"
     umount "$mpoint"
 
@@ -525,9 +526,9 @@ testcase_long_sysfs_path() {
     udevadm settle
 
     logfile="$(mktemp)"
-    journalctl -b -q --no-pager -o short-monotonic -p info --grep "Device path.*vda.?' too long to fit into unit name"
+    [[ "$(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 ]]
     # Make sure we don't unnecessarily spam the log
-    journalctl -b -q --no-pager -o short-monotonic -p info --grep "/sys/devices/.+/vda[0-9]?" _PID=1 + UNIT=systemd-udevd.service | tee "$logfile"
+    { journalctl -b -q --no-pager -o short-monotonic -p info --grep "/sys/devices/.+/vda[0-9]?" _PID=1 + UNIT=systemd-udevd.service || :;} | tee "$logfile"
     [[ "$(wc -l <"$logfile")" -lt 10 ]]
 
     : >/etc/fstab