tests/functional: Convert Aarch64 Virt machine avocado tests
PATCH 1/1 tests/functional: Convert Aarch64 Virt machine avocado tests
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
---
Based-on: <[email protected]>
---
MAINTAINERS | 2 +-
tests/functional/meson.build | 2 +
.../test_aarch64_virt.py} | 63 ++++++++-----------
3 files changed, 29 insertions(+), 38 deletions(-)
rename tests/{avocado/machine_aarch64_virt.py => functional/test_aarch64_virt.py} (74%)
mode change 100644 => 100755MAINTAINERS +1 -1
@@ -1023,7 +1023,7 @@ S: Maintained F: hw/arm/virt* F: include/hw/arm/virt.h F: docs/system/arm/virt.rst -F: tests/avocado/machine_aarch64_virt.py +F: tests/functional/test_aarch64_virt.py Xilinx Zynq M: Edgar E. Iglesias <[email protected]>
tests/functional/meson.build +2 -0
@@ -12,6 +12,7 @@ endif # Timeouts for individual tests that can be slow e.g. with debugging enabled test_timeouts = { 'aarch64_sbsaref' : 18000, + 'aarch64_virt' : 360, 'acpi_bits' : 240, 'netdev_ethtool' : 180, 'ppc_40p' : 240,
@@ -29,6 +30,7 @@ tests_generic = [ tests_aarch64_thorough = [ 'aarch64_sbsaref', + 'aarch64_virt', ] tests_arm_thorough = [
tests/functional/test_aarch64_virt.py renamed from tests/avocado/machine_aarch64_virt.py +26 -37
112 lines not on this page · raw message
Signature · 1 line
2.45.2
Quoted 15 lines · Philippe Mathieu-Daudé
Straight forward conversion. Update the SHA1 hash to SHA256 since SHA1 should not be used anymore nowadays. Use
has_cmd()andrun_cmd()methods fromqemu_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 passedSigned-off-by Philippe Mathieu-Daudé <[email protected]>---
Based-on: <[email protected]>
---
...
tests/functional/test_aarch64_virt.py def common_aarch64_virt(self, machine): · line 101
Quoted 6 lines
tests/functional/test_aarch64_virt.py renamed from tests/avocado/machine_aarch64_virt.py +1
-1@@ -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 ...
tests/functional/test_aarch64_virt.py def common_aarch64_virt(self, machine): · line 105
Quoted 6 lines
tests/functional/test_aarch64_virt.py renamed from tests/avocado/machine_aarch64_virt.py +1
-2if 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?
Thomas
Quoted 17 lines · Thomas Huth
Quoted 15 lines · Philippe Mathieu-Daudé
Straight forward conversion. Update the SHA1 hash to SHA256 since SHA1 should not be used anymore nowadays. Use
has_cmd()andrun_cmd()methods fromqemu_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 passedSigned-off-by Philippe Mathieu-Daudé <[email protected]>---
Based-on: <[email protected]>
---...
Quoted 8 lines
Quoted 6 lines
tests/functional/test_aarch64_virt.py renamed from tests/avocado/machine_aarch64_virt.py +0
-0@@ -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.
Quoted 11 lines
Quoted 7 lines
if
qemu_imgis 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__.pyused to have aget_qemu_img()function, maybe you could port that one over?
Good idea.