aboutsummaryrefslogtreecommitdiff
path: root/tests/functional
AgeCommit message (Collapse)Author
2024-12-02tests/functional: increase timeouts for arm sx1 testDaniel P. Berrangé
When under high load the test VM does not complete running in the default 30 second timeout. Double it to give more headroom. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241129173120.761728-2-berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-12-02tests/functional/test_virtio_version: Check for the availability of the machineThomas Huth
Use self_set_machine() to set and check for the availability of the default pc machine (so that the test is not failing if the machine has not been included in the QEMU binary). Message-ID: <20241128120142.593408-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-12-02tests/functional/test_acpi_bits: Turn the test into a QemuSystemTestThomas Huth
By using QemuSystemTest as a base class, we can use the set_machine() command to check whether the required machine is available in the binary (otherwise this test is failing when QEMU has been compiled without the default 'pc' machine type). Message-ID: <20241128115019.591362-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Ani Sinha <anisinha@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-11-27tests/functional: Remove sleep workarounds from sh4 testCédric Le Goater
These were introduced in the avocado tests to workaround read issues when interacting with console. They are no longer necessary and we can use the expected login string instead. Test always passes now. Remove skipUnless test on QEMU_TEST_FLAKY_TESTS. Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241122141827.2039984-1-clg@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-11-27tests/functional: Fix the running test case causes loongarch64 to hangXianglai Li
There is a bug in the process of resolving the serial port base address in the fdt of the loongarch VM UEFI. When both serial port information and rng-seed information are chosen in the fdt, there is a probability that the serial port base address cannot be resolved correctly. This problem can be fixed by updating UEFI. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2686 Signed-off-by: Xianglai Li <lixianglai@loongson.cn> Message-ID: <20241127013438.2206426-1-lixianglai@loongson.cn> Tested-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-11-25tests/functional: Remove sleep workarounds from Aspeed testsCédric Le Goater
These were introduced in the avocado tests to workaround read issues when interacting with console. They are no longer necessary and we can use the expected "login:" string or the command prompt now. Drop the last use of exec_command. Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20241122090322.1934697-4-clg@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2024-11-25tests/functional: Convert Aspeed arm SDK testsCédric Le Goater
Drop the SSH connection which was introduced in the avocado tests to workaround read issues when interacting with console. EXTRA_BOOTARGS was introduced to reduce the console output at Linux boot time. This didn't have the desired effect as we still had issues when trying to match patterns on the console and we had to use the ssh connection as a workaround. While at it, remove the U-Boot EXTRA_BOOTARGS variable which has become useless. Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20241122090322.1934697-3-clg@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2024-11-25tests/functional: Convert Aspeed aarch64 SDK testsCédric Le Goater
Drop the SSH connection which was introduced in the avocado tests to workaround read issues when interacting with console. Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20241122090322.1934697-2-clg@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2024-11-25tests/functional: update the aarch64 tuxrun testsAlex Bennée
Now there are new up to date images available we should update to them. With the new rootfs the blk I/O errors also go away on arm64be. Cc: Anders Roxell <anders.roxell@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-22-alex.bennee@linaro.org>
2024-11-25tests/functional: Convert the Avocado aarch64 tuxrun testsThomas Huth
Move the tests to a new file so that they can be run via qemu-system-aarch64 in the functional framework. Since these were the last tests in tests/avocado/tuxrun_baselines.py, we can now remove that file, too. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-20-alex.bennee@linaro.org>
2024-11-25tests/functional: avoid accessing log_filename on earlier failuresDaniel P. Berrangé
If a failure occurs early in the QemuBaseTest constructor, the 'log_filename' object atttribute may not exist yet. This happens most notably if the QEMU_TEST_QEMU_BINARY is not set. We can't initialize 'log_filename' earlier as we use the binary to identify the architecture which is then used to build the path in which the logs are stored. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-19-berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-19-alex.bennee@linaro.org>
2024-11-25tests/functional: add a QMP backdoor for debugging stalled testsDaniel P. Berrangé
Support the QEMU_TEST_QMP_BACKDOOR=backdoor.sock env variable as a way to get a QMP backdoor for debugging a stalled QEMU test. Most typically this would be used if running the tests directly: $ QEMU_TEST_QMP_BACKDOOR=backdoor.sock \ QEMU_TEST_QEMU_BINARY=./build/qemu-system-arm \ PYTHONPATH=./python \ ./tests/functional/test_arm_tuxrun.py And then, when the test stalls, in a second shell run: $ ./scripts/qmp/qmp-shell backdoor.sock Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-18-berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-18-alex.bennee@linaro.org>
2024-11-25tests/functional: remove time.sleep usage from tuxrun testsDaniel P. Berrangé
The tuxrun tests send a series of strings to the guest to login and then run commands. Since we have been unable to match on console output that isn't followed by a newline, the test used many time.sleep() statements to pretend to synchronize with the guest. This has proved to be unreliable for the aarch64be instance of the tuxrun tests, with the test often hanging. The hang is a very subtle timing problem, and it is suspected that some (otherwise apparently harmless) I/O error messages could be resulting in full FIFO buffers, stalling interaction with the guest. With the newly rewritten console interaction able to match strings that don't have a following newline, the tux run tests can now match directly on the login prompt, and/or shell PS1 prompt. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2689 Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-17-berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-17-alex.bennee@linaro.org>
2024-11-25tests/functional: rewrite console handling to be bytewiseDaniel P. Berrangé
The console interaction that waits for predicted strings uses readline(), and thus is only capable of waiting for strings that are followed by a newline. This is inconvenient when needing to match on some things, particularly login prompts, or shell prompts, causing tests to use time.sleep(...) instead, which is unreliable. Switch to reading the console 1 byte at a time, comparing against the success/failure messages until we see a match, regardless of whether a newline is encountered. The success/failure comparisons are done with the python bytes type, rather than strings, to avoid the problem of needing to decode partially received multibyte utf8 characters. Heavily inspired by a patch proposed by Cédric, but written again to work in bytes, rather than strings. Co-developed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-16-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-16-alex.bennee@linaro.org>
2024-11-25tests/functional: require non-NULL success_message for console waitDaniel P. Berrangé
When waiting for expected output, the 'success_message' is a mandatory parameter, with 'failure_message' defaulting to None. The code has logic which indicates it was trying to cope with 'success_message' being None and 'failure_message' being non-None but it does not appear able to actually do anything useful. The check for 'success_message is None' will break out of the loop before any check for 'failure_message' has been performed. IOW, for practcal purposes 'success_message' must be non-None unless 'send_string' is set. Assert this expectation and simplify the loop logic. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-15-berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-15-alex.bennee@linaro.org>
2024-11-25tests/functional: don't try to wait for the empty stringDaniel P. Berrangé
Telling exec_command_wand_wait_for_pattern to wait for the empty string does not make any conceptual sense, as a check for empty string will always succeed. It makes even less sense when followed by a call to wait_for_console_pattern() with a real match. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-14-berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-14-alex.bennee@linaro.org>
2024-11-25tests/functional: logs details of console interaction operationsDaniel P. Berrangé
When functional tests go wrong, it will often be related to the console interaction wait state. By logging the messages that we're looking for, and data we're about to be sending, it'll be easier to diagnose where tests are getting stuck. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-13-berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-13-alex.bennee@linaro.org>
2024-11-25tests/functional: enable debug logging for QEMUMachineDaniel P. Berrangé
Set the 'qemu.machine' logger to 'DEBUG' level, to ensure we see log messages related to the QEMUMachine class. Most importantly this ensures we capture the full QEMU command line args for instances we spawn. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-12-berrange@redhat.com> Tested-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20241121165806.476008-12-alex.bennee@linaro.org>
2024-11-25tests/functional: honour requested test VM name in QEMUMachineDaniel P. Berrangé
The functional test case class is going to the trouble of passing around a machine name, but then fails to give this QEMUMachine. As a result, QEMUMachine will create a completely random name. Since log file names match the machine name, this results in log files accumulating over time. Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-11-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-11-alex.bennee@linaro.org>
2024-11-25tests/functional: put QEMUMachine logs in testcase log directoryDaniel P. Berrangé
We are not passing the 'log_dir' parameter to QEMUMachine, so the QEMU stdout/err logs are being placed in a temp directory and thus deleted after execution. This makes them inaccessible as gitlab CI artifacts. Pass the testcase log directory path into QEMUMachine to make the logs persistent. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-10-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-10-alex.bennee@linaro.org>
2024-11-25tests/functional: honour self.workdir in ACPI bits testsDaniel P. Berrangé
The ACPI bits test sets up its own private temporary directory into it creates scratch files. This is justified by a suggestion that we need to be able to preserve the scratch files. We have the ability to preserve the scratch dir with our functional harness, so there's no reason to diverge from standard practice in file placement. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-9-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-9-alex.bennee@linaro.org>
2024-11-25tests/functional: remove comments talking about avocadoDaniel P. Berrangé
The first comment is still relevant but should talk about our own test harness instead. The second comment adds no value over reading the code and can be removed. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-8-berrange@redhat.com> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-8-alex.bennee@linaro.org>
2024-11-25tests/functional: remove obsolete reference to avocado bugDaniel P. Berrangé
Historical bugs in avocado related to zstd support are not relevant to the code now that it uses QEMU's native test harness. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-7-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-7-alex.bennee@linaro.org>
2024-11-25tests/functional: remove leftover :avocado: tagsDaniel P. Berrangé
These tags are not honoured under the new functional test harness. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-6-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-6-alex.bennee@linaro.org>
2024-11-25tests/functional: remove todo wrt avocado.utils.wait_forDaniel P. Berrangé
We're not using avocado anymore, so while the TODO item is still relevant, suggesting use of avocado.utils is not. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-5-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-5-alex.bennee@linaro.org>
2024-11-25tests/functional: remove "AVOCADO" from env variable nameDaniel P. Berrangé
This env variable is a debugging flag to save screendumps in the mips64el malta tests. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-4-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-4-alex.bennee@linaro.org>
2024-11-25tests/functional: automatically clean up scratch files after testsDaniel P. Berrangé
The build/tests/functional subdirectories are consuming huge amounts of disk space. Split the location for scratch files into a 'scratch' sub-directory, separate from log files, and delete it upon completion of each test. The new env variable QEMU_TEST_KEEP_SCRATCH can be set to preserve this scratch dir for debugging access if required. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-3-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-3-alex.bennee@linaro.org>
2024-11-25tests/functional: fix mips64el test to honour workdirDaniel P. Berrangé
The missing directory separator resulted in the kernel file being created 1 level higher than expected. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-2-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-2-alex.bennee@linaro.org>
2024-11-08Merge tag 'pull-request-2024-11-08' of https://gitlab.com/thuth/qemu into ↵Peter Maydell
staging * Various fixes and improvements for the functional tests * Refresh CI container files with the latest changes from libvirt-ci * Clean up keyboard code of the next-cube machine to get rid of a legacy API # -----BEGIN PGP SIGNATURE----- # # iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmct48QRHHRodXRoQHJl # ZGhhdC5jb20ACgkQLtnXdP5wLbUAzw//fOgAe+rNX10KIEWaHzTlw6EPRUHbKEo+ # yvy9mZ4CYiK3PfojuW6u9Mt32RIGFjLRUPC+ljZggjbxY2DUjzAUGx/kSwf0bzwE # 8eRKRvd+l3ZFKklwDd7YQh+/O38P/uAq+T0AZQv/9h7rr0wPD6O+sVpKjVN4akuh # 66Ekz974bDFaVJi8iIix0WCPCUFMZwWQqxaQrnoBH3wN8Ibc6Ermchs7aa1e6KNh # DoX519JVNofXbugONNnqEjp43tbx/hzPZFyWf9tyX8ehp6+8po0zcZZwqdRkWhuv # BkESKPz8rHuQOGMjm8rAnjmDEsbpJ+vOfn/ShdyAERv78mTNWwSvYVwq5zfpcTCt # 9gpCNhhFzFLKlbDeIfgy9ky4R8Gzrww3icLzCsLlat6YCK547YkSr57BsYXJzLX4 # /NUYsaJ1RPdutwgNnmSzhBhObtUik3rFYH5aD0ETWZBdVY8ig5OqGpJ29P5zo860 # ROVFn4RX/XpmODOpYez4dwKVetR5SLHNG1aqduWKOwhAxPzLxK5OghjYkGf0bsel # gA9t7A1TafgneYxJARKi7esD39xeUzhfzdzCOIOLXJga5kD2/bvZnQ4tkoLPl8QR # iQEp1z758XmSFTYfzGUDA7SgIOzi9JG5dqtzcqJklr9wYurxwMYmqicJqA4ImoQt # fZV/axe8Em0= # =YRCB # -----END PGP SIGNATURE----- # gpg: Signature made Fri 08 Nov 2024 10:11:16 GMT # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "thuth@redhat.com" # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full] # gpg: aka "Thomas Huth <thuth@redhat.com>" [full] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * tag 'pull-request-2024-11-08' of https://gitlab.com/thuth/qemu: ui/input-legacy.c: remove unused legacy qemu_add_kbd_event_handler() function next-kbd: convert to use qemu_input_handler_register() tests: refresh package lists with latest libvirt-ci tests/functional: Split the test_aarch64_sbsaref test tests/functional: Bump timeouts of functional tests tests/functional: Provide the user with hints where to find more log files tests/functional: Fix the ppc64_hv and the ppc_40p test for read-only assets test/functional: Fix Aspeed buildroot tests tests/functional: Convert the riscv_opensbi avocado test into a standalone test scripts/checkpatch.pl: Ignore ObjC #import lines for operator spacing Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2024-11-08tests/functional: Split the test_aarch64_sbsaref testThomas Huth
The test_aarch64_sbsaref test is the test with the longest runtime in our functional test suite. Split it into parts so that it can be run on multiple CPUs in parallel. For this we have to move the fetch_firmware() function out of the class definition to be able to reuse it easily from the other tests (deriving the Aarch64SbsarefAlpine and Aarch64SbsarefFreeBSD directly from Aarch64SbsarefMachine does not work, unfortunately, since we'd inherit the test_sbsaref_edk2_firmware() function that way, causing it to be run multiple times - and keeping the fetch_firmware() in a separate class without the test_sbsaref_edk2_firmware() function also does not work since the "make precache-functional" won't work in that case ==> turning fetch_firmware() into a static function is the best option). Message-ID: <20241106175029.1000589-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-11-08tests/functional: Bump timeouts of functional testsThomas Huth
When building QEMU with "--enable-debug" and running the tests in parallel with "make -j$(nproc) check-functional", many tests are still timing out due to our conservative timeout settings. Bump the timeouts of the problematic tests and also increase the default timeout to 90 seconds (from 60 seconds) to be on the safe side. Message-ID: <20241106170946.990731-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-11-08tests/functional: Provide the user with hints where to find more log filesThomas Huth
Since the base.log and console.log files are not referenced from the meson test logs yet, they might be hard to find for the casual users. Thus let's print some hints in case a test case failed. For this we have to run unittest.main() with exit=False to get the results of the testing. Then we can iterate through the failed test cases to print out the information accordingly. Message-ID: <20241105123849.359391-1-thuth@redhat.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Tested-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-11-08tests/functional: Fix the ppc64_hv and the ppc_40p test for read-only assetsThomas Huth
Since commit 786bc2255256, cached asset files are read-only, so now we've got to use "read-only=true" in tests that try to use these files directly. Fixes: 786bc22552 ("tests/functional: make cached asset files read-only") Message-ID: <20241105160926.393852-1-thuth@redhat.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-11-08test/functional: Fix Aspeed buildroot testsCédric Le Goater
Since commit 786bc2255256, cached asset files are read-only. Adjust the QEMU command line for buildroot tests to reflect the new constraint on the flash drive. Fixes: f04cb2d00d5c ("tests/functional: Convert most Aspeed machine tests") Suggested-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241105132339.2967202-1-clg@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-11-08tests/functional: Convert the riscv_opensbi avocado test into a standalone testThomas Huth
The avocado test defined test functions for both, riscv32 and riscv64. Since we can run the whole file with multiple targets in the new framework, we can now consolidate the functions so we have to only define one function per machine now. Message-ID: <20240821082748.65853-23-thuth@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-11-07Merge tag 'pull-tpm-2024-11-07-2' of ↵Peter Maydell
https://github.com/stefanberger/qemu-tpm into staging Merge test 2024/11/07 v2 # -----BEGIN PGP SIGNATURE----- # # iQEzBAABCAAdFiEEuBi5yt+QicLVzsZrda1lgCoLQhEFAmcs1YAACgkQda1lgCoL # QhFPbAgA71gnxNjOEIlDwTbFPkS8mj4mtRryp96UN6v+XYEB0RL2uSEwcCJfQ+Cd # Xbo0/g1GKNFtf9fsn16M2uxPh8VlcwBF7diboN5sGNVRJGgshD5ynedW/9T3Vyds # 1elahNl/FjqIgcBo9GbAVumcC0TY/8w+BwKG1HQaP0TWSVQQzUfxz3wiVFLJh7Oe # oxUTvyz0gWFKAqX5rTptWRitfew/xA7LimP0gdl1pVp3mkBS8KiPUdqx+LQ/OsFe # Gn4JybDhNYdyf8VbcQK5LQKAGVcLLGDtxp5DNdu3fk+LFkqYy4V0AyxxyyU70/OY # j9+H7nJTlf8pf5s5UrhYADyIvlW+LQ== # =lGlS # -----END PGP SIGNATURE----- # gpg: Signature made Thu 07 Nov 2024 14:58:08 GMT # gpg: using RSA key B818B9CADF9089C2D5CEC66B75AD65802A0B4211 # gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: B818 B9CA DF90 89C2 D5CE C66B 75AD 6580 2A0B 4211 * tag 'pull-tpm-2024-11-07-2' of https://github.com/stefanberger/qemu-tpm: tests: Adjust path for swtpm state to use path under /var/tmp/ Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2024-11-07tests: Adjust path for swtpm state to use path under /var/tmp/Stefan Berger
To avoid AppArmor-related test failures when functional test are run from somewhere under /mnt, adjust the path to swtpm's state to use an AppArmor- supported path, such as /var/tmp, which is provided by the python function tempfile.TemporaryDirectory(). An update to swtpm's AppArmor profile is also being done to support /var/tmp. Link: https://lore.kernel.org/qemu-devel/CAFEAcA8A=kWLtTZ+nua-MpzqkaEjW5srOYZruZnE2tB6vmoMig@mail.gmail.com/ Link: https://github.com/stefanberger/swtpm/pull/944 Tested-by: Peter Maydell <peter.maydell@linaro.org> Fixes: f04cb2d00d5c ("tests/functional: Convert most Aspeed machine tests") Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-11-07tests/functional: Convert the RV32-on-RV64 riscv testThomas Huth
A straggler that has been added to the Avocado framework while the conversion to the functional framework was already in progress... Move it over now, too! Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com> Message-ID: <20241105103519.341304-1-thuth@redhat.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2024-11-04tests/functional: Convert the OrangePi tests to the functional frameworkThomas Huth
Move the OrangePi tests from tests/avocado/boot_linux_console.py into a new file dedicated for OrangePi tests in the functional framework and update the hash sums of the assets to sha256 along the way. For the buildroot image and the Armbian image, we've got to switch to a newer version since the old images have been removed from the server, and the NetBSD image has been moved to the archive, so we need to update this URL as well. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241029092440.25021-3-thuth@redhat.com>
2024-11-04tests/functional: Convert BananaPi tests to the functional frameworkThomas Huth
Move the BananaPi tests from tests/avocado/boot_linux_console.py into a new file dedicated for Banana Pi tests in the functional framework. Update the hash sums of the assets to sha256 along the way and fix the broken link for the buildroot image from storage.kernelci.org. (Note: The test_arm_bpim2u_openwrt_22_03_3 test is currently broken due to a regression in commit 4c2c047469 ("target/arm: Fix usage of MMU indexes when EL3 is AArch32") - it works if that commit gets reverted) Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241029092440.25021-2-thuth@redhat.com>
2024-11-04tests/functional: Convert the tcg_plugins testThomas Huth
A straight forward conversion, only the usual changes were required here (i.e. adjustment for asset downloading, machine selection). Message-ID: <20241023051754.813412-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-11-04tests/functional: Fix the s390x and ppc64 tuxrun testsThomas Huth
I forgot to add the tests to the meson.build file and looks like I even managed to somehow mix up the hashsums in the ppc64 test! Message-ID: <20241023141919.930689-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-11-04tests/functional: Add a test for sh4ebThomas Huth
Now that we are aware of binaries that are available for sh4eb, we should make sure that there are no regressions with this target and test it regularly in our CI. Message-ID: <20241024082735.42324-3-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-11-04tests/functional: make cached asset files read-onlyDaniel P. Berrangé
This ensures that if a functional test runs QEMU with a writable disk pointing to a cached asset, an error will be reported, rather than silently modifying the cache file. As an example, tweaking test_sbsaref.py to set snapshot=off, results in a clear error: Command: ./build/qemu-system-aarch64 ...snip... -drive file=/var/home/berrange/.cache/qemu/download/44cdbae275ef1bb6dab1d5fbb59473d4f741e1c8ea8a80fd9e906b531d6ad461,format=raw,snapshot=off -cpu max,pauth=off Output: qemu-system-aarch64: Could not open '/var/home/berrange/.cache/qemu/download/44cdbae275ef1bb6dab1d5fbb59473d4f741e1c8ea8a80fd9e906b531d6ad461': Permission denied Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241025092659.2312118-3-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-11-04tests/functional: make tuxrun disk images writableDaniel P. Berrangé
The zstd command will preserve the input archive permissions on the output file. So when we decompress the readonly cached image, the resulting per-test run private disk image will also be readonly. We need it to be writable, so make it so. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241025092659.2312118-2-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-10-29tests/functional: Add a functional test for the sx1 boardPeter Maydell
Add a functional test for the sx1 board that uses the kernel and rootfs provided by Guenter Roeck in the linux-test-downloads repo: https://github.com/groeck/linux-test-downloads/ We have three variants of the test for this board: * just boot initrd * boot with filesystem on SD card * boot from flash In all cases these images have a userspace that is configured to immediately reboot the system on successful boot, and the board itself supports telling QEMU to do the reboot, so we only need to wait for QEMU to exit (via -no-reboot). Since there are three subtests, the test as a whole takes about 80s on my local machine. That's about the same as the aarch64_virt test, so give it the same overall test timeout as that one. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 20241017163247.711244-3-peter.maydell@linaro.org
2024-10-29tests/functional: Add a functional test for the collie boardPeter Maydell
Add a functional test for the collie board that uses the kernel and rootfs provided by Guenter Roeck in the linux-test-downloads repo: https://github.com/groeck/linux-test-downloads/ This just boots Linux with a userspace that immediately reboots the board, so we wait for the reboot log line. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 20241017163247.711244-2-peter.maydell@linaro.org
2024-10-24tests/functional: Convert most Aspeed machine testsCédric Le Goater
This is a simple conversion of the tests with some cleanups and adjustments to match the new test framework. Replace the zephyr image MD5 hashes with SHA256 hashes while at it. The SDK tests depend on a ssh class from avocado.utils which is difficult to replace. To be addressed separately. Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Thomas Huth <thuth@redhat.com>
2024-10-21tests/functional: Convert the Avocado sh4 tuxrun testThomas Huth
Move the test into a new file so that it can be run via qemu-system-sh4 in the functional framework. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-18-thuth@redhat.com>
2024-10-21tests/functional: Convert the Avocado ppc32 tuxrun testThomas Huth
Move the test into a new file so that it can be run via qemu-system-ppc in the functional framework. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-16-thuth@redhat.com>