Hi all,
This series adds three new functional tests for the pseries (sPAPR/PAPR)
machine type and registers them in MAINTAINERS.
Patch 1 adds test_hotplug_cpu.py. It boots a buildroot guest with one
core (-smp 2,threads=2,cores=1,maxcpus=4), hot-adds a second core with
QMP device_add and waits until /sys/devices/system/cpu/online changes
from 0-1 to 0-3. It then hot-removes the core with device_del and waits
for the guest to be back at 0-1. It runs with TCG and, if available,
with KVM.
Patch 2 adds test_pseries_caps.py, a quick test that does not boot a
guest. QEMU is started halted (-S) and QMP is used to check that
pseries starts with the security capability options (cap-cfpc,
cap-sbbc, cap-ibs, cap-ccf-assist, cap-nested-hv), that pseries-7.2,
9.2 and 10.0 can be instantiated, and that cap-hpt-max-page-size is
visible under /machine in the QOM tree.
Patch 3 adds test_hotplug_blk.py. It boots a similar guest with a
second PCI host bridge (phb1), hot-adds a virtio-blk-pci disk backed by
a null-co node with QMP device_add and waits for /dev/vda to appear in
the guest. It then hot-removes the disk with device_del and waits for
the DEVICE_DELETED event and for /dev/vda to disappear. The guest
needs rtas_errd and drmgr to enumerate the new device, so the test uses
a rootfs that includes them. I raised the patch that adds this image
(rootfs-hotplug.ext2) to qemu-ppc-boot, see
https://github.com/raphael502/qemu-ppc-boot/pull/1. It has been merged,
so the test downloads the image from that repository. The test runs
with TCG, and also with KVM if KVM is enabled.
Patch 4 adds the MAINTAINERS entries for the three tests.
Testing
-------
v1 of the CPU hotplug, caps and virtio-blk tests were run on a ppc64le
POWER host with both TCG and KVM and passed. The changes below do not
touch the test logic. checkpatch.pl reports no errors or warnings on
any patch (apart from the expected "MAINTAINERS needs updating" notices
on patches 1-3, resolved by patch 4), and pylint with
tests/functional/pylintrc reports nothing for the new files.
CI
--
GitLab pipeline: https://gitlab.com/Anushree-Mathur1/qemu/-/pipelines/3084104292
The jobs that fail are all allow_failure: Rust nightly (bitops.rs),
tuxrun/armbian asset downloads, and aarch64 timeout/migration tests.
None of them involve this series, which only adds ppc64 tests and
MAINTAINERS entries.
Links to v1:
- v1 for CPU hotplug and caps tests:
https://lore.kernel.org/qemu-devel/20261030131025.32219-1-anushree.mathur@linux.ibm.com/
- RFC v1 for virtio-blk hotplug test:
https://lore.kernel.org/qemu-devel/20261103141938.41147-1-anushree.mathur@linux.ibm.com/
Changes in v2:
- Combined the two v1 postings above into one series.
- Patch 1: buildroot kernel and rootfs assets now point to
raphael502/qemu-ppc-boot instead of legoater/qemu-ppc-boot. They are
the same files; the sha256 values are unchanged and were re-verified.
Wrapped the long URL lines to keep checkpatch quiet.
- Patch 2: reworded the commit message to say what is actually checked
(the options are accepted and the machine starts), fixed docstrings
that did not match the code, and dropped the skipped
query-cpu-model-expansion placeholder test.
- Patch 3: no longer an RFC. v1 was an RFC because rootfs-hotplug.ext2
was not available yet; it is now merged in qemu-ppc-boot and the
asset URLs point to it (the sha256 is unchanged). The vmlinux asset
also points to qemu-ppc-boot, and the test file is now executable
like the other functional tests.
- Patch 4: a single MAINTAINERS patch covering all three tests
(previously a separate patch for the CPU and caps tests, and an
entry inside the virtio-blk patch).
- Rebased on current master (6883fb508c).
Anushree Mathur (4):
tests/functional/ppc64: add pseries CPU hotplug test
tests/functional/ppc64: add pseries security caps test
tests/functional/ppc64: add pseries virtio-blk hotplug test
MAINTAINERS: add pseries hotplug and caps functional tests
MAINTAINERS | 3 +
tests/functional/ppc64/meson.build | 5 +
tests/functional/ppc64/test_hotplug_blk.py | 188 ++++++++++++++++++++
tests/functional/ppc64/test_hotplug_cpu.py | 185 +++++++++++++++++++
tests/functional/ppc64/test_pseries_caps.py | 162 +++++++++++++++++
5 files changed, 543 insertions(+)
create mode 100755 tests/functional/ppc64/test_hotplug_blk.py
create mode 100755 tests/functional/ppc64/test_hotplug_cpu.py
create mode 100755 tests/functional/ppc64/test_pseries_caps.py
base-commit: 6883fb508cb7a93e2e7b44c0582bfd9fc2196d4d
--
2.55.0