On 22/8/24 14:41, Thomas Huth wrote:
On 22/08/2024 14.07, Philippe Mathieu-Daudé wrote:
Straight forward conversion. Update the SHA1 hash to
SHA256 since SHA1 should not be used anymore nowadays.
Use has_cmd() and run_cmd() methods from 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>
---
...
@@ -100,12 +98,11 @@ def common_aarch64_virt(self, machine):
image_path = os.path.join(self.workdir, 'scratch.qcow2')
qemu_img = os.path.join(BUILD_DIR, 'qemu-img')
if not os.path.exists(qemu_img):
- qemu_img = find_command('qemu-img', False)
+ qemu_img = has_cmd('qemu-img')
As far as I can see, has_cmd() returns either True or False ...
Oops.
if qemu_img is False:
self.cancel('Could not find "qemu-img", which is
required to '
'create the temporary qcow2 image')
- cmd = '%s create -f qcow2 %s 8M' % (qemu_img, image_path)
- process.run(cmd)
+ run_cmd([qemu_img, 'create', '-f', 'qcow2', image_path, '8M'])
... so this seems wrong to me?
tests/avocado/avocado_qemu/__init__.py used to have a get_qemu_img()
function, maybe you could port that one over?
Good idea.