mirror of
https://github.com/systemd/systemd.git
synced 2025-03-24 14:50:17 +03:00
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.
This commit is contained in:
parent
aa6178058b
commit
ac09c21d45
@ -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 += [
|
||||
|
@ -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}"
|
||||
|
@ -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
|
||||
|
@ -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}"
|
@ -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 ]]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user