iotests: Check whether luks works

Whenever running an iotest for the luks format, we should check whether
luks actually really works.

Tests that try to create luks-encrypted qcow2 images should do the same.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200625125548.870061-7-mreitz@redhat.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
This commit is contained in:
Max Reitz 2020-06-25 14:55:35 +02:00
parent 6649f4bd29
commit d2a839ede8
10 changed files with 16 additions and 0 deletions

View file

@ -1010,12 +1010,17 @@ def _verify_image_format(supported_fmts: Sequence[str] = (),
# similar to
# _supported_fmt generic
# for bash tests
if imgfmt == 'luks':
verify_working_luks()
return
not_sup = supported_fmts and (imgfmt not in supported_fmts)
if not_sup or (imgfmt in unsupported_fmts):
notrun('not suitable for this image format: %s' % imgfmt)
if imgfmt == 'luks':
verify_working_luks()
def _verify_protocol(supported: Sequence[str] = (),
unsupported: Sequence[str] = ()) -> None:
assert not (supported and unsupported)