37e9b19c | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: replace 'run_cmd' with subprocess helpers
The 'run_cmd' helper is re-implementing a convenient helper that already exists in the form of the 'run' and 'check_call' methods provided
tests/functional: replace 'run_cmd' with subprocess helpers
The 'run_cmd' helper is re-implementing a convenient helper that already exists in the form of the 'run' and 'check_call' methods provided by 'subprocess'.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-29-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
3bb4c8b6 | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: drop back compat imports from utils.py
Now that all tests are converted over to the higher level wrapper functions, the back compat imports from utils.py are redundant.
Reviewed-b
tests/functional: drop back compat imports from utils.py
Now that all tests are converted over to the higher level wrapper functions, the back compat imports from utils.py are redundant.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-28-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
fd4abcb0 | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: add 'uncompress' to QemuBaseTest
This helper wrappers utils.uncompress, forcing the use of the scratch directory, to ensure any uncompressed files are cleaned at test termination.
tests/functional: add 'uncompress' to QemuBaseTest
This helper wrappers utils.uncompress, forcing the use of the scratch directory, to ensure any uncompressed files are cleaned at test termination.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-26-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
dd66e65f | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: add a generalized uncompress helper
There are many types of compression that the tests deal with, and it makes sense to have a single helper 'uncompress' that can deal with all.
R
tests/functional: add a generalized uncompress helper
There are many types of compression that the tests deal with, and it makes sense to have a single helper 'uncompress' that can deal with all.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-25-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
5831ed84 | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: convert tests to new archive_extract helper
Replace use of utils.archive_extract and extract_from_deb with the new archive_extract helper.
Reviewed-by: Thomas Huth <thuth@redhat.c
tests/functional: convert tests to new archive_extract helper
Replace use of utils.archive_extract and extract_from_deb with the new archive_extract helper.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-24-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
239fd29d | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: add 'archive_extract' to QemuBaseTest
This helper wrappers archive.archive_extract, forcing the use of the scratch directory, to ensure any extracted files are cleaned at test term
tests/functional: add 'archive_extract' to QemuBaseTest
This helper wrappers archive.archive_extract, forcing the use of the scratch directory, to ensure any extracted files are cleaned at test termination. If a specific member is requested, then the path to the extracted file is also returned.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-23-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
c283afbf | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: add a generalized archive_extract
There are many types of archives that the tests deal with. Provide a generalized 'archive_extract' that can detect the format and delegate to the
tests/functional: add a generalized archive_extract
There are many types of archives that the tests deal with. Provide a generalized 'archive_extract' that can detect the format and delegate to the appropriate helper for extraction. This ensures that all archive extraction code follows the same design pattern.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-22-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
c055f1d2 | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: let cpio_extract accept filenames
Currently cpio_extract differs from tar_extract/zip_extract in that it only allows a file-like object as input. Adapt it to also support filenames
tests/functional: let cpio_extract accept filenames
Currently cpio_extract differs from tar_extract/zip_extract in that it only allows a file-like object as input. Adapt it to also support filenames.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-21-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
512fe088 | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: add common deb_extract helper
This mirrors the existing archive_extract, cpio_extract and zip_extract helpers
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P.
tests/functional: add common deb_extract helper
This mirrors the existing archive_extract, cpio_extract and zip_extract helpers
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-20-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
379ee839 | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: add common zip_extract helper
This mirrors the existing archive_extract and cpio_extract helpers
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <ber
tests/functional: add common zip_extract helper
This mirrors the existing archive_extract and cpio_extract helpers
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-19-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
ba32e50a | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: move uncompress handling into new uncompress.py file
More uncompress related code will be added shortly, so having a separate file makes more sense.
The utils.py imports the funct
tests/functional: move uncompress handling into new uncompress.py file
More uncompress related code will be added shortly, so having a separate file makes more sense.
The utils.py imports the functions from archive.py, so that existing callers don't need to be modified. This avoids redundant code churn until later in the series when all calls will be adapted for other reasons.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-18-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
cfcb4484 | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: move archive handling into new archive.py file
More archive related code will be added shortly, so having a separate file makes more sense.
The utils.py imports the functions from
tests/functional: move archive handling into new archive.py file
More archive related code will be added shortly, so having a separate file makes more sense.
The utils.py imports the functions from archive.py, so that existing callers don't need to be modified. This avoids redundant code churn until later in the series when all calls will be adapted for other reasons.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-17-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
beaf88c8 | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: switch over to using self.scratch_file()
Replace any instances of
os.path.join(self.workdir, ".../...") self.workdir + "/.../..."
with
self.scratch_file("...", "...")
whi
tests/functional: switch over to using self.scratch_file()
Replace any instances of
os.path.join(self.workdir, ".../...") self.workdir + "/.../..."
with
self.scratch_file("...", "...")
which is more compact and portable
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-15-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
8b5a0dd3 | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: switch over to using self.build_file(...)
This removes direct access of the 'BUILD_DIR' variable.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <be
tests/functional: switch over to using self.build_file(...)
This removes direct access of the 'BUILD_DIR' variable.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-13-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
bcc12768 | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: switch over to using self.log_file(...)
This removes direct access of the 'self.logdir' variable.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <be
tests/functional: switch over to using self.log_file(...)
This removes direct access of the 'self.logdir' variable.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-12-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
f84f8e71 | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: add helpers for building file paths
Add helper methods that construct paths for
* log files - to be preserved at the end of a test * scratch files - to be purged at the end of a
tests/functional: add helpers for building file paths
Add helper methods that construct paths for
* log files - to be preserved at the end of a test * scratch files - to be purged at the end of a test * build files - anything relative to the build root * data files - anything relative to the functional test source root * socket files - a short temporary dir to avoid UNIX socket limits
These are to be used instead of direct access to the self.workdir, or self.logdir variables, or any other place where paths are built manually.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-11-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
9132fff8 | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: drop 'has_cmd' and 'has_cmds' helpers
The 'which' helper is simpler, not depending on the external 'which' binary, and is sufficient for test needs.
Reviewed-by: Thomas Huth <thut
tests/functional: drop 'has_cmd' and 'has_cmds' helpers
The 'which' helper is simpler, not depending on the external 'which' binary, and is sufficient for test needs.
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-10-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
3ea06d65 | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: introduce some helpful decorators
Reduce repeated boilerplate with some helper decorators:
@skipIfNotPlatform("x86_64", "aarch64")
=> Skip unless the build host platform match
tests/functional: introduce some helpful decorators
Reduce repeated boilerplate with some helper decorators:
@skipIfNotPlatform("x86_64", "aarch64")
=> Skip unless the build host platform matches
@skipIfMissingCommands("mkisofs", "losetup")
=> Skips unless all listed commands are found in $PATH
@skipIfMissingImports("numpy", "cv2")
=> Skips unless all listed modules can be imported
@skipFlakyTest("https://gitlab.com/qemu-project/qemu/-/issues/NNN")
=> Skips unless env var requests flaky tests with the reason documented in the referenced gitlab bug
@skipBigData
=> Skips unless env var permits tests creating big data files
@skipUntrustedTest
=> Skips unless env var permits tests which are potentially dangerous to the host
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-8-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
c54edc71 | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: drop 'tesseract_available' helper
Platforms we target have new enough tesseract that it suffices to merely check if the binary exists.
Signed-off-by: Daniel P. Berrangé <berrange@
tests/functional: drop 'tesseract_available' helper
Platforms we target have new enough tesseract that it suffices to merely check if the binary exists.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20241217155953.3950506-7-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
dd6dfc01 | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: simplify 'which' implementation
The 'access' check implies the file exists.
Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.or
tests/functional: simplify 'which' implementation
The 'access' check implies the file exists.
Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-6-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
0da341a7 | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: remove duplicated 'which' function impl
Put the 'which' function into shared code.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Daniel P. Berrangé
tests/functional: remove duplicated 'which' function impl
Put the 'which' function into shared code.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-5-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
c27f452d | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: resolve str(Asset) to cache file path
Allow an Asset object to be used in place of a filename but making its string representation resolve to the cache file path.
Signed-off-by: D
tests/functional: resolve str(Asset) to cache file path
Allow an Asset object to be used in place of a filename but making its string representation resolve to the cache file path.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20241217155953.3950506-4-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
8a6253a4 | 17-Dec-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: remove many unused imports
Identified using 'pylint --disable=all --enable=W0611'
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.co
tests/functional: remove many unused imports
Identified using 'pylint --disable=all --enable=W0611'
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-3-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
f5578e42 | 21-Nov-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: avoid accessing log_filename on earlier failures
If a failure occurs early in the QemuBaseTest constructor, the 'log_filename' object atttribute may not exist yet. This happens mos
tests/functional: avoid accessing log_filename on earlier failures
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>
show more ...
|
1a8755a5 | 21-Nov-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
tests/functional: add a QMP backdoor for debugging stalled tests
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
tests/functional: add a QMP backdoor for debugging stalled tests
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>
show more ...
|