| cac08383 | 25-Jul-2025 |
Alex Bennée <alex.bennee@linaro.org> |
tests/functional: expose sys.argv to unittest.main
With this we can call the supported we can take advantage of the argument the module supports:
env PYTHONPATH=/home/alex/lsrc/qemu.git/python:/h
tests/functional: expose sys.argv to unittest.main
With this we can call the supported we can take advantage of the argument the module supports:
env PYTHONPATH=/home/alex/lsrc/qemu.git/python:/home/alex/lsrc/qemu.git/tests/functional ./pyvenv/bin/python /home/alex/lsrc/qemu.git/tests/functional/test_aarch64_kvm.py --help usage: test_aarch64_kvm.py [-h] [-v] [-q] [--locals] [--durations N] [-f] [-c] [-b] [-k TESTNAMEPATTERNS] [tests ...]
positional arguments: tests a list of any number of test modules, classes and test methods.
options: -h, --help show this help message and exit -v, --verbose Verbose output -q, --quiet Quiet output --locals Show local variables in tracebacks --durations N Show the N slowest test cases (N=0 for all) -f, --failfast Stop on first fail or error -c, --catch Catch Ctrl-C and display results so far -b, --buffer Buffer stdout and stderr during tests -k TESTNAMEPATTERNS Only run tests which match the given substring
Examples: test_aarch64_kvm.py test_module - run tests from test_module test_aarch64_kvm.py module.TestClass - run tests from module.TestClass test_aarch64_kvm.py module.Class.test_method - run specified test method test_aarch64_kvm.py path/to/test_file.py - run tests from test_file.py
usage: test_aarch64_kvm.py discover [-h] [-v] [-q] [--locals] [--durations N] [-f] [-c] [-b] [-k TESTNAMEPATTERNS] [-s START] [-p PATTERN] [-t TOP]
options: -h, --help show this help message and exit -v, --verbose Verbose output -q, --quiet Quiet output --locals Show local variables in tracebacks --durations N Show the N slowest test cases (N=0 for all) -f, --failfast Stop on first fail or error -c, --catch Catch Ctrl-C and display results so far -b, --buffer Buffer stdout and stderr during tests -k TESTNAMEPATTERNS Only run tests which match the given substring -s, --start-directory START Directory to start discovery ('.' default) -p, --pattern PATTERN Pattern to match tests ('test*.py' default) -t, --top-level-directory TOP Top level directory of project (defaults to start directory)
For test discovery all test modules must be importable from the top level directory of the project.
Suggested-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-ID: <20250725154517.3523095-15-alex.bennee@linaro.org>
show more ...
|
| c3fd296c | 15-Jul-2025 |
Daniel P. Berrangé <berrange@redhat.com> |
functional: always enable all python warnings
Of most importance is that this gives us a heads-up if anything we rely on has been deprecated. The default python behaviour only emits a warning if tri
functional: always enable all python warnings
Of most importance is that this gives us a heads-up if anything we rely on has been deprecated. The default python behaviour only emits a warning if triggered from __main__ which is very limited.
Setting the env variable further ensures that any python child processes will also display warnings.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250715143023.1851000-11-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
| 28adad0a | 12-Mar-2025 |
Nicholas Piggin <npiggin@gmail.com> |
tests/functional/asset: Add AssetError exception class
Assets are uniquely identified by human-readable-ish url, so make an AssetError exception class that prints url with error message.
A property
tests/functional/asset: Add AssetError exception class
Assets are uniquely identified by human-readable-ish url, so make an AssetError exception class that prints url with error message.
A property 'transient' is used to capture whether the client may retry or try again later, or if it is a serious and likely permanent error. This is used to retain the existing behaviour of treating HTTP errors other than 404 as 'transient' and not causing precache step to fail. Additionally, partial-downloads and stale asset caches that fail to resolve after the retry limit are now treated as transient and do not cause precache step to fail.
For background: The NetBSD archive is, at the time of writing, failing with short transfer. Retrying the fetch at that position (as wget does) results in a "503 backend unavailable" error. We would like to get that error code directly, but I have not found a way to do that with urllib, so treating the short-copy as a transient failure covers that case (and seems like a reasonable way to handle it in general).
Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Message-ID: <20250312130002.945508-4-npiggin@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
| 7524e1b3 | 12-Mar-2025 |
Nicholas Piggin <npiggin@gmail.com> |
tests/functional/asset: Verify downloaded size
If the server provides a Content-Length header, use that to verify the size of the downloaded file. This catches cases where the connection terminates
tests/functional/asset: Verify downloaded size
If the server provides a Content-Length header, use that to verify the size of the downloaded file. This catches cases where the connection terminates early, and gives the opportunity to retry. Without this, the checksum will likely mismatch and fail without retry.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Message-ID: <20250312130002.945508-3-npiggin@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
| ed557cc5 | 04-Mar-2025 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
tests/functional: Allow running TCG plugins tests on non-Linux/BSD hosts
Not all platforms use the '.so' suffix for shared libraries, which is how plugins are built. Use the recently introduced dso_
tests/functional: Allow running TCG plugins tests on non-Linux/BSD hosts
Not all platforms use the '.so' suffix for shared libraries, which is how plugins are built. Use the recently introduced dso_suffix() helper to get the proper host suffix.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2804 Suggested-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Suggested-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20250220080215.49165-4-philmd@linaro.org> [AJB: moved plugin_file into testcase.py] Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20250304222439.2035603-11-alex.bennee@linaro.org>
show more ...
|
| 2c92ecb6 | 27-Feb-2025 |
Thomas Huth <thuth@redhat.com> |
tests/functional: Move the code for testing HTTP downloads to a common function
We are going to use this code in other tests, too, so let's move it to the qemu_test module to be able to re-use it mo
tests/functional: Move the code for testing HTTP downloads to a common function
We are going to use this code in other tests, too, so let's move it to the qemu_test module to be able to re-use it more easily.
Message-ID: <20250227103915.19795-2-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
| 98139588 | 28-Feb-2025 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: stop output from zstd command when uncompressing
The zstd command will print incremental decompression progress to stderr when running. Fortunately it is not on stdout as that woul
tests/functional: stop output from zstd command when uncompressing
The zstd command will print incremental decompression progress to stderr when running. Fortunately it is not on stdout as that would confuse the TAP parsing, but we should still not have this printed. By switching from 'check_call' to 'run' with the check=True and capture_output=True we'll get the desired silence on success, and on failure the raised exception will automatically include stdout/stderr data for diagnosis purposes.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250228102738.3064045-8-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
| 8188356a | 28-Feb-2025 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: set 'qemu_bin' as an object level field
The 'qemu_bin' field is currently set on the class, despite being accessed as if it were an object instance field with 'self.qemu_bin'.
Thi
tests/functional: set 'qemu_bin' as an object level field
The 'qemu_bin' field is currently set on the class, despite being accessed as if it were an object instance field with 'self.qemu_bin'.
This is no obvious need to have it as a class field, so move it into the object instance.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20250228102738.3064045-3-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
| 257de641 | 22-Jan-2025 |
Thomas Huth <thuth@redhat.com> |
tests/functional: Fix broken decorators with lamda functions
The decorators that use a lambda function are currently broken and do not properly skip the test if the condition is not met. Using "retu
tests/functional: Fix broken decorators with lamda functions
The decorators that use a lambda function are currently broken and do not properly skip the test if the condition is not met. Using "return skipUnless(lambda: ...)" does not work as expected. To fix it, rewrite the decorators without lambda, it's simpler that way anyway.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250122134315.1448794-3-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
| 3b9ec25e | 08-Jan-2025 |
Alex Bennée <alex.bennee@linaro.org> |
tests/functional: update tuxruntest to use uncompress utility
Use the utility functions to reduce code duplication.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.benn
tests/functional: update tuxruntest to use uncompress utility
Use the utility functions to reduce code duplication.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20250108121054.1126164-21-alex.bennee@linaro.org>
show more ...
|