]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: settle before checking logs
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 16 Dec 2021 10:59:09 +0000 (11:59 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 16 Dec 2021 10:59:09 +0000 (11:59 +0100)
Otherwise we might miss the "Device path too long" message:

```
[   21.083274] testsuite-64.sh[374]: swapoff /dev/vda1
[   21.089841] testsuite-64.sh[376]: ++ mktemp
[   21.095115] testsuite-64.sh[271]: + logfile=/tmp/tmp.a1MULA35wL
[   21.095115] testsuite-64.sh[271]: + journalctl -b -q --no-pager -o short-monotonic -p info --grep 'Device path.*vda.?'\'' too long to fit into unit name'
...
[   21.277360] systemd[1]: testsuite-64.service: Main process exited, code=exited, status=1/FAILURE
[   21.277508] systemd[1]: testsuite-64.service: Failed with result 'exit-code'.
...
[   21.323500] systemd[1]: Device path '/sys/devices/pci0000:00/0000:00:03.0/0000:01:00.0/0000:02:00.0/0000:03:00.0/0000:04:00.0/0000:05:00.0/0000:06:00.0/0000:07:00.0/0000:08:00.0/0000:09:00.0/0000:0a:00.0/0000:0b:00.0/0000:0c:00.0/0000:0d:00.0/0000:0e:00.0/0000:0f:00.0/0000:10:00.0/0000:11:00.0/0000:12:00.0/0000:13:00.0/0000:14:00.0/0000:15:00.0/0000:16:00.0/0000:17:00.0/0000:18:00.0/0000:19:00.0/0000:1a:00.0/virtio0/block/vda/vda1' too long to fit into unit name, ignoring device.

```

test/units/testsuite-64.sh

index d41e807ef568a175937f109b9c50071f06b89d22..f75382d90a6cd9cfd4fa276c49b8ddfc96b89fe9 100755 (executable)
@@ -673,6 +673,8 @@ testcase_long_sysfs_path() {
     swapon -v -L swap_vol
     swapoff -v -L swap_vol
 
+    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"
     # Make sure we don't unnecessarily spam the log