From 1678bd2f81096b3b2b7c09f335e9c5cc8da96dca Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Thu, 25 Aug 2022 12:57:42 +0200 Subject: [PATCH 1/6] test: lower the # of mpath devices to 16 to make the test suitable for slower machines. --- test/TEST-64-UDEV-STORAGE/test.sh | 4 ++-- test/units/testsuite-64.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/TEST-64-UDEV-STORAGE/test.sh b/test/TEST-64-UDEV-STORAGE/test.sh index fe80434309..36c2dcd51b 100755 --- a/test/TEST-64-UDEV-STORAGE/test.sh +++ b/test/TEST-64-UDEV-STORAGE/test.sh @@ -286,8 +286,8 @@ EOF mkfs.ext4 -U "deadbeef-dead-dead-beef-111111111111" -L "failover_vol" "${lodev}p2" losetup -d "$lodev" - # Add 64 multipath devices, each backed by 4 paths - for ndisk in {0..63}; do + # Add 16 multipath devices, each backed by 4 paths + for ndisk in {0..15}; do wwn="0xDEADDEADBEEF$(printf "%.4d" "$ndisk")" # Use a partitioned disk for the first device to test failover [[ $ndisk -eq 0 ]] && image="$partdisk" || image="${TESTDIR:?}/disk$ndisk.img" diff --git a/test/units/testsuite-64.sh b/test/units/testsuite-64.sh index 05a012b2b1..61fed6648c 100755 --- a/test/units/testsuite-64.sh +++ b/test/units/testsuite-64.sh @@ -82,7 +82,7 @@ EOF udevadm settle ls -l /dev/disk/by-id/ - for i in {0..63}; do + for i in {0..15}; do wwid="deaddeadbeef$(printf "%.4d" "$i")" path="/dev/disk/by-id/wwn-0x$wwid" dmpath="$(readlink -f "$path")" From cde09b07dfdc132a31672693c037bfc0b5879331 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Thu, 25 Aug 2022 13:51:15 +0200 Subject: [PATCH 2/6] test: check for other hypervisors as well EC2 machines run on Xen, so account for that as well when checking KVM availability. --- test/test-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-functions b/test/test-functions index 3cdfd800f0..14344a4d1e 100644 --- a/test/test-functions +++ b/test/test-functions @@ -92,7 +92,7 @@ add_at_exit_handler() { # check if it's not explicitly disabled (TEST_NO_KVM) and we're not already # running under KVM. If these conditions are met, enable KVM (and possibly # nested KVM), otherwise disable it. -if get_bool "${TEST_NESTED_KVM:=}" || (! get_bool "${TEST_NO_KVM:=}" && [[ "$(systemd-detect-virt -v)" != kvm ]]); then +if get_bool "${TEST_NESTED_KVM:=}" || (! get_bool "${TEST_NO_KVM:=}" && ! systemd-detect-virt -v); then QEMU_KVM=yes else QEMU_KVM=no From 092499b9f69b89f7afb392ddc733edb87e1503ca Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Thu, 25 Aug 2022 14:23:49 +0200 Subject: [PATCH 3/6] test: require KVM only for specific sub-tests since other sub-tests run relatively fine with TCG as well. --- test/TEST-64-UDEV-STORAGE/test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/TEST-64-UDEV-STORAGE/test.sh b/test/TEST-64-UDEV-STORAGE/test.sh index 36c2dcd51b..80c60f19f7 100755 --- a/test/TEST-64-UDEV-STORAGE/test.sh +++ b/test/TEST-64-UDEV-STORAGE/test.sh @@ -20,11 +20,6 @@ QEMU_TIMEOUT="${QEMU_TIMEOUT:-600}" USER_QEMU_OPTIONS="${QEMU_OPTIONS:-}" USER_KERNEL_APPEND="${KERNEL_APPEND:-}" -if ! get_bool "$QEMU_KVM"; then - echo "This test requires KVM, skipping..." - exit 0 -fi - _host_has_feature() {( set -e @@ -213,6 +208,11 @@ testcase_nvme_basic() { # Test for issue https://github.com/systemd/systemd/issues/20212 testcase_virtio_scsi_identically_named_partitions() { + if ! get_bool "$QEMU_KVM"; then + echo "This test requires KVM, skipping..." + return 77 + fi + if ! "${QEMU_BIN:?}" -device help | grep 'name "virtio-scsi-pci"'; then echo "virtio-scsi-pci device driver is not available, skipping test..." return 77 From b307c227579976ea70a220265e7954d76944ca78 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Thu, 25 Aug 2022 14:25:07 +0200 Subject: [PATCH 4/6] test: lower the # of iterations with plain QEMU --- test/units/testsuite-64.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/units/testsuite-64.sh b/test/units/testsuite-64.sh index 61fed6648c..3ae1bddaf4 100755 --- a/test/units/testsuite-64.sh +++ b/test/units/testsuite-64.sh @@ -178,7 +178,7 @@ EOF # leading to dead symlinks in /dev/disk/ iterations=100 timeout=30 - if [[ -n "${ASAN_OPTIONS:-}" ]]; then + if [[ -n "${ASAN_OPTIONS:-}" ]] || [[ "$(systemd-detect-virt -v)" == "qemu" ]]; then iterations=10 timeout=180 fi From 6a9c4977683a30fcd36baf64e35255e9846028c6 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Thu, 25 Aug 2022 14:52:30 +0200 Subject: [PATCH 5/6] test: bump the base VM memory to 768M as with 512M some tests occasionally trip off OOM-killer (e.g. TEST-64 + multipath). --- test/TEST-36-NUMAPOLICY/test.sh | 2 +- test/test-functions | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/TEST-36-NUMAPOLICY/test.sh b/test/TEST-36-NUMAPOLICY/test.sh index 7909b1dce3..a0bfd4079a 100755 --- a/test/TEST-36-NUMAPOLICY/test.sh +++ b/test/TEST-36-NUMAPOLICY/test.sh @@ -9,7 +9,7 @@ TEST_NO_NSPAWN=1 . "${TEST_BASE_DIR:?}/test-functions" if qemu_min_version "5.2.0"; then - QEMU_OPTIONS="-object memory-backend-ram,id=mem0,size=${QEMU_MEM:-512M} -numa node,memdev=mem0,nodeid=0" + QEMU_OPTIONS="-object memory-backend-ram,id=mem0,size=${QEMU_MEM:-768M} -numa node,memdev=mem0,nodeid=0" else QEMU_OPTIONS="-numa node,nodeid=0" fi diff --git a/test/test-functions b/test/test-functions index 14344a4d1e..359eb90314 100644 --- a/test/test-functions +++ b/test/test-functions @@ -483,7 +483,7 @@ run_qemu() { qemu_options+=( -smp "$QEMU_SMP" -net none - -m "${QEMU_MEM:-512M}" + -m "${QEMU_MEM:-768M}" -nographic -kernel "$KERNEL_BIN" -drive "format=raw,cache=unsafe,file=$image" From 9def084861a4b5aaaa441fd5e346a38298638a6d Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Fri, 26 Aug 2022 15:39:32 +0200 Subject: [PATCH 6/6] test: temporarily (?) disable TEST-64 in Ubuntu CI The machines are still way too slow for the test to work properly without accel. --- test/TEST-64-UDEV-STORAGE/deny-list-ubuntu-ci | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test/TEST-64-UDEV-STORAGE/deny-list-ubuntu-ci diff --git a/test/TEST-64-UDEV-STORAGE/deny-list-ubuntu-ci b/test/TEST-64-UDEV-STORAGE/deny-list-ubuntu-ci new file mode 100644 index 0000000000..e69de29bb2