Machine types, s390x, functional tests and Avocado removal
Subsystems (2)
Hi!
The following changes since commit 1da8f3a3c53b604edfe0d55e475102640490549e:
Open 10.1 development tree (2025-04-22 15:09:23 -0400)
are available in the Git repository at:
https://gitlab.com/thuth/qemu.git tags/pull-request-2025-04-23
for you to fetch changes up to 12c6b6153063aafcdbadca8fee7eac793ef85e4b:
MAINTAINERS: Add functional tests that are not covered yet (2025-04-23 07:51:25 +0200)
----------------------------------------------------------------
* Remove the obsolete s390-ccw-virtio-2.9 machine type
* Prepare the dump-skeys QMP command for the universal binary project
* Add compat machine types for 10.1
* Convert the remaining Avocado tests to the functional framework
* Some more small fixes for the functional tests
----------------------------------------------------------------
Cornelia Huck (2):
hw: add compat machines for 10.1 tests/functional/test_vnc: skip test if no crypto backend available
Philippe Mathieu-Daudé (4):
hw/s390x/skeys: Declare QOM types using DEFINE_TYPES() macro
hw/s390x/skeys: Introduce TYPE_DUMP_SKEYS_INTERFACE
hw/s390x/ccw: Have CCW machine implement a qmp_dump_skeys() callback
qapi/machine: Make @dump-skeys command genericThomas Huth (23):
hw/s390x/s390-virtio-ccw: Remove the deprecated 2.9 machine type hw/s390x/css: Remove the obsolete "css_migration_enabled" variable hw/s390x/s390-stattrib: Remove the old migration_enabled flag hw/intc/s390_flic: Remove the obsolete migration_enabled flag
gitlab-ci: Remove the avocado tests from the CI pipelines tests/functional: Move the check for the parameters from avocado to functional tests/functional: Convert reverse_debugging tests to the functional framework tests/functional: Convert the i386 replay avocado test tests/avocado: Remove the LinuxKernelTest class tests/functional: Convert the 32-bit big endian Wheezy mips test tests/functional: Convert the 32-bit little endian Wheezy mips test tests/functional: Convert the 64-bit little endian Wheezy mips test tests/functional: Convert the 64-bit big endian Wheezy mips test tests/avocado: Remove the boot_linux.py tests
tests/functional: Use the tuxrun kernel for the x86 replay test tests/functional: Use the tuxrun kernel for the aarch64 replay test tests/functional: Convert the SMMU test to the functional framework
gitlab-ci: Update QEMU_JOB_AVOCADO and QEMU_CI_AVOCADO_TESTING docs/devel/testing: Dissolve the ci-definitions.rst.inc file Remove the remainders of the Avocado tests
tests/functional: Remove semicolons at the end of lines tests/functional: Remove unnecessary import statements
MAINTAINERS: Add functional tests that are not covered yet
MAINTAINERS | 28 +-
docs/about/build-platforms.rst | 10 +-
docs/devel/build-system.rst | 11 +-
docs/devel/codebase.rst | 5 -
docs/devel/testing/avocado.rst | 581 ---------------------
docs/devel/testing/ci-definitions.rst.inc | 121 -----
docs/devel/testing/ci-jobs.rst.inc | 19 +-
docs/devel/testing/ci.rst | 28 +-
docs/devel/testing/functional.rst | 3 -
docs/devel/testing/index.rst | 1 -
docs/devel/testing/main.rst | 80 ++-
tests/avocado/README.rst | 10 -
configure | 2 +-
qapi/machine.json | 18 +
qapi/misc-target.json | 19 -
include/hw/boards.h | 3 +
include/hw/i386/pc.h | 3 +
include/hw/s390x/css.h | 6 -
include/hw/s390x/s390_flic.h | 1 -
include/hw/s390x/storage-attributes.h | 1 -
include/hw/s390x/storage-keys.h | 16 +
hw/arm/virt.c | 9 +-
hw/core/machine-qmp-cmds.c | 14 +
hw/core/machine.c | 3 +
hw/i386/pc.c | 3 +
hw/i386/pc_piix.c | 13 +-
hw/i386/pc_q35.c | 13 +-
hw/intc/s390_flic.c | 14 -
hw/m68k/virt.c | 9 +-
hw/ppc/spapr.c | 15 +-
hw/s390x/css.c | 31 +-
hw/s390x/s390-skeys.c | 47 +-
hw/s390x/s390-stattrib-kvm.c | 2 +-
hw/s390x/s390-stattrib.c | 7 +-
hw/s390x/s390-virtio-ccw.c | 41 +-
.gitlab-ci.d/base.yml | 8 +-
.gitlab-ci.d/buildtest-template.yml | 13 +-
.gitlab-ci.d/buildtest.yml | 33 +-
pythondeps.toml | 8 +-
tests/Makefile.include | 60 +--
tests/avocado/avocado_qemu/__init__.py | 424 ---------------
tests/avocado/avocado_qemu/linuxtest.py | 253 ---------
tests/avocado/boot_linux.py | 132 -----
tests/avocado/boot_linux_console.py | 96 ----
tests/avocado/linux_ssh_mips_malta.py | 205 --------
tests/avocado/replay_kernel.py | 110 ----
tests/avocado/replay_linux.py | 206 --------
tests/avocado/smmu.py | 139 -----
tests/functional/aspeed.py | 2 +-
tests/functional/meson.build | 13 +-
tests/functional/qemu_test/ports.py | 3 +-
tests/functional/qemu_test/tuxruntest.py | 11 +-
tests/functional/qemu_test/uncompress.py | 2 +-
tests/{avocado => functional}/reverse_debugging.py | 114 +---
tests/functional/test_aarch64_aspeed.py | 2 +-
tests/functional/test_aarch64_replay.py | 37 +-
tests/functional/test_aarch64_reverse_debug.py | 38 ++
tests/functional/test_aarch64_rme_sbsaref.py | 6 +-
tests/functional/test_aarch64_rme_virt.py | 2 -
tests/functional/test_aarch64_sbsaref_alpine.py | 3 -
tests/functional/test_aarch64_sbsaref_freebsd.py | 2 -
tests/functional/test_aarch64_smmu.py | 205 ++++++++
tests/functional/test_aarch64_tcg_plugins.py | 1 -
tests/functional/test_aarch64_virt.py | 8 +-
tests/functional/test_arm_aspeed_ast2500.py | 9 +-
tests/functional/test_arm_aspeed_ast2600.py | 36 +-
tests/functional/test_arm_aspeed_bletchley.py | 4 +-
tests/functional/test_arm_aspeed_palmetto.py | 4 +-
tests/functional/test_arm_aspeed_romulus.py | 4 +-
tests/functional/test_arm_aspeed_witherspoon.py | 4 +-
tests/functional/test_arm_bpim2u.py | 2 +-
tests/functional/test_arm_cubieboard.py | 4 +-
tests/functional/test_arm_orangepi.py | 2 +-
tests/functional/test_arm_quanta_gsj.py | 2 -
tests/functional/test_arm_smdkc210.py | 2 -
tests/functional/test_i386_replay.py | 28 +
tests/functional/test_migration.py | 3 +-
tests/functional/test_mips64_malta.py | 35 ++
tests/functional/test_mips64el_malta.py | 22 +
tests/functional/test_mips64el_replay.py | 6 +-
tests/functional/test_mips_malta.py | 108 +++-
tests/functional/test_mips_replay.py | 2 +-
tests/functional/test_mipsel_malta.py | 22 +
tests/functional/test_mipsel_replay.py | 2 +-
tests/functional/test_ppc64_hv.py | 8 +-
tests/functional/test_ppc64_reverse_debug.py | 41 ++
tests/functional/test_s390x_topology.py | 12 +-
tests/functional/test_vnc.py | 6 +-
tests/functional/test_x86_64_kvm_xen.py | 2 -
tests/functional/test_x86_64_replay.py | 43 +-
tests/functional/test_x86_64_reverse_debug.py | 36 ++
91 files changed, 978 insertions(+), 2794 deletions(-)
delete mode 100644 docs/devel/testing/avocado.rst
delete mode 100644 docs/devel/testing/ci-definitions.rst.inc
delete mode 100644 tests/avocado/README.rst
delete mode 100644 tests/avocado/avocado_qemu/__init__.py
delete mode 100644 tests/avocado/avocado_qemu/linuxtest.py
delete mode 100644 tests/avocado/boot_linux.py
delete mode 100644 tests/avocado/boot_linux_console.py
delete mode 100644 tests/avocado/linux_ssh_mips_malta.py
delete mode 100644 tests/avocado/replay_kernel.py
delete mode 100644 tests/avocado/replay_linux.py
delete mode 100644 tests/avocado/smmu.py
rename tests/{avocado => functional}/reverse_debugging.py (66%)
create mode 100755 tests/functional/test_aarch64_reverse_debug.py
create mode 100755 tests/functional/test_aarch64_smmu.py
create mode 100755 tests/functional/test_i386_replay.py
create mode 100755 tests/functional/test_mips64_malta.py
create mode 100755 tests/functional/test_ppc64_reverse_debug.py
create mode 100755 tests/functional/test_x86_64_reverse_debug.py[PULL 09/29] hw: add compat machines for 10.1
From: Cornelia Huck <[email protected]>
Add 10.1 machine types for arm/i440fx/m68k/q35/s390x/spapr.
Message-ID: <[email protected]>
--- include/hw/boards.h | 3 +++ include/hw/i386/pc.h | 3 +++ hw/arm/virt.c | 9 ++++++++- hw/core/machine.c | 3 +++ hw/i386/pc.c | 3 +++ hw/i386/pc_piix.c | 13 +++++++++++-- hw/i386/pc_q35.c | 13 +++++++++++-- hw/m68k/virt.c | 9 ++++++++- hw/ppc/spapr.c | 15 +++++++++++++-- hw/s390x/s390-virtio-ccw.c | 14 +++++++++++++- 10 files changed, 76 insertions(+), 9 deletions(-)
include/hw/boards.h +3 -0
@@ -761,6 +761,9 @@ struct MachineState { } \ type_init(machine_initfn##_register_types) +extern GlobalProperty hw_compat_10_0[]; +extern const size_t hw_compat_10_0_len; +extern GlobalProperty hw_compat_9_2[];extern const size_t hw_compat_9_2_len;
include/hw/i386/pc.h +3 -0
@@ -215,6 +215,9 @@ void pc_system_parse_ovmf_flash(uint8_t *flash_ptr, size_t flash_size);/* sgx.c */ void pc_machine_init_sgx_epc (PCMachineState *pcms); +extern GlobalProperty pc_compat_10_0[]; +extern const size_t pc_compat_10_0_len; +extern GlobalProperty pc_compat_9_2[];extern const size_t pc_compat_9_2_len;
hw/arm/virt.c +8 -1
@@ -3408,10 +3408,17 @@ static void machvirt_machine_init(void) }type_init (machvirt_machine_init); +static void virt_machine_10_1_options (MachineClass *mc) +{ +} +DEFINE_VIRT_MACHINE_AS_LATEST(10, 1) +static void virt_machine_10_0_options (MachineClass *mc) { +virt_machine_10_1_options (mc); +compat_props_add (mc->compat_props, hw_compat_10_0, hw_compat_10_0_len); } -DEFINE_VIRT_MACHINE_AS_LATEST(10, 0) +DEFINE_VIRT_MACHINE(10, 0)static void virt_machine_9_2_options (MachineClass *mc) {
hw/core/machine.c +3 -0
@@ -37,6 +37,9 @@#include "hw/virtio/virtio-iommu.h" #include "audio/audio.h" +GlobalProperty hw_compat_10_0[] = {}; +const size_t hw_compat_10_0_len =G_N_ELEMENTS (hw_compat_10_0); +GlobalProperty hw_compat_9_2[] = { {"arm-cpu" ,"backcompat-pauth-default-use-qarma5" ,"true" }, {"virtio-balloon-pci" ,"vectors" ,"0" },
hw/i386/pc.c +3 -0
@@ -79,6 +79,9 @@ { "qemu64-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },\ { "athlon-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }, +GlobalProperty pc_compat_10_0[] = {}; +const size_t pc_compat_10_0_len =G_N_ELEMENTS (pc_compat_10_0); +GlobalProperty pc_compat_9_2[] = {};const size_t pc_compat_9_2_len =G_N_ELEMENTS (pc_compat_9_2);
hw/i386/pc_piix.c +11 -2
@@ -479,12 +479,21 @@ static void pc_i440fx_machine_options(MachineClass *m) "Use a different south bridge than PIIX3"); } -static void pc_i440fx_machine_10_0_options (MachineClass *m) +static void pc_i440fx_machine_10_1_options (MachineClass *m) {pc_i440fx_machine_options (m); } -DEFINE_I440FX_MACHINE_AS_LATEST (10 ,0 ); +DEFINE_I440FX_MACHINE_AS_LATEST (10 ,1 ); + +static void pc_i440fx_machine_10_0_options (MachineClass *m) +{ +pc_i440fx_machine_10_1_options (m); +compat_props_add (m->compat_props, hw_compat_10_0, hw_compat_10_0_len); +compat_props_add (m->compat_props, pc_compat_10_0, pc_compat_10_0_len); +} + +DEFINE_I440FX_MACHINE (10 ,0 );static void pc_i440fx_machine_9_2_options (MachineClass *m) {
hw/i386/pc_q35.c +11 -2
@@ -361,12 +361,21 @@ static void pc_q35_machine_options(MachineClass *m) pc_q35_compat_defaults, pc_q35_compat_defaults_len); } -static void pc_q35_machine_10_0_options (MachineClass *m) +static void pc_q35_machine_10_1_options (MachineClass *m) {pc_q35_machine_options (m); } -DEFINE_Q35_MACHINE_AS_LATEST (10 ,0 ); +DEFINE_Q35_MACHINE_AS_LATEST (10 ,1 ); + +static void pc_q35_machine_10_0_options (MachineClass *m) +{ +pc_q35_machine_10_1_options (m); +compat_props_add (m->compat_props, hw_compat_10_0, hw_compat_10_0_len); +compat_props_add (m->compat_props, pc_compat_10_0, pc_compat_10_0_len); +} + +DEFINE_Q35_MACHINE (10 ,0 );static void pc_q35_machine_9_2_options (MachineClass *m) {
hw/m68k/virt.c +8 -1
@@ -366,10 +366,17 @@ type_init(virt_machine_register_types)#define DEFINE_VIRT_MACHINE (major, minor) \ DEFINE_VIRT_MACHINE_IMPL(false, major, minor) +static void virt_machine_10_1_options (MachineClass *mc) +{ +} +DEFINE_VIRT_MACHINE_AS_LATEST(10, 1) +static void virt_machine_10_0_options (MachineClass *mc) { +virt_machine_10_1_options (mc); +compat_props_add (mc->compat_props, hw_compat_10_0, hw_compat_10_0_len); } -DEFINE_VIRT_MACHINE_AS_LATEST(10, 0) +DEFINE_VIRT_MACHINE(10, 0)static void virt_machine_9_2_options (MachineClass *mc) {
hw/ppc/spapr.c +13 -2
@@ -4766,15 +4766,26 @@ static void spapr_machine_latest_class_options(MachineClass *mc)#define DEFINE_SPAPR_MACHINE (major, minor) \ DEFINE_SPAPR_MACHINE_IMPL(false, major, minor) +/* +* pseries-10.1 +*/ +static void spapr_machine_10_1_class_options (MachineClass *mc) +{ +/* Defaults for the latest behaviour inherited from the base class */ +} + +DEFINE_SPAPR_MACHINE_AS_LATEST (10 ,1 ); +/* * pseries-10.0 */ static void spapr_machine_10_0_class_options (MachineClass *mc) { -/* Defaults for the latest behaviour inherited from the base class */ +spapr_machine_10_1_class_options (mc); +compat_props_add (mc->compat_props, hw_compat_10_0, hw_compat_10_0_len); } -DEFINE_SPAPR_MACHINE_AS_LATEST (10 ,0 ); +DEFINE_SPAPR_MACHINE (10 ,0 );/* * pseries-9.2
hw/s390x/s390-virtio-ccw.c +13 -1
@@ -924,14 +924,26 @@ static const TypeInfo ccw_machine_info = { DEFINE_CCW_MACHINE_IMPL(false, major, minor) +static void ccw_machine_10_1_instance_options (MachineState *machine) +{ +} + +static void ccw_machine_10_1_class_options (MachineClass *mc) +{ +} +DEFINE_CCW_MACHINE_AS_LATEST (10 ,1 ); +static void ccw_machine_10_0_instance_options (MachineState *machine) { +ccw_machine_10_1_instance_options (machine); }static void ccw_machine_10_0_class_options (MachineClass *mc) { +ccw_machine_10_1_class_options (mc); +compat_props_add (mc->compat_props, hw_compat_10_0, hw_compat_10_0_len); } -DEFINE_CCW_MACHINE_AS_LATEST (10 ,0 ); +DEFINE_CCW_MACHINE (10 ,0 );static void ccw_machine_9_2_instance_options (MachineState *machine) {
Signature · 1 line
2.49.0
[PULL 03/29] hw/s390x/s390-stattrib: Remove the old migration_enabled flag
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
Now that the machine types that set the migration_enabled flag to false are gone, we can remove it and the related code.
Message-ID: <[email protected]>
--- include/hw/s390x/storage-attributes.h | 1 - hw/s390x/s390-stattrib-kvm.c | 2 +- hw/s390x/s390-stattrib.c | 7 +------ 3 files changed, 2 insertions(+), 8 deletions(-)
include/hw/s390x/storage-attributes.h +0 -1
@@ -25,7 +25,6 @@ OBJECT_DECLARE_TYPE(S390StAttribState, S390StAttribClass, S390_STATTRIB)struct S390StAttribState {DeviceState parent_obj;uint64_t migration_cur_gfn; -bool migration_enabled; };
hw/s390x/s390-stattrib-kvm.c +1 -1
@@ -185,7 +185,7 @@ static long long kvm_s390_stattrib_get_dirtycount(S390StAttribState *sa)static int kvm_s390_stattrib_get_active (S390StAttribState *sa) { -return kvm_s390_cmma_active () && sa->migration_enabled; +return kvm_s390_cmma_active (); }static void kvm_s390_stattrib_class_init (ObjectClass *oc,void *data)
hw/s390x/s390-stattrib.c +1 -6
@@ -304,7 +304,7 @@ static int qemu_s390_set_migrationmode_stub(S390StAttribState *sa, bool value,static int qemu_s390_get_active (S390StAttribState *sa) { -return sa->migration_enabled; +return true; }static void qemu_s390_stattrib_class_init (ObjectClass *oc,void *data)
@@ -360,10 +360,6 @@ static void s390_stattrib_realize(DeviceState *dev, Error **errp) &savevm_s390_stattrib_handlers, dev); } -static const Property s390_stattrib_props[] = { -DEFINE_PROP_BOOL ("migration-enabled" , S390StAttribState, migration_enabled, true), -}; -static void s390_stattrib_class_init (ObjectClass *oc,void *data) {DeviceClass *dc =DEVICE_CLASS (oc);
@@ -371,7 +367,6 @@ static void s390_stattrib_class_init(ObjectClass *oc, void *data) dc->hotpluggable = false;set_bit (DEVICE_CATEGORY_MISC , dc->categories); dc->realize = s390_stattrib_realize; -device_class_set_props (dc, s390_stattrib_props); }static void s390_stattrib_instance_init (Object *obj)
Signature · 1 line
2.49.0
[PULL 19/29] tests/functional: Convert the 64-bit big endian Wheezy mips test
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
Reuse the test function from the 32-bit big endian test to easily convert the 64-bit big endian Wheezy mips test.
Since this was the last test in tests/avocado/linux_ssh_mips_malta.py, we can remove this avocado file now, too.
Message-ID: <[email protected]>
--- MAINTAINERS | 1 - tests/avocado/linux_ssh_mips_malta.py | 181 -------------------------- tests/functional/meson.build | 2 + tests/functional/test_mips64_malta.py | 35 +++++ 4 files changed, 37 insertions(+), 182 deletions(-) delete mode 100644 tests/avocado/linux_ssh_mips_malta.py create mode 100755 tests/functional/test_mips64_malta.py
MAINTAINERS +0 -1
@@ -1355,7 +1355,6 @@ F: hw/acpi/piix4.c F: hw/mips/malta.c F: hw/pci-host/gt64120.c F: include/hw/southbridge/piix.h -F: tests/avocado/linux_ssh_mips_malta.py F: tests/functional/test_mips*_malta.py F: tests/functional/test_mips*_tuxrun.py
tests/avocado/linux_ssh_mips_malta.py deleted +0 -181
181 lines not on this page · raw message
tests/functional/meson.build +2 -0
@@ -42,6 +42,7 @@ test_timeouts = { 'mips_malta' : 480, 'mipsel_malta' : 420, 'mipsel_replay' : 480, + 'mips64_malta' : 240, 'mips64el_malta' : 420, 'mips64el_replay' : 180, 'netdev_ethtool' : 180,
@@ -191,6 +192,7 @@ tests_mipsel_system_thorough = [ ] tests_mips64_system_thorough = [ + 'mips64_malta', 'mips64_tuxrun', ]
tests/functional/test_mips64_malta.py new file +35 -0
@@ -0,0 +1,35 @@ +#!/usr/bin/env python3 +# +# Functional tests for the big-endian 64-bit MIPS Malta board +# +# SPDX-License-Identifier: GPL-2.0-or-later + +from qemu_test import LinuxKernelTest, Asset +from test_mips_malta import mips_check_wheezy + + +class MaltaMachineConsole(LinuxKernelTest): + + ASSET_WHEEZY_KERNEL = Asset( + ('https://people.debian.org/~aurel32/qemu/mips/' + 'vmlinux-3.2.0-4-5kc-malta'), + '3e4ec154db080b3f1839f04dde83120654a33e5e1716863de576c47cb94f68f6') + + ASSET_WHEEZY_DISK = Asset( + ('https://people.debian.org/~aurel32/qemu/mips/' + 'debian_wheezy_mips_standard.qcow2'), + 'de03599285b8382ad309309a6c4869f6c6c42a5cfc983342bab9ec0dfa7849a2') + + def test_wheezy(self): + kernel_path = self.ASSET_WHEEZY_KERNEL.fetch() + image_path = self.ASSET_WHEEZY_DISK.fetch() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + + 'console=ttyS0 root=/dev/sda1') + mips_check_wheezy(self, + kernel_path, image_path, kernel_command_line, cpuinfo='MIPS 20Kc', + dl_file='/boot/initrd.img-3.2.0-4-5kc-malta', + hsum='d98b953bb4a41c0fc0fd8d19bbc691c08989ac52568c1d3054d92dfd890d3f06') + + +if __name__ == '__main__': + LinuxKernelTest.main()
Signature · 1 line
2.49.0
[PULL 16/29] tests/functional: Convert the 32-bit big endian Wheezy mips test
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
The test checks some entries in /proc and the output of some commands ... we put these checks into exportable functions now so that they can be reused more easily.
Additionally the linux_ssh_mips_malta.py uses SSH to test the networking of the guest. Since we don't have a SSH module in the functional framework yet, let's use the check_http_download() function here instead.
And while we're at it, also switch the NIC to e1000 now to get some more test coverage, since the "pcnet" device is already tested in the test test_mips_malta_cpio.
Message-ID: <[email protected]>
--- tests/avocado/linux_ssh_mips_malta.py | 8 -- tests/functional/meson.build | 2 +- tests/functional/test_mips_malta.py | 108 +++++++++++++++++++++++++- 3 files changed, 107 insertions(+), 11 deletions(-)
tests/avocado/linux_ssh_mips_malta.py +0 -8
@@ -172,14 +172,6 @@ def check_mips_malta(self, uname_m, endianess): # Wait for VM to shut down gracefully self.vm.wait() - def test_mips_malta32eb_kernel3_2_0(self): - """ - :avocado: tags=arch:mips - :avocado: tags=endian:big - :avocado: tags=device:pcnet32 - """ - self.check_mips_malta('mips', 'be') - def test_mips_malta32el_kernel3_2_0(self): """ :avocado: tags=arch:mipsel
tests/functional/meson.build +1 -1
@@ -39,7 +39,7 @@ test_timeouts = { 'arm_tuxrun' : 240, 'arm_sx1' : 360, 'intel_iommu': 300, - 'mips_malta' : 120, + 'mips_malta' : 480, 'mipsel_replay' : 480, 'mips64el_replay' : 180, 'netdev_ethtool' : 180,
tests/functional/test_mips_malta.py +106 -2
129 lines not on this page · raw message
Signature · 1 line
2.49.0
[PULL 10/29] tests/functional/test_vnc: skip test if no crypto backend available
In reply to Thomas HuthFrom: Cornelia Huck <[email protected]>
The test_change_password test will fail if no cryptographic backend is available (e.g. if QEMU was built on a system with no cryptographic library development packages installed); just skip the test in that case.
Message-ID: <[email protected]>
--- tests/functional/test_vnc.py | 2 ++ 1 file changed, 2 insertions(+)
tests/functional/test_vnc.py +2 -0
@@ -55,6 +55,8 @@ def launch_guarded(self): except VMLaunchFailure as excp: if "-vnc: invalid option" in excp.output: self.skipTest("VNC support not available") + elif "Cipher backend does not support DES algorithm" in excp.output: + self.skipTest("No cryptographic backend available") else: self.log.info("unhandled launch failure: %s", excp.output) raise excp
Signature · 1 line
2.49.0
[PULL 06/29] hw/s390x/skeys: Introduce TYPE_DUMP_SKEYS_INTERFACE
In reply to Thomas HuthFrom: Philippe Mathieu-Daudé <[email protected]>
The storage keys are part of the machine memory.
Introduce the TYPE_DUMP_SKEYS_INTERFACE type, allowing machine using storage keys to dump them when a DumpSKeysInterface::qmp_dump_skeys() callback is provided.
Message-ID: <[email protected]>
--- include/hw/s390x/storage-keys.h | 15 +++++++++++++++ hw/s390x/s390-skeys.c | 5 +++++ 2 files changed, 20 insertions(+)
include/hw/s390x/storage-keys.h +15 -0
@@ -125,4 +125,19 @@ S390SKeysState *s390_get_skeys_device(void);void hmp_dump_skeys (Monitor *mon,const QDict *qdict);void hmp_info_skeys (Monitor *mon,const QDict *qdict); +#define TYPE_DUMP_SKEYS_INTERFACE "dump-skeys-interface" + +typedef struct DumpSKeysInterface DumpSKeysInterface ; +DECLARE_CLASS_CHECKERS (DumpSKeysInterface,DUMP_SKEYS_INTERFACE , + TYPE_DUMP_SKEYS_INTERFACE) + +struct DumpSKeysInterface { +InterfaceClass parent_class; + +/** +* @qmp_dump_skeys: Callback to dump guest's storage keys to @filename. +*/ +void (*qmp_dump_skeys)(const char *filename,Error **errp); +}; +#endif /* S390_STORAGE_KEYS_H */
hw/s390x/s390-skeys.c +5 -0
@@ -474,6 +474,11 @@ static void s390_skeys_class_init(ObjectClass *oc, void *data) }static const TypeInfo s390_skeys_types[] = { + { + .name =TYPE_DUMP_SKEYS_INTERFACE , + .parent =TYPE_INTERFACE , + .class_size =sizeof (DumpSKeysInterface), + }, { .name =TYPE_S390_SKEYS , .parent =TYPE_DEVICE ,
Signature · 1 line
2.49.0
[PULL 01/29] hw/s390x/s390-virtio-ccw: Remove the deprecated 2.9 machine type
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
The s390-ccw-virtio-2.9 machine is older than 6 years, so according to our machine support policy, it can be removed now.
Message-ID: <[email protected]>
--- hw/s390x/s390-virtio-ccw.c | 24 ------------------------ 1 file changed, 24 deletions(-)
hw/s390x/s390-virtio-ccw.c +0 -24
@@ -1270,30 +1270,6 @@ static void ccw_machine_2_10_class_options(MachineClass *mc) }DEFINE_CCW_MACHINE (2 ,10 ); -static void ccw_machine_2_9_instance_options (MachineState *machine) -{ -ccw_machine_2_10_instance_options (machine); -s390_cpudef_featoff_greater (12 ,1 ,S390_FEAT_ESOP ); -s390_cpudef_featoff_greater (12 ,1 ,S390_FEAT_SIDE_EFFECT_ACCESS_ESOP2 ); -s390_cpudef_featoff_greater (12 ,1 ,S390_FEAT_ZPCI ); -s390_cpudef_featoff_greater (12 ,1 ,S390_FEAT_ADAPTER_INT_SUPPRESSION ); -s390_cpudef_featoff_greater (12 ,1 ,S390_FEAT_ADAPTER_EVENT_NOTIFICATION ); - css_migration_enabled = false; -} - -static void ccw_machine_2_9_class_options (MachineClass *mc) -{ -static GlobalProperty compat[] = { - {TYPE_S390_STATTRIB ,"migration-enabled" ,"off" , }, - {TYPE_S390_FLIC_COMMON ,"migration-enabled" ,"off" , }, - }; - -ccw_machine_2_10_class_options (mc); -compat_props_add (mc->compat_props, hw_compat_2_9, hw_compat_2_9_len); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); -} -DEFINE_CCW_MACHINE (2 ,9 ); -#endif static void ccw_machine_register_types (void )
Signature · 1 line
2.49.0
[PULL 07/29] hw/s390x/ccw: Have CCW machine implement a qmp_dump_skeys() callback
In reply to Thomas HuthFrom: Philippe Mathieu-Daudé <[email protected]>
In preparation to make @dump-skeys command generic, extract s390_qmp_dump_skeys() out of qmp_dump_skeys(). Register it as CCW qmp_dump_skeys() callback.
Message-ID: <[email protected]>
--- include/hw/s390x/storage-keys.h | 1 + hw/s390x/s390-skeys.c | 7 ++++++- hw/s390x/s390-virtio-ccw.c | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-)
include/hw/s390x/storage-keys.h +1 -0
@@ -122,6 +122,7 @@ int s390_skeys_set(S390SKeysState *ks, uint64_t start_gfn,S390SKeysState *s390_get_skeys_device (void ); +void s390_qmp_dump_skeys (const char *filename,Error **errp);void hmp_dump_skeys (Monitor *mon,const QDict *qdict);void hmp_info_skeys (Monitor *mon,const QDict *qdict);
hw/s390x/s390-skeys.c +6 -1
@@ -142,7 +142,7 @@ void hmp_dump_skeys(Monitor *mon, const QDict *qdict) } } -void qmp_dump_skeys (const char *filename,Error **errp) +void s390_qmp_dump_skeys (const char *filename,Error **errp) {S390SKeysState *ss =s390_get_skeys_device ();S390SKeysClass *skeyclass =S390_SKEYS_GET_CLASS (ss);
@@ -219,6 +219,11 @@ out:fclose (f); } +void qmp_dump_skeys (const char *filename,Error **errp) +{ +s390_qmp_dump_skeys (filename, errp); +} +static bool qemu_s390_skeys_are_enabled (S390SKeysState *ss) {QEMUS390SKeysState *skeys =QEMU_S390_SKEYS (ss);
hw/s390x/s390-virtio-ccw.c +3 -0
@@ -810,6 +810,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)NMIClass *nc =NMI_CLASS (oc);HotplugHandlerClass *hc =HOTPLUG_HANDLER_CLASS (oc);S390CcwMachineClass *s390mc =S390_CCW_MACHINE_CLASS (mc); +DumpSKeysInterface *dsi =DUMP_SKEYS_INTERFACE_CLASS (oc); s390mc->hpage_1m_allowed = true; s390mc->max_threads =1 ;
@@ -835,6 +836,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data) nc->nmi_monitor_handler = s390_nmi; mc->default_ram_id ="s390.ram" ; mc->default_nic ="virtio-net-ccw" ; + dsi->qmp_dump_skeys = s390_qmp_dump_skeys; object_class_property_add_bool(oc, "aes-key-wrap", machine_get_aes_key_wrap,
@@ -876,6 +878,7 @@ static const TypeInfo ccw_machine_info = { .interfaces = (InterfaceInfo[]) { {TYPE_NMI }, {TYPE_HOTPLUG_HANDLER }, + {TYPE_DUMP_SKEYS_INTERFACE }, { } }, };
Signature · 1 line
2.49.0
[PULL 02/29] hw/s390x/css: Remove the obsolete "css_migration_enabled" variable
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
Now that the s390-ccw-virtio-2.9 machine type has been removed, we don't need the "css_migration_enabled" variable anymore and can remove the related code.
Message-ID: <[email protected]>
--- include/hw/s390x/css.h | 6 ------ hw/s390x/css.c | 31 +------------------------------ 2 files changed, 1 insertion(+), 36 deletions(-)
include/hw/s390x/css.h +0 -6
@@ -333,10 +333,4 @@ static inline int ccw_dstream_read_buf(CcwDataStream *cds, void *buff, int len)#define ccw_dstream_read (cds, v) ccw_dstream_read_buf((cds), &(v), sizeof(v))#define ccw_dstream_write (cds, v) ccw_dstream_write_buf((cds), &(v), sizeof(v)) -/** -* true if (vmstate based) migration of the channel subsystem -* is enabled, false if it is disabled. -*/ -extern bool css_migration_enabled; -#endif
hw/s390x/css.c +1 -30
@@ -23,8 +23,6 @@#include "hw/s390x/s390-virtio-ccw.h" #include "hw/s390x/s390-ccw.h" -bool css_migration_enabled = true; - typedef struct CrwContainer { CRW crw; QTAILQ_ENTRY(CrwContainer) sibling;
@@ -180,16 +178,10 @@ static const VMStateDescription vmstate_orb = { } }; -static bool vmstate_schdev_orb_needed (void *opaque) -{ -return css_migration_enabled; -} -static const VMStateDescription vmstate_schdev_orb = { .name ="s390_subch_dev/orb" , .version_id =1 , .minimum_version_id =1 , - .needed = vmstate_schdev_orb_needed, .fields = (const VMStateField []) {VMSTATE_STRUCT (orb, SubchDev,1 , vmstate_orb,ORB ),VMSTATE_END_OF_LIST ()
@@ -390,33 +382,12 @@ static int subch_dev_post_load(void *opaque, int version_id)css_subch_assign (s->cssid, s->ssid, s->schid, s->devno, s); } -if (css_migration_enabled) { -/* No compat voodoo to do ;) */ -return 0 ; - } -/* -* Hack alert. If we don't migrate the channel subsystem status -* we still need to find out if the guest enabled mss/mcss-e. -* If the subchannel is enabled, it certainly was able to access it, -* so adjust the max_ssid/max_cssid values for relevant ssid/cssid -* values. This is not watertight, but better than nothing. -*/ -if (s->curr_status.pmcw.flags &PMCW_FLAGS_MASK_ENA ) { -if (s->ssid) { - channel_subsys.max_ssid =MAX_SSID ; - } -if (s->cssid != channel_subsys.default_cssid) { - channel_subsys.max_cssid =MAX_CSSID ; - } - }return 0 ; }void css_register_vmstate (void ) { -if (css_migration_enabled) { -vmstate_register (NULL ,0 , &vmstate_css, &channel_subsys); - } +vmstate_register (NULL ,0 , &vmstate_css, &channel_subsys); }IndAddr *get_indicator (hwaddr ind_addr,int len)
Signature · 1 line
2.49.0
[PULL 14/29] tests/functional: Convert the i386 replay avocado test
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
Since this was the last test in tests/avocado/replay_kernel.py, we can remove that Avocado file now.
Message-ID: <[email protected]>
--- MAINTAINERS | 1 - tests/avocado/replay_kernel.py | 110 --------------------------- tests/functional/meson.build | 1 + tests/functional/test_i386_replay.py | 28 +++++++ 4 files changed, 29 insertions(+), 111 deletions(-) delete mode 100644 tests/avocado/replay_kernel.py create mode 100755 tests/functional/test_i386_replay.py
MAINTAINERS +0 -1
@@ -3669,7 +3669,6 @@ F: include/system/replay.h F: docs/devel/replay.rst F: docs/system/replay.rst F: stubs/replay.c -F: tests/avocado/replay_kernel.py F: tests/avocado/replay_linux.py F: tests/functional/*reverse_debug*.py F: tests/functional/*replay*.py
tests/avocado/replay_kernel.py deleted +0 -110
110 lines not on this page · raw message
tests/functional/meson.build +1 -0
@@ -151,6 +151,7 @@ tests_i386_system_quick = [ ] tests_i386_system_thorough = [ + 'i386_replay', 'i386_tuxrun', ]
tests/functional/test_i386_replay.py new file +28 -0
@@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +# +# Replay test that boots a Linux kernel on a i386 machine +# and checks the console +# +# SPDX-License-Identifier: GPL-2.0-or-later + +from qemu_test import Asset +from replay_kernel import ReplayKernelBase + + +class I386Replay(ReplayKernelBase): + + ASSET_KERNEL = Asset( + 'https://storage.tuxboot.com/20230331/i386/bzImage', + 'a3e5b32a354729e65910f5a1ffcda7c14a6c12a55e8213fb86e277f1b76ed956') + + def test_pc(self): + self.set_machine('pc') + kernel_url = () + kernel_path = self.ASSET_KERNEL.fetch() + kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' + console_pattern = 'VFS: Cannot open root device' + self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5) + + +if __name__ == '__main__': + ReplayKernelBase.main()
Signature · 1 line
2.49.0
[PULL 04/29] hw/intc/s390_flic: Remove the obsolete migration_enabled flag
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
Now that the machine types that set the migration_enabled flag to false are gone, we can remove it and the related code.
Message-ID: <[email protected]>
--- include/hw/s390x/s390_flic.h | 1 - hw/intc/s390_flic.c | 14 -------------- 2 files changed, 15 deletions(-)
include/hw/s390x/s390_flic.h +0 -1
@@ -42,7 +42,6 @@ OBJECT_DECLARE_TYPE(S390FLICState, S390FLICStateClass,struct S390FLICState {SysBusDevice parent_obj;bool ais_supported; -bool migration_enabled; };
hw/intc/s390_flic.c +0 -14
@@ -470,11 +470,6 @@ static void qemu_s390_flic_class_init(ObjectClass *oc, void *data) fsc->inject_crw_mchk = qemu_s390_inject_crw_mchk; } -static const Property s390_flic_common_properties[] = { -DEFINE_PROP_BOOL ("migration-enabled" , S390FLICState, - migration_enabled, true), -}; -static void s390_flic_common_realize (DeviceState *dev,Error **errp) {S390FLICState *fs =S390_FLIC_COMMON (dev);
@@ -486,7 +481,6 @@ static void s390_flic_class_init(ObjectClass *oc, void *data) {DeviceClass *dc =DEVICE_CLASS (oc); -device_class_set_props (dc, s390_flic_common_properties); dc->realize = s390_flic_common_realize; }
@@ -515,18 +509,10 @@ static void qemu_s390_flic_register_types(void)type_init (qemu_s390_flic_register_types) -static bool adapter_info_so_needed(void *opaque) -{ -S390FLICState *fs =s390_get_flic (); - -return fs->migration_enabled; -} - const VMStateDescription vmstate_adapter_info_so = { .name ="s390_adapter_info/summary_offset" , .version_id =1 , .minimum_version_id =1 , - .needed = adapter_info_so_needed, .fields = (const VMStateField []) {VMSTATE_UINT32 (summary_offset, AdapterInfo),VMSTATE_END_OF_LIST ()
Signature · 1 line
2.49.0
[PULL 05/29] hw/s390x/skeys: Declare QOM types using DEFINE_TYPES() macro
In reply to Thomas HuthFrom: Philippe Mathieu-Daudé <[email protected]>
When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. In particular because type array declared with such macro are easier to review.
Message-ID: <[email protected]>
--- hw/s390x/s390-skeys.c | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-)
hw/s390x/s390-skeys.c +17 -22
@@ -316,14 +316,6 @@ static void qemu_s390_skeys_class_init(ObjectClass *oc, void *data) dc->user_creatable = false; } -static const TypeInfo qemu_s390_skeys_info = { - .name =TYPE_QEMU_S390_SKEYS , - .parent =TYPE_S390_SKEYS , - .instance_size =sizeof (QEMUS390SKeysState), - .class_init = qemu_s390_skeys_class_init, - .class_size =sizeof (S390SKeysClass), -}; -static void s390_storage_keys_save (QEMUFile *f,void *opaque) {S390SKeysState *ss =S390_SKEYS (opaque);
@@ -481,19 +473,22 @@ static void s390_skeys_class_init(ObjectClass *oc, void *data)set_bit (DEVICE_CATEGORY_MISC , dc->categories); } -static const TypeInfo s390_skeys_info = { - .name =TYPE_S390_SKEYS , - .parent =TYPE_DEVICE , - .instance_size =sizeof (S390SKeysState), - .class_init = s390_skeys_class_init, - .class_size =sizeof (S390SKeysClass), - .abstract = true, +static const TypeInfo s390_skeys_types[] = { + { + .name =TYPE_S390_SKEYS , + .parent =TYPE_DEVICE , + .instance_size =sizeof (S390SKeysState), + .class_init = s390_skeys_class_init, + .class_size =sizeof (S390SKeysClass), + .abstract = true, + }, + { + .name =TYPE_QEMU_S390_SKEYS , + .parent =TYPE_S390_SKEYS , + .instance_size =sizeof (QEMUS390SKeysState), + .class_init = qemu_s390_skeys_class_init, + .class_size =sizeof (S390SKeysClass), + }, }; -static void qemu_s390_skeys_register_types (void ) -{ -type_register_static (&s390_skeys_info); -type_register_static (&qemu_s390_skeys_info); -} - -type_init (qemu_s390_skeys_register_types) +DEFINE_TYPES (s390_skeys_types)
Signature · 1 line
2.49.0
[PULL 21/29] tests/functional: Use the tuxrun kernel for the x86 replay test
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
This way we can do a full boot in record-replay mode and should get a similar test coverage compared to the old replay test from tests/avocado/replay_linux.py. Thus remove the x86 avocado replay_linux test now.
Message-ID: <[email protected]>
--- tests/avocado/replay_linux.py | 46 -------------------------- tests/functional/test_x86_64_replay.py | 43 ++++++++++++++++++------ 2 files changed, 33 insertions(+), 56 deletions(-)
tests/avocado/replay_linux.py +0 -46
@@ -118,52 +118,6 @@ def run_replay_dump(self, replay_path): except subprocess.CalledProcessError: self.fail('replay-dump.py failed') -@skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') -class ReplayLinuxX8664(ReplayLinux): - """ - :avocado: tags=arch:x86_64 - :avocado: tags=accel:tcg - """ - - chksum = 'e3c1b309d9203604922d6e255c2c5d098a309c2d46215d8fc026954f3c5c27a0' - - def test_pc_i440fx(self): - """ - :avocado: tags=machine:pc - """ - self.run_rr(shift=1) - - def test_pc_q35(self): - """ - :avocado: tags=machine:q35 - """ - self.run_rr(shift=3) - -@skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') -class ReplayLinuxX8664Virtio(ReplayLinux): - """ - :avocado: tags=arch:x86_64 - :avocado: tags=virtio - :avocado: tags=accel:tcg - """ - - hdd = 'virtio-blk-pci' - cd = 'virtio-blk-pci' - bus = None - - chksum = 'e3c1b309d9203604922d6e255c2c5d098a309c2d46215d8fc026954f3c5c27a0' - - def test_pc_i440fx(self): - """ - :avocado: tags=machine:pc - """ - self.run_rr(shift=1) - - def test_pc_q35(self): - """ - :avocado: tags=machine:q35 - """ - self.run_rr(shift=3) @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') class ReplayLinuxAarch64(ReplayLinux):
tests/functional/test_x86_64_replay.py +33 -10
63 lines not on this page · raw message
Signature · 1 line
2.49.0
[PULL 27/29] tests/functional: Remove semicolons at the end of lines
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
Yes, we are all C coders who try to write Python code for testing... but still, let's better avoid semicolons at the end of the lines to keep "pylint" happy!
Message-ID: <[email protected]>
--- tests/functional/aspeed.py | 2 +- tests/functional/test_aarch64_aspeed.py | 2 +- tests/functional/test_arm_aspeed_ast2500.py | 6 ++-- tests/functional/test_arm_aspeed_ast2600.py | 36 +++++++++---------- tests/functional/test_arm_aspeed_bletchley.py | 4 +-- tests/functional/test_arm_aspeed_palmetto.py | 4 +-- tests/functional/test_arm_aspeed_romulus.py | 4 +-- .../functional/test_arm_aspeed_witherspoon.py | 4 +-- tests/functional/test_arm_bpim2u.py | 2 +- tests/functional/test_arm_cubieboard.py | 2 +- tests/functional/test_arm_orangepi.py | 2 +- tests/functional/test_s390x_topology.py | 12 +++---- 12 files changed, 40 insertions(+), 40 deletions(-)
tests/functional/aspeed.py +1 -1
@@ -44,7 +44,7 @@ def do_test_arm_aspeed_buildroot_start(self, image, cpu_id, pattern='Aspeed EVB' def do_test_arm_aspeed_buildroot_poweroff(self): exec_command_and_wait_for_pattern(self, 'poweroff', - 'System halted'); + 'System halted') def do_test_arm_aspeed_sdk_start(self, image): self.require_netdev('user')
tests/functional/test_aarch64_aspeed.py +1 -1
@@ -85,7 +85,7 @@ def start_ast2700_test(self, name): exec_command_and_wait_for_pattern(self, 'echo lm75 0x4d > /sys/class/i2c-dev/i2c-1/device/new_device ', - 'i2c i2c-1: new_device: Instantiated device lm75 at 0x4d'); + 'i2c i2c-1: new_device: Instantiated device lm75 at 0x4d') exec_command_and_wait_for_pattern(self, 'cat /sys/bus/i2c/devices/1-004d/hwmon/hwmon*/temp1_input', '0') self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test',
tests/functional/test_arm_aspeed_ast2500.py +3 -3
@@ -22,17 +22,17 @@ def test_arm_ast2500_evb_buildroot(self): image_path = self.ASSET_BR2_202411_AST2500_FLASH.fetch() self.vm.add_args('-device', - 'tmp105,bus=aspeed.i2c.bus.3,address=0x4d,id=tmp-test'); + 'tmp105,bus=aspeed.i2c.bus.3,address=0x4d,id=tmp-test') self.do_test_arm_aspeed_buildroot_start(image_path, '0x0', 'ast2500-evb login:') exec_command_and_wait_for_pattern(self, 'echo lm75 0x4d > /sys/class/i2c-dev/i2c-3/device/new_device', - 'i2c i2c-3: new_device: Instantiated device lm75 at 0x4d'); + 'i2c i2c-3: new_device: Instantiated device lm75 at 0x4d') exec_command_and_wait_for_pattern(self, 'cat /sys/class/hwmon/hwmon1/temp1_input', '0') self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test', - property='temperature', value=18000); + property='temperature', value=18000) exec_command_and_wait_for_pattern(self, 'cat /sys/class/hwmon/hwmon1/temp1_input', '18000')
tests/functional/test_arm_aspeed_ast2600.py +18 -18
@@ -27,38 +27,38 @@ def test_arm_ast2600_evb_buildroot(self): image_path = self.ASSET_BR2_202411_AST2600_FLASH.fetch() self.vm.add_args('-device', - 'tmp105,bus=aspeed.i2c.bus.3,address=0x4d,id=tmp-test'); + 'tmp105,bus=aspeed.i2c.bus.3,address=0x4d,id=tmp-test') self.vm.add_args('-device', - 'ds1338,bus=aspeed.i2c.bus.3,address=0x32'); + 'ds1338,bus=aspeed.i2c.bus.3,address=0x32') self.vm.add_args('-device', - 'i2c-echo,bus=aspeed.i2c.bus.3,address=0x42'); + 'i2c-echo,bus=aspeed.i2c.bus.3,address=0x42') self.do_test_arm_aspeed_buildroot_start(image_path, '0xf00', 'ast2600-evb login:') exec_command_and_wait_for_pattern(self, 'echo lm75 0x4d > /sys/class/i2c-dev/i2c-3/device/new_device', - 'i2c i2c-3: new_device: Instantiated device lm75 at 0x4d'); + 'i2c i2c-3: new_device: Instantiated device lm75 at 0x4d') exec_command_and_wait_for_pattern(self, 'cat /sys/class/hwmon/hwmon1/temp1_input', '0') self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test', - property='temperature', value=18000); + property='temperature', value=18000) exec_command_and_wait_for_pattern(self, 'cat /sys/class/hwmon/hwmon1/temp1_input', '18000') exec_command_and_wait_for_pattern(self, 'echo ds1307 0x32 > /sys/class/i2c-dev/i2c-3/device/new_device', - 'i2c i2c-3: new_device: Instantiated device ds1307 at 0x32'); + 'i2c i2c-3: new_device: Instantiated device ds1307 at 0x32') year = time.strftime("%Y") - exec_command_and_wait_for_pattern(self, 'hwclock -f /dev/rtc1', year); + exec_command_and_wait_for_pattern(self, 'hwclock -f /dev/rtc1', year) exec_command_and_wait_for_pattern(self, 'echo slave-24c02 0x1064 > /sys/bus/i2c/devices/i2c-3/new_device', - 'i2c i2c-3: new_device: Instantiated device slave-24c02 at 0x64'); + 'i2c i2c-3: new_device: Instantiated device slave-24c02 at 0x64') exec_command_and_wait_for_pattern(self, - 'i2cset -y 3 0x42 0x64 0x00 0xaa i', '#'); + 'i2cset -y 3 0x42 0x64 0x00 0xaa i', '#') exec_command_and_wait_for_pattern(self, 'hexdump /sys/bus/i2c/devices/3-1064/slave-eeprom', - '0000000 ffaa ffff ffff ffff ffff ffff ffff ffff'); + '0000000 ffaa ffff ffff ffff ffff ffff ffff ffff') self.do_test_arm_aspeed_buildroot_poweroff() ASSET_BR2_202302_AST2600_TPM_FLASH = Asset(
@@ -90,10 +90,10 @@ def test_arm_ast2600_evb_buildroot_tpm(self): exec_command_and_wait_for_pattern(self, 'echo tpm_tis_i2c 0x2e > /sys/bus/i2c/devices/i2c-12/new_device', - 'tpm_tis_i2c 12-002e: 2.0 TPM (device-id 0x1, rev-id 1)'); + 'tpm_tis_i2c 12-002e: 2.0 TPM (device-id 0x1, rev-id 1)') exec_command_and_wait_for_pattern(self, 'cat /sys/class/tpm/tpm0/pcr-sha256/0', - 'B804724EA13F52A9072BA87FE8FDCC497DFC9DF9AA15B9088694639C431688E0'); + 'B804724EA13F52A9072BA87FE8FDCC497DFC9DF9AA15B9088694639C431688E0') self.do_test_arm_aspeed_buildroot_poweroff()
@@ -107,9 +107,9 @@ def test_arm_ast2600_evb_sdk(self): self.archive_extract(self.ASSET_SDK_V806_AST2600_A2) self.vm.add_args('-device', - 'tmp105,bus=aspeed.i2c.bus.5,address=0x4d,id=tmp-test'); + 'tmp105,bus=aspeed.i2c.bus.5,address=0x4d,id=tmp-test') self.vm.add_args('-device', - 'ds1338,bus=aspeed.i2c.bus.5,address=0x32'); + 'ds1338,bus=aspeed.i2c.bus.5,address=0x32') self.do_test_arm_aspeed_sdk_start( self.scratch_file("ast2600-a2", "image-bmc"))
@@ -120,20 +120,20 @@ def test_arm_ast2600_evb_sdk(self): exec_command_and_wait_for_pattern(self, 'echo lm75 0x4d > /sys/class/i2c-dev/i2c-5/device/new_device', - 'i2c i2c-5: new_device: Instantiated device lm75 at 0x4d'); + 'i2c i2c-5: new_device: Instantiated device lm75 at 0x4d') exec_command_and_wait_for_pattern(self, 'cat /sys/class/hwmon/hwmon19/temp1_input', '0') self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test', - property='temperature', value=18000); + property='temperature', value=18000) exec_command_and_wait_for_pattern(self, 'cat /sys/class/hwmon/hwmon19/temp1_input', '18000') exec_command_and_wait_for_pattern(self, 'echo ds1307 0x32 > /sys/class/i2c-dev/i2c-5/device/new_device', - 'i2c i2c-5: new_device: Instantiated device ds1307 at 0x32'); + 'i2c i2c-5: new_device: Instantiated device ds1307 at 0x32') year = time.strftime("%Y") exec_command_and_wait_for_pattern(self, - '/sbin/hwclock -f /dev/rtc1', year); + '/sbin/hwclock -f /dev/rtc1', year) if __name__ == '__main__': AspeedTest.main()
tests/functional/test_arm_aspeed_bletchley.py +2 -2
@@ -12,14 +12,14 @@ class BletchleyMachine(AspeedTest): ASSET_BLETCHLEY_FLASH = Asset( 'https://github.com/legoater/qemu-aspeed-boot/raw/master/images/bletchley-bmc/openbmc-20250128071329/obmc-phosphor-image-bletchley-20250128071329.static.mtd.xz', - 'db21d04d47d7bb2a276f59d308614b4dfb70b9c7c81facbbca40a3977a2d8844'); + 'db21d04d47d7bb2a276f59d308614b4dfb70b9c7c81facbbca40a3977a2d8844') def test_arm_ast2600_bletchley_openbmc(self): image_path = self.uncompress(self.ASSET_BLETCHLEY_FLASH) self.do_test_arm_aspeed_openbmc('bletchley-bmc', image=image_path, uboot='2019.04', cpu_id='0xf00', - soc='AST2600 rev A3'); + soc='AST2600 rev A3') if __name__ == '__main__': AspeedTest.main()
tests/functional/test_arm_aspeed_palmetto.py +2 -2
@@ -12,14 +12,14 @@ class PalmettoMachine(AspeedTest): ASSET_PALMETTO_FLASH = Asset( 'https://github.com/legoater/qemu-aspeed-boot/raw/master/images/palmetto-bmc/openbmc-20250128071432/obmc-phosphor-image-palmetto-20250128071432.static.mtd', - 'bce7c392eec75c707a91cfc8fad7ca9a69d7e4f10df936930d65c1cb9897ac81'); + 'bce7c392eec75c707a91cfc8fad7ca9a69d7e4f10df936930d65c1cb9897ac81') def test_arm_ast2400_palmetto_openbmc(self): image_path = self.ASSET_PALMETTO_FLASH.fetch() self.do_test_arm_aspeed_openbmc('palmetto-bmc', image=image_path, uboot='2019.04', cpu_id='0x0', - soc='AST2400 rev A1'); + soc='AST2400 rev A1') if __name__ == '__main__': AspeedTest.main()
tests/functional/test_arm_aspeed_romulus.py +2 -2
@@ -12,14 +12,14 @@ class RomulusMachine(AspeedTest): ASSET_ROMULUS_FLASH = Asset( 'https://github.com/legoater/qemu-aspeed-boot/raw/master/images/romulus-bmc/openbmc-20250128071340/obmc-phosphor-image-romulus-20250128071340.static.mtd', - '6d031376440c82ed9d087d25e9fa76aea75b42f80daa252ec402c0bc3cf6cf5b'); + '6d031376440c82ed9d087d25e9fa76aea75b42f80daa252ec402c0bc3cf6cf5b') def test_arm_ast2500_romulus_openbmc(self): image_path = self.ASSET_ROMULUS_FLASH.fetch() self.do_test_arm_aspeed_openbmc('romulus-bmc', image=image_path, uboot='2019.04', cpu_id='0x0', - soc='AST2500 rev A1'); + soc='AST2500 rev A1') if __name__ == '__main__': AspeedTest.main()
tests/functional/test_arm_aspeed_witherspoon.py +2 -2
@@ -12,14 +12,14 @@ class WitherspoonMachine(AspeedTest): ASSET_WITHERSPOON_FLASH = Asset( 'https://github.com/legoater/qemu-aspeed-boot/raw/master/images/witherspoon-bmc/openbmc-20240618035022/obmc-phosphor-image-witherspoon-20240618035022.ubi.mtd', - '937d9ed449ea6c6cbed983519088a42d0cafe276bcfe4fce07772ca6673f9213'); + '937d9ed449ea6c6cbed983519088a42d0cafe276bcfe4fce07772ca6673f9213') def test_arm_ast2500_witherspoon_openbmc(self): image_path = self.ASSET_WITHERSPOON_FLASH.fetch() self.do_test_arm_aspeed_openbmc('witherspoon-bmc', image=image_path, uboot='2016.07', cpu_id='0x0', - soc='AST2500 rev A1'); + soc='AST2500 rev A1') if __name__ == '__main__': AspeedTest.main()
tests/functional/test_arm_bpim2u.py +1 -1
@@ -163,7 +163,7 @@ def test_arm_bpim2u_openwrt_22_03_3(self): self, 'Hit any key to stop autoboot:', '=>') exec_command_and_wait_for_pattern(self, "setenv extraargs '" + kernel_command_line + "'", '=>') - exec_command_and_wait_for_pattern(self, 'boot', 'Starting kernel ...'); + exec_command_and_wait_for_pattern(self, 'boot', 'Starting kernel ...') self.wait_for_console_pattern( 'Please press Enter to activate this console.')
tests/functional/test_arm_cubieboard.py +1 -1
@@ -128,7 +128,7 @@ def test_arm_cubieboard_openwrt_22_03_2(self): self, 'Hit any key to stop autoboot:', '=>') exec_command_and_wait_for_pattern(self, "setenv extraargs '" + kernel_command_line + "'", '=>') - exec_command_and_wait_for_pattern(self, 'boot', 'Starting kernel ...'); + exec_command_and_wait_for_pattern(self, 'boot', 'Starting kernel ...') self.wait_for_console_pattern( 'Please press Enter to activate this console.')
tests/functional/test_arm_orangepi.py +1 -1
@@ -174,7 +174,7 @@ def test_arm_orangepi_armbian(self): exec_command_and_wait_for_pattern(self, ' ', '=>') exec_command_and_wait_for_pattern(self, "setenv extraargs '" + kernel_command_line + "'", '=>') - exec_command_and_wait_for_pattern(self, 'boot', 'Starting kernel ...'); + exec_command_and_wait_for_pattern(self, 'boot', 'Starting kernel ...') self.wait_for_console_pattern('systemd[1]: Hostname set ' + 'to <orangepipc>')
tests/functional/test_s390x_topology.py +6 -6
@@ -217,12 +217,12 @@ def test_polarization(self): self.assertEqual(res['return']['polarization'], 'horizontal') self.check_topology(0, 0, 0, 0, 'medium', False) - self.guest_set_dispatching('1'); + self.guest_set_dispatching('1') res = self.vm.qmp('query-s390x-cpu-polarization') self.assertEqual(res['return']['polarization'], 'vertical') self.check_topology(0, 0, 0, 0, 'medium', False) - self.guest_set_dispatching('0'); + self.guest_set_dispatching('0') res = self.vm.qmp('query-s390x-cpu-polarization') self.assertEqual(res['return']['polarization'], 'horizontal') self.check_topology(0, 0, 0, 0, 'medium', False)
@@ -283,7 +283,7 @@ def test_entitlement(self): self.check_polarization('vertical:high') self.check_topology(0, 0, 0, 0, 'high', False) - self.guest_set_dispatching('0'); + self.guest_set_dispatching('0') self.check_polarization("horizontal") self.check_topology(0, 0, 0, 0, 'high', False)
@@ -310,11 +310,11 @@ def test_dedicated(self): self.check_topology(0, 0, 0, 0, 'high', True) self.check_polarization("horizontal") - self.guest_set_dispatching('1'); + self.guest_set_dispatching('1') self.check_topology(0, 0, 0, 0, 'high', True) self.check_polarization("vertical:high") - self.guest_set_dispatching('0'); + self.guest_set_dispatching('0') self.check_topology(0, 0, 0, 0, 'high', True) self.check_polarization("horizontal")
@@ -360,7 +360,7 @@ def test_dedicated_error(self): self.check_topology(0, 0, 0, 0, 'high', True) - self.guest_set_dispatching('1'); + self.guest_set_dispatching('1') self.check_topology(0, 0, 0, 0, 'high', True)
Signature · 1 line
2.49.0
[PULL 13/29] tests/functional: Convert reverse_debugging tests to the functional framework
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
These tests are using the gdb-related library functions from the Avocado framework which we don't have in the functional framework yet. So for the time being, keep those imports and skip the test if the Avocado framework is not installed on the host.
Message-ID: <[email protected]>
---
MAINTAINERS | 2 +-
tests/functional/meson.build | 4 +
.../reverse_debugging.py | 114 +++---------------
.../functional/test_aarch64_reverse_debug.py | 38 ++++++
tests/functional/test_ppc64_reverse_debug.py | 41 +++++++
tests/functional/test_x86_64_reverse_debug.py | 36 ++++++
6 files changed, 139 insertions(+), 96 deletions(-)
rename tests/{avocado => functional}/reverse_debugging.py (66%)
create mode 100755 tests/functional/test_aarch64_reverse_debug.py
create mode 100755 tests/functional/test_ppc64_reverse_debug.py
create mode 100755 tests/functional/test_x86_64_reverse_debug.pyMAINTAINERS +1 -1
@@ -3671,7 +3671,7 @@ F: docs/system/replay.rst F: stubs/replay.c F: tests/avocado/replay_kernel.py F: tests/avocado/replay_linux.py -F: tests/avocado/reverse_debugging.py +F: tests/functional/*reverse_debug*.py F: tests/functional/*replay*.py F: qapi/replay.json
tests/functional/meson.build +4 -0
@@ -13,6 +13,7 @@ endif test_timeouts = { 'aarch64_aspeed' : 600, 'aarch64_raspi4' : 480, + 'aarch64_reverse_debug' : 180, 'aarch64_rme_virt' : 1200, 'aarch64_rme_sbsaref' : 1200, 'aarch64_sbsaref_alpine' : 1200,
@@ -78,6 +79,7 @@ tests_aarch64_system_thorough = [ 'aarch64_raspi3', 'aarch64_raspi4', 'aarch64_replay', + 'aarch64_reverse_debug', 'aarch64_rme_virt', 'aarch64_rme_sbsaref', 'aarch64_sbsaref',
@@ -229,6 +231,7 @@ tests_ppc64_system_thorough = [ 'ppc64_powernv', 'ppc64_pseries', 'ppc64_replay', + 'ppc64_reverse_debug', 'ppc64_tuxrun', 'ppc64_mac99', ]
@@ -311,6 +314,7 @@ tests_x86_64_system_thorough = [ 'x86_64_hotplug_cpu', 'x86_64_kvm_xen', 'x86_64_replay', + 'x86_64_reverse_debug', 'x86_64_tuxrun', ]
tests/functional/reverse_debugging.py renamed from tests/avocado/reverse_debugging.py +19 -95
158 lines not on this page · raw message
tests/functional/test_aarch64_reverse_debug.py new file +38 -0
@@ -0,0 +1,38 @@ +#!/usr/bin/env python3 +# +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Reverse debugging test +# +# Copyright (c) 2020 ISP RAS +# +# Author: +# Pavel Dovgalyuk <[email protected]> +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +from qemu_test import Asset, skipIfMissingImports, skipFlakyTest +from reverse_debugging import ReverseDebugging + + +@skipIfMissingImports('avocado.utils') +class ReverseDebugging_AArch64(ReverseDebugging): + + REG_PC = 32 + + KERNEL_ASSET = Asset( + ('https://archives.fedoraproject.org/pub/archive/fedora/linux/' + 'releases/29/Everything/aarch64/os/images/pxeboot/vmlinuz'), + '7e1430b81c26bdd0da025eeb8fbd77b5dc961da4364af26e771bd39f379cbbf7') + + @skipFlakyTest("https://gitlab.com/qemu-project/qemu/-/issues/2921") + def test_aarch64_virt(self): + self.set_machine('virt') + self.cpu = 'cortex-a53' + kernel_path = self.KERNEL_ASSET.fetch() + self.reverse_debugging(args=('-kernel', kernel_path)) + + +if __name__ == '__main__': + ReverseDebugging.main()
tests/functional/test_ppc64_reverse_debug.py new file +41 -0
41 lines not on this page · raw message
tests/functional/test_x86_64_reverse_debug.py new file +36 -0
@@ -0,0 +1,36 @@ +#!/usr/bin/env python3 +# +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Reverse debugging test +# +# Copyright (c) 2020 ISP RAS +# +# Author: +# Pavel Dovgalyuk <[email protected]> +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +from qemu_test import skipIfMissingImports, skipFlakyTest +from reverse_debugging import ReverseDebugging + + +@skipIfMissingImports('avocado.utils') +class ReverseDebugging_X86_64(ReverseDebugging): + + REG_PC = 0x10 + REG_CS = 0x12 + def get_pc(self, g): + return self.get_reg_le(g, self.REG_PC) \ + + self.get_reg_le(g, self.REG_CS) * 0x10 + + @skipFlakyTest("https://gitlab.com/qemu-project/qemu/-/issues/2922") + def test_x86_64_pc(self): + self.set_machine('pc') + # start with BIOS only + self.reverse_debugging() + + +if __name__ == '__main__': + ReverseDebugging.main()
Signature · 1 line
2.49.0
[PULL 24/29] gitlab-ci: Update QEMU_JOB_AVOCADO and QEMU_CI_AVOCADO_TESTING
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
Since we don't run the Avocado jobs in the CI anymore, rename these variables to QEMU_JOB_FUNCTIONAL and QEMU_CI_FUNCTIONAL.
Also, there was a mismatch between the documentation and the implementation of QEMU_CI_AVOCADO_TESTING: While the documentation said that you had to "Set this variable to have the tests using the Avocado framework run automatically", you indeed needed to set it to make the pipelines appear in your dashboard - but they were never run automatically in forks and had to be triggered manually. Let's improve this now: No need to hide these pipelines from the users by default anymore (the functional tests should be stable enough nowadays), and rather allow the users to run the pipelines auto- matically with this switch now instead, as was documented.
Message-ID: <[email protected]>
--- docs/devel/testing/ci-jobs.rst.inc | 19 +++++++++---------- .gitlab-ci.d/base.yml | 8 ++------ .gitlab-ci.d/buildtest-template.yml | 2 +- 3 files changed, 12 insertions(+), 17 deletions(-)
docs/devel/testing/ci-jobs.rst.inc +9 -10
@@ -126,10 +126,10 @@ QEMU_JOB_PUBLISH The job is for publishing content after a branch has been merged into the upstream default branch. -QEMU_JOB_AVOCADO -~~~~~~~~~~~~~~~~ +QEMU_JOB_FUNCTIONAL +~~~~~~~~~~~~~~~~~~~ -The job runs the Avocado integration test suite +The job runs the functional test suite Contributor controlled runtime variables ----------------------------------------
@@ -149,13 +149,12 @@ the jobs to be manually started from the UI Set this variable to 2 to create the pipelines and run all the jobs immediately, as was the historical behaviour -QEMU_CI_AVOCADO_TESTING -~~~~~~~~~~~~~~~~~~~~~~~ -By default, tests using the Avocado framework are not run automatically in -the pipelines (because multiple artifacts have to be downloaded, and if -these artifacts are not already cached, downloading them make the jobs -reach the timeout limit). Set this variable to have the tests using the -Avocado framework run automatically. +QEMU_CI_FUNCTIONAL +~~~~~~~~~~~~~~~~~~ +By default, tests using the functional framework are not run automatically +in the pipelines (because multiple artifacts have to be downloaded, which +might cause a lot of network traffic). Set this variable to have the tests +using the functional framework run automatically. Other misc variables --------------------
.gitlab-ci.d/base.yml +2 -6
@@ -69,10 +69,6 @@ variables: - if: '$QEMU_CI != "1" && $QEMU_CI != "2" && $CI_PROJECT_NAMESPACE != $QEMU_CI_UPSTREAM' when: never - # Avocado jobs don't run in forks unless $QEMU_CI_AVOCADO_TESTING is set - - if: '$QEMU_JOB_AVOCADO && $QEMU_CI_AVOCADO_TESTING != "1" && $CI_PROJECT_NAMESPACE != $QEMU_CI_UPSTREAM' - when: never - ############################################################# # Stage 2: fine tune execution of jobs in specific scenarios
@@ -101,8 +97,8 @@ variables: when: manual allow_failure: true - # Avocado jobs can be manually start in forks if $QEMU_CI_AVOCADO_TESTING is unset - - if: '$QEMU_JOB_AVOCADO && $CI_PROJECT_NAMESPACE != $QEMU_CI_UPSTREAM' + # Functional jobs can be manually started in forks + - if: '$QEMU_JOB_FUNCTIONAL && $QEMU_CI_FUNCTIONAL != "1" && $CI_PROJECT_NAMESPACE != $QEMU_CI_UPSTREAM' when: manual allow_failure: true
.gitlab-ci.d/buildtest-template.yml +1 -1
@@ -114,4 +114,4 @@ - cd build - du -chs ${CI_PROJECT_DIR}/*-cache variables: - QEMU_JOB_AVOCADO: 1 + QEMU_JOB_FUNCTIONAL: 1
Signature · 1 line
2.49.0
[PULL 23/29] tests/functional: Convert the SMMU test to the functional framework
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
This test was using cloudinit and a "dnf install" command in the guest to exercise the NIC with SMMU enabled. Since we don't have the cloudinit stuff in the functional framework and we should not rely on having access to external networks (once our ASSETs have been cached), we rather boot into the initrd first, manually mount the root disk and then use the check_http_download() function from the functional framework here instead for testing whether the network works as expected.
Unfortunately, there seems to be a small race when using the files from Fedora 33: To enter the initrd shell, we have to send a "return" once. But it does not seem to work if we send it too early. Using a sleep(0.2) makes it work reliably for me, but to make it even more unlikely to trigger this situation, let's better limit the Fedora 33 tests to only run with KVM.
Finally, while we're at it, we also add some lines for testing writes to the hard disk, as we already do it in the test_intel_iommu test.
Message-ID: <[email protected]>
--- MAINTAINERS | 2 +- tests/avocado/smmu.py | 139 ----------------- tests/functional/meson.build | 2 + tests/functional/test_aarch64_smmu.py | 205 ++++++++++++++++++++++++++ 4 files changed, 208 insertions(+), 140 deletions(-) delete mode 100644 tests/avocado/smmu.py create mode 100755 tests/functional/test_aarch64_smmu.py
MAINTAINERS +1 -1
@@ -211,7 +211,7 @@ L: [email protected] S: Maintained F: hw/arm/smmu* F: include/hw/arm/smmu* -F: tests/avocado/smmu.py +F: tests/functional/test_aarch64_smmu.py AVR TCG CPUs M: Michael Rolnik <[email protected]>
tests/avocado/smmu.py deleted +0 -139
139 lines not on this page · raw message
tests/functional/meson.build +2 -0
@@ -18,6 +18,7 @@ test_timeouts = { 'aarch64_rme_sbsaref' : 1200, 'aarch64_sbsaref_alpine' : 1200, 'aarch64_sbsaref_freebsd' : 720, + 'aarch64_smmu' : 720, 'aarch64_tuxrun' : 240, 'aarch64_virt' : 360, 'aarch64_virt_gpu' : 480,
@@ -88,6 +89,7 @@ tests_aarch64_system_thorough = [ 'aarch64_sbsaref', 'aarch64_sbsaref_alpine', 'aarch64_sbsaref_freebsd', + 'aarch64_smmu', 'aarch64_tcg_plugins', 'aarch64_tuxrun', 'aarch64_virt',
tests/functional/test_aarch64_smmu.py new file +205 -0
205 lines not on this page · raw message
Signature · 1 line
2.49.0
[PULL 25/29] docs/devel/testing: Dissolve the ci-definitions.rst.inc file
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
This file was meant for defining the vocabulary for our testing efforts, but it did not age well: First, the definitions are not only about the CI part, but also about testing in general, so most of the information should rather reside in main.rst instead. Second, some vocabulary has never been really adopted by the QEMU project, for example we never really use the word "system testing" since "system" rather means the system emulator binaries in the QEMU project (and we also don't do any testing with other components like libvirt and virt-managers here). It also defines that the qtests are the "functional" tests in QEMU, which is not really up to date anymore after the "tests/functional" framework has been introduced a couple of months ago (FWIW, the qtests could rather be seen as a mix between unit testing and functional testing).
To solve this problem, move the useful parts of this file into main.rst and directly into ci.rst, and drop the ones (like "system testing") that we don't really need anymore.
Message-ID: <[email protected]>
--- docs/devel/testing/ci-definitions.rst.inc | 121 ---------------------- docs/devel/testing/ci.rst | 28 ++++- docs/devel/testing/main.rst | 65 ++++++++++-- 3 files changed, 81 insertions(+), 133 deletions(-) delete mode 100644 docs/devel/testing/ci-definitions.rst.inc
docs/devel/testing/ci-definitions.rst.inc deleted +0 -121
@@ -1,121 +0,0 @@ -Definition of terms -=================== - -This section defines the terms used in this document and correlates them with -what is currently used on QEMU. - -Automated tests ---------------- - -An automated test is written on a test framework using its generic test -functions/classes. The test framework can run the tests and report their -success or failure [1]_. - -An automated test has essentially three parts: - -1. The test initialization of the parameters, where the expected parameters, - like inputs and expected results, are set up; -2. The call to the code that should be tested; -3. An assertion, comparing the result from the previous call with the expected - result set during the initialization of the parameters. If the result - matches the expected result, the test has been successful; otherwise, it has - failed. - -Unit testing ------------- - -A unit test is responsible for exercising individual software components as a -unit, like interfaces, data structures, and functionality, uncovering errors -within the boundaries of a component. The verification effort is in the -smallest software unit and focuses on the internal processing logic and data -structures. A test case of unit tests should be designed to uncover errors due -to erroneous computations, incorrect comparisons, or improper control flow [2]_. - -On QEMU, unit testing is represented by the 'check-unit' target from 'make'. - -Functional testing ------------------- - -A functional test focuses on the functional requirement of the software. -Deriving sets of input conditions, the functional tests should fully exercise -all the functional requirements for a program. Functional testing is -complementary to other testing techniques, attempting to find errors like -incorrect or missing functions, interface errors, behavior errors, and -initialization and termination errors [3]_. - -On QEMU, functional testing is represented by the 'check-qtest' target from -'make'. - -System testing --------------- - -System tests ensure all application elements mesh properly while the overall -functionality and performance are achieved [4]_. Some or all system components -are integrated to create a complete system to be tested as a whole. System -testing ensures that components are compatible, interact correctly, and -transfer the right data at the right time across their interfaces. As system -testing focuses on interactions, use case-based testing is a practical approach -to system testing [5]_. Note that, in some cases, system testing may require -interaction with third-party software, like operating system images, databases, -networks, and so on. - -On QEMU, system testing is represented by the 'check-avocado' target from -'make'. - -Flaky tests ------------ - -A flaky test is defined as a test that exhibits both a passing and a failing -result with the same code on different runs. Some usual reasons for an -intermittent/flaky test are async wait, concurrency, and test order dependency -[6]_. - -Gating ------- - -A gate restricts the move of code from one stage to another on a -test/deployment pipeline. The step move is granted with approval. The approval -can be a manual intervention or a set of tests succeeding [7]_. - -On QEMU, the gating process happens during the pull request. The approval is -done by the project leader running its own set of tests. The pull request gets -merged when the tests succeed. - -Continuous Integration (CI) ---------------------------- - -Continuous integration (CI) requires the builds of the entire application and -the execution of a comprehensive set of automated tests every time there is a -need to commit any set of changes [8]_. The automated tests can be composed of -the unit, functional, system, and other tests. - -Keynotes about continuous integration (CI) [9]_: - -1. System tests may depend on external software (operating system images, - firmware, database, network). -2. It may take a long time to build and test. It may be impractical to build - the system being developed several times per day. -3. If the development platform is different from the target platform, it may - not be possible to run system tests in the developer’s private workspace. - There may be differences in hardware, operating system, or installed - software. Therefore, more time is required for testing the system. - -References ----------- - -.. [1] Sommerville, Ian (2016). Software Engineering. p. 233. -.. [2] Pressman, Roger S. & Maxim, Bruce R. (2020). Software Engineering, - A Practitioner’s Approach. p. 48, 376, 378, 381. -.. [3] Pressman, Roger S. & Maxim, Bruce R. (2020). Software Engineering, - A Practitioner’s Approach. p. 388. -.. [4] Pressman, Roger S. & Maxim, Bruce R. (2020). Software Engineering, - A Practitioner’s Approach. Software Engineering, p. 377. -.. [5] Sommerville, Ian (2016). Software Engineering. p. 59, 232, 240. -.. [6] Luo, Qingzhou, et al. An empirical analysis of flaky tests. - Proceedings of the 22nd ACM SIGSOFT International Symposium on - Foundations of Software Engineering. 2014. -.. [7] Humble, Jez & Farley, David (2010). Continuous Delivery: - Reliable Software Releases Through Build, Test, and Deployment, p. 122. -.. [8] Humble, Jez & Farley, David (2010). Continuous Delivery: - Reliable Software Releases Through Build, Test, and Deployment, p. 55. -.. [9] Sommerville, Ian (2016). Software Engineering. p. 743.
docs/devel/testing/ci.rst +24 -4
@@ -1,14 +1,34 @@ .. _ci: -== -CI -== +Continuous Integration (CI) +=========================== + +Continuous integration (CI) requires the builds of the entire application and +the execution of a comprehensive set of automated tests every time there is a +need to commit any set of changes [1]_. The automated tests are composed +of unit, functional and other tests. Most of QEMU's CI is run on GitLab's infrastructure although a number of other CI services are used for specialised purposes. The most up to date information about them and their status can be found on the `project wiki testing page <https://wiki.qemu.org/Testing/CI>`_. -.. include:: ci-definitions.rst.inc +These tests are also used as gating tests before merging pull requests. +A gating test restricts the move of code from one stage to another on a +test/deployment pipeline. The step move is granted with approval. The approval +can be a manual intervention or a set of tests succeeding [2]_. + +On QEMU, the gating process happens during the pull request. The approval is +done by the project leader running its own set of tests. The pull request gets +merged when the tests succeed. + .. include:: ci-jobs.rst.inc .. include:: ci-runners.rst.inc + +References +---------- + +.. [1] Humble, Jez & Farley, David (2010). Continuous Delivery: + Reliable Software Releases Through Build, Test, and Deployment, p. 55. +.. [2] Humble, Jez & Farley, David (2010). Continuous Delivery: + Reliable Software Releases Through Build, Test, and Deployment, p. 122.
docs/devel/testing/main.rst +57 -8
94 lines not on this page · raw message
Signature · 1 line
2.49.0
[PULL 20/29] tests/avocado: Remove the boot_linux.py tests
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
These tests are based on the cloudinit functions from Avocado. The cloudinit is very, very slow compared to our other tests, so most of these Avocado tests have either been disabled by default with a decorator, or have been marked to only run with KVM.
We won't include this sluggish cloudinit stuff in the functional framework, and we've already got plenty of other tests there that check pretty much the same things, so let's simply get rid of these old tests now.
Message-ID: <[email protected]>
--- tests/avocado/boot_linux.py | 132 ------------------------------------ 1 file changed, 132 deletions(-) delete mode 100644 tests/avocado/boot_linux.py
tests/avocado/boot_linux.py deleted +0 -132
@@ -1,132 +0,0 @@ -# Functional test that boots a complete Linux system via a cloud image -# -# Copyright (c) 2018-2020 Red Hat, Inc. -# -# Author: -# Cleber Rosa <[email protected]> -# -# This work is licensed under the terms of the GNU GPL, version 2 or -# later. See the COPYING file in the top-level directory. - -import os - -from avocado_qemu.linuxtest import LinuxTest -from avocado_qemu import BUILD_DIR - -from avocado import skipUnless - - -class BootLinuxX8664(LinuxTest): - """ - :avocado: tags=arch:x86_64 - """ - timeout = 480 - - def test_pc_i440fx_tcg(self): - """ - :avocado: tags=machine:pc - :avocado: tags=accel:tcg - """ - self.require_accelerator("tcg") - self.vm.add_args("-accel", "tcg") - self.launch_and_wait(set_up_ssh_connection=False) - - def test_pc_i440fx_kvm(self): - """ - :avocado: tags=machine:pc - :avocado: tags=accel:kvm - """ - self.require_accelerator("kvm") - self.vm.add_args("-accel", "kvm") - self.launch_and_wait(set_up_ssh_connection=False) - - def test_pc_q35_tcg(self): - """ - :avocado: tags=machine:q35 - :avocado: tags=accel:tcg - """ - self.require_accelerator("tcg") - self.vm.add_args("-accel", "tcg") - self.launch_and_wait(set_up_ssh_connection=False) - - def test_pc_q35_kvm(self): - """ - :avocado: tags=machine:q35 - :avocado: tags=accel:kvm - """ - self.require_accelerator("kvm") - self.vm.add_args("-accel", "kvm") - self.launch_and_wait(set_up_ssh_connection=False) - - -# For Aarch64 we only boot KVM tests in CI as booting the current -# Fedora OS in TCG tests is very heavyweight. There are lighter weight -# distros which we use in the machine_aarch64_virt.py tests. -class BootLinuxAarch64(LinuxTest): - """ - :avocado: tags=arch:aarch64 - :avocado: tags=machine:virt - """ - timeout = 720 - - def test_virt_kvm(self): - """ - :avocado: tags=accel:kvm - :avocado: tags=cpu:host - """ - self.require_accelerator("kvm") - self.vm.add_args("-accel", "kvm") - self.vm.add_args("-machine", "virt,gic-version=host") - self.vm.add_args('-bios', - os.path.join(BUILD_DIR, 'pc-bios', - 'edk2-aarch64-code.fd')) - self.vm.add_args('-device', 'virtio-rng-pci,rng=rng0') - self.vm.add_args('-object', 'rng-random,id=rng0,filename=/dev/urandom') - self.launch_and_wait(set_up_ssh_connection=False) - - -# See the tux_baseline.py tests for almost the same coverage in a lot -# less time. -class BootLinuxPPC64(LinuxTest): - """ - :avocado: tags=arch:ppc64 - """ - - timeout = 360 - - @skipUnless(os.getenv('SPEED') == 'slow', 'runtime limited') - def test_pseries_tcg(self): - """ - :avocado: tags=machine:pseries - :avocado: tags=accel:tcg - """ - self.require_accelerator("tcg") - self.vm.add_args("-accel", "tcg") - self.launch_and_wait(set_up_ssh_connection=False) - - def test_pseries_kvm(self): - """ - :avocado: tags=machine:pseries - :avocado: tags=accel:kvm - """ - self.require_accelerator("kvm") - self.vm.add_args("-accel", "kvm") - self.vm.add_args("-machine", "cap-ccf-assist=off") - self.launch_and_wait(set_up_ssh_connection=False) - -class BootLinuxS390X(LinuxTest): - """ - :avocado: tags=arch:s390x - """ - - timeout = 240 - - @skipUnless(os.getenv('SPEED') == 'slow', 'runtime limited') - def test_s390_ccw_virtio_tcg(self): - """ - :avocado: tags=machine:s390-ccw-virtio - :avocado: tags=accel:tcg - """ - self.require_accelerator("tcg") - self.vm.add_args("-accel", "tcg") - self.launch_and_wait(set_up_ssh_connection=False)
Signature · 1 line
2.49.0
[PULL 29/29] MAINTAINERS: Add functional tests that are not covered yet
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
Some functional tests are currently not covered by the entries in MAINTAINERS yet, so scripts/get_maintainers.pl fails to suggest the right people who should be CC:-ed for related patches. Add the uncovered tests to the right sections to close this gap.
Message-ID: <[email protected]>
--- MAINTAINERS | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
MAINTAINERS +11 -2
@@ -475,6 +475,7 @@ F: docs/system/i386/sgx.rst F: target/i386/kvm/ F: target/i386/sev* F: scripts/kvm/vmxcap +F: tests/functional/test_x86_64_hotplug_cpu.py Xen emulation on X86 KVM CPUs M: David Woodhouse <[email protected]>
@@ -626,6 +627,7 @@ S: Maintained F: hw/alpha/ F: hw/isa/smc37c669-superio.c F: tests/tcg/alpha/system/ +F: tests/functional/test_alpha_clipper.py ARM Machines ------------
@@ -950,7 +952,7 @@ F: hw/misc/sbsa_ec.c F: hw/watchdog/sbsa_gwdt.c F: include/hw/watchdog/sbsa_gwdt.h F: docs/system/arm/sbsa.rst -F: tests/functional/test_aarch64_sbsaref*.py +F: tests/functional/test_aarch64_*sbsaref*.py Sharp SL-5500 (Collie) PDA M: Peter Maydell <[email protected]>
@@ -1019,9 +1021,10 @@ S: Maintained F: hw/arm/virt* F: include/hw/arm/virt.h F: docs/system/arm/virt.rst -F: tests/functional/test_aarch64_virt*.py +F: tests/functional/test_aarch64_*virt*.py F: tests/functional/test_aarch64_tuxrun.py F: tests/functional/test_arm_tuxrun.py +F: tests/functional/test_arm_virt.py Xilinx Zynq M: Edgar E. Iglesias <[email protected]>
@@ -1262,6 +1265,7 @@ F: hw/m68k/mcf_intc.c F: hw/char/mcf_uart.c F: hw/net/mcf_fec.c F: include/hw/m68k/mcf*.h +F: tests/functional/test_m68k_mcf5208evb.py NeXTcube M: Thomas Huth <[email protected]>
@@ -1406,6 +1410,7 @@ S: Maintained F: docs/system/openrisc/or1k-sim.rst F: hw/intc/ompic.c F: hw/openrisc/openrisc_sim.c +F: tests/functional/test_or1k_sim.py PowerPC Machines ----------------
@@ -1827,6 +1832,7 @@ F: include/hw/isa/apm.h F: tests/unit/test-x86-topo.c F: tests/qtest/test-x86-cpuid-compat.c F: tests/functional/test_i386_tuxrun.py +F: tests/functional/test_linux_initrd.py F: tests/functional/test_mem_addr_space.py F: tests/functional/test_pc_cpu_hotplug_props.py F: tests/functional/test_x86_64_tuxrun.py
@@ -3150,6 +3156,7 @@ F: include/ui/ F: qapi/ui.json F: util/drm.c F: docs/devel/ui.rst +F: tests/functional/test_vnc.py Cocoa graphics M: Peter Maydell <[email protected]>
@@ -3815,6 +3822,7 @@ F: configs/targets/*linux-user.mak F: scripts/qemu-binfmt-conf.sh F: scripts/update-syscalltbl.sh F: scripts/update-mips-syscall-args.sh +F: tests/functional/test_arm_bflt.py Tiny Code Generator (TCG) -------------------------
@@ -4187,6 +4195,7 @@ F: hw/remote/vfio-user-obj.c F: include/hw/remote/vfio-user-obj.h F: hw/remote/iommu.c F: include/hw/remote/iommu.h +F: tests/functional/test_multiprocess.py EBPF: M: Jason Wang <[email protected]>
Signature · 1 line
2.49.0
[PULL 22/29] tests/functional: Use the tuxrun kernel for the aarch64 replay test
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
This way we can do a full boot in record-replay mode and should get a similar test coverage compared to the old replay test from tests/avocado/replay_linux.py.
Since the aarch64 test was the last avocado test in the tests/avocado/replay_linux.py file, we can remove this file now completely.
Message-ID: <[email protected]>
--- MAINTAINERS | 1 - tests/avocado/replay_linux.py | 160 ------------------------ tests/functional/test_aarch64_replay.py | 37 ++++-- 3 files changed, 29 insertions(+), 169 deletions(-) delete mode 100644 tests/avocado/replay_linux.py
MAINTAINERS +0 -1
@@ -3668,7 +3668,6 @@ F: include/system/replay.h F: docs/devel/replay.rst F: docs/system/replay.rst F: stubs/replay.c -F: tests/avocado/replay_linux.py F: tests/functional/*reverse_debug*.py F: tests/functional/*replay*.py F: qapi/replay.json
tests/avocado/replay_linux.py deleted +0 -160
160 lines not on this page · raw message
tests/functional/test_aarch64_replay.py +29 -8
@@ -5,25 +5,46 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -from qemu_test import Asset, skipIfOperatingSystem +from subprocess import check_call, DEVNULL + +from qemu_test import Asset, skipIfOperatingSystem, get_qemu_img from replay_kernel import ReplayKernelBase class Aarch64Replay(ReplayKernelBase): ASSET_KERNEL = Asset( - ('https://archives.fedoraproject.org/pub/archive/fedora/linux/' - 'releases/29/Everything/aarch64/os/images/pxeboot/vmlinuz'), - '7e1430b81c26bdd0da025eeb8fbd77b5dc961da4364af26e771bd39f379cbbf7') + 'https://storage.tuxboot.com/buildroot/20241119/arm64/Image', + 'b74743c5e89e1cea0f73368d24ae0ae85c5204ff84be3b5e9610417417d2f235') + + ASSET_ROOTFS = Asset( + 'https://storage.tuxboot.com/buildroot/20241119/arm64/rootfs.ext4.zst', + 'a1acaaae2068df4648d04ff75f532aaa8c5edcd6b936122b6f0db4848a07b465') def test_aarch64_virt(self): + self.require_netdev('user') self.set_machine('virt') - self.cpu = 'cortex-a53' + self.cpu = 'cortex-a57' kernel_path = self.ASSET_KERNEL.fetch() + + raw_disk = self.uncompress(self.ASSET_ROOTFS) + disk = self.scratch_file('scratch.qcow2') + qemu_img = get_qemu_img(self) + check_call([qemu_img, 'create', '-f', 'qcow2', '-b', raw_disk, + '-F', 'raw', disk], stdout=DEVNULL, stderr=DEVNULL) + + args = ('-drive', 'file=%s,snapshot=on,id=hd0,if=none' % disk, + '-drive', 'driver=blkreplay,id=hd0-rr,if=none,image=hd0', + '-device', 'virtio-blk-device,drive=hd0-rr', + '-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22', + '-device', 'virtio-net,netdev=vnet', + '-object', 'filter-replay,id=replay,netdev=vnet') + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + - 'console=ttyAMA0') - console_pattern = 'VFS: Cannot open root device' - self.run_rr(kernel_path, kernel_command_line, console_pattern) + 'console=ttyAMA0 root=/dev/vda') + console_pattern = 'Welcome to TuxTest' + self.run_rr(kernel_path, kernel_command_line, console_pattern, + args=args) if __name__ == '__main__':
Signature · 1 line
2.49.0
[PULL 26/29] Remove the remainders of the Avocado tests
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
Now that all Avocado tests have been converted to or been replaced by other functional tests, we can delete the remainders of the Avocado tests from the QEMU source tree.
Message-ID: <[email protected]>
--- MAINTAINERS | 8 +- docs/about/build-platforms.rst | 10 +- docs/devel/build-system.rst | 11 +- docs/devel/codebase.rst | 5 - docs/devel/testing/avocado.rst | 581 ------------------------ docs/devel/testing/functional.rst | 3 - docs/devel/testing/index.rst | 1 - docs/devel/testing/main.rst | 15 - tests/avocado/README.rst | 10 - configure | 2 +- pythondeps.toml | 8 +- tests/Makefile.include | 60 +-- tests/avocado/avocado_qemu/__init__.py | 424 ----------------- tests/avocado/avocado_qemu/linuxtest.py | 253 ----------- 14 files changed, 16 insertions(+), 1375 deletions(-) delete mode 100644 docs/devel/testing/avocado.rst delete mode 100644 tests/avocado/README.rst delete mode 100644 tests/avocado/avocado_qemu/__init__.py delete mode 100644 tests/avocado/avocado_qemu/linuxtest.py
MAINTAINERS +1 -7
@@ -2073,7 +2073,7 @@ S: Supported F: hw/acpi/viot.c F: hw/acpi/viot.h -ACPI/AVOCADO/BIOSBITS +ACPI/FUNCTIONAL/BIOSBITS M: Ani Sinha <[email protected]> M: Michael S. Tsirkin <[email protected]> S: Supported
@@ -4246,12 +4246,6 @@ R: Philippe Mathieu-Daudé <[email protected]> S: Maintained F: tests/tcg/Makefile.target -Integration Testing with the Avocado framework -W: https://trello.com/b/6Qi1pxVn/avocado-qemu -R: Cleber Rosa <[email protected]> -S: Odd Fixes -F: tests/avocado/ - GitLab custom runner (Works On Arm Sponsored) M: Alex Bennée <[email protected]> M: Philippe Mathieu-Daudé <[email protected]>
docs/about/build-platforms.rst +5 -5
@@ -123,11 +123,11 @@ Rust build dependencies to build QEMU. Optional build dependencies - Build components whose absence does not affect the ability to build - QEMU may not be available in distros, or may be too old for QEMU's - requirements. Many of these, such as the Avocado testing framework - or various linters, are written in Python and therefore can also - be installed using ``pip``. Cross compilers are another example + Build components whose absence does not affect the ability to build QEMU + may not be available in distros, or may be too old for our requirements. + Many of these, such as additional modules for the functional testing + framework or various linters, are written in Python and therefore can + also be installed using ``pip``. Cross compilers are another example of optional build-time dependency; in this case it is possible to download them from repositories such as EPEL, to use container-based cross compilation using ``docker`` or ``podman``, or to use pre-built
docs/devel/build-system.rst +3 -8
@@ -134,7 +134,7 @@ in how the build process runs Python code. At this stage, ``configure`` also queries the chosen Python interpreter about QEMU's build dependencies. Note that the build process does *not* -look for ``meson``, ``sphinx-build`` or ``avocado`` binaries in the PATH; +look for ``meson`` or ``sphinx-build`` binaries in the PATH; likewise, there are no options such as ``--meson`` or ``--sphinx-build``. This avoids a potential mismatch, where Meson and Sphinx binaries on the PATH might operate in a different Python environment than the one chosen
@@ -151,7 +151,7 @@ virtual environment with ``pip``, either from wheels in ``python/wheels`` or by downloading the package with PyPI. Downloading can be disabled with ``--disable-download``; and anyway, it only happens when a ``configure`` option (currently, only ``--enable-docs``) is explicitly enabled but -the dependencies are not present\ [#pip]_. +the dependencies are not present. .. [#distlib] The scripts are created based on the package's metadata, specifically the ``console_script`` entry points. This is the
@@ -164,10 +164,6 @@ the dependencies are not present\ [#pip]_. because the Python Packaging Authority provides a package ``distlib.scripts`` to perform this task. -.. [#pip] ``pip`` might also be used when running ``make check-avocado`` - if downloading is enabled, to ensure that Avocado is - available. - The required versions of the packages are stored in a configuration file ``pythondeps.toml``. The format is custom to QEMU, but it is documented at the top of the file itself and it should be easy to understand. The
@@ -497,8 +493,7 @@ number of dynamically created files listed later. ``pyvenv/bin``, and calling ``pip`` to install dependencies. ``tests/Makefile.include`` - Rules for external test harnesses. These include the TCG tests - and the Avocado-based integration tests. + Rules for external test harnesses like the TCG tests. ``tests/docker/Makefile.include`` Rules for Docker tests. Like ``tests/Makefile.include``, this file is
docs/devel/codebase.rst +0 -5
@@ -175,11 +175,6 @@ yet, so sometimes the source code is all you have. * `tests <https://gitlab.com/qemu-project/qemu/-/tree/master/tests>`_: QEMU `test <testing>` suite - - `avocado <https://gitlab.com/qemu-project/qemu/-/tree/master/tests/avocado>`_: - Functional tests booting full VM using `Avocado framework <checkavocado-ref>`. - Those tests will be transformed and moved into - `tests/functional <https://gitlab.com/qemu-project/qemu/-/tree/master/tests/functional>`_ - in the future. - `data <https://gitlab.com/qemu-project/qemu/-/tree/master/tests/data>`_: Data for various tests. - `decode <https://gitlab.com/qemu-project/qemu/-/tree/master/tests/decode>`_:
docs/devel/testing/avocado.rst deleted +0 -581
581 lines not on this page · raw message
docs/devel/testing/functional.rst +0 -3
@@ -6,9 +6,6 @@ Functional testing with Python The ``tests/functional`` directory hosts functional tests written in Python. They are usually higher level tests, and may interact with external resources and with various guest operating systems. -The functional tests have initially evolved from the Avocado tests, so there -is a lot of similarity to those tests here (see :ref:`checkavocado-ref` for -details about the Avocado tests). The tests should be written in the style of the Python `unittest`_ framework, using stdio for the TAP protocol. The folder ``tests/functional/qemu_test``
docs/devel/testing/index.rst +0 -1
@@ -10,7 +10,6 @@ testing infrastructure. main qtest functional - avocado acpi-bits ci fuzzing
docs/devel/testing/main.rst +0 -15
@@ -919,21 +919,6 @@ Python. You can run the functional tests simply by executing: See :ref:`checkfunctional-ref` for more details. -Integration tests using the Avocado Framework ---------------------------------------------- - -The ``tests/avocado`` directory hosts integration tests. They're usually -higher level tests, and may interact with external resources and with -various guest operating systems. - -You can run the avocado tests simply by executing: - -.. code:: - - make check-avocado - -See :ref:`checkavocado-ref` for more details. - .. _checktcg-ref: Testing with "make check-tcg"
tests/avocado/README.rst deleted +0 -10
@@ -1,10 +0,0 @@ -============================================= -Integration tests using the Avocado Framework -============================================= - -This directory contains integration tests. They're usually higher -level, and may interact with external resources and with various -guest operating systems. - -For more information, please refer to ``docs/devel/testing.rst``, -section "Integration tests using the Avocado Framework".
configure +1 -1
@@ -1685,7 +1685,7 @@ LINKS="$LINKS pc-bios/optionrom/Makefile" LINKS="$LINKS pc-bios/s390-ccw/Makefile" LINKS="$LINKS pc-bios/vof/Makefile" LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit -LINKS="$LINKS tests/avocado tests/data" +LINKS="$LINKS tests/data" LINKS="$LINKS tests/qemu-iotests/check tests/qemu-iotests/Makefile" LINKS="$LINKS python" for f in $LINKS ; do
pythondeps.toml +2 -6
@@ -27,9 +27,5 @@ pycotap = { accepted = ">=1.1.0", installed = "1.3.1" } sphinx = { accepted = ">=3.4.3", installed = "5.3.0", canary = "sphinx-build" } sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.1.1" } -[avocado] -# Note that qemu.git/python/ is always implicitly installed. -# Prefer an LTS version when updating the accepted versions of -# avocado-framework, for example right now the limit is 92.x. -avocado-framework = { accepted = "(>=103.0, <104.0)", installed = "103.0", canary = "avocado" } -pycdlib = { accepted = ">=1.11.0" } +[testdeps] +qemu.qmp = { accepted = ">=0.0.3", installed = "0.0.3" }
tests/Makefile.include +4 -56
104 lines not on this page · raw message
tests/avocado/avocado_qemu/__init__.py deleted +0 -424
424 lines not on this page · raw message
tests/avocado/avocado_qemu/linuxtest.py deleted +0 -253
253 lines not on this page · raw message
Signature · 1 line
2.49.0
[PULL 28/29] tests/functional: Remove unnecessary import statements
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
pylint complains about these unnecessary import statements, so let's remove them.
Message-ID: <[email protected]>
--- tests/functional/qemu_test/ports.py | 3 +-- tests/functional/qemu_test/tuxruntest.py | 2 -- tests/functional/qemu_test/uncompress.py | 2 +- tests/functional/test_aarch64_rme_sbsaref.py | 6 ++---- tests/functional/test_aarch64_rme_virt.py | 2 -- tests/functional/test_aarch64_sbsaref_alpine.py | 3 --- tests/functional/test_aarch64_sbsaref_freebsd.py | 2 -- tests/functional/test_aarch64_tcg_plugins.py | 1 - tests/functional/test_aarch64_virt.py | 8 ++------ tests/functional/test_arm_aspeed_ast2500.py | 3 +-- tests/functional/test_arm_cubieboard.py | 2 -- tests/functional/test_arm_quanta_gsj.py | 2 -- tests/functional/test_arm_smdkc210.py | 2 -- tests/functional/test_migration.py | 3 +-- tests/functional/test_mips64el_replay.py | 6 +----- tests/functional/test_mips_replay.py | 2 +- tests/functional/test_mipsel_replay.py | 2 +- tests/functional/test_ppc64_hv.py | 8 ++++---- tests/functional/test_vnc.py | 4 ++-- tests/functional/test_x86_64_kvm_xen.py | 2 -- 20 files changed, 17 insertions(+), 48 deletions(-)
tests/functional/qemu_test/ports.py +1 -2
@@ -10,12 +10,11 @@ import fcntl import os import socket -import sys -import tempfile from .config import BUILD_DIR from typing import List + class Ports(): PORTS_ADDR = '127.0.0.1'
tests/functional/qemu_test/tuxruntest.py +0 -2
@@ -10,8 +10,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later import os -import stat -from subprocess import check_call, DEVNULL from qemu_test import QemuSystemTest from qemu_test import exec_command_and_wait_for_pattern
tests/functional/qemu_test/uncompress.py +1 -1
@@ -13,7 +13,7 @@ import stat import shutil from urllib.parse import urlparse -from subprocess import run, CalledProcessError, DEVNULL +from subprocess import run, CalledProcessError from .asset import Asset
tests/functional/test_aarch64_rme_sbsaref.py +2 -4
@@ -9,15 +9,13 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -import time import os -import logging -from qemu_test import QemuSystemTest, Asset -from qemu_test import exec_command, wait_for_console_pattern +from qemu_test import QemuSystemTest, Asset, wait_for_console_pattern from qemu_test import exec_command_and_wait_for_pattern from test_aarch64_rme_virt import test_realms_guest + class Aarch64RMESbsaRefMachine(QemuSystemTest): # Stack is built with OP-TEE build environment from those instructions:
tests/functional/test_aarch64_rme_virt.py +0 -2
@@ -9,9 +9,7 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -import time import os -import logging from qemu_test import QemuSystemTest, Asset from qemu_test import exec_command, wait_for_console_pattern
tests/functional/test_aarch64_sbsaref_alpine.py +0 -3
@@ -10,11 +10,8 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -import os - from qemu_test import QemuSystemTest, Asset, skipSlowTest from qemu_test import wait_for_console_pattern -from unittest import skipUnless from test_aarch64_sbsaref import fetch_firmware
tests/functional/test_aarch64_sbsaref_freebsd.py +0 -2
@@ -10,8 +10,6 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -import os - from qemu_test import QemuSystemTest, Asset, skipSlowTest from qemu_test import wait_for_console_pattern from test_aarch64_sbsaref import fetch_firmware
tests/functional/test_aarch64_tcg_plugins.py +0 -1
@@ -13,7 +13,6 @@ import tempfile import mmap -import os import re from qemu.machine.machine import VMLaunchFailure
tests/functional/test_aarch64_virt.py +2 -6
@@ -13,12 +13,8 @@ import logging from subprocess import check_call, DEVNULL -from qemu.machine.machine import VMLaunchFailure - -from qemu_test import QemuSystemTest, Asset -from qemu_test import exec_command, exec_command_and_wait_for_pattern -from qemu_test import wait_for_console_pattern -from qemu_test import skipIfMissingCommands, get_qemu_img +from qemu_test import QemuSystemTest, Asset, exec_command_and_wait_for_pattern +from qemu_test import wait_for_console_pattern, get_qemu_img class Aarch64VirtMachine(QemuSystemTest):
tests/functional/test_arm_aspeed_ast2500.py +1 -2
@@ -4,9 +4,8 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -from qemu_test import Asset +from qemu_test import Asset, exec_command_and_wait_for_pattern from aspeed import AspeedTest -from qemu_test import exec_command_and_wait_for_pattern class AST2500Machine(AspeedTest):
tests/functional/test_arm_cubieboard.py +0 -2
@@ -4,8 +4,6 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -import os - from qemu_test import LinuxKernelTest, Asset, exec_command_and_wait_for_pattern from qemu_test import interrupt_interactive_console_until_pattern from qemu_test import skipBigDataTest
tests/functional/test_arm_quanta_gsj.py +0 -2
@@ -4,8 +4,6 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -import os - from qemu_test import LinuxKernelTest, Asset, exec_command_and_wait_for_pattern from qemu_test import interrupt_interactive_console_until_pattern, skipSlowTest
tests/functional/test_arm_smdkc210.py +0 -2
@@ -4,8 +4,6 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -import os - from qemu_test import LinuxKernelTest, Asset
tests/functional/test_migration.py +1 -2
@@ -11,14 +11,13 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. - import tempfile -import os import time from qemu_test import QemuSystemTest, skipIfMissingCommands from qemu_test.ports import Ports + class MigrationTest(QemuSystemTest): timeout = 10
tests/functional/test_mips64el_replay.py +1 -5
@@ -4,11 +4,7 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -import os -import logging - -from qemu_test import Asset, exec_command_and_wait_for_pattern -from qemu_test import skipIfMissingImports, skipFlakyTest, skipUntrustedTest +from qemu_test import Asset, skipUntrustedTest from replay_kernel import ReplayKernelBase
tests/functional/test_mips_replay.py +1 -1
@@ -4,7 +4,7 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -from qemu_test import Asset, skipSlowTest, exec_command_and_wait_for_pattern +from qemu_test import Asset, skipSlowTest from replay_kernel import ReplayKernelBase
tests/functional/test_mipsel_replay.py +1 -1
@@ -4,7 +4,7 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -from qemu_test import Asset, wait_for_console_pattern, skipSlowTest +from qemu_test import Asset, skipSlowTest from replay_kernel import ReplayKernelBase
tests/functional/test_ppc64_hv.py +4 -4
@@ -9,14 +9,14 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. +import os +import subprocess + +from datetime import datetime from qemu_test import QemuSystemTest, Asset from qemu_test import wait_for_console_pattern, exec_command from qemu_test import skipIfMissingCommands, skipBigDataTest from qemu_test import exec_command_and_wait_for_pattern -import os -import time -import subprocess -from datetime import datetime # Alpine is a light weight distro that supports QEMU. These tests boot # that on the machine then run a QEMU guest inside it in KVM mode,
tests/functional/test_vnc.py +2 -2
@@ -11,12 +11,12 @@ # later. See the COPYING file in the top-level directory. import socket -from typing import List -from qemu.machine.machine import VMLaunchFailure +from qemu.machine.machine import VMLaunchFailure from qemu_test import QemuSystemTest from qemu_test.ports import Ports + VNC_ADDR = '127.0.0.1' def check_connect(port: int) -> bool:
tests/functional/test_x86_64_kvm_xen.py +0 -2
@@ -11,8 +11,6 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -import os - from qemu.machine import machine from qemu_test import QemuSystemTest, Asset, exec_command_and_wait_for_pattern
Signature · 1 line
2.49.0
[PULL 15/29] tests/avocado: Remove the LinuxKernelTest class
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
All tests that used this class have been converted to the functional framework, so we can remove the boot_linux_console.py file now.
Message-ID: <[email protected]>
--- tests/avocado/boot_linux_console.py | 62 ----------------------------- 1 file changed, 62 deletions(-) delete mode 100644 tests/avocado/boot_linux_console.py
tests/avocado/boot_linux_console.py deleted +0 -62
@@ -1,62 +0,0 @@ -# Functional test that boots a Linux kernel and checks the console -# -# Copyright (c) 2018 Red Hat, Inc. -# -# Author: -# Cleber Rosa <[email protected]> -# -# This work is licensed under the terms of the GNU GPL, version 2 or -# later. See the COPYING file in the top-level directory. - -import os -import shutil - -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern -from avocado.utils import process -from avocado.utils import archive - -class LinuxKernelTest(QemuSystemTest): - KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 ' - - def wait_for_console_pattern(self, success_message, vm=None): - wait_for_console_pattern(self, success_message, - failure_message='Kernel panic - not syncing', - vm=vm) - - def extract_from_deb(self, deb, path): - """ - Extracts a file from a deb package into the test workdir - - :param deb: path to the deb archive - :param path: path within the deb archive of the file to be extracted - :returns: path of the extracted file - """ - cwd = os.getcwd() - os.chdir(self.workdir) - file_path = process.run("ar t %s" % deb).stdout_text.split()[2] - process.run("ar x %s %s" % (deb, file_path)) - archive.extract(file_path, self.workdir) - os.chdir(cwd) - # Return complete path to extracted file. Because callers to - # extract_from_deb() specify 'path' with a leading slash, it is - # necessary to use os.path.relpath() as otherwise os.path.join() - # interprets it as an absolute path and drops the self.workdir part. - return os.path.normpath(os.path.join(self.workdir, - os.path.relpath(path, '/'))) - - def extract_from_rpm(self, rpm, path): - """ - Extracts a file from an RPM package into the test workdir. - - :param rpm: path to the rpm archive - :param path: path within the rpm archive of the file to be extracted - needs to be a relative path (starting with './') because - cpio(1), which is used to extract the file, expects that. - :returns: path of the extracted file - """ - cwd = os.getcwd() - os.chdir(self.workdir) - process.run("rpm2cpio %s | cpio -id %s" % (rpm, path), shell=True) - os.chdir(cwd) - return os.path.normpath(os.path.join(self.workdir, path))
Signature · 1 line
2.49.0
[PULL 08/29] qapi/machine: Make @dump-skeys command generic
In reply to Thomas HuthFrom: Philippe Mathieu-Daudé <[email protected]>
Reduce misc-target.json by one target specific command.
Error message is returned for machines not implementing TYPE_DUMP_SKEYS_INTERFACE:
$ qemu-system-aarch64 -M virt -S -qmp stdio
{"QMP": {"version": {"qemu": {"micro": 50, "major": 9}}, "capabilities": ["oob"]}}
{ "execute": "qmp_capabilities" }
{"return": {}}
{ "execute": "dump-skeys", "arguments": { "filename": "/tmp/foo" } }
{"error": {"class": "GenericError", "desc": "Storage keys information not available for this architecture"}}Message-ID: <[email protected]>
--- qapi/machine.json | 18 ++++++++++++++++++ qapi/misc-target.json | 19 ------------------- hw/core/machine-qmp-cmds.c | 14 ++++++++++++++ hw/s390x/s390-skeys.c | 6 +----- 4 files changed, 33 insertions(+), 24 deletions(-)
qapi/machine.json +18 -0
@@ -1898,3 +1898,21 @@ { 'command': 'x-query-interrupt-controllers', 'returns': 'HumanReadableText', 'features': [ 'unstable' ]} + +## +# @dump-skeys: +# +# Dump the storage keys for an s390x guest +# +# @filename: the path to the file to dump to +# +# Since: 2.5 +# +# .. qmp-example:: +# +# -> { "execute": "dump-skeys", +# "arguments": { "filename": "/tmp/skeys" } } +# <- { "return": {} } +## +{ 'command': 'dump-skeys', + 'data': { 'filename': 'str' } }
qapi/misc-target.json +0 -19
@@ -274,25 +274,6 @@ 'returns': 'SevAttestationReport', 'if': 'TARGET_I386' } -## -# @dump-skeys: -# -# Dump guest's storage keys -# -# @filename: the path to the file to dump to -# -# Since: 2.5 -# -# .. qmp-example:: -# -# -> { "execute": "dump-skeys", -# "arguments": { "filename": "/tmp/skeys" } } -# <- { "return": {} } -## -{ 'command': 'dump-skeys', - 'data': { 'filename': 'str' }, - 'if': 'TARGET_S390X' } - ## # @GICCapability: #
hw/core/machine-qmp-cmds.c +14 -0
@@ -25,6 +25,7 @@#include "system/numa.h" #include "system/runstate.h" #include "system/system.h" +#include "hw/s390x/storage-keys.h" /* * fast means: we NEVER interrupt vCPU threads to retrieve
@@ -406,3 +407,16 @@ GuidInfo *qmp_query_vm_generation_id(Error **errp) info->guid =qemu_uuid_unparse_strdup (&vms->guid);return info; } + +void qmp_dump_skeys (const char *filename,Error **errp) +{ +ObjectClass *mc =object_get_class (qdev_get_machine ()); +ObjectClass *oc =object_class_dynamic_cast (mc,TYPE_DUMP_SKEYS_INTERFACE ); + +if (!oc) { +error_setg (errp,"Storage keys information not available" +" for this architecture" ); +return ; + } +DUMP_SKEYS_INTERFACE_CLASS (oc)->qmp_dump_skeys (filename, errp); +}
hw/s390x/s390-skeys.c +1 -5
@@ -15,6 +15,7 @@#include "hw/qdev-properties.h" #include "hw/s390x/storage-keys.h" #include "qapi/error.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/qapi-commands-misc-target.h" #include "qobject/qdict.h" #include "qemu/error-report.h"
@@ -219,11 +220,6 @@ out:fclose (f); } -void qmp_dump_skeys (const char *filename,Error **errp) -{ -s390_qmp_dump_skeys (filename, errp); -} -static bool qemu_s390_skeys_are_enabled (S390SKeysState *ss) {QEMUS390SKeysState *skeys =QEMU_S390_SKEYS (ss);
Signature · 1 line
2.49.0
[PULL 17/29] tests/functional: Convert the 32-bit little endian Wheezy mips test
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
Reuse the test function from the big endian test to easily convert the 32-bit little endian Wheezy mips test.
Message-ID: <[email protected]>
--- tests/avocado/linux_ssh_mips_malta.py | 8 -------- tests/functional/meson.build | 1 + tests/functional/test_mipsel_malta.py | 22 ++++++++++++++++++++++ 3 files changed, 23 insertions(+), 8 deletions(-)
tests/avocado/linux_ssh_mips_malta.py +0 -8
@@ -172,14 +172,6 @@ def check_mips_malta(self, uname_m, endianess): # Wait for VM to shut down gracefully self.vm.wait() - def test_mips_malta32el_kernel3_2_0(self): - """ - :avocado: tags=arch:mipsel - :avocado: tags=endian:little - :avocado: tags=device:pcnet32 - """ - self.check_mips_malta('mips', 'le') - def test_mips_malta64eb_kernel3_2_0(self): """ :avocado: tags=arch:mips64
tests/functional/meson.build +1 -0
@@ -40,6 +40,7 @@ test_timeouts = { 'arm_sx1' : 360, 'intel_iommu': 300, 'mips_malta' : 480, + 'mipsel_malta' : 420, 'mipsel_replay' : 480, 'mips64el_replay' : 180, 'netdev_ethtool' : 180,
tests/functional/test_mipsel_malta.py +22 -0
@@ -13,6 +13,8 @@ from qemu_test import interrupt_interactive_console_until_pattern from qemu_test import wait_for_console_pattern +from test_mips_malta import mips_check_wheezy + class MaltaMachineConsole(LinuxKernelTest):
@@ -57,6 +59,26 @@ def test_mips_malta32el_nanomips_16k_up(self): def test_mips_malta32el_nanomips_64k_dbg(self): self.do_test_mips_malta32el_nanomips(self.ASSET_KERNEL_64K) + ASSET_WHEEZY_KERNEL = Asset( + ('https://people.debian.org/~aurel32/qemu/mipsel/' + 'vmlinux-3.2.0-4-4kc-malta'), + 'dc8a3648305b0201ca7a5cd135fe2890067a65d93c38728022bb0e656ad2bf9a') + + ASSET_WHEEZY_DISK = Asset( + ('https://people.debian.org/~aurel32/qemu/mipsel/' + 'debian_wheezy_mipsel_standard.qcow2'), + '454f09ae39f7e6461c84727b927100d2c7813841f2a0a5dce328114887ecf914') + + def test_wheezy(self): + kernel_path = self.ASSET_WHEEZY_KERNEL.fetch() + image_path = self.ASSET_WHEEZY_DISK.fetch() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + + 'console=ttyS0 root=/dev/sda1') + mips_check_wheezy(self, + kernel_path, image_path, kernel_command_line, + dl_file='/boot/initrd.img-3.2.0-4-4kc-malta', + hsum='9fc9f250ed56a74e35e704ddfd5a1c5a5625adefc5c9da91f649288d3ca000f0') + class MaltaMachineYAMON(QemuSystemTest):
Signature · 1 line
2.49.0
[PULL 11/29] gitlab-ci: Remove the avocado tests from the CI pipelines
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
We are going to move the remaining Avocado tests step by step into the functional test framework. Unfortunately, Avocado fails with an error if it cannot determine a test to run, so disable the tests here now to avoid failures in the Gitlab-CI during the next steps.
Message-ID: <[email protected]>
--- .gitlab-ci.d/buildtest-template.yml | 11 ---------- .gitlab-ci.d/buildtest.yml | 33 +++++++++++------------------ 2 files changed, 12 insertions(+), 32 deletions(-)
.gitlab-ci.d/buildtest-template.yml +0 -11
@@ -95,7 +95,6 @@ cache: key: "${CI_JOB_NAME}-cache" paths: - - ${CI_PROJECT_DIR}/avocado-cache - ${CI_PROJECT_DIR}/functional-cache policy: pull-push artifacts:
@@ -109,16 +108,6 @@ reports: junit: build/tests/results/latest/results.xml before_script: - - mkdir -p ~/.config/avocado - - echo "[datadir.paths]" > ~/.config/avocado/avocado.conf - - echo "cache_dirs = ['${CI_PROJECT_DIR}/avocado-cache']" - >> ~/.config/avocado/avocado.conf - - echo -e '[job.output.testlogs]\nstatuses = ["FAIL", "INTERRUPT"]' - >> ~/.config/avocado/avocado.conf - - if [ -d ${CI_PROJECT_DIR}/avocado-cache ]; then - du -chs ${CI_PROJECT_DIR}/*-cache ; - fi - - export AVOCADO_ALLOW_UNTRUSTED_CODE=1 - export QEMU_TEST_ALLOW_UNTRUSTED_CODE=1 - export QEMU_TEST_CACHE_DIR=${CI_PROJECT_DIR}/functional-cache after_script:
.gitlab-ci.d/buildtest.yml +12 -21
@@ -29,8 +29,7 @@ functional-system-alpine: artifacts: true variables: IMAGE: alpine - MAKE_CHECK_ARGS: check-avocado check-functional - AVOCADO_TAGS: arch:avr arch:loongarch64 arch:mips64 arch:mipsel + MAKE_CHECK_ARGS: check-functional build-system-ubuntu: extends:
@@ -60,8 +59,7 @@ functional-system-ubuntu: artifacts: true variables: IMAGE: ubuntu2204 - MAKE_CHECK_ARGS: check-avocado check-functional - AVOCADO_TAGS: arch:alpha arch:microblazeel arch:mips64el + MAKE_CHECK_ARGS: check-functional build-system-debian: extends:
@@ -92,8 +90,7 @@ functional-system-debian: artifacts: true variables: IMAGE: debian - MAKE_CHECK_ARGS: check-avocado check-functional - AVOCADO_TAGS: arch:arm arch:i386 arch:riscv64 arch:sh4 arch:sparc arch:xtensa + MAKE_CHECK_ARGS: check-functional crash-test-debian: extends: .native_test_job_template
@@ -155,9 +152,7 @@ functional-system-fedora: artifacts: true variables: IMAGE: fedora - MAKE_CHECK_ARGS: check-avocado check-functional - AVOCADO_TAGS: arch:microblaze arch:mips arch:xtensa arch:m68k - arch:riscv32 arch:ppc arch:sparc64 + MAKE_CHECK_ARGS: check-functional crash-test-fedora: extends: .native_test_job_template
@@ -278,9 +273,7 @@ functional-system-centos: artifacts: true variables: IMAGE: centos9 - MAKE_CHECK_ARGS: check-avocado check-functional - AVOCADO_TAGS: arch:ppc64 arch:or1k arch:s390x arch:x86_64 arch:rx - arch:sh4 + MAKE_CHECK_ARGS: check-functional build-system-opensuse: extends:
@@ -309,8 +302,7 @@ functional-system-opensuse: artifacts: true variables: IMAGE: opensuse-leap - MAKE_CHECK_ARGS: check-avocado check-functional - AVOCADO_TAGS: arch:s390x arch:x86_64 arch:aarch64 + MAKE_CHECK_ARGS: check-functional # # Flaky tests. We don't run these by default and they are allow fail
@@ -338,10 +330,9 @@ functional-system-flaky: allow_failure: true variables: IMAGE: debian - MAKE_CHECK_ARGS: check-avocado check-functional + MAKE_CHECK_ARGS: check-functional QEMU_JOB_OPTIONAL: 1 QEMU_TEST_FLAKY_TESTS: 1 - AVOCADO_TAGS: flaky # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by # the configure script. The container doesn't contain Xen headers so
@@ -482,8 +473,8 @@ clang-user: # Since slirp callbacks are used in QEMU Timers, we cannot use libslirp with # CFI builds, and thus have to disable it here. # -# Split in three sets of build/check/avocado to limit the execution time of each -# job +# Split in three sets of build/check/functional to limit the execution time +# of each job build-cfi-aarch64: extends: - .native_build_job_template
@@ -520,7 +511,7 @@ functional-cfi-aarch64: artifacts: true variables: IMAGE: fedora - MAKE_CHECK_ARGS: check-avocado check-functional + MAKE_CHECK_ARGS: check-functional build-cfi-ppc64-s390x: extends:
@@ -558,7 +549,7 @@ functional-cfi-ppc64-s390x: artifacts: true variables: IMAGE: fedora - MAKE_CHECK_ARGS: check-avocado check-functional + MAKE_CHECK_ARGS: check-functional build-cfi-x86_64: extends:
@@ -592,7 +583,7 @@ functional-cfi-x86_64: artifacts: true variables: IMAGE: fedora - MAKE_CHECK_ARGS: check-avocado check-functional + MAKE_CHECK_ARGS: check-functional tsan-build: extends: .native_build_job_template
Signature · 1 line
2.49.0
[PULL 18/29] tests/functional: Convert the 64-bit little endian Wheezy mips test
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
Reuse the test function from the 32-bit big endian test to easily convert the 64-bit little endian Wheezy mips test.
Message-ID: <[email protected]>
--- tests/avocado/linux_ssh_mips_malta.py | 8 -------- tests/functional/meson.build | 1 + tests/functional/test_mips64el_malta.py | 22 ++++++++++++++++++++++ 3 files changed, 23 insertions(+), 8 deletions(-)
tests/avocado/linux_ssh_mips_malta.py +0 -8
@@ -179,11 +179,3 @@ def test_mips_malta64eb_kernel3_2_0(self): :avocado: tags=device:pcnet32 """ self.check_mips_malta('mips64', 'be') - - def test_mips_malta64el_kernel3_2_0(self): - """ - :avocado: tags=arch:mips64el - :avocado: tags=endian:little - :avocado: tags=device:pcnet32 - """ - self.check_mips_malta('mips64', 'le')
tests/functional/meson.build +1 -0
@@ -42,6 +42,7 @@ test_timeouts = { 'mips_malta' : 480, 'mipsel_malta' : 420, 'mipsel_replay' : 480, + 'mips64el_malta' : 420, 'mips64el_replay' : 180, 'netdev_ethtool' : 180, 'ppc_40p' : 240,
tests/functional/test_mips64el_malta.py +22 -0
@@ -16,6 +16,8 @@ from qemu_test import exec_command_and_wait_for_pattern from qemu_test import skipIfMissingImports, skipFlakyTest, skipUntrustedTest +from test_mips_malta import mips_check_wheezy + class MaltaMachineConsole(LinuxKernelTest):
@@ -90,6 +92,26 @@ def test_mips64el_malta_5KEc_cpio(self): # Wait for VM to shut down gracefully self.vm.wait() + ASSET_WHEEZY_KERNEL = Asset( + ('https://people.debian.org/~aurel32/qemu/mipsel/' + 'vmlinux-3.2.0-4-5kc-malta'), + '5e8b725244c59745bb8b64f5d8f49f25fecfa549f3395fb6d19a3b9e5065b85b') + + ASSET_WHEEZY_DISK = Asset( + ('https://people.debian.org/~aurel32/qemu/mipsel/' + 'debian_wheezy_mipsel_standard.qcow2'), + '454f09ae39f7e6461c84727b927100d2c7813841f2a0a5dce328114887ecf914') + + def test_wheezy(self): + kernel_path = self.ASSET_WHEEZY_KERNEL.fetch() + image_path = self.ASSET_WHEEZY_DISK.fetch() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + + 'console=ttyS0 root=/dev/sda1') + mips_check_wheezy(self, + kernel_path, image_path, kernel_command_line, cpuinfo='MIPS 20Kc', + dl_file='/boot/initrd.img-3.2.0-4-5kc-malta', + hsum='7579f8b56c1187c7c04d0dc3c0c56c7a6314c5ddd3a9bf8803ecc7cf8a3be9f8') + @skipIfMissingImports('numpy', 'cv2') class MaltaMachineFramebuffer(LinuxKernelTest):
Signature · 1 line
2.49.0
[PULL 12/29] tests/functional: Move the check for the parameters from avocado to functional
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
test_x86_64_pc in tests/avocado/boot_linux_console.py only checks whether the kernel parameters have correctly been passed to the kernel in the guest by looking for them in the console output of the guest. Let's move that to the functional test framework now, but instead of doing it in a separate test, let's do it for all tuxrun tests instead, so it is done automatically for all targets that have a tuxrun test.
Message-ID: <[email protected]>
--- tests/avocado/boot_linux_console.py | 34 ------------------------ tests/functional/qemu_test/tuxruntest.py | 9 ++++--- 2 files changed, 5 insertions(+), 38 deletions(-)
tests/avocado/boot_linux_console.py +0 -34
@@ -9,17 +9,9 @@ # later. See the COPYING file in the top-level directory. import os -import lzma -import gzip import shutil -from avocado import skip -from avocado import skipUnless -from avocado import skipUnless from avocado_qemu import QemuSystemTest -from avocado_qemu import exec_command -from avocado_qemu import exec_command_and_wait_for_pattern -from avocado_qemu import interrupt_interactive_console_until_pattern from avocado_qemu import wait_for_console_pattern from avocado.utils import process from avocado.utils import archive
@@ -68,29 +60,3 @@ def extract_from_rpm(self, rpm, path): process.run("rpm2cpio %s | cpio -id %s" % (rpm, path), shell=True) os.chdir(cwd) return os.path.normpath(os.path.join(self.workdir, path)) - -class BootLinuxConsole(LinuxKernelTest): - """ - Boots a Linux kernel and checks that the console is operational and the - kernel command line is properly passed from QEMU to the kernel - """ - timeout = 90 - - def test_x86_64_pc(self): - """ - :avocado: tags=arch:x86_64 - :avocado: tags=machine:pc - """ - kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora' - '/linux/releases/29/Everything/x86_64/os/images/pxeboot' - '/vmlinuz') - kernel_hash = '23bebd2680757891cf7adedb033532163a792495' - kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) - - self.vm.set_console() - kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' - self.vm.add_args('-kernel', kernel_path, - '-append', kernel_command_line) - self.vm.launch() - console_pattern = 'Kernel command line: %s' % kernel_command_line - self.wait_for_console_pattern(console_pattern)
tests/functional/qemu_test/tuxruntest.py +5 -4
@@ -77,12 +77,12 @@ def prepare_run(self, kernel, disk, drive, dtb=None, console_index=0): blockdev = "driver=raw,file.driver=file," \ + f"file.filename={disk},node-name=hd0" - kcmd_line = self.KERNEL_COMMON_COMMAND_LINE - kcmd_line += f" root=/dev/{self.root}" - kcmd_line += f" console={self.console}" + self.kcmd_line = self.KERNEL_COMMON_COMMAND_LINE + self.kcmd_line += f" root=/dev/{self.root}" + self.kcmd_line += f" console={self.console}" self.vm.add_args('-kernel', kernel, - '-append', kcmd_line, + '-append', self.kcmd_line, '-blockdev', blockdev) # Sometimes we need extra devices attached
@@ -103,6 +103,7 @@ def run_tuxtest_tests(self, haltmsg): wait to exit cleanly. """ ps1='root@tuxtest:~#' + self.wait_for_console_pattern(self.kcmd_line) self.wait_for_console_pattern('tuxtest login:') exec_command_and_wait_for_pattern(self, 'root', ps1) exec_command_and_wait_for_pattern(self, 'cat /proc/interrupts', ps1)
Signature · 1 line
2.49.0
Stefan Hajnoczi
AppliedApplied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes.
Quoted 48 lines · Thomas Huth
Hi!
The following changes since commit
1da8f3a3c53b604edfe0d55e475102640490549e:Open 10.1 development tree (2025-04-22 15:09:23 -0400)are available in the Git repository at:
https://gitlab.com/thuth/qemu.git tags/pull-request-2025-04-23for you to fetch changes up to
12c6b6153063aafcdbadca8fee7eac793ef85e4b:
MAINTAINERS: Add functional tests that are not covered yet (2025-04-23 07:51:25 +0200)----------------------------------------------------------------
* Remove the obsolete s390-ccw-virtio-2.9 machine type
* Prepare the dump-skeys QMP command for the universal binary project
* Add compat machine types for 10.1
* Convert the remaining Avocado tests to the functional framework
* Some more small fixes for the functional tests----------------------------------------------------------------
Cornelia Huck (2):
hw: add compat machines for 10.1 tests/functional/test_vnc: skip test if no crypto backend availablePhilippe Mathieu-Daudé (4):
hw/s390x/skeys: Declare QOM types using DEFINE_TYPES() macro hw/s390x/skeys: Introduce TYPE_DUMP_SKEYS_INTERFACE hw/s390x/ccw: Have CCW machine implement a qmp_dump_skeys() callback qapi/machine: Make @dump-skeys command genericThomas Huth (23):
hw/s390x/s390-virtio-ccw: Remove the deprecated 2.9 machine type hw/s390x/css: Remove the obsolete "css_migration_enabled" variable hw/s390x/s390-stattrib: Remove the oldmigration_enabledflag hw/intc/s390_flic: Remove the obsoletemigration_enabledflag
gitlab-ci: Remove the avocado tests from the CI pipelines tests/functional: Move the check for the parameters from avocado to functional tests/functional: Convertreverse_debuggingtests to the functional framework tests/functional: Convert the i386 replay avocado test tests/avocado: Remove the LinuxKernelTest class tests/functional: Convert the 32-bit big endian Wheezy mips test tests/functional: Convert the 32-bit little endian Wheezy mips test tests/functional: Convert the 64-bit little endian Wheezy mips test tests/functional: Convert the 64-bit big endian Wheezy mips test tests/avocado: Remove theboot_linux.pytests
tests/functional: Use the tuxrun kernel for the x86 replay test
Quoted 8 lines
tests/functional: Use the tuxrun kernel for the aarch64 replay test tests/functional: Convert the SMMU test to the functional framework
gitlab-ci: UpdateQEMU_JOB_AVOCADOandQEMU_CI_AVOCADO_TESTINGdocs/devel/testing: Dissolve the ci-definitions.rst.inc file Remove the remainders of the Avocado tests tests/functional: Remove semicolons at the end of lines tests/functional: Remove unnecessary import statements
MAINTAINERS: Add functional tests that are not covered yet
Hi!
I'm picking the bulk of this patchset from Apr-2025 to 10.0.x stable series of qemu, so that testing framework for 10.0.x will be the same as current/future versions of qemu.
In particular, I'm picking up the following patches, all of which applies cleanly to 10.0.x:
4e3823c68c tests/functional/test_vnc: skip test if no crypto backend available 22baa5f340 gitlab-ci: Remove the avocado tests from the CI pipelines bc65ae6961 tests/functional: Move the check for the parameters from avocado to functional 951ededf12 tests/functional: Convert reverse_debugging tests to the functional framework 0e756f404d tests/functional: Convert the i386 replay avocado test 574f71bc1f tests/avocado: Remove the LinuxKernelTest class42a87f0ce7 tests/functional: Convert the 32-bit big endian Wheezy mips test 689a8b56a6 tests/functional: Convert the 32-bit little endian Wheezy mips test 8e3461c3a6 tests/functional: Convert the 64-bit little endian Wheezy mips test f79592f427 tests/functional: Convert the 64-bit big endian Wheezy mips test e83aee9c6a tests/avocado: Remove the boot_linux.py tests7fecdb0acd tests/functional: Use the tuxrun kernel for the x86 replay test a820caf844 tests/functional: Use the tuxrun kernel for the aarch64 replay test 5c2bae2155 tests/functional: Convert the SMMU test to the functional framework f8c5484417 gitlab-ci: Update QEMU_JOB_AVOCADO and QEMU_CI_AVOCADO_TESTING 5748e46415 docs/devel/testing: Dissolve the ci-definitions.rst.inc file 52e9ed6d3a Remove the remainders of the Avocado tests858640eaee tests/functional: Remove semicolons at the end of lines 99fb9256b7 tests/functional: Remove unnecessary import statements 12c6b61530 MAINTAINERS: Add functional tests that are not covered yet
The result is at https://gitlab.com/mjt0k/qemu/-/pipelines/2174244481.
Please let me know if I should skip/omit some of them. And please also let me know of there's someting else which is worth picking up for 10.0 in the testing area, to keep an LTS branch more manageable.
Thanks!
/mjt