summaryrefslogtreecommitdiffstats
path: root/test/TEST-64-UDEV-STORAGE
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-08-28 04:58:52 +0200
committerFrantisek Sumsal <frantisek@sumsal.cz>2022-08-28 11:18:18 +0200
commit0bfe2aa378615caf8c9ee22cd00524b7661c3f75 (patch)
tree14feacd537d549f3bdd4cfdec68c5ab9045e59f3 /test/TEST-64-UDEV-STORAGE
parentdocs: fix incorrect env var name for credentials directory (diff)
downloadsystemd-0bfe2aa378615caf8c9ee22cd00524b7661c3f75.tar.xz
systemd-0bfe2aa378615caf8c9ee22cd00524b7661c3f75.zip
test-64: run one more subtest on non-KVM environment with relaxed condition
Diffstat (limited to 'test/TEST-64-UDEV-STORAGE')
-rwxr-xr-xtest/TEST-64-UDEV-STORAGE/test.sh33
1 files changed, 18 insertions, 15 deletions
diff --git a/test/TEST-64-UDEV-STORAGE/test.sh b/test/TEST-64-UDEV-STORAGE/test.sh
index 07b5df1d82..6eed43cc25 100755
--- a/test/TEST-64-UDEV-STORAGE/test.sh
+++ b/test/TEST-64-UDEV-STORAGE/test.sh
@@ -207,10 +207,6 @@ 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..."
@@ -221,25 +217,26 @@ 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 i lodev qemu_timeout
+ local i lodev num_disk num_part qemu_timeout
+
+ if get_bool "${IS_BUILT_WITH_ASAN:=}" || ! get_bool "$QEMU_KVM"; then
+ num_disk=4
+ num_part=4
+ else
+ num_disk=16
+ num_part=8
+ fi
dd if=/dev/zero of="$diskpath" bs=1M count=18
lodev="$(losetup --show -f -P "$diskpath")"
sfdisk "${lodev:?}" <<EOF
label: gpt
-name="Hello world", size=2M
-name="Hello world", size=2M
-name="Hello world", size=2M
-name="Hello world", size=2M
-name="Hello world", size=2M
-name="Hello world", size=2M
-name="Hello world", size=2M
-name="Hello world", size=2M
+$(for ((i = 1; i <= num_part; i++)); do echo 'name="Hello world", size=2M'; done)
EOF
losetup -d "$lodev"
- for i in {0..15}; do
+ for ((i = 0; i < num_disk; i++)); do
diskpath="${TESTDIR:?}/namedpart$i.img"
if [[ $i -gt 0 ]]; then
cp -uv "${TESTDIR:?}/namedpart0.img" "$diskpath"
@@ -253,7 +250,13 @@ EOF
# 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
+ if get_bool "${IS_BUILT_WITH_ASAN:=}" || ! get_bool "$QEMU_KVM"; then
+ qemu_timeout=240
+ elif is_built_with_coverage; then
+ qemu_timeout=120
+ else
+ qemu_timeout=60
+ fi
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