qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: mreitz@redhat.com, kwolf@redhat.com, jsnow@redhat.com,
	eblake@redhat.com, stefanha@redhat.com, vsementsov@virtuozzo.com,
	den@openvz.org
Subject: [Qemu-devel] [PATCH 1/3] iotests.py: improve verify_image_format helper
Date: Fri, 30 Mar 2018 18:16:34 +0300	[thread overview]
Message-ID: <1522422996-14235-2-git-send-email-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <1522422996-14235-1-git-send-email-vsementsov@virtuozzo.com>

Add an assert (we don't want set both arguments) and remove
duplication.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 tests/qemu-iotests/iotests.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index b5d7945..83c454d 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -532,9 +532,9 @@ def notrun(reason):
     sys.exit(0)
 
 def verify_image_format(supported_fmts=[], unsupported_fmts=[]):
-    if supported_fmts and (imgfmt not in supported_fmts):
-        notrun('not suitable for this image format: %s' % imgfmt)
-    if unsupported_fmts and (imgfmt in unsupported_fmts):
+    assert not (supported_fmts and unsupported_fmts)
+    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)
 
 def verify_platform(supported_oses=['linux']):
-- 
2.7.4

  reply	other threads:[~2018-03-30 15:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-30 15:16 [Qemu-devel] [PATCH 0/3] iotests: blacklist bochs and cloop for 205 and 208 Vladimir Sementsov-Ogievskiy
2018-03-30 15:16 ` Vladimir Sementsov-Ogievskiy [this message]
2018-04-03 13:54   ` [Qemu-devel] [PATCH 1/3] iotests.py: improve verify_image_format helper Kevin Wolf
2018-04-04  8:48     ` Vladimir Sementsov-Ogievskiy
2018-04-04  9:50       ` Kevin Wolf
2018-03-30 15:16 ` [Qemu-devel] [PATCH 2/3] iotests.py: support unsupported_fmts in main() Vladimir Sementsov-Ogievskiy
2018-03-30 15:16 ` [Qemu-devel] [PATCH 3/3] iotests: blacklist bochs and cloop for 205 and 208 Vladimir Sementsov-Ogievskiy
2018-04-03 13:36   ` Kevin Wolf
2018-04-09 11:30     ` Vladimir Sementsov-Ogievskiy
2018-04-09 13:29       ` Kevin Wolf
2018-03-30 15:17 ` [Qemu-devel] [PATCH for 2.12 0/3] " Vladimir Sementsov-Ogievskiy
2018-03-31  8:29 ` [Qemu-devel] [PATCH " no-reply
2018-03-31  8:58 ` no-reply
2018-04-04 10:05 ` Kevin Wolf

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=1522422996-14235-2-git-send-email-vsementsov@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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).