From: Kevin Wolf <kwolf@redhat.com>
To: Hanna Reitz <hreitz@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [PATCH 2/2] iotests/149: Skip on unsupported ciphers
Date: Fri, 10 Dec 2021 14:15:47 +0100 [thread overview]
Message-ID: <YbNTA+5QtRdqMHe3@redhat.com> (raw)
In-Reply-To: <1d499aa2-86bb-db1f-6379-88dc7d5ab356@redhat.com>
Am 17.11.2021 um 16:05 hat Hanna Reitz geschrieben:
> 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...
This is an old thread by now, but I think that it works is just because
it's defined as a global variable ('for config in configs') before
calling this function.
Kevin
prev parent reply other threads:[~2021-12-10 13:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-17 15:01 [PATCH 0/2] iotests: Fix crypto algorithm failures Hanna Reitz
2021-11-17 15:01 ` [PATCH 1/2] iotests: Use aes-128-cbc Hanna Reitz
2021-11-17 15:01 ` [PATCH 2/2] iotests/149: Skip on unsupported ciphers Hanna Reitz
2021-11-17 15:05 ` Hanna Reitz
2021-12-10 13:15 ` Kevin Wolf [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YbNTA+5QtRdqMHe3@redhat.com \
--to=kwolf@redhat.com \
--cc=hreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).