Skip to content

Commit

Permalink
Merge pull request systemd#33062 from DaanDeMeyer/virtio-scsi
Browse files Browse the repository at this point in the history
mkosi: Switch back to cloud/KVM kernel packages
  • Loading branch information
DaanDeMeyer authored May 29, 2024
2 parents aa61780 + 556659a commit c15747e
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Packages=
iputils
iscsi-initiator-utils
kernel-core
kernel-modules # For squashfs and megasas2
libasan
libcap-ng-utils
libubsan
Expand Down
1 change: 1 addition & 0 deletions mkosi.images/system/mkosi.conf.d/10-centos/mkosi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ Distribution=centos

[Content]
Packages=
kernel-modules # For squashfs
rpmautospec-rpm-macros
4 changes: 0 additions & 4 deletions mkosi.images/system/mkosi.conf.d/10-debian/mkosi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@

[Match]
Distribution=debian

[Content]
Packages=
linux-image-generic
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SPDX-License-Identifier: LGPL-2.1-or-later

[Match]
Architecture=arm64

[Content]
Packages=
linux-image-cloud-arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SPDX-License-Identifier: LGPL-2.1-or-later

[Match]
Architecture=x86-64

[Content]
Packages=
linux-image-cloud-amd64
1 change: 1 addition & 0 deletions mkosi.images/system/mkosi.conf.d/10-fedora/mkosi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Packages=
dnf5
f2fs-tools
scsi-target-utils
# Required for systemd-networkd-tests.py (netdevsim and sch_xxx modules)
kernel-modules-extra
kernel-modules-internal

Expand Down
3 changes: 2 additions & 1 deletion test/TEST-24-CRYPTSETUP/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ integration_tests += [
'luks.options=0d318174-56b0-4d6e-a324-ac1e7e7d235d=x-initrd.attach',
],
'qemu-args' : [
'-drive', 'format=raw,cache=unsafe,file=@0@'.format(project_build_root / 'mkosi.output/keydev.raw'),
'-drive', 'id=keydev,if=none,format=raw,cache=unsafe,file=@0@'.format(project_build_root / 'mkosi.output/keydev.raw'),
'-device', 'scsi-hd,drive=keydev',
],
'mkosi-args' : integration_test_template['mkosi-args'] + [
'--runtime-size=11G',
Expand Down
2 changes: 1 addition & 1 deletion test/TEST-64-UDEV-STORAGE/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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 += [
Expand Down
3 changes: 0 additions & 3 deletions test/TEST-64-UDEV-STORAGE/nvme_basic.configure
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
14 changes: 7 additions & 7 deletions test/TEST-64-UDEV-STORAGE/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion test/units/TEST-64-UDEV-STORAGE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]]
}
Expand Down

0 comments on commit c15747e

Please sign in to comment.