]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-64-UDEV-STORAGE: Replace megasas2 controller with virtio scsi controller
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 28 May 2024 12:08:18 +0000 (14:08 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 29 May 2024 13:24:03 +0000 (15:24 +0200)
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
test/TEST-64-UDEV-STORAGE/nvme_basic.configure
test/TEST-64-UDEV-STORAGE/test.sh
test/TEST-64-UDEV-STORAGE/virtio_scsi_basic.configure [moved from test/TEST-64-UDEV-STORAGE/megasas2_basic.configure with 55% similarity]
test/units/TEST-64-UDEV-STORAGE.sh

index 363104d861bc93d46efe4582ca163ae084d10243..d54c2623860a4efde06460e6f3001ebff558353d 100644 (file)
@@ -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 += [
index 68cbd728c331ee365ff6b659f4f9e73cd364bd6a..37d0d356fde8085096c6c50fe78985fbdc9dd49d 100755 (executable)
@@ -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}"
index ddcb938588249ed2ae43c9e303ad6cfa636c0076..b5a70cafaf8c642b688075a7b384898373e2679f 100755 (executable)
@@ -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
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 632e2de5b062983cfc0dc5983fd9e33847336b00..ab8d530a3e3f7b4ce01534686f86b1fb7b0ab592 100755 (executable)
@@ -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}"
index f8d49ea29d368ec34ea97a1b62e73a5d8a7d5e96..5ddddf549bb29fc731fe2341086e01550fe867b3 100755 (executable)
@@ -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 ]]
 }