From: Frantisek Sumsal Date: Tue, 27 Sep 2022 11:57:04 +0000 (+0200) Subject: test: use fewer partitions/LVs when running with plain QEMU X-Git-Tag: v252-rc1~82^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=998fb5c5e30dc8d0abcd20fb9199a01e2b9307c8;p=thirdparty%2Fsystemd.git test: use fewer partitions/LVs when running with plain QEMU --- diff --git a/test/units/testsuite-64.sh b/test/units/testsuite-64.sh index 8ded8b6e2df..83377a4728b 100755 --- a/test/units/testsuite-64.sh +++ b/test/units/testsuite-64.sh @@ -380,7 +380,7 @@ EOF } testcase_lvm_basic() { - local i iterations part timeout + local i iterations partitions part timeout local vgroup="MyTestGroup$RANDOM" local devices=( /dev/disk/by-id/ata-foobar_deadbeeflvm{0..3} @@ -464,25 +464,30 @@ testcase_lvm_basic() { helper_check_device_units # Create & remove LVs in a loop, i.e. with more "stress" - if [[ -n "${ASAN_OPTIONS:-}" ]] || [[ "$(systemd-detect-virt -v)" == "qemu" ]]; then + if [[ -n "${ASAN_OPTIONS:-}" ]]; then + iterations=8 + iterations=16 + elif [[ "$(systemd-detect-virt -v)" == "qemu" ]]; then iterations=8 + partitions=8 else iterations=16 + partitions=16 fi for ((i = 1; i <= iterations; i++)); do - # 1) Create 16 logical volumes - for ((part = 0; part < 16; part++)); do + # 1) Create some logical volumes + for ((part = 0; part < partitions; part++)); do lvm lvcreate -y -L 4M "$vgroup" -n "looppart$part" done # 2) Immediately remove them - lvm lvremove -y "$vgroup"/looppart{0..15} + lvm lvremove -y $(seq -f "$vgroup/looppart%g" 0 "$((partitions - 1))") # 3) On every 4th iteration settle udev and check if all partitions are # indeed gone, and if all symlinks are still valid if ((i % 4 == 0)); then - for ((part = 0; part < 16; part++)); do + for ((part = 0; part < partitions; part++)); do udevadm wait --settle --timeout="$timeout" --removed "/dev/$vgroup/looppart$part" done helper_check_device_symlinks "/dev/disk" "/dev/$vgroup"