From ac09c21d4576f0b72165d9c13a701924b0916406 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 28 May 2024 14:08:18 +0200 Subject: [PATCH] TEST-64-UDEV-STORAGE: Replace megasas2 controller with virtio scsi controller The virtio-scsi driver is available in the KVM/cloud kernel packages provided by distributions whereas the megasas2 driver is not. Let's switch to virtio-scsi so we can switch back to the KVM/cloud kernel packages. --- test/TEST-64-UDEV-STORAGE/meson.build | 2 +- test/TEST-64-UDEV-STORAGE/nvme_basic.configure | 3 --- test/TEST-64-UDEV-STORAGE/test.sh | 14 +++++++------- ...basic.configure => virtio_scsi_basic.configure} | 10 +--------- test/units/TEST-64-UDEV-STORAGE.sh | 2 +- 5 files changed, 10 insertions(+), 21 deletions(-) rename test/TEST-64-UDEV-STORAGE/{megasas2_basic.configure => virtio_scsi_basic.configure} (55%) diff --git a/test/TEST-64-UDEV-STORAGE/meson.build b/test/TEST-64-UDEV-STORAGE/meson.build index 363104d861b..d54c2623860 100644 --- a/test/TEST-64-UDEV-STORAGE/meson.build +++ b/test/TEST-64-UDEV-STORAGE/meson.build @@ -14,11 +14,11 @@ foreach testcase : [ 'lvm_basic', 'mdadm_basic', 'mdadm_lvm', - 'megasas2_basic', 'multipath_basic_failover', 'nvme_basic', 'nvme_subsystem', 'simultaneous_events', + 'virtio_scsi_basic', 'virtio_scsi_identically_named_partitions', ] integration_tests += [ diff --git a/test/TEST-64-UDEV-STORAGE/nvme_basic.configure b/test/TEST-64-UDEV-STORAGE/nvme_basic.configure index 68cbd728c33..37d0d356fde 100755 --- a/test/TEST-64-UDEV-STORAGE/nvme_basic.configure +++ b/test/TEST-64-UDEV-STORAGE/nvme_basic.configure @@ -15,9 +15,6 @@ if 'name "nvme"' not in result.stdout: print("nvme device driver is not available, skipping test...", file=sys.stderr) exit(77) -for i in range(4): - config["QemuArgs"] += ["-device", f"megasas-gen2,id=scsi{i}"] - def add_drive(i: int, serial: str) -> None: global config id = f"nvme{i}" diff --git a/test/TEST-64-UDEV-STORAGE/test.sh b/test/TEST-64-UDEV-STORAGE/test.sh index ddcb9385882..b5a70cafaf8 100755 --- a/test/TEST-64-UDEV-STORAGE/test.sh +++ b/test/TEST-64-UDEV-STORAGE/test.sh @@ -159,18 +159,18 @@ test_run() { return 0 } -testcase_megasas2_basic() { - if ! "${QEMU_BIN:?}" -device help | grep 'name "megasas-gen2"'; then - echo "megasas-gen2 device driver is not available, skipping test..." +testcase_virtio_scsi_basic() { + if ! "${QEMU_BIN:?}" -device help | grep 'name "virtio-scsi-pci"'; then + echo "virtio-scsi-pci device driver is not available, skipping test..." return 77 fi local i local qemu_opts=( - "-device megasas-gen2,id=scsi0" - "-device megasas-gen2,id=scsi1" - "-device megasas-gen2,id=scsi2" - "-device megasas-gen2,id=scsi3" + "-device virtio-scsi-pci,id=scsi0" + "-device virtio-scsi-pci,id=scsi1" + "-device virtio-scsi-pci,id=scsi2" + "-device virtio-scsi-pci,id=scsi3" ) for i in {0..127}; do diff --git a/test/TEST-64-UDEV-STORAGE/megasas2_basic.configure b/test/TEST-64-UDEV-STORAGE/virtio_scsi_basic.configure similarity index 55% rename from test/TEST-64-UDEV-STORAGE/megasas2_basic.configure rename to test/TEST-64-UDEV-STORAGE/virtio_scsi_basic.configure index 632e2de5b06..ab8d530a3e3 100755 --- a/test/TEST-64-UDEV-STORAGE/megasas2_basic.configure +++ b/test/TEST-64-UDEV-STORAGE/virtio_scsi_basic.configure @@ -2,21 +2,13 @@ # SPDX-License-Identifier: LGPL-2.1-or-later import json -import os -import subprocess import sys config = json.load(sys.stdin) -qemu = f"qemu-system-{os.environ["QEMU_ARCHITECTURE"]}" -result = subprocess.run([qemu, '-device', 'help'], check=True, text=True, stdout=subprocess.PIPE) -if 'name "megasas-gen2"' not in result.stdout: - print("megasas-gen2 device driver is not available, skipping test...", file=sys.stderr) - exit(77) - for i in range(4): - config["QemuArgs"] += ['-device', f"megasas-gen2,id=scsi{i}"] + config["QemuArgs"] += ['-device', f"virtio-scsi-pci,id=scsi{i}"] for i in range(128): id = f"drive{i}" diff --git a/test/units/TEST-64-UDEV-STORAGE.sh b/test/units/TEST-64-UDEV-STORAGE.sh index f8d49ea29d3..5ddddf549bb 100755 --- a/test/units/TEST-64-UDEV-STORAGE.sh +++ b/test/units/TEST-64-UDEV-STORAGE.sh @@ -168,7 +168,7 @@ helper_check_device_units() {( check_device_units 1 "$@" )} -testcase_megasas2_basic() { +testcase_virtio_scsi_basic() { lsblk -S [[ "$(lsblk --scsi --noheadings | wc -l)" -ge 128 ]] } -- 2.47.3