summary refs log tree commit diff stats
path: root/tests/functional/qemu_test/utils.py (unfollow)
Commit message (Collapse)AuthorFilesLines
2025-04-23rust/hw/char/pl011: Extract extract DR read logic into separate functionRakesh Jeyasingh1-19/+20
- Split `read()` DR case into `read_data_register()` Signed-off-by: Rakesh Jeyasingh <rakeshjb010@gmail.com> Link: https://lore.kernel.org/r/20250407181327.171563-2-rakeshjb010@gmail.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-23rust/vmstate_test: Fix typo in test_vmstate_macro_array_of_pointer_wrapped()Zhao Liu1-2/+2
test_vmstate_macro_array_of_pointer_wrapped() tests the 3rd element, so fix the index. Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Link: https://lore.kernel.org/r/20250414144943.1112885-5-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-23rust/hpet: Fix a clippy errorZhao Liu1-1/+1
Carge clippy complained about: error: casts from `u8` to `u32` can be expressed infallibly using `From` So use `From` to convert `u8` to `u32`. Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Link: https://lore.kernel.org/r/20250414144943.1112885-10-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-23rust/hpet: convert HPETTimer index to u8 typeZhao Liu1-5/+5
The C version of HPET uses the uint8_t type for timer index ("tn"), and usize type in Rust version will break migration between the C and Rust versions. So convert HPETTimer index' type to u8 (consistent with the C version of HPET) to make it friendly for vmstate support. Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Link: https://lore.kernel.org/r/20250414144943.1112885-8-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-23rust/hpet: convert num_timers to u8 typeZhao Liu1-13/+18
The C version of HPET uses the uint8_t type for num_timers, and usize type in Rust version will break migration between the C and Rust versions. So convert num_timers' type to u8 (consistent with the C version of HPET) to make it friendly for vmstate support. Note the commit 7bda68e8e2b0 ("qdev, rust/hpet: fix type of HPET 'timers property") supports the usize type property, but the uint8 property has to be re-supported now. Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Link: https://lore.kernel.org/r/20250414144943.1112885-7-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-23MAINTAINERS: Add functional tests that are not covered yetThomas Huth1-2/+11
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. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20250414121520.213665-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23tests/functional: Remove unnecessary import statementsThomas Huth20-48/+17
pylint complains about these unnecessary import statements, so let's remove them. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20250414145457.261734-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23tests/functional: Remove semicolons at the end of linesThomas Huth12-40/+40
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! Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Message-ID: <20250327201305.996241-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23Remove the remainders of the Avocado testsThomas Huth14-1375/+16
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. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250414113031.151105-16-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23docs/devel/testing: Dissolve the ci-definitions.rst.inc fileThomas Huth3-133/+81
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: <20250314085959.1585568-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23gitlab-ci: Update QEMU_JOB_AVOCADO and QEMU_CI_AVOCADO_TESTINGThomas Huth3-17/+12
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. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250414113031.151105-15-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23tests/functional: Convert the SMMU test to the functional frameworkThomas Huth4-140/+208
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. Reviewed-by: Eric Auger <eric.auger@redhat.com> Tested-by: Eric Auger <eric.auger@redhat.com> Message-ID: <20250414113031.151105-14-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23tests/functional: Use the tuxrun kernel for the aarch64 replay testThomas Huth3-169/+29
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. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250414113031.151105-13-thuth@redhat.com>
2025-04-23tests/functional: Use the tuxrun kernel for the x86 replay testThomas Huth2-56/+33
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. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250414113031.151105-12-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23tests/avocado: Remove the boot_linux.py testsThomas Huth1-132/+0
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. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250414113031.151105-11-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23tests/functional: Convert the 64-bit big endian Wheezy mips testThomas Huth4-182/+37
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. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250414113031.151105-10-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23tests/functional: Convert the 64-bit little endian Wheezy mips testThomas Huth3-8/+23
Reuse the test function from the 32-bit big endian test to easily convert the 64-bit little endian Wheezy mips test. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250414113031.151105-9-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23tests/functional: Convert the 32-bit little endian Wheezy mips testThomas Huth3-8/+23
Reuse the test function from the big endian test to easily convert the 32-bit little endian Wheezy mips test. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250414113031.151105-8-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23tests/functional: Convert the 32-bit big endian Wheezy mips testThomas Huth3-11/+107
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. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250414113031.151105-7-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23tests/avocado: Remove the LinuxKernelTest classThomas Huth1-62/+0
All tests that used this class have been converted to the functional framework, so we can remove the boot_linux_console.py file now. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250414113031.151105-6-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23tests/functional: Convert the i386 replay avocado testThomas Huth4-111/+29
Since this was the last test in tests/avocado/replay_kernel.py, we can remove that Avocado file now. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250414113031.151105-5-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23tests/functional: Convert reverse_debugging tests to the functional frameworkThomas Huth6-96/+139
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. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250414113031.151105-4-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23tests/functional: Move the check for the parameters from avocado to functionalThomas Huth2-38/+5
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. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250414113031.151105-3-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23gitlab-ci: Remove the avocado tests from the CI pipelinesThomas Huth2-32/+12
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. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250414113031.151105-2-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23tests/functional/test_vnc: skip test if no crypto backend availableCornelia Huck1-0/+2
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. Signed-off-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250414093732.220498-1-cohuck@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23hw: add compat machines for 10.1Cornelia Huck10-9/+76
Add 10.1 machine types for arm/i440fx/m68k/q35/s390x/spapr. Signed-off-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-ID: <20250414094543.221241-1-cohuck@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23qapi/machine: Make @dump-skeys command genericPhilippe Mathieu-Daudé4-24/+33
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"}} Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250310151414.11550-5-philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23hw/s390x/ccw: Have CCW machine implement a qmp_dump_skeys() callbackPhilippe Mathieu-Daudé3-1/+10
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. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Eric Farman <farman@linux.ibm.com> Message-ID: <20250310151414.11550-4-philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23hw/s390x/skeys: Introduce TYPE_DUMP_SKEYS_INTERFACEPhilippe Mathieu-Daudé2-0/+20
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. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Eric Farman <farman@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250310151414.11550-3-philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23hw/s390x/skeys: Declare QOM types using DEFINE_TYPES() macroPhilippe Mathieu-Daudé1-22/+17
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. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Eric Farman <farman@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250310151414.11550-2-philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23hw/intc/s390_flic: Remove the obsolete migration_enabled flagThomas Huth2-15/+0
Now that the machine types that set the migration_enabled flag to false are gone, we can remove it and the related code. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20250115073819.15452-5-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23hw/s390x/s390-stattrib: Remove the old migration_enabled flagThomas Huth3-8/+2
Now that the machine types that set the migration_enabled flag to false are gone, we can remove it and the related code. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20250115073819.15452-4-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23hw/s390x/css: Remove the obsolete "css_migration_enabled" variableThomas Huth2-36/+1
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. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20250115073819.15452-3-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-23hw/s390x/s390-virtio-ccw: Remove the deprecated 2.9 machine typeThomas Huth1-24/+0
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: <20250115073819.15452-2-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2025-04-22target/avr: Increase TARGET_PAGE_BITS to 10Richard Henderson1-7/+1
Now that we can handle the MCU allocating only a portion of the first page to i/o, increase the page size. Choose 10 as larger than the i/o on every MCU, just so that this path is tested. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-04-22hw/avr: Prepare for TARGET_PAGE_SIZE > 256Richard Henderson2-7/+33
If i/o does not cover the entire first page, allocate a portion of ram as an i/o device, so that the entire first page is i/o. While memory_region_init_ram_device_ptr is happy to allocate the RAMBlock, it does not register the ram for migration. Do this by hand. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-04-22target/avr: Use do_stb in avr_cpu_do_interruptRichard Henderson1-6/+6
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-04-22target/avr: Use cpu_stb_mmuidx_ra in helper_fullwrRichard Henderson1-3/+7
Avoid direct use of address_space_memory. Make use of the softmmu cache of the i/o page. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-04-22target/avr: Remove NUMBER_OF_IO_REGISTERSRichard Henderson1-2/+0
This define is no longer used. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-04-22target/avr: Move cpu register accesses into system memoryRichard Henderson5-146/+131
Integrate the i/o 0x00-0x1f and 0x38-0x3f loopbacks into the cpu registers with normal address space accesses. We no longer need to trap accesses to the first page within avr_cpu_tlb_fill but can wait until a write occurs. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-04-22target/avr: Add defines for i/o port registersRichard Henderson2-18/+28
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-04-22target/avr: Remove OFFSET_CPU_REGISTERSRichard Henderson2-4/+1
This define isn't really used. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-04-22target/avr: Improve decode of LDS, STSRichard Henderson2-7/+2
The comment about not being able to define a field with zero bits is out of date since 94597b6146f3 ("decodetree: Allow !function with no input bits"). This fixes the missing load of imm in the disassembler. Cc: qemu-stable@nongnu.org Fixes: 9d8caa67a24 ("target/avr: Add support for disassembling via option '-d in_asm'") Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-04-22Open 10.1 development treeStefan Hajnoczi1-1/+1
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-04-22Update version for the v10.0.0 releaseStefan Hajnoczi1-1/+1
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-04-17