On 23/08/2024 10.24, Philippe Mathieu-Daudé wrote:
Straight forward conversion. Update the SHA1 hash to
SHA256 since SHA1 should not be used anymore nowadays.
Provide get_qemu_img() helper in qemu_test.
$ make check-functional-aarch64 V=1
...
▶ 1/4 test_aarch64_virt.Aarch64VirtMachine.test_aarch64_virt_gicv2
OK
▶ 1/4 test_aarch64_virt.Aarch64VirtMachine.test_aarch64_virt_gicv3
OK
▶ 1/4 test_aarch64_virt.Aarch64VirtMachine.test_alpine_virt_tcg_gic_max
OK
1/4 qemu:func-thorough+func-aarch64-thorough+thorough /
func-aarch64-aarch64_virt OK 30.44s 3 subtests passed
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
Based-on: <20240822114146.86838-1-phi...@linaro.org>
---
MAINTAINERS | 2 +-
tests/functional/meson.build | 2 +
tests/functional/qemu_test/__init__.py | 2 +-
tests/functional/qemu_test/cmd.py | 15 ++++
.../test_aarch64_virt.py} | 69 ++++++++-----------
5 files changed, 46 insertions(+), 44 deletions(-)
rename tests/{avocado/machine_aarch64_virt.py =>
functional/test_aarch64_virt.py} (69%)
mode change 100644 => 100755
...
@@ -176,3 +178,16 @@ def exec_command_and_wait_for_pattern(test, command,
:param failure_message: if this message appears, test fails
"""
_console_interaction(test, success_message, failure_message, command +
'\r')
+
+def get_qemu_img(test):
+ test.log.debug('Looking for and selecting a qemu-img binary')
+
+ # If qemu-img has been built, use it, otherwise the system wide one
+ # will be used.
+ qemu_img = os.path.join(BUILD_DIR, 'qemu-img')
+ if os.path.exists(qemu_img):
+ return qemu_img
+ if has_cmd('qemu-img'):
+ return 'qemu-img'
+ test.cancel('Could not find "qemu-img", which is required to '
+ 'create temporary images')
Please use self.skipTest() instead ... cancel() was something from the
Avocado framework only.
Apart from that the patch looks fine to me now, thanks!
Thomas