qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] iotests/149: Skip on unsupported ciphers


From: Hanna Reitz
Subject: Re: [PATCH 2/2] iotests/149: Skip on unsupported ciphers
Date: Wed, 17 Nov 2021 16:05:27 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0

On 17.11.21 16:01, Hanna Reitz wrote:
Whenever qemu-img or qemu-io report that some cipher is unsupported,
skip the whole test, because that is probably because qemu has been
configured with the gnutls crypto backend.

We could taylor the algorithm list to what gnutls supports, but this is
a test that is run rather rarely anyway (because it requires
password-less sudo), and so it seems better and easier to skip it.  When
this test is intentionally run to check LUKS compatibility, it seems
better not to limit the algorithms but keep the list extensive.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
---
  tests/qemu-iotests/149 | 23 ++++++++++++++++++-----
  1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/tests/qemu-iotests/149 b/tests/qemu-iotests/149
index 328fd05a4c..adcef86e88 100755
--- a/tests/qemu-iotests/149
+++ b/tests/qemu-iotests/149
@@ -230,6 +230,18 @@ def create_image(config, size_mb):
          fn.truncate(size_mb * 1024 * 1024)
+def check_cipher_support(output):
+    """Check the output of qemu-img or qemu-io for mention of the respective
+    cipher algorithm being unsupported, and if so, skip this test.
+    (Returns `output` for convenience.)"""
+
+    if 'Unsupported cipher algorithm' in output:
+        iotests.notrun('Unsupported cipher algorithm '
+                       f'{config.cipher}-{config.keylen}-{config.mode}; '

Oops.  Just when I sent this I realized that during refactoring (putting this code into its own function) I forgot to pass `config` as a parameter.

Didn’t notice that because...  It seems to work just fine despite `config` not being defined here?  Python will forever remain a black box for me...

Hanna

+                       'consider configuring qemu with a different crypto '
+                       'backend')
+    return output
+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]