Fix test_vmdk_bad_descriptor_mem_limit and test_vmdk_bad_descriptor_mem_limit_stream_optimized

These tests depend on qemu-img being installed and in the path, if it is not installed, skip them.

Change-Id: I896f16c512f24bcdd898ab002af4e5e068f66b64
Closes-bug: #2073862
Signed-off-by: Julien Le Jeune <julien.le-jeune@ovhcloud.com>
(cherry picked from commit a3202f7bf9)
(cherry picked from commit c782f0e6a0)
This commit is contained in:
Julien Le Jeune 2024-07-15 14:10:43 +02:00
parent 45d9489383
commit 828a5d0786
No known key found for this signature in database
GPG Key ID: EB59AD4164D3F024

View File

@ -179,10 +179,16 @@ class TestFormatInspectors(test.NoDBTestCase):
shell=True) shell=True)
# Convert it to VMDK # Convert it to VMDK
subprocess.check_output( # these tests depend on qemu-img
'qemu-img convert -f raw -O vmdk -o subformat=%s -S 0 %s %s' % ( # being installed and in the path,
subformat, raw, fn), # if it is not installed, skip
shell=True) try:
subprocess.check_output(
'qemu-img convert -f raw -O vmdk -o subformat=%s -S 0 %s %s'
% (subformat, raw, fn),
shell=True)
except Exception:
self.skipTest("qemu-img not installed")
return fn return fn
def _test_format_at_block_size(self, format_name, img, block_size): def _test_format_at_block_size(self, format_name, img, block_size):