From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1vlt-0005Un-M8 for qemu-devel@nongnu.org; Fri, 30 Mar 2018 11:16:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f1vlq-0006PP-NN for qemu-devel@nongnu.org; Fri, 30 Mar 2018 11:16:53 -0400 From: Vladimir Sementsov-Ogievskiy Date: Fri, 30 Mar 2018 18:16:34 +0300 Message-Id: <1522422996-14235-2-git-send-email-vsementsov@virtuozzo.com> In-Reply-To: <1522422996-14235-1-git-send-email-vsementsov@virtuozzo.com> References: <1522422996-14235-1-git-send-email-vsementsov@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH 1/3] iotests.py: improve verify_image_format helper List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Add an assert (we don't want set both arguments) and remove duplication. Signed-off-by: Vladimir Sementsov-Ogievskiy --- 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