From 7b3a1af0633a4ebad8c4a46cc7c5819c829b357b Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Thu, 16 Dec 2021 11:59:09 +0100 Subject: [PATCH 1/2] test: settle before checking logs 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/units/testsuite-64.sh b/test/units/testsuite-64.sh index d41e807ef56..f75382d90a6 100755 --- a/test/units/testsuite-64.sh +++ b/test/units/testsuite-64.sh @@ -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 From bd1660c4fa576c22027205ef93a8e127ecf842a1 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Thu, 16 Dec 2021 12:05:01 +0100 Subject: [PATCH 2/2] test: bump the timeout when collecting test coverage --- test/TEST-64-UDEV-STORAGE/test.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/TEST-64-UDEV-STORAGE/test.sh b/test/TEST-64-UDEV-STORAGE/test.sh index d9abfc5d95c..0f26eaafeba 100755 --- a/test/TEST-64-UDEV-STORAGE/test.sh +++ b/test/TEST-64-UDEV-STORAGE/test.sh @@ -215,7 +215,7 @@ testcase_virtio_scsi_identically_named_partitions() { # and attach them to a virtio-scsi controller local qemu_opts=("-device virtio-scsi-pci,id=scsi0,num_queues=4") local diskpath="${TESTDIR:?}/namedpart0.img" - local lodev + local lodev qemu_timeout dd if=/dev/zero of="$diskpath" bs=1M count=18 lodev="$(losetup --show -f -P "$diskpath")" @@ -245,10 +245,14 @@ EOF ) done + # Bump the timeout when collecting test coverage, since the test is a bit + # slower in that case + is_built_with_coverage && qemu_timeout=120 || qemu_timeout=60 + KERNEL_APPEND="systemd.setenv=TEST_FUNCTION_NAME=${FUNCNAME[0]} ${USER_KERNEL_APPEND:-}" # Limit the number of VCPUs and set a timeout to make sure we trigger the issue QEMU_OPTIONS="${qemu_opts[*]} ${USER_QEMU_OPTIONS:-}" - QEMU_SMP=1 QEMU_TIMEOUT=60 test_run_one "${1:?}" || return $? + QEMU_SMP=1 QEMU_TIMEOUT=$qemu_timeout test_run_one "${1:?}" || return $? rm -f "${TESTDIR:?}"/namedpart*.img }