qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Roman Kagan <rkagan@virtuozzo.com>, Kevin Wolf <kwolf@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 03/17] iotests: ask qemu for supported formats
Date: Wed, 30 May 2018 14:17:55 +0200	[thread overview]
Message-ID: <f924aadb-35b1-ee72-1040-fdeee5baefaf@redhat.com> (raw)
In-Reply-To: <20180426161958.2872-4-rkagan@virtuozzo.com>

[-- Attachment #1: Type: text/plain, Size: 1986 bytes --]

On 2018-04-26 18:19, Roman Kagan wrote:
> Add helper functions to query the block drivers actually supported by
> QEMU using "-drive format=?".  This allows to skip certain tests that
> require drivers not built in or whitelisted in QEMU.
> 
> Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
> ---
>  tests/qemu-iotests/common.rc  | 19 +++++++++++++++++++
>  tests/qemu-iotests/iotests.py | 30 +++++++++++++++++++++++++++---
>  2 files changed, 46 insertions(+), 3 deletions(-)

[...]

> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
> index e2abf0cb53..698ef2b2c0 100644
> --- a/tests/qemu-iotests/iotests.py
> +++ b/tests/qemu-iotests/iotests.py

[...]

> @@ -550,13 +561,26 @@ def verify_cache_mode(supported_cache_modes=[]):
>      if supported_cache_modes and (cachemode not in supported_cache_modes):
>          notrun('not suitable for this cache mode: %s' % cachemode)
>  
> +rw_formats = None
> +
> +def supports_format(format_name):
> +    format_message = qemu_pipe('-drive', 'format=?')
> +    global rw_formats
> +    if rw_formats is None:
> +        rw_formats = format_message.splitlines()[0].split(':')[1].split()

Isn't it sufficient to call qemu_pipe() only if rw_formats is None?

The rest looks good.

Max

> +    return format_name in rw_formats
> +
> +def require_formats(*formats):
> +    for fmt in formats:
> +        if not supports_format(fmt):
> +            notrun('%s does not support format %s' % (qemu_prog, fmt))
> +
>  def supports_quorum():
> -    return 'quorum' in qemu_img_pipe('--help')
> +    return supports_format('quorum')
>  
>  def verify_quorum():
>      '''Skip test suite if quorum support is not available'''
> -    if not supports_quorum():
> -        notrun('quorum support missing')
> +    require_formats('quorum')
>  
>  def main(supported_fmts=[], supported_oses=['linux'], supported_cache_modes=[],
>           unsupported_fmts=[]):
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2018-05-30 12:18 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-26 16:19 [Qemu-devel] [PATCH 00/17] iotests: don't choke on disabled drivers Roman Kagan
2018-04-26 16:19 ` [Qemu-devel] [PATCH 01/17] block: iterate_format with account of whitelisting Roman Kagan
2018-04-26 18:15   ` Eric Blake
2018-05-30 12:03   ` Max Reitz
2018-04-26 16:19 ` [Qemu-devel] [PATCH 02/17] iotests: iotests.py: prevent deadlock in subprocess Roman Kagan
2018-05-30 12:07   ` Max Reitz
2018-04-26 16:19 ` [Qemu-devel] [PATCH 03/17] iotests: ask qemu for supported formats Roman Kagan
2018-05-30 12:17   ` Max Reitz [this message]
2018-05-30 13:07     ` Roman Kagan
2018-06-04  7:18   ` Markus Armbruster
2018-06-04 10:34     ` Thomas Huth
2018-06-04 22:40       ` Eric Blake
2018-06-05  4:02         ` Thomas Huth
2018-06-07  6:57           ` Markus Armbruster
2018-06-07  7:50             ` Thomas Huth
2018-06-07 11:07               ` Paolo Bonzini
2018-06-07 11:10                 ` Thomas Huth
2018-06-07 11:18                   ` Paolo Bonzini
2018-06-07 11:27                     ` [Qemu-devel] -enable-kvm and friens (was: Re: [PATCH 03/17] iotests: ask qemu for supported formats) Thomas Huth
2018-06-07 11:42                       ` Paolo Bonzini
2018-06-07 11:51                         ` [Qemu-devel] -enable-kvm and friens Thomas Huth
2018-06-07 11:29               ` [Qemu-devel] [PATCH 03/17] iotests: ask qemu for supported formats Markus Armbruster
2018-06-07 12:42               ` Daniel P. Berrangé
2018-04-26 16:19 ` [Qemu-devel] [PATCH 04/17] iotest 030: skip quorum test setup/teardown too Roman Kagan
2018-05-30 12:19   ` Max Reitz
2018-04-26 16:19 ` [Qemu-devel] [PATCH 05/17] iotest 030: require blkdebug Roman Kagan
2018-05-30 12:19   ` Max Reitz
2018-04-26 16:19 ` [Qemu-devel] [PATCH 06/17] iotest 055: skip unsupported backup target formats Roman Kagan
2018-05-30 12:22   ` Max Reitz
2018-04-26 16:19 ` [Qemu-devel] [PATCH 07/17] iotest 055: require blkdebug Roman Kagan
2018-05-30 12:22   ` Max Reitz
2018-04-26 16:19 ` [Qemu-devel] [PATCH 08/17] iotest 056: skip testcases using blkdebug if disabled Roman Kagan
2018-05-30 12:26   ` Max Reitz
2018-04-26 16:19 ` [Qemu-devel] [PATCH 09/17] iotest 071: notrun if blkdebug or blkverify is disabled Roman Kagan
2018-04-26 16:19 ` [Qemu-devel] [PATCH 10/17] iotest 081: notrun if quorum " Roman Kagan
2018-04-26 16:19 ` [Qemu-devel] [PATCH 11/17] iotest 087: notrun if null-co " Roman Kagan
2018-04-26 16:19 ` [Qemu-devel] [PATCH 12/17] iotest 093: notrun if null-co or null-aio " Roman Kagan
2018-04-26 16:19 ` [Qemu-devel] [PATCH 13/17] iotest 099: notrun if blkdebug or blkverify " Roman Kagan
2018-04-26 16:19 ` [Qemu-devel] [PATCH 14/17] iotest 124: skip testcases using blkdebug if disabled Roman Kagan
2018-04-26 16:19 ` [Qemu-devel] [PATCH 15/17] iotest 139: skip testcases using disabled drivers Roman Kagan
2018-04-26 16:19 ` [Qemu-devel] [PATCH 16/17] iotest 147: notrun if nbd is disabled Roman Kagan
2018-04-26 16:19 ` [Qemu-devel] [PATCH 17/17] iotest 184: notrun if null-co or throttle " Roman Kagan
2018-04-26 16:47 ` [Qemu-devel] [PATCH 00/17] iotests: don't choke on disabled drivers no-reply
2018-05-17 16:11 ` [Qemu-devel] [Qemu-block] " Roman Kagan
2018-05-30 12:35 ` [Qemu-devel] " Max Reitz
2018-05-30 13:47   ` Roman Kagan
2018-05-30 13:53     ` Max Reitz
2018-05-30 14:16       ` Roman Kagan

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=f924aadb-35b1-ee72-1040-fdeee5baefaf@redhat.com \
    --to=mreitz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rkagan@virtuozzo.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).