From nobody Thu Nov 13 20:40:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582762175; cv=none; d=zohomail.com; s=zohoarc; b=VPsDKQU1Wut7xlEnhlqNpTgFGli5c6lmd7vOCXCU70svkw6nuU5U5ZyEq6AymORfgrvUUKs4uRXmH5EiFWXZoOBrwGF2rSSjbaxEXdeMAWDEeaLwqoKWbqVpvsBhkZprACep0ULrX5Y6/ZnU0bRWrLGaOH0EEP9CXgY8Xp8izNU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582762175; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UcgUwAOBd3LDPg2kzsnKY2Wr6fuoNlU8dqfG2hiDis0=; b=cCl68RQyIVnNpvwTBHBHkhxFdd92V/1dOF94hmsSrqZPVU6dH4WK9EF0fqEOPjJq2EELymkX3mb1mp9aZ4AEUg3E3y72iqcEfoNZYzSboXGxr3SP0H6Ht43JIlx+eWwISdxzb9cblOosW3QVE6dMivyqsl9/5hxXle+630+mJu0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582762175295192.02054358059468; Wed, 26 Feb 2020 16:09:35 -0800 (PST) Received: from localhost ([::1]:51998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76kA-0001sq-6O for importer@patchew.org; Wed, 26 Feb 2020 19:09:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43441) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76hg-0005BS-Ui for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:07:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j76he-0006Er-SJ for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:07:00 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:20998 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j76he-0006CV-N7 for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:58 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-182-CndbzEnMOdiF-hS2nDcPSg-1; Wed, 26 Feb 2020 19:06:45 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 439F318FF663; Thu, 27 Feb 2020 00:06:44 +0000 (UTC) Received: from probe.redhat.com (ovpn-123-58.rdu2.redhat.com [10.10.123.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA5E3390; Thu, 27 Feb 2020 00:06:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582762018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UcgUwAOBd3LDPg2kzsnKY2Wr6fuoNlU8dqfG2hiDis0=; b=dIW1Sv2tRmYZ8a9vlcPzAplhxBAxvysKSYvNw4SkceXFiJt4rDALGi80R2UAmt8V16KjwK Ys8L4CiWgzQF7sDjHqyRQtvWfyjiCQ4aCRqeESpqf4Wtm/UqYlHktQRRn/Y6lH7SRrWON0 itaSsGo5zIOi0UDqLMDcYF8du4WpRjw= X-MC-Unique: CndbzEnMOdiF-hS2nDcPSg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v6 1/9] iotests: do a light delinting Date: Wed, 26 Feb 2020 19:06:31 -0500 Message-Id: <20200227000639.9644-2-jsnow@redhat.com> In-Reply-To: <20200227000639.9644-1-jsnow@redhat.com> References: <20200227000639.9644-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , John Snow , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This doesn't fix everything in here, but it does help clean up the pylint report considerably. This should be 100% style changes only; the intent is to make pylint more useful by working on establishing a baseline for iotests that we can gate against in the future. This will be important if (when?) we begin adding type hints to our code base. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 88 ++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 8815052eb5..e8a0ea14fc 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -16,11 +16,9 @@ # along with this program. If not, see . # =20 -import errno import os import re import subprocess -import string import unittest import sys import struct @@ -34,7 +32,7 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) from qemu import qtest =20 -assert sys.version_info >=3D (3,6) +assert sys.version_info >=3D (3, 6) =20 # This will not work if arguments contain spaces but is necessary if we # want to support the override options that ./check supports. @@ -138,11 +136,11 @@ def qemu_img_log(*args): return result =20 def img_info_log(filename, filter_path=3DNone, imgopts=3DFalse, extra_args= =3D[]): - args =3D [ 'info' ] + args =3D ['info'] if imgopts: args.append('--image-opts') else: - args +=3D [ '-f', imgfmt ] + args +=3D ['-f', imgfmt] args +=3D extra_args args.append(filename) =20 @@ -221,7 +219,7 @@ def cmd(self, cmd): # quit command is in close(), '\n' is added automatically assert '\n' not in cmd cmd =3D cmd.strip() - assert cmd !=3D 'q' and cmd !=3D 'quit' + assert cmd not in ('q', 'quit') self._p.stdin.write(cmd + '\n') self._p.stdin.flush() return self._read_output() @@ -245,8 +243,7 @@ def qemu_nbd_early_pipe(*args): ' '.join(qemu_nbd_args + ['--fork'] + list(args)= ))) if exitcode =3D=3D 0: return exitcode, '' - else: - return exitcode, subp.communicate()[0] + return exitcode, subp.communicate()[0] =20 def qemu_nbd_popen(*args): '''Run qemu-nbd in daemon mode and return the parent's exit code''' @@ -310,7 +307,7 @@ def filter_qmp(qmsg, filter_fn): items =3D qmsg.items() =20 for k, v in items: - if isinstance(v, list) or isinstance(v, dict): + if isinstance(v, (dict, list)): qmsg[k] =3D filter_qmp(v, filter_fn) else: qmsg[k] =3D filter_fn(k, v) @@ -321,7 +318,7 @@ def filter_testfiles(msg): return msg.replace(prefix, 'TEST_DIR/PID-') =20 def filter_qmp_testfiles(qmsg): - def _filter(key, value): + def _filter(_key, value): if is_str(value): return filter_testfiles(value) return value @@ -347,7 +344,7 @@ def filter_imgfmt(msg): return msg.replace(imgfmt, 'IMGFMT') =20 def filter_qmp_imgfmt(qmsg): - def _filter(key, value): + def _filter(_key, value): if is_str(value): return filter_imgfmt(value) return value @@ -358,7 +355,7 @@ def log(msg, filters=3D[], indent=3DNone): If indent is provided, JSON serializable messages are pretty-printed.'= '' for flt in filters: msg =3D flt(msg) - if isinstance(msg, dict) or isinstance(msg, list): + if isinstance(msg, (dict, list)): # Python < 3.4 needs to know not to add whitespace when pretty-pri= nting: separators =3D (', ', ': ') if indent is None else (',', ': ') # Don't sort if it's already sorted @@ -369,14 +366,14 @@ def log(msg, filters=3D[], indent=3DNone): print(msg) =20 class Timeout: - def __init__(self, seconds, errmsg =3D "Timeout"): + def __init__(self, seconds, errmsg=3D"Timeout"): self.seconds =3D seconds self.errmsg =3D errmsg def __enter__(self): signal.signal(signal.SIGALRM, self.timeout) signal.setitimer(signal.ITIMER_REAL, self.seconds) return self - def __exit__(self, type, value, traceback): + def __exit__(self, exc_type, value, traceback): signal.setitimer(signal.ITIMER_REAL, 0) return False def timeout(self, signum, frame): @@ -385,7 +382,7 @@ def timeout(self, signum, frame): def file_pattern(name): return "{0}-{1}".format(os.getpid(), name) =20 -class FilePaths(object): +class FilePaths: """ FilePaths is an auto-generated filename that cleans itself up. =20 @@ -455,10 +452,9 @@ def file_path(*names, base_dir=3Dtest_dir): def remote_filename(path): if imgproto =3D=3D 'file': return path - elif imgproto =3D=3D 'ssh': + if imgproto =3D=3D 'ssh': return "ssh://%s@127.0.0.1:22%s" % (os.environ.get('USER'), path) - else: - raise Exception("Protocol %s not supported" % (imgproto)) + raise Exception("Protocol %s not supported" % (imgproto)) =20 class VM(qtest.QEMUQtestMachine): '''A QEMU VM''' @@ -532,11 +528,11 @@ def pause_drive(self, drive, event=3DNone): self.pause_drive(drive, "write_aio") return self.qmp('human-monitor-command', - command_line=3D'qemu-io %s "break %s bp_%s"' % (drive,= event, drive)) + command_line=3D'qemu-io %s "break %s bp_%s"' % (drive, ev= ent, drive)) =20 def resume_drive(self, drive): self.qmp('human-monitor-command', - command_line=3D'qemu-io %s "remove_break bp_%s"' % (dr= ive, drive)) + command_line=3D'qemu-io %s "remove_break bp_%s"' % (drive= , drive)) =20 def hmp_qemu_io(self, drive, cmd): '''Write to a given drive using an HMP command''' @@ -547,8 +543,8 @@ def flatten_qmp_object(self, obj, output=3DNone, basest= r=3D''): if output is None: output =3D dict() if isinstance(obj, list): - for i in range(len(obj)): - self.flatten_qmp_object(obj[i], output, basestr + str(i) += '.') + for i, atom in enumerate(obj): + self.flatten_qmp_object(atom, output, basestr + str(i) + '= .') elif isinstance(obj, dict): for key in obj: self.flatten_qmp_object(obj[key], output, basestr + key + = '.') @@ -703,9 +699,7 @@ def get_bitmap(self, node_name, bitmap_name, recording= =3DNone, bitmaps=3DNone): =20 for bitmap in bitmaps[node_name]: if bitmap.get('name', '') =3D=3D bitmap_name: - if recording is None: - return bitmap - elif bitmap.get('recording') =3D=3D recording: + if recording is None or bitmap.get('recording') =3D=3D rec= ording: return bitmap return None =20 @@ -756,12 +750,13 @@ def assert_block_path(self, root, path, expected_node= , graph=3DNone): assert node is not None, 'Cannot follow path %s%s' % (root, pa= th) =20 try: - node_id =3D next(edge['child'] for edge in graph['edges'] \ - if edge['parent'] =3D=3D node= ['id'] and - edge['name'] =3D=3D child_= name) + node_id =3D next(edge['child'] for edge in graph['edges'] + if edge['parent'] =3D=3D node['id'] and + edge['name'] =3D=3D child_name) + + node =3D next(node for node in graph['nodes'] + if node['id'] =3D=3D node_id) =20 - node =3D next(node for node in graph['nodes'] \ - if node['id'] =3D=3D node_id) except StopIteration: node =3D None =20 @@ -779,6 +774,12 @@ def assert_block_path(self, root, path, expected_node,= graph=3DNone): class QMPTestCase(unittest.TestCase): '''Abstract base class for QMP test cases''' =20 + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + # Many users of this class set a VM property we rely on heavily + # in the methods below. + self.vm =3D None + def dictpath(self, d, path): '''Traverse a path in a nested dict''' for component in path.split('/'): @@ -824,7 +825,7 @@ def assert_qmp(self, d, path, value): else: self.assertEqual(result, value, '"%s" is "%s", expected "%s"' - % (path, str(result), str(value))) + % (path, str(result), str(value))) =20 def assert_no_active_block_jobs(self): result =3D self.vm.qmp('query-block-jobs') @@ -834,15 +835,15 @@ def assert_has_block_node(self, node_name=3DNone, fil= e_name=3DNone): """Issue a query-named-block-nodes and assert node_name and/or file_name is present in the result""" def check_equal_or_none(a, b): - return a =3D=3D None or b =3D=3D None or a =3D=3D b + return a is None or b is None or a =3D=3D b assert node_name or file_name result =3D self.vm.qmp('query-named-block-nodes') for x in result["return"]: if check_equal_or_none(x.get("node-name"), node_name) and \ check_equal_or_none(x.get("file"), file_name): return - self.assertTrue(False, "Cannot find %s %s in result:\n%s" % \ - (node_name, file_name, result)) + self.fail("Cannot find %s %s in result:\n%s" % + (node_name, file_name, result)) =20 def assert_json_filename_equal(self, json_filename, reference): '''Asserts that the given filename is a json: filename and that its @@ -891,13 +892,14 @@ def wait_until_completed(self, drive=3D'drive0', chec= k_offset=3DTrue, wait=3D60.0, self.assert_qmp(event, 'data/error', error) self.assert_no_active_block_jobs() return event - elif event['event'] =3D=3D 'JOB_STATUS_CHANGE': + if event['event'] =3D=3D 'JOB_STATUS_CHANGE': self.assert_qmp(event, 'data/id', drive) =20 def wait_ready(self, drive=3D'drive0'): '''Wait until a block job BLOCK_JOB_READY event''' - f =3D {'data': {'type': 'mirror', 'device': drive } } + f =3D {'data': {'type': 'mirror', 'device': drive}} event =3D self.vm.event_wait(name=3D'BLOCK_JOB_READY', match=3Df) + return event =20 def wait_ready_and_cancel(self, drive=3D'drive0'): self.wait_ready(drive=3Ddrive) @@ -926,7 +928,7 @@ def pause_wait(self, job_id=3D'job0'): for job in result['return']: if job['device'] =3D=3D job_id: found =3D True - if job['paused'] =3D=3D True and job['busy'] =3D= =3D False: + if job['paused'] and not job['busy']: return job break assert found @@ -1023,8 +1025,8 @@ def qemu_pipe(*args): universal_newlines=3DTrue) exitcode =3D subp.wait() if exitcode < 0: - sys.stderr.write('qemu received signal %i: %s\n' % (-exitcode, - ' '.join(args))) + sys.stderr.write('qemu received signal %i: %s\n' % + (-exitcode, ' '.join(args))) return subp.communicate()[0] =20 def supported_formats(read_only=3DFalse): @@ -1056,8 +1058,8 @@ def func_wrapper(test_case: QMPTestCase, *args, **kwa= rgs): if usf_list: test_case.case_skip('{}: formats {} are not whitelisted'.f= ormat( test_case, usf_list)) - else: - return func(test_case, *args, **kwargs) + return None + return func(test_case, *args, **kwargs) return func_wrapper return skip_test_decorator =20 @@ -1067,8 +1069,8 @@ def skip_if_user_is_root(func): def func_wrapper(*args, **kwargs): if os.getuid() =3D=3D 0: case_notrun('{}: cannot be run as root'.format(args[0])) - else: - return func(*args, **kwargs) + return None + return func(*args, **kwargs) return func_wrapper =20 def execute_unittest(output, verbosity, debug): --=20 2.21.1 From nobody Thu Nov 13 20:40:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582762294; cv=none; d=zohomail.com; s=zohoarc; b=ZcuxdHXlLnt5OEfCLk5iaNbSwB/S0nErJmnmnLzz86uD5/YIh33a7F8h2ZLOsOynzFvi3NUCXXTuXoRBiIVHksshjHg6uhLhr08zYAxGnaIPqJcBmMpqZzKR8wg0N6yP15egXMhYWdp9slkHVhOLhSgQxMekgPNDUGMI1uJsS7I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582762294; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sBvGI8kHjaw63ZbwEs0PHtOli3eA6Ygh8pBdqGaXt8I=; b=bsNpTFyn116jd/5KU3CrFm4OqQRVGAz75xBE8943udPn1LItmrim32IMxfW7xQUamo196BZA60PF0/xYBt2djQo/7FMHcc85yWEOg+9zTll2ji127x88rfYqJ4lI5D1XnPJycuNrTN5/LGBbprWIzUY58IXO+sNblExHyAxVXIU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 158276229480450.405792716587484; Wed, 26 Feb 2020 16:11:34 -0800 (PST) Received: from localhost ([::1]:52034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76m5-0004mZ-Lt for importer@patchew.org; Wed, 26 Feb 2020 19:11:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43198) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76hY-0004p7-0B for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j76hU-0005lj-Ve for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:51 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:44277 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j76hU-0005ku-RC for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:48 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-193-OaHx9-iNNg6NHWr0iC-lkQ-1; Wed, 26 Feb 2020 19:06:46 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6BD978017DF; Thu, 27 Feb 2020 00:06:45 +0000 (UTC) Received: from probe.redhat.com (ovpn-123-58.rdu2.redhat.com [10.10.123.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6D8AA2708E; Thu, 27 Feb 2020 00:06:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582762008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sBvGI8kHjaw63ZbwEs0PHtOli3eA6Ygh8pBdqGaXt8I=; b=Yrrh+kZU4u1wre/QPLzOm3s/T2rfIn/R7YGOyaLlXASHqyacH/csP/BYIAh9SYft2PzRz5 MyarL4giWnm2ahgu0gbrODJb5xXtlByKoK4guaLfG+Om9V3PAJi/VMUACyu0S9jGs0Xht9 6kKQjAexUR0RW/duD/2aew8JP+6eJSg= X-MC-Unique: OaHx9-iNNg6NHWr0iC-lkQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v6 2/9] iotests: add script_initialize Date: Wed, 26 Feb 2020 19:06:32 -0500 Message-Id: <20200227000639.9644-3-jsnow@redhat.com> In-Reply-To: <20200227000639.9644-1-jsnow@redhat.com> References: <20200227000639.9644-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , John Snow , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Like script_main, but doesn't require a single point of entry. Replace all existing initialization sections with this drop-in replacement. This brings debug support to all existing script-style iotests. Signed-off-by: John Snow Reviewed-by: Max Reitz --- tests/qemu-iotests/149 | 3 +- tests/qemu-iotests/194 | 4 +- tests/qemu-iotests/202 | 4 +- tests/qemu-iotests/203 | 4 +- tests/qemu-iotests/206 | 2 +- tests/qemu-iotests/207 | 6 ++- tests/qemu-iotests/208 | 2 +- tests/qemu-iotests/209 | 2 +- tests/qemu-iotests/210 | 6 ++- tests/qemu-iotests/211 | 6 ++- tests/qemu-iotests/212 | 6 ++- tests/qemu-iotests/213 | 6 ++- tests/qemu-iotests/216 | 4 +- tests/qemu-iotests/218 | 2 +- tests/qemu-iotests/219 | 2 +- tests/qemu-iotests/222 | 7 ++-- tests/qemu-iotests/224 | 4 +- tests/qemu-iotests/228 | 6 ++- tests/qemu-iotests/234 | 4 +- tests/qemu-iotests/235 | 4 +- tests/qemu-iotests/236 | 2 +- tests/qemu-iotests/237 | 2 +- tests/qemu-iotests/238 | 2 + tests/qemu-iotests/242 | 2 +- tests/qemu-iotests/246 | 2 +- tests/qemu-iotests/248 | 2 +- tests/qemu-iotests/254 | 2 +- tests/qemu-iotests/255 | 2 +- tests/qemu-iotests/256 | 2 +- tests/qemu-iotests/258 | 7 ++-- tests/qemu-iotests/260 | 4 +- tests/qemu-iotests/262 | 4 +- tests/qemu-iotests/264 | 4 +- tests/qemu-iotests/277 | 2 + tests/qemu-iotests/280 | 8 ++-- tests/qemu-iotests/283 | 4 +- tests/qemu-iotests/iotests.py | 73 +++++++++++++++++++++++------------ 37 files changed, 128 insertions(+), 80 deletions(-) diff --git a/tests/qemu-iotests/149 b/tests/qemu-iotests/149 index b4a21bf7b7..852768f80a 100755 --- a/tests/qemu-iotests/149 +++ b/tests/qemu-iotests/149 @@ -382,8 +382,7 @@ def test_once(config, qemu_img=3DFalse): =20 =20 # Obviously we only work with the luks image format -iotests.verify_image_format(supported_fmts=3D['luks']) -iotests.verify_platform() +iotests.script_initialize(supported_fmts=3D['luks']) =20 # We need sudo in order to run cryptsetup to create # dm-crypt devices. This is safe to use on any diff --git a/tests/qemu-iotests/194 b/tests/qemu-iotests/194 index 9dc1bd3510..8b1f720af4 100755 --- a/tests/qemu-iotests/194 +++ b/tests/qemu-iotests/194 @@ -21,8 +21,8 @@ =20 import iotests =20 -iotests.verify_image_format(supported_fmts=3D['qcow2', 'qed', 'raw']) -iotests.verify_platform(['linux']) +iotests.script_initialize(supported_fmts=3D['qcow2', 'qed', 'raw'], + supported_platforms=3D['linux']) =20 with iotests.FilePath('source.img') as source_img_path, \ iotests.FilePath('dest.img') as dest_img_path, \ diff --git a/tests/qemu-iotests/202 b/tests/qemu-iotests/202 index 920a8683ef..e3900a44d1 100755 --- a/tests/qemu-iotests/202 +++ b/tests/qemu-iotests/202 @@ -24,8 +24,8 @@ =20 import iotests =20 -iotests.verify_image_format(supported_fmts=3D['qcow2']) -iotests.verify_platform(['linux']) +iotests.script_initialize(supported_fmts=3D['qcow2'], + supported_platforms=3D['linux']) =20 with iotests.FilePath('disk0.img') as disk0_img_path, \ iotests.FilePath('disk1.img') as disk1_img_path, \ diff --git a/tests/qemu-iotests/203 b/tests/qemu-iotests/203 index 49eff5d405..4b4bd3307d 100755 --- a/tests/qemu-iotests/203 +++ b/tests/qemu-iotests/203 @@ -24,8 +24,8 @@ =20 import iotests =20 -iotests.verify_image_format(supported_fmts=3D['qcow2']) -iotests.verify_platform(['linux']) +iotests.script_initialize(supported_fmts=3D['qcow2'], + supported_platforms=3D['linux']) =20 with iotests.FilePath('disk0.img') as disk0_img_path, \ iotests.FilePath('disk1.img') as disk1_img_path, \ diff --git a/tests/qemu-iotests/206 b/tests/qemu-iotests/206 index e2b50ae24d..f42432a838 100755 --- a/tests/qemu-iotests/206 +++ b/tests/qemu-iotests/206 @@ -23,7 +23,7 @@ import iotests from iotests import imgfmt =20 -iotests.verify_image_format(supported_fmts=3D['qcow2']) +iotests.script_initialize(supported_fmts=3D['qcow2']) =20 with iotests.FilePath('t.qcow2') as disk_path, \ iotests.FilePath('t.qcow2.base') as backing_path, \ diff --git a/tests/qemu-iotests/207 b/tests/qemu-iotests/207 index 3d9c1208ca..a6621410da 100755 --- a/tests/qemu-iotests/207 +++ b/tests/qemu-iotests/207 @@ -24,8 +24,10 @@ import iotests import subprocess import re =20 -iotests.verify_image_format(supported_fmts=3D['raw']) -iotests.verify_protocol(supported=3D['ssh']) +iotests.script_initialize( + supported_fmts=3D['raw'], + supported_protocols=3D['ssh'], +) =20 def filter_hash(qmsg): def _filter(key, value): diff --git a/tests/qemu-iotests/208 b/tests/qemu-iotests/208 index 1c3fc8c7fd..6cb642f821 100755 --- a/tests/qemu-iotests/208 +++ b/tests/qemu-iotests/208 @@ -22,7 +22,7 @@ =20 import iotests =20 -iotests.verify_image_format(supported_fmts=3D['generic']) +iotests.script_initialize(supported_fmts=3D['generic']) =20 with iotests.FilePath('disk.img') as disk_img_path, \ iotests.FilePath('disk-snapshot.img') as disk_snapshot_img_path, \ diff --git a/tests/qemu-iotests/209 b/tests/qemu-iotests/209 index 65c1a1e70a..8c804f4a30 100755 --- a/tests/qemu-iotests/209 +++ b/tests/qemu-iotests/209 @@ -22,7 +22,7 @@ import iotests from iotests import qemu_img_create, qemu_io, qemu_img_verbose, qemu_nbd, \ file_path =20 -iotests.verify_image_format(supported_fmts=3D['qcow2']) +iotests.script_initialize(supported_fmts=3D['qcow2']) =20 disk =3D file_path('disk') nbd_sock =3D file_path('nbd-sock', base_dir=3Diotests.sock_dir) diff --git a/tests/qemu-iotests/210 b/tests/qemu-iotests/210 index e49896e23d..7bf591f313 100755 --- a/tests/qemu-iotests/210 +++ b/tests/qemu-iotests/210 @@ -23,8 +23,10 @@ import iotests from iotests import imgfmt =20 -iotests.verify_image_format(supported_fmts=3D['luks']) -iotests.verify_protocol(supported=3D['file']) +iotests.script_initialize( + supported_fmts=3D['luks'], + supported_protocols=3D['file'], +) =20 with iotests.FilePath('t.luks') as disk_path, \ iotests.VM() as vm: diff --git a/tests/qemu-iotests/211 b/tests/qemu-iotests/211 index 163994d559..4969edb00c 100755 --- a/tests/qemu-iotests/211 +++ b/tests/qemu-iotests/211 @@ -23,8 +23,10 @@ import iotests from iotests import imgfmt =20 -iotests.verify_image_format(supported_fmts=3D['vdi']) -iotests.verify_protocol(supported=3D['file']) +iotests.script_initialize( + supported_fmts=3D['vdi'], + supported_protocols=3D['file'], +) =20 def blockdev_create(vm, options): error =3D vm.blockdev_create(options) diff --git a/tests/qemu-iotests/212 b/tests/qemu-iotests/212 index 800f92dd84..45d08842bb 100755 --- a/tests/qemu-iotests/212 +++ b/tests/qemu-iotests/212 @@ -23,8 +23,10 @@ import iotests from iotests import imgfmt =20 -iotests.verify_image_format(supported_fmts=3D['parallels']) -iotests.verify_protocol(supported=3D['file']) +iotests.script_initialize( + supported_fmts=3D['parallels'], + supported_protocols=3D['file'], +) =20 with iotests.FilePath('t.parallels') as disk_path, \ iotests.VM() as vm: diff --git a/tests/qemu-iotests/213 b/tests/qemu-iotests/213 index 1eee45276a..cf638eb927 100755 --- a/tests/qemu-iotests/213 +++ b/tests/qemu-iotests/213 @@ -23,8 +23,10 @@ import iotests from iotests import imgfmt =20 -iotests.verify_image_format(supported_fmts=3D['vhdx']) -iotests.verify_protocol(supported=3D['file']) +iotests.script_initialize( + supported_fmts=3D['vhdx'], + supported_protocols=3D['file'], +) =20 with iotests.FilePath('t.vhdx') as disk_path, \ iotests.VM() as vm: diff --git a/tests/qemu-iotests/216 b/tests/qemu-iotests/216 index 372f042d3e..de11d85b5d 100755 --- a/tests/qemu-iotests/216 +++ b/tests/qemu-iotests/216 @@ -23,8 +23,8 @@ import iotests from iotests import log, qemu_img, qemu_io_silent =20 # Need backing file support -iotests.verify_image_format(supported_fmts=3D['qcow2', 'qcow', 'qed', 'vmd= k']) -iotests.verify_platform(['linux']) +iotests.script_initialize(supported_fmts=3D['qcow2', 'qcow', 'qed', 'vmdk'= ], + supported_platforms=3D['linux']) =20 log('') log('=3D=3D=3D Copy-on-read across nodes =3D=3D=3D') diff --git a/tests/qemu-iotests/218 b/tests/qemu-iotests/218 index 1325ba9eaa..5586870456 100755 --- a/tests/qemu-iotests/218 +++ b/tests/qemu-iotests/218 @@ -29,7 +29,7 @@ import iotests from iotests import log, qemu_img, qemu_io_silent =20 -iotests.verify_image_format(supported_fmts=3D['qcow2', 'raw']) +iotests.script_initialize(supported_fmts=3D['qcow2', 'raw']) =20 =20 # Launches the VM, adds two null-co nodes (source and target), and diff --git a/tests/qemu-iotests/219 b/tests/qemu-iotests/219 index b8774770c4..db272c5249 100755 --- a/tests/qemu-iotests/219 +++ b/tests/qemu-iotests/219 @@ -21,7 +21,7 @@ =20 import iotests =20 -iotests.verify_image_format(supported_fmts=3D['qcow2']) +iotests.script_initialize(supported_fmts=3D['qcow2']) =20 img_size =3D 4 * 1024 * 1024 =20 diff --git a/tests/qemu-iotests/222 b/tests/qemu-iotests/222 index bf1718e179..6602f6b4ba 100755 --- a/tests/qemu-iotests/222 +++ b/tests/qemu-iotests/222 @@ -24,9 +24,10 @@ import iotests from iotests import log, qemu_img, qemu_io, qemu_io_silent =20 -iotests.verify_platform(['linux']) -iotests.verify_image_format(supported_fmts=3D['qcow2', 'qcow', 'qed', 'vmd= k', - 'vhdx', 'raw']) +iotests.script_initialize( + supported_fmts=3D['qcow2', 'qcow', 'qed', 'vmdk', 'vhdx', 'raw'], + supported_platforms=3D['linux'], +) =20 patterns =3D [("0x5d", "0", "64k"), ("0xd5", "1M", "64k"), diff --git a/tests/qemu-iotests/224 b/tests/qemu-iotests/224 index e91fb26fd8..81ca1e4898 100755 --- a/tests/qemu-iotests/224 +++ b/tests/qemu-iotests/224 @@ -26,8 +26,8 @@ from iotests import log, qemu_img, qemu_io_silent, filter= _qmp_testfiles, \ import json =20 # Need backing file support (for arbitrary backing formats) -iotests.verify_image_format(supported_fmts=3D['qcow2', 'qcow', 'qed']) -iotests.verify_platform(['linux']) +iotests.script_initialize(supported_fmts=3D['qcow2', 'qcow', 'qed'], + supported_platforms=3D['linux']) =20 =20 # There are two variations of this test: diff --git a/tests/qemu-iotests/228 b/tests/qemu-iotests/228 index 64bc82ee23..da0900fb82 100755 --- a/tests/qemu-iotests/228 +++ b/tests/qemu-iotests/228 @@ -25,8 +25,10 @@ from iotests import log, qemu_img, filter_testfiles, fil= ter_imgfmt, \ filter_qmp_testfiles, filter_qmp_imgfmt =20 # Need backing file and change-backing-file support -iotests.verify_image_format(supported_fmts=3D['qcow2', 'qed']) -iotests.verify_platform(['linux']) +iotests.script_initialize( + supported_fmts=3D['qcow2', 'qed'], + supported_platforms=3D['linux'], +) =20 =20 def log_node_info(node): diff --git a/tests/qemu-iotests/234 b/tests/qemu-iotests/234 index 324c1549fd..73c899ddae 100755 --- a/tests/qemu-iotests/234 +++ b/tests/qemu-iotests/234 @@ -23,8 +23,8 @@ import iotests import os =20 -iotests.verify_image_format(supported_fmts=3D['qcow2']) -iotests.verify_platform(['linux']) +iotests.script_initialize(supported_fmts=3D['qcow2'], + supported_platforms=3D['linux']) =20 with iotests.FilePath('img') as img_path, \ iotests.FilePath('backing') as backing_path, \ diff --git a/tests/qemu-iotests/235 b/tests/qemu-iotests/235 index 760826128e..d1b10ac36b 100755 --- a/tests/qemu-iotests/235 +++ b/tests/qemu-iotests/235 @@ -27,6 +27,8 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '= ..', '..', 'python')) =20 from qemu.machine import QEMUMachine =20 +iotests.script_initialize(supported_fmts=3D['qcow2']) + # Note: # This test was added to check that mirror dead-lock was fixed (see previo= us # commit before this test addition). @@ -40,8 +42,6 @@ from qemu.machine import QEMUMachine =20 size =3D 1 * 1024 * 1024 * 1024 =20 -iotests.verify_image_format(supported_fmts=3D['qcow2']) - disk =3D file_path('disk') =20 # prepare source image diff --git a/tests/qemu-iotests/236 b/tests/qemu-iotests/236 index 8ce927a16c..6f5cee2444 100755 --- a/tests/qemu-iotests/236 +++ b/tests/qemu-iotests/236 @@ -22,7 +22,7 @@ import iotests from iotests import log =20 -iotests.verify_image_format(supported_fmts=3D['generic']) +iotests.script_initialize(supported_fmts=3D['generic']) size =3D 64 * 1024 * 1024 granularity =3D 64 * 1024 =20 diff --git a/tests/qemu-iotests/237 b/tests/qemu-iotests/237 index 50ba364a3e..5b21ad3509 100755 --- a/tests/qemu-iotests/237 +++ b/tests/qemu-iotests/237 @@ -24,7 +24,7 @@ import math import iotests from iotests import imgfmt =20 -iotests.verify_image_format(supported_fmts=3D['vmdk']) +iotests.script_initialize(supported_fmts=3D['vmdk']) =20 with iotests.FilePath('t.vmdk') as disk_path, \ iotests.FilePath('t.vmdk.1') as extent1_path, \ diff --git a/tests/qemu-iotests/238 b/tests/qemu-iotests/238 index d4e060228c..b8fcf15a1f 100755 --- a/tests/qemu-iotests/238 +++ b/tests/qemu-iotests/238 @@ -23,6 +23,8 @@ import os import iotests from iotests import log =20 +iotests.script_initialize() + virtio_scsi_device =3D iotests.get_virtio_scsi_device() =20 vm =3D iotests.VM() diff --git a/tests/qemu-iotests/242 b/tests/qemu-iotests/242 index 97617876bc..64f1bd95e4 100755 --- a/tests/qemu-iotests/242 +++ b/tests/qemu-iotests/242 @@ -24,7 +24,7 @@ import struct from iotests import qemu_img_create, qemu_io, qemu_img_pipe, \ file_path, img_info_log, log, filter_qemu_io =20 -iotests.verify_image_format(supported_fmts=3D['qcow2']) +iotests.script_initialize(supported_fmts=3D['qcow2']) =20 disk =3D file_path('disk') chunk =3D 256 * 1024 diff --git a/tests/qemu-iotests/246 b/tests/qemu-iotests/246 index 59a216a839..58a479cc1f 100755 --- a/tests/qemu-iotests/246 +++ b/tests/qemu-iotests/246 @@ -22,7 +22,7 @@ import iotests from iotests import log =20 -iotests.verify_image_format(supported_fmts=3D['qcow2']) +iotests.script_initialize(supported_fmts=3D['qcow2']) size =3D 64 * 1024 * 1024 * 1024 gran_small =3D 32 * 1024 gran_large =3D 128 * 1024 diff --git a/tests/qemu-iotests/248 b/tests/qemu-iotests/248 index 68c374692e..18ba03467e 100755 --- a/tests/qemu-iotests/248 +++ b/tests/qemu-iotests/248 @@ -21,7 +21,7 @@ import iotests from iotests import qemu_img_create, qemu_io, file_path, filter_qmp_testfi= les =20 -iotests.verify_image_format(supported_fmts=3D['qcow2']) +iotests.script_initialize(supported_fmts=3D['qcow2']) =20 source, target =3D file_path('source', 'target') size =3D 5 * 1024 * 1024 diff --git a/tests/qemu-iotests/254 b/tests/qemu-iotests/254 index ee66c986db..150e58be8e 100755 --- a/tests/qemu-iotests/254 +++ b/tests/qemu-iotests/254 @@ -21,7 +21,7 @@ import iotests from iotests import qemu_img_create, file_path, log =20 -iotests.verify_image_format(supported_fmts=3D['qcow2']) +iotests.script_initialize(supported_fmts=3D['qcow2']) =20 disk, top =3D file_path('disk', 'top') size =3D 1024 * 1024 diff --git a/tests/qemu-iotests/255 b/tests/qemu-iotests/255 index 4a4818bafb..8f08f741da 100755 --- a/tests/qemu-iotests/255 +++ b/tests/qemu-iotests/255 @@ -23,7 +23,7 @@ import iotests from iotests import imgfmt =20 -iotests.verify_image_format(supported_fmts=3D['qcow2']) +iotests.script_initialize(supported_fmts=3D['qcow2']) =20 iotests.log('Finishing a commit job with background reads') iotests.log('=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D') diff --git a/tests/qemu-iotests/256 b/tests/qemu-iotests/256 index e34074c83e..db8d6f31cf 100755 --- a/tests/qemu-iotests/256 +++ b/tests/qemu-iotests/256 @@ -23,7 +23,7 @@ import os import iotests from iotests import log =20 -iotests.verify_image_format(supported_fmts=3D['qcow2']) +iotests.script_initialize(supported_fmts=3D['qcow2']) size =3D 64 * 1024 * 1024 =20 with iotests.FilePath('img0') as img0_path, \ diff --git a/tests/qemu-iotests/258 b/tests/qemu-iotests/258 index 091755a45c..a65151dda6 100755 --- a/tests/qemu-iotests/258 +++ b/tests/qemu-iotests/258 @@ -24,9 +24,10 @@ from iotests import log, qemu_img, qemu_io_silent, \ filter_qmp_testfiles, filter_qmp_imgfmt =20 # Need backing file and change-backing-file support -iotests.verify_image_format(supported_fmts=3D['qcow2', 'qed']) -iotests.verify_platform(['linux']) - +iotests.script_initialize( + supported_fmts=3D['qcow2', 'qed'], + supported_platforms=3D['linux'], +) =20 # Returns a node for blockdev-add def node(node_name, path, backing=3DNone, fmt=3DNone, throttle=3DNone): diff --git a/tests/qemu-iotests/260 b/tests/qemu-iotests/260 index 30c0de380d..804a7addb9 100755 --- a/tests/qemu-iotests/260 +++ b/tests/qemu-iotests/260 @@ -21,7 +21,9 @@ import iotests from iotests import qemu_img_create, file_path, log, filter_qmp_event =20 -iotests.verify_image_format(supported_fmts=3D['qcow2']) +iotests.script_initialize( + supported_fmts=3D['qcow2'] +) =20 base, top =3D file_path('base', 'top') size =3D 64 * 1024 * 3 diff --git a/tests/qemu-iotests/262 b/tests/qemu-iotests/262 index 8835dce7be..03af061f94 100755 --- a/tests/qemu-iotests/262 +++ b/tests/qemu-iotests/262 @@ -23,8 +23,8 @@ import iotests import os =20 -iotests.verify_image_format(supported_fmts=3D['qcow2']) -iotests.verify_platform(['linux']) +iotests.script_initialize(supported_fmts=3D['qcow2'], + supported_platforms=3D['linux']) =20 with iotests.FilePath('img') as img_path, \ iotests.FilePath('mig_fifo') as fifo, \ diff --git a/tests/qemu-iotests/264 b/tests/qemu-iotests/264 index 879123a343..304a7443d7 100755 --- a/tests/qemu-iotests/264 +++ b/tests/qemu-iotests/264 @@ -24,7 +24,9 @@ import iotests from iotests import qemu_img_create, qemu_io_silent_check, file_path, \ qemu_nbd_popen, log =20 -iotests.verify_image_format(supported_fmts=3D['qcow2']) +iotests.script_initialize( + supported_fmts=3D['qcow2'], +) =20 disk_a, disk_b, nbd_sock =3D file_path('disk_a', 'disk_b', 'nbd-sock') nbd_uri =3D 'nbd+unix:///?socket=3D' + nbd_sock diff --git a/tests/qemu-iotests/277 b/tests/qemu-iotests/277 index 04aa15a3d5..d34f87021f 100755 --- a/tests/qemu-iotests/277 +++ b/tests/qemu-iotests/277 @@ -23,6 +23,8 @@ import subprocess import iotests from iotests import file_path, log =20 +iotests.script_initialize() + =20 nbd_sock, conf_file =3D file_path('nbd-sock', 'nbd-fault-injector.conf') =20 diff --git a/tests/qemu-iotests/280 b/tests/qemu-iotests/280 index 69288fdd0e..f594bb9ed2 100755 --- a/tests/qemu-iotests/280 +++ b/tests/qemu-iotests/280 @@ -22,9 +22,11 @@ import iotests import os =20 -iotests.verify_image_format(supported_fmts=3D['qcow2']) -iotests.verify_protocol(supported=3D['file']) -iotests.verify_platform(['linux']) +iotests.script_initialize( + supported_fmts=3D['qcow2'], + supported_protocols=3D['file'], + supported_platforms=3D['linux'], +) =20 with iotests.FilePath('base') as base_path , \ iotests.FilePath('top') as top_path, \ diff --git a/tests/qemu-iotests/283 b/tests/qemu-iotests/283 index 55b7cff953..e17b953333 100644 --- a/tests/qemu-iotests/283 +++ b/tests/qemu-iotests/283 @@ -21,7 +21,9 @@ import iotests =20 # The test is unrelated to formats, restrict it to qcow2 to avoid extra ru= ns -iotests.verify_image_format(supported_fmts=3D['qcow2']) +iotests.script_initialize( + supported_fmts=3D['qcow2'], +) =20 size =3D 1024 * 1024 =20 diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index e8a0ea14fc..fdcf8a940c 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -28,6 +28,7 @@ import atexit import io from collections import OrderedDict +from typing import Collection =20 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) from qemu import qtest @@ -991,12 +992,11 @@ def verify_protocol(supported=3D[], unsupported=3D[]): if not_sup or (imgproto in unsupported): notrun('not suitable for this protocol: %s' % imgproto) =20 -def verify_platform(supported=3DNone, unsupported=3DNone): - if unsupported is not None: - if any((sys.platform.startswith(x) for x in unsupported)): - notrun('not suitable for this OS: %s' % sys.platform) +def verify_platform(supported=3D(), unsupported=3D()): + if any((sys.platform.startswith(x) for x in unsupported)): + notrun('not suitable for this OS: %s' % sys.platform) =20 - if supported is not None: + if supported: if not any((sys.platform.startswith(x) for x in supported)): notrun('not suitable for this OS: %s' % sys.platform) =20 @@ -1073,7 +1073,18 @@ def func_wrapper(*args, **kwargs): return func(*args, **kwargs) return func_wrapper =20 -def execute_unittest(output, verbosity, debug): +def execute_unittest(debug=3DFalse): + """Executes unittests within the calling module.""" + + verbosity =3D 2 if debug else 1 + + if debug: + output =3D sys.stdout + else: + # We need to filter out the time taken from the output so that + # qemu-iotest can reliably diff the results against master output. + output =3D io.StringIO() + runner =3D unittest.TextTestRunner(stream=3Doutput, descriptions=3DTru= e, verbosity=3Dverbosity) try: @@ -1081,6 +1092,8 @@ def execute_unittest(output, verbosity, debug): # exception unittest.main(testRunner=3Drunner) finally: + # We need to filter out the time taken from the output so that + # qemu-iotest can reliably diff the results against master output. if not debug: out =3D output.getvalue() out =3D re.sub(r'Ran (\d+) tests? in [\d.]+s', r'Ran \1 tests'= , out) @@ -1092,13 +1105,18 @@ def execute_unittest(output, verbosity, debug): =20 sys.stderr.write(out) =20 -def execute_test(test_function=3DNone, - supported_fmts=3D[], - supported_platforms=3DNone, - supported_cache_modes=3D[], supported_aio_modes=3D{}, - unsupported_fmts=3D[], supported_protocols=3D[], - unsupported_protocols=3D[]): - """Run either unittest or script-style tests.""" +def execute_setup_common(supported_fmts: Collection[str] =3D (), + supported_platforms: Collection[str] =3D (), + supported_cache_modes: Collection[str] =3D (), + supported_aio_modes: Collection[str] =3D (), + unsupported_fmts: Collection[str] =3D (), + supported_protocols: Collection[str] =3D (), + unsupported_protocols: Collection[str] =3D ()) ->= bool: + """ + Perform necessary setup for either script-style or unittest-style test= s. + + :return: Bool; Whether or not debug mode has been requested via the CL= I. + """ =20 # We are using TEST_DIR and QEMU_DEFAULT_MACHINE as proxies to # indicate that we're not being run via "check". There may be @@ -1108,34 +1126,39 @@ def execute_test(test_function=3DNone, sys.stderr.write('Please run this test via the "check" script\n') sys.exit(os.EX_USAGE) =20 - debug =3D '-d' in sys.argv - verbosity =3D 1 verify_image_format(supported_fmts, unsupported_fmts) verify_protocol(supported_protocols, unsupported_protocols) verify_platform(supported=3Dsupported_platforms) verify_cache_mode(supported_cache_modes) verify_aio_mode(supported_aio_modes) =20 + debug =3D '-d' in sys.argv if debug: - output =3D sys.stdout - verbosity =3D 2 sys.argv.remove('-d') - else: - # We need to filter out the time taken from the output so that - # qemu-iotest can reliably diff the results against master output. - output =3D io.StringIO() - logging.basicConfig(level=3D(logging.DEBUG if debug else logging.WARN)) =20 + return debug + +def execute_test(*args, test_function=3DNone, **kwargs): + """Run either unittest or script-style tests.""" + + debug =3D execute_setup_common(*args, **kwargs) if not test_function: - execute_unittest(output, verbosity, debug) + execute_unittest(debug) else: test_function() =20 +# This is called from script-style iotests without a single point of entry +def script_initialize(*args, **kwargs): + """Initialize script-style tests without running any tests.""" + execute_setup_common(*args, **kwargs) + +# This is called from script-style iotests with a single point of entry def script_main(test_function, *args, **kwargs): """Run script-style tests outside of the unittest framework""" - execute_test(test_function, *args, **kwargs) + execute_test(*args, test_function=3Dtest_function, **kwargs) =20 +# This is called from unittest style iotests def main(*args, **kwargs): """Run tests using the unittest framework""" - execute_test(None, *args, **kwargs) + execute_test(*args, **kwargs) --=20 2.21.1 From nobody Thu Nov 13 20:40:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582762152; cv=none; d=zohomail.com; s=zohoarc; b=O3c0u1uEKwBNI3+SrvXL87qEYRE+8VPjAzeJ3KJG8d8Rnw40UkTT8lzd/n0gMGZNP3WmTQh0y0niyFF0qIWYBglE+ZaboePT9QfvjY8jzyOQW75e3uLb0wz6ryIJPNRRq0qa6zoPY58TH3hwVrvBYUuwlLH5X1ZxIrWXt2+NAJ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582762152; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jAWhedyGRj9dcXay2ibOcrLSLi59SGh1Ywce0Ex++Hw=; b=U93N2hPO2gPRE1EAtnR5YgxMcWlSoERAloHktG6J6j/756+7u4GezAoQlwm1CDlVeqGOjSCi3ZsxIZalJvInf8IG0vpCGAE/yfR0L+iCjGGegMs5f9cONZZ+zc/e5+UiJ5D6tqUs/dfekzd0bL/3/XhVdo9xtohSuKFKUaU6u5A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582762152352670.6038986378426; Wed, 26 Feb 2020 16:09:12 -0800 (PST) Received: from localhost ([::1]:51992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76jn-00016P-0v for importer@patchew.org; Wed, 26 Feb 2020 19:09:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43156) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76hW-0004nR-W0 for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j76hV-0005o6-Ku for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:50 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:21134 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j76hV-0005mW-G0 for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:49 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-379-6J1aXl8YOY6PmHKB16nkYw-1; Wed, 26 Feb 2020 19:06:47 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4DCF718FF660; Thu, 27 Feb 2020 00:06:46 +0000 (UTC) Received: from probe.redhat.com (ovpn-123-58.rdu2.redhat.com [10.10.123.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4E37390; Thu, 27 Feb 2020 00:06:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582762009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jAWhedyGRj9dcXay2ibOcrLSLi59SGh1Ywce0Ex++Hw=; b=cPLuFQGlnGFlFKiFVVx0a5W8gW4XPm8LaKAVUntO5sgJSQrpttut56Zs3Xz8l8qqHWuObG bdWynG9B3q3ZiOyjhvmsOG4kwEkkf4sVmAt6gOb26H5ZSaQe76JvEmTI9r0NrYDisEi7/v ixg5/dsHAfZCGONH3kkpPR3iZyX2H2E= X-MC-Unique: 6J1aXl8YOY6PmHKB16nkYw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v6 3/9] iotests: replace mutable list default args Date: Wed, 26 Feb 2020 19:06:33 -0500 Message-Id: <20200227000639.9644-4-jsnow@redhat.com> In-Reply-To: <20200227000639.9644-1-jsnow@redhat.com> References: <20200227000639.9644-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , John Snow , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" It's bad hygiene: if we modify this list, it will be modified across all invocations. Signed-off-by: John Snow Reviewed-by: Max Reitz --- tests/qemu-iotests/iotests.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index fdcf8a940c..9eb96561b6 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -136,7 +136,7 @@ def qemu_img_log(*args): log(result, filters=3D[filter_testfiles]) return result =20 -def img_info_log(filename, filter_path=3DNone, imgopts=3DFalse, extra_args= =3D[]): +def img_info_log(filename, filter_path=3DNone, imgopts=3DFalse, extra_args= =3D()): args =3D ['info'] if imgopts: args.append('--image-opts') @@ -351,7 +351,7 @@ def _filter(_key, value): return value return filter_qmp(qmsg, _filter) =20 -def log(msg, filters=3D[], indent=3DNone): +def log(msg, filters=3D(), indent=3DNone): '''Logs either a string message or a JSON serializable message (like Q= MP). If indent is provided, JSON serializable messages are pretty-printed.'= '' for flt in filters: @@ -566,7 +566,7 @@ def get_qmp_events_filtered(self, wait=3D60.0): result.append(filter_qmp_event(ev)) return result =20 - def qmp_log(self, cmd, filters=3D[], indent=3DNone, **kwargs): + def qmp_log(self, cmd, filters=3D(), indent=3DNone, **kwargs): full_cmd =3D OrderedDict(( ("execute", cmd), ("arguments", ordered_qmp(kwargs)) @@ -968,7 +968,7 @@ def case_notrun(reason): open('%s/%s.casenotrun' % (output_dir, seq), 'a').write( ' [case not run] ' + reason + '\n') =20 -def verify_image_format(supported_fmts=3D[], unsupported_fmts=3D[]): +def verify_image_format(supported_fmts=3D(), unsupported_fmts=3D()): assert not (supported_fmts and unsupported_fmts) =20 if 'generic' in supported_fmts and \ @@ -982,7 +982,7 @@ def verify_image_format(supported_fmts=3D[], unsupporte= d_fmts=3D[]): if not_sup or (imgfmt in unsupported_fmts): notrun('not suitable for this image format: %s' % imgfmt) =20 -def verify_protocol(supported=3D[], unsupported=3D[]): +def verify_protocol(supported=3D(), unsupported=3D()): assert not (supported and unsupported) =20 if 'generic' in supported: @@ -1000,11 +1000,11 @@ def verify_platform(supported=3D(), unsupported=3D(= )): if not any((sys.platform.startswith(x) for x in supported)): notrun('not suitable for this OS: %s' % sys.platform) =20 -def verify_cache_mode(supported_cache_modes=3D[]): +def verify_cache_mode(supported_cache_modes=3D()): if supported_cache_modes and (cachemode not in supported_cache_modes): notrun('not suitable for this cache mode: %s' % cachemode) =20 -def verify_aio_mode(supported_aio_modes=3D[]): +def verify_aio_mode(supported_aio_modes=3D()): if supported_aio_modes and (aiomode not in supported_aio_modes): notrun('not suitable for this aio mode: %s' % aiomode) =20 @@ -1044,7 +1044,7 @@ def supported_formats(read_only=3DFalse): =20 return supported_formats.formats[read_only] =20 -def skip_if_unsupported(required_formats=3D[], read_only=3DFalse): +def skip_if_unsupported(required_formats=3D(), read_only=3DFalse): '''Skip Test Decorator Runs the test if all the required formats are whitelisted''' def skip_test_decorator(func): --=20 2.21.1 From nobody Thu Nov 13 20:40:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582762227; cv=none; d=zohomail.com; s=zohoarc; b=SjhYAXrZ7u1g4+AbZrpYFIbe0qGGbH0QU4uk73+LnePgNXBRMilEs8c2VYIr4W2DSBYOuW3pZ6492dj+bSg+4KiPWUa3gEuAZ8xEdbPLZ6qI1TFp7Cv8ojVRRfdjVzeSoUJENu7yXVcbknlxscY0+M1WQmI0hHRWDq70zIy8OXc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582762227; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pqk4wxA6nnZvUyKF6PV4dGl1yN1v3YNdC2jlmhSmI9w=; b=UiGdPpYVcWpN8OoEkY3OBS55aGywRr3q7bDoi9/J5hk0LderzuxoD6C/t+cwx3VwCom4dqhvCgne89eaJ/4z13YPGmDkTjbKBnto7q0wEO24SBZZWQTeCXoPHaLwlfobTErD1rc25Fvpn/8kM03Zyf8rhpmrTa+PNFi4M6Tis0o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582762227053692.5992596726028; Wed, 26 Feb 2020 16:10:27 -0800 (PST) Received: from localhost ([::1]:52010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76l0-00036c-08 for importer@patchew.org; Wed, 26 Feb 2020 19:10:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43210) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76hY-0004pR-9Z for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j76hX-0005ti-9D for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:52 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:38226 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j76hX-0005sA-4s for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:51 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-295-c3yUrWL_NaaLs0l9vsoa8g-1; Wed, 26 Feb 2020 19:06:48 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4BC7F8017CC; Thu, 27 Feb 2020 00:06:47 +0000 (UTC) Received: from probe.redhat.com (ovpn-123-58.rdu2.redhat.com [10.10.123.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id 78EB3390; Thu, 27 Feb 2020 00:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582762010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pqk4wxA6nnZvUyKF6PV4dGl1yN1v3YNdC2jlmhSmI9w=; b=gsWQmV8WEe0z7sw4RD76lyciTDXVbpUgU65s+JZVB448wK25J5NYR+vzIzIQFXTYqs6/Lo zYMl7YO7SIafJH6t0qxA6MBulReltGrCWoH8Ge/klmDcIteO7rlYzBwSpXLDr1V45dHyYW q4v0kIBMxsgNWmqaqrzmjZf+u0AxISw= X-MC-Unique: c3yUrWL_NaaLs0l9vsoa8g-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v6 4/9] iotest 258: use script_main Date: Wed, 26 Feb 2020 19:06:34 -0500 Message-Id: <20200227000639.9644-5-jsnow@redhat.com> In-Reply-To: <20200227000639.9644-1-jsnow@redhat.com> References: <20200227000639.9644-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , John Snow , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Since this one is nicely factored to use a single entry point, use script_main to run the tests. Signed-off-by: John Snow Reviewed-by: Max Reitz Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/qemu-iotests/258 | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/qemu-iotests/258 b/tests/qemu-iotests/258 index a65151dda6..e305a1502f 100755 --- a/tests/qemu-iotests/258 +++ b/tests/qemu-iotests/258 @@ -23,12 +23,6 @@ import iotests from iotests import log, qemu_img, qemu_io_silent, \ filter_qmp_testfiles, filter_qmp_imgfmt =20 -# Need backing file and change-backing-file support -iotests.script_initialize( - supported_fmts=3D['qcow2', 'qed'], - supported_platforms=3D['linux'], -) - # Returns a node for blockdev-add def node(node_name, path, backing=3DNone, fmt=3DNone, throttle=3DNone): if fmt is None: @@ -161,4 +155,7 @@ def main(): test_concurrent_finish(False) =20 if __name__ =3D=3D '__main__': - main() + # Need backing file and change-backing-file support + iotests.script_main(main, + supported_fmts=3D['qcow2', 'qed'], + supported_platforms=3D['linux']) --=20 2.21.1 From nobody Thu Nov 13 20:40:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582762075; cv=none; d=zohomail.com; s=zohoarc; b=doke8kZ1VbcxS0RMz4CwsbdU46nHq5iPQ31q/NRJwkNg2R+eSTOJxNZ/d5srTmj+H3cPQbGWWsOWIGTWj6uGapwweAsmrcGKVRRwCdDx5ebN59fxv8GYtuDdRU3WcscXHCloVQyXdnTfC3i7d+5nhlrdhk+QK/kiTagNRcyEx+w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582762075; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tUAtYoK1mo8ZCVBHN8tRD6IeZlFlvmbrhWxQafc7JFs=; b=n1Yw47jgJGBAPjh8sKpyp1VXyJeJ7++sGZBzEFo9RzWeip8GHIul6SmwfNMfghodEZnNdwK2s1SgS6GJ5uwf8vVIiChRHUzXaUHAEzsw1hQjtMtZSGV/PiExcAiaiaOtqNUWpG9pwXw0mmZ+qOBKWL/1KqWM+BqxoG3z9OsjpKs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582762075291467.8282260151759; Wed, 26 Feb 2020 16:07:55 -0800 (PST) Received: from localhost ([::1]:51952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76iY-0006XA-4j for importer@patchew.org; Wed, 26 Feb 2020 19:07:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43213) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76hY-0004pY-CR for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j76hX-0005tD-3U for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:52 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:55756 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j76hW-0005rd-V3 for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:51 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-344-yuR_qSaePYOKtOztcf64bw-1; Wed, 26 Feb 2020 19:06:48 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0D698800D50; Thu, 27 Feb 2020 00:06:48 +0000 (UTC) Received: from probe.redhat.com (ovpn-123-58.rdu2.redhat.com [10.10.123.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A228390; Thu, 27 Feb 2020 00:06:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582762010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tUAtYoK1mo8ZCVBHN8tRD6IeZlFlvmbrhWxQafc7JFs=; b=Lf2BqYAy9cokx6ufNNBUYwHvYp/9JQV0SrZfRj8hSwk8HgXb4CNn1U98pZZrm6dPsHG8KC fmFa4h1+hFt/fbqjnLyoNsocb9QyahoMJAVqb9bQag2BlcEr5uCtkUsEW4bfm24iC1Vc4E T5gzfDisN9PBG1LLqE9/AaB2NNcJBIo= X-MC-Unique: yuR_qSaePYOKtOztcf64bw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v6 5/9] iotests: Mark verify functions as private Date: Wed, 26 Feb 2020 19:06:35 -0500 Message-Id: <20200227000639.9644-6-jsnow@redhat.com> In-Reply-To: <20200227000639.9644-1-jsnow@redhat.com> References: <20200227000639.9644-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , John Snow , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Discourage their use. (Also, make pending patches not yet using the new entry points fail in a very obvious way.) Signed-off-by: John Snow Reviewed-by: Max Reitz --- tests/qemu-iotests/iotests.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 9eb96561b6..b02d7932fa 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -968,7 +968,7 @@ def case_notrun(reason): open('%s/%s.casenotrun' % (output_dir, seq), 'a').write( ' [case not run] ' + reason + '\n') =20 -def verify_image_format(supported_fmts=3D(), unsupported_fmts=3D()): +def _verify_image_format(supported_fmts=3D(), unsupported_fmts=3D()): assert not (supported_fmts and unsupported_fmts) =20 if 'generic' in supported_fmts and \ @@ -982,7 +982,7 @@ def verify_image_format(supported_fmts=3D(), unsupporte= d_fmts=3D()): if not_sup or (imgfmt in unsupported_fmts): notrun('not suitable for this image format: %s' % imgfmt) =20 -def verify_protocol(supported=3D(), unsupported=3D()): +def _verify_protocol(supported=3D(), unsupported=3D()): assert not (supported and unsupported) =20 if 'generic' in supported: @@ -992,7 +992,7 @@ def verify_protocol(supported=3D(), unsupported=3D()): if not_sup or (imgproto in unsupported): notrun('not suitable for this protocol: %s' % imgproto) =20 -def verify_platform(supported=3D(), unsupported=3D()): +def _verify_platform(supported=3D(), unsupported=3D()): if any((sys.platform.startswith(x) for x in unsupported)): notrun('not suitable for this OS: %s' % sys.platform) =20 @@ -1000,11 +1000,11 @@ def verify_platform(supported=3D(), unsupported=3D(= )): if not any((sys.platform.startswith(x) for x in supported)): notrun('not suitable for this OS: %s' % sys.platform) =20 -def verify_cache_mode(supported_cache_modes=3D()): +def _verify_cache_mode(supported_cache_modes=3D()): if supported_cache_modes and (cachemode not in supported_cache_modes): notrun('not suitable for this cache mode: %s' % cachemode) =20 -def verify_aio_mode(supported_aio_modes=3D()): +def _verify_aio_mode(supported_aio_modes=3D()): if supported_aio_modes and (aiomode not in supported_aio_modes): notrun('not suitable for this aio mode: %s' % aiomode) =20 @@ -1126,11 +1126,11 @@ def execute_setup_common(supported_fmts: Collection= [str] =3D (), sys.stderr.write('Please run this test via the "check" script\n') sys.exit(os.EX_USAGE) =20 - verify_image_format(supported_fmts, unsupported_fmts) - verify_protocol(supported_protocols, unsupported_protocols) - verify_platform(supported=3Dsupported_platforms) - verify_cache_mode(supported_cache_modes) - verify_aio_mode(supported_aio_modes) + _verify_image_format(supported_fmts, unsupported_fmts) + _verify_protocol(supported_protocols, unsupported_protocols) + _verify_platform(supported=3Dsupported_platforms) + _verify_cache_mode(supported_cache_modes) + _verify_aio_mode(supported_aio_modes) =20 debug =3D '-d' in sys.argv if debug: --=20 2.21.1 From nobody Thu Nov 13 20:40:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582762347; cv=none; d=zohomail.com; s=zohoarc; b=k3f9meeRCjSTbAF4HplPVZN2uqexsUk+e5nLn67j5UYvqAdrqGTZWWsf1pl6K/1CtuO2HEUxeI3C0CjEnWk17G+EjbvYyT8p5borAzicwtFdh/yt3SJ9TlXSGYHO+slz6zrqTilXGsaVAqclnxaUeLNkcNS2lmpqlaIHM5t48MI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582762347; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AJefKQtoki8CCsDVwlXv0xNzlmDcB+4Ud4A3n2u5We0=; b=IUMizj/G3oj4NCvhvDC9344LXUH1X/TRteYkiot+ooUo98W/LAngxe8itPTKM4fruFGtaqrJUyhWfF26ZwWc5sL02Dn7dLQgbxraCaVp5PN1DAENKWS9QRCaUHROOpb0wyTF0dNr10jySIWaIvAfSZBMotnEAPGRzdcxO0ZYLfg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582762347415902.7693911719747; Wed, 26 Feb 2020 16:12:27 -0800 (PST) Received: from localhost ([::1]:52042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76mw-0005eQ-8v for importer@patchew.org; Wed, 26 Feb 2020 19:12:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43280) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76ha-0004rj-27 for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j76hY-0005w2-57 for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:53 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:46358 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j76hX-0005uy-WF for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:52 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-90-wmIHiigfOym8KHFOxlbhGQ-1; Wed, 26 Feb 2020 19:06:49 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ABE4F107ACC4; Thu, 27 Feb 2020 00:06:48 +0000 (UTC) Received: from probe.redhat.com (ovpn-123-58.rdu2.redhat.com [10.10.123.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2AB642708E; Thu, 27 Feb 2020 00:06:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582762011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AJefKQtoki8CCsDVwlXv0xNzlmDcB+4Ud4A3n2u5We0=; b=UqxBkDLjPtemty8+mpOWQ4VLpp6Gl0lq49WQUGd6Xe8MXZ8C4i+0OJNmWIEJOV0Nrvq7s+ 3R9sKJsvDgcTTA01mHC7Y2kjSs/oysbou4V24Q0i9Tzc7XLL8mPcnMo7mLrTrRt7QLogIx 7Gt7b7smKWG1vMgGKSNsdO32W7vSqvM= X-MC-Unique: wmIHiigfOym8KHFOxlbhGQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v6 6/9] iotests: use python logging for iotests.log() Date: Wed, 26 Feb 2020 19:06:36 -0500 Message-Id: <20200227000639.9644-7-jsnow@redhat.com> In-Reply-To: <20200227000639.9644-1-jsnow@redhat.com> References: <20200227000639.9644-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , John Snow , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We can turn logging on/off globally instead of per-function. Remove use_log from run_job, and use python logging to turn on diffable output when we run through a script entry point. iotest 245 changes output order due to buffering reasons. Signed-off-by: John Snow --- tests/qemu-iotests/030 | 4 +-- tests/qemu-iotests/245 | 1 + tests/qemu-iotests/245.out | 24 ++++++++--------- tests/qemu-iotests/iotests.py | 50 +++++++++++++++++++++-------------- 4 files changed, 45 insertions(+), 34 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index aa911d266a..104e3cee1b 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -411,8 +411,8 @@ class TestParallelOps(iotests.QMPTestCase): result =3D self.vm.qmp('block-job-set-speed', device=3D'drive0', s= peed=3D0) self.assert_qmp(result, 'return', {}) =20 - self.vm.run_job(job=3D'drive0', auto_dismiss=3DTrue, use_log=3DFal= se) - self.vm.run_job(job=3D'node4', auto_dismiss=3DTrue, use_log=3DFals= e) + self.vm.run_job(job=3D'drive0', auto_dismiss=3DTrue) + self.vm.run_job(job=3D'node4', auto_dismiss=3DTrue) self.assert_no_active_block_jobs() =20 # Test a block-stream and a block-commit job in parallel diff --git a/tests/qemu-iotests/245 b/tests/qemu-iotests/245 index 489bf78bd0..edb40a4ae8 100755 --- a/tests/qemu-iotests/245 +++ b/tests/qemu-iotests/245 @@ -1002,5 +1002,6 @@ class TestBlockdevReopen(iotests.QMPTestCase): self.reopen(opts, {'backing': 'hd2'}) =20 if __name__ =3D=3D '__main__': + iotests.activate_logging() iotests.main(supported_fmts=3D["qcow2"], supported_protocols=3D["file"]) diff --git a/tests/qemu-iotests/245.out b/tests/qemu-iotests/245.out index a19de5214d..15c3630e92 100644 --- a/tests/qemu-iotests/245.out +++ b/tests/qemu-iotests/245.out @@ -1,17 +1,17 @@ +{"execute": "job-finalize", "arguments": {"id": "commit0"}} +{"return": {}} +{"data": {"id": "commit0", "type": "commit"}, "event": "BLOCK_JOB_PENDING"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "commit0", "len": 3145728, "offset": 3145728, "speed":= 0, "type": "commit"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micro= seconds": "USECS", "seconds": "SECS"}} +{"execute": "job-finalize", "arguments": {"id": "stream0"}} +{"return": {}} +{"data": {"id": "stream0", "type": "stream"}, "event": "BLOCK_JOB_PENDING"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "stream0", "len": 3145728, "offset": 3145728, "speed":= 0, "type": "stream"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micro= seconds": "USECS", "seconds": "SECS"}} +{"execute": "job-finalize", "arguments": {"id": "stream0"}} +{"return": {}} +{"data": {"id": "stream0", "type": "stream"}, "event": "BLOCK_JOB_PENDING"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "stream0", "len": 3145728, "offset": 3145728, "speed":= 0, "type": "stream"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micro= seconds": "USECS", "seconds": "SECS"}} .................. ---------------------------------------------------------------------- Ran 18 tests =20 OK -{"execute": "job-finalize", "arguments": {"id": "commit0"}} -{"return": {}} -{"data": {"id": "commit0", "type": "commit"}, "event": "BLOCK_JOB_PENDING"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "commit0", "len": 3145728, "offset": 3145728, "speed":= 0, "type": "commit"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micro= seconds": "USECS", "seconds": "SECS"}} -{"execute": "job-finalize", "arguments": {"id": "stream0"}} -{"return": {}} -{"data": {"id": "stream0", "type": "stream"}, "event": "BLOCK_JOB_PENDING"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "stream0", "len": 3145728, "offset": 3145728, "speed":= 0, "type": "stream"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micro= seconds": "USECS", "seconds": "SECS"}} -{"execute": "job-finalize", "arguments": {"id": "stream0"}} -{"return": {}} -{"data": {"id": "stream0", "type": "stream"}, "event": "BLOCK_JOB_PENDING"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "stream0", "len": 3145728, "offset": 3145728, "speed":= 0, "type": "stream"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micro= seconds": "USECS", "seconds": "SECS"}} diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index b02d7932fa..60c4c7f736 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -35,6 +35,14 @@ =20 assert sys.version_info >=3D (3, 6) =20 +# Use this logger for logging messages directly from the iotests module +logger =3D logging.getLogger('qemu.iotests') +logger.addHandler(logging.NullHandler()) + +# Use this logger for messages that ought to be used for diff output. +test_logger =3D logging.getLogger('qemu.iotests.diff_io') + + # This will not work if arguments contain spaces but is necessary if we # want to support the override options that ./check supports. qemu_img_args =3D [os.environ.get('QEMU_IMG_PROG', 'qemu-img')] @@ -361,10 +369,10 @@ def log(msg, filters=3D(), indent=3DNone): separators =3D (', ', ': ') if indent is None else (',', ': ') # Don't sort if it's already sorted do_sort =3D not isinstance(msg, OrderedDict) - print(json.dumps(msg, sort_keys=3Ddo_sort, - indent=3Dindent, separators=3Dseparators)) + test_logger.info(json.dumps(msg, sort_keys=3Ddo_sort, + indent=3Dindent, separators=3Dseparato= rs)) else: - print(msg) + test_logger.info(msg) =20 class Timeout: def __init__(self, seconds, errmsg=3D"Timeout"): @@ -578,7 +586,7 @@ def qmp_log(self, cmd, filters=3D(), indent=3DNone, **k= wargs): =20 # Returns None on success, and an error string on failure def run_job(self, job, auto_finalize=3DTrue, auto_dismiss=3DFalse, - pre_finalize=3DNone, cancel=3DFalse, use_log=3DTrue, wait= =3D60.0): + pre_finalize=3DNone, cancel=3DFalse, wait=3D60.0): """ run_job moves a job from creation through to dismissal. =20 @@ -591,7 +599,6 @@ def run_job(self, job, auto_finalize=3DTrue, auto_dismi= ss=3DFalse, invoked prior to issuing job-finalize, if any. :param cancel: Bool. When true, cancels the job after the pre_fina= lize callback. - :param use_log: Bool. When false, does not log QMP messages. :param wait: Float. Timeout value specifying how long to wait for = any event, in seconds. Defaults to 60.0. """ @@ -609,8 +616,7 @@ def run_job(self, job, auto_finalize=3DTrue, auto_dismi= ss=3DFalse, while True: ev =3D filter_qmp_event(self.events_wait(events, timeout=3Dwai= t)) if ev['event'] !=3D 'JOB_STATUS_CHANGE': - if use_log: - log(ev) + log(ev) continue status =3D ev['data']['status'] if status =3D=3D 'aborting': @@ -618,26 +624,18 @@ def run_job(self, job, auto_finalize=3DTrue, auto_dis= miss=3DFalse, for j in result['return']: if j['id'] =3D=3D job: error =3D j['error'] - if use_log: - log('Job failed: %s' % (j['error'])) + log('Job failed: %s' % (j['error'])) elif status =3D=3D 'ready': self.qmp_log('job-complete', id=3Djob) elif status =3D=3D 'pending' and not auto_finalize: if pre_finalize: pre_finalize() - if cancel and use_log: + if cancel: self.qmp_log('job-cancel', id=3Djob) - elif cancel: - self.qmp('job-cancel', id=3Djob) - elif use_log: + else: self.qmp_log('job-finalize', id=3Djob) - else: - self.qmp('job-finalize', id=3Djob) elif status =3D=3D 'concluded' and not auto_dismiss: - if use_log: - self.qmp_log('job-dismiss', id=3Djob) - else: - self.qmp('job-dismiss', id=3Djob) + self.qmp_log('job-dismiss', id=3Djob) elif status =3D=3D 'null': return error =20 @@ -953,7 +951,7 @@ def notrun(reason): seq =3D os.path.basename(sys.argv[0]) =20 open('%s/%s.notrun' % (output_dir, seq), 'w').write(reason + '\n') - print('%s not run: %s' % (seq, reason)) + logger.warning("%s not run: %s", seq, reason) sys.exit(0) =20 def case_notrun(reason): @@ -1136,6 +1134,7 @@ def execute_setup_common(supported_fmts: Collection[s= tr] =3D (), if debug: sys.argv.remove('-d') logging.basicConfig(level=3D(logging.DEBUG if debug else logging.WARN)) + logger.debug("iotests debugging messages active") =20 return debug =20 @@ -1148,14 +1147,25 @@ def execute_test(*args, test_function=3DNone, **kwa= rgs): else: test_function() =20 +def activate_logging(): + """Activate iotests.log() output to stdout for script-style tests.""" + handler =3D logging.StreamHandler(stream=3Dsys.stdout) + formatter =3D logging.Formatter('%(message)s') + handler.setFormatter(formatter) + test_logger.addHandler(handler) + test_logger.setLevel(logging.INFO) + test_logger.propagate =3D False + # This is called from script-style iotests without a single point of entry def script_initialize(*args, **kwargs): """Initialize script-style tests without running any tests.""" + activate_logging() execute_setup_common(*args, **kwargs) =20 # This is called from script-style iotests with a single point of entry def script_main(test_function, *args, **kwargs): """Run script-style tests outside of the unittest framework""" + activate_logging() execute_test(*args, test_function=3Dtest_function, **kwargs) =20 # This is called from unittest style iotests --=20 2.21.1 From nobody Thu Nov 13 20:40:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582762076; cv=none; d=zohomail.com; s=zohoarc; b=XU4If5BQNDmSbcXINlQqSCZFC9mfy3tqZIaBb+8JNNWikTf9Nf4gsC/9JpKh8PkUhSXhqMNLv8upTJSVsBgkJbCXmMABlPnEytdO801tT07hR4TO+h5g7/5XJ5yOTzd9MG7zH5/35RhQztPtPvYZ0aDKYKz5/rPaiTLAtyvBRGE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582762076; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SGiQVnf46PSJrSTolJI4zT48hbs3f22awRHyKDmrIbo=; b=ihXjwhwB1LF1X3odMqgCGpffQJKnEJFIQ003mdLGfK3+K2YzIWHS+dT5XAmdKaeLLU0j9b6cvAwPWuFV4MHV2JXsH1bkBh6afXCpcr6sPmTp0gVycVtPIcvE4z4ioWH3Ke4V5amocDjiTvk9kfxiqTXK3qm/ZLjw4NrET105OD4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582762076227538.7431740705883; Wed, 26 Feb 2020 16:07:56 -0800 (PST) Received: from localhost ([::1]:51954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76iZ-0006aG-2e for importer@patchew.org; Wed, 26 Feb 2020 19:07:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43260) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76hZ-0004r7-MY for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j76hY-0005xZ-JN for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:53 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:46383 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j76hY-0005vx-EO for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:52 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-337-gFb_z9xLP0qlp_h2F1umFg-1; Wed, 26 Feb 2020 19:06:50 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5304F107ACC5; Thu, 27 Feb 2020 00:06:49 +0000 (UTC) Received: from probe.redhat.com (ovpn-123-58.rdu2.redhat.com [10.10.123.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id C7639390; Thu, 27 Feb 2020 00:06:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582762012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SGiQVnf46PSJrSTolJI4zT48hbs3f22awRHyKDmrIbo=; b=WRUxzE4z9O9LiMZZW0fzzGKgyil/2kZYbzsXs6WZgLTIsbg1xWTkNrqiIeBVxiLhZ3flEO Rl5AOE9o/u41BlsnZOaQpE0osFw5G7tF2ez2TNscE+YXjOXbxbrBHBP/bNFQbsOVf4NOeK gtmtqhCFAzDNh8uXPfV+kadxddzOot8= X-MC-Unique: gFb_z9xLP0qlp_h2F1umFg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v6 7/9] iotests: ignore import warnings from pylint Date: Wed, 26 Feb 2020 19:06:37 -0500 Message-Id: <20200227000639.9644-8-jsnow@redhat.com> In-Reply-To: <20200227000639.9644-1-jsnow@redhat.com> References: <20200227000639.9644-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , John Snow , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The right way to solve this is to come up with a virtual environment infrastructure that sets all the paths correctly, and/or to create installable python modules that can be imported normally. That's hard, so just silence this error for now. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 60c4c7f736..214f59995e 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -30,6 +30,7 @@ from collections import OrderedDict from typing import Collection =20 +# pylint: disable=3Dimport-error, wrong-import-position sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) from qemu import qtest =20 --=20 2.21.1 From nobody Thu Nov 13 20:40:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582762425; cv=none; d=zohomail.com; s=zohoarc; b=h955CN/NdaUyZ2lwWnf7zsJtrSjXhdfHnPWdmogzOoZJ03556JCgR+/DER0kzGIBJ7+Vs2x1lTorIPNLoU0s/TJMcpGi4h82cgvcbz2pnoVXUSBKJpkvE8L2tlq/eLE4bAKq6iH8+UDuUzTGAHNh7n9oISn7MlRmy2fyaAuaPB8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582762425; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4oPJhfkI0aRGGAECXKuAWDJVkZzi1afNH0v3JIceBRE=; b=k0QBZAjwQk8ZTYC9N9NHIeNX++3EKfdAVa7sDwFUHv4DIYFbJyJxbSin3rXg0f9SkmIOZ9fRVp94Xz1vCYhXyth773didrnDjgo+SRTHvkA8Z3D+sjUj0N22IzPM2CeQKW8d/y/86UKAR4nY755JPFBjyCxVQpILjCi/4XW/Tgs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582762425195867.2550464865824; Wed, 26 Feb 2020 16:13:45 -0800 (PST) Received: from localhost ([::1]:52056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76oB-0006bo-EU for importer@patchew.org; Wed, 26 Feb 2020 19:13:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43359) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76hc-0004w9-58 for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j76hb-000642-2P for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:56 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:41472 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j76ha-000635-Uw for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:06:55 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-185-ilqkU8zhMEigNxUy8-w1pQ-1; Wed, 26 Feb 2020 19:06:51 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EDF631005514; Thu, 27 Feb 2020 00:06:49 +0000 (UTC) Received: from probe.redhat.com (ovpn-123-58.rdu2.redhat.com [10.10.123.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7038A390; Thu, 27 Feb 2020 00:06:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582762014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4oPJhfkI0aRGGAECXKuAWDJVkZzi1afNH0v3JIceBRE=; b=RzPoKAff0zWW5fN0hSrIbjjqTTu2dJ4ZNcqFVT/bunWSmQDsQXUIyzJwYa6tPFUMnJFYD0 nVU44HhOw28uiK8mNW6xEMLCyhEKXXefXWeHojExhXZBsn4FBy+FxbBe4HQXtSdqT4A6Tz Xzo/FB5IIb2glfkNPC8OO5WwC1AqBEc= X-MC-Unique: ilqkU8zhMEigNxUy8-w1pQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v6 8/9] iotests: don't use 'format' for drive_add Date: Wed, 26 Feb 2020 19:06:38 -0500 Message-Id: <20200227000639.9644-9-jsnow@redhat.com> In-Reply-To: <20200227000639.9644-1-jsnow@redhat.com> References: <20200227000639.9644-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , John Snow , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" It shadows (with a different type) the built-in format. Use something else. Signed-off-by: John Snow Reviewed-by: Max Reitz Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/qemu-iotests/055 | 3 ++- tests/qemu-iotests/iotests.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/055 b/tests/qemu-iotests/055 index 82b9f5f47d..4175fff5e4 100755 --- a/tests/qemu-iotests/055 +++ b/tests/qemu-iotests/055 @@ -469,7 +469,8 @@ class TestDriveCompression(iotests.QMPTestCase): qemu_img('create', '-f', fmt, blockdev_target_img, str(TestDriveCompression.image_len), *args) if attach_target: - self.vm.add_drive(blockdev_target_img, format=3Dfmt, interface= =3D"none") + self.vm.add_drive(blockdev_target_img, + img_format=3Dfmt, interface=3D"none") =20 self.vm.launch() =20 diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 214f59995e..8bf640c632 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -492,21 +492,21 @@ def add_drive_raw(self, opts): self._args.append(opts) return self =20 - def add_drive(self, path, opts=3D'', interface=3D'virtio', format=3Dim= gfmt): + def add_drive(self, path, opts=3D'', interface=3D'virtio', img_format= =3Dimgfmt): '''Add a virtio-blk drive to the VM''' options =3D ['if=3D%s' % interface, 'id=3Ddrive%d' % self._num_drives] =20 if path is not None: options.append('file=3D%s' % path) - options.append('format=3D%s' % format) + options.append('format=3D%s' % img_format) options.append('cache=3D%s' % cachemode) options.append('aio=3D%s' % aiomode) =20 if opts: options.append(opts) =20 - if format =3D=3D 'luks' and 'key-secret' not in opts: + if img_format =3D=3D 'luks' and 'key-secret' not in opts: # default luks support if luks_default_secret_object not in self._args: self.add_object(luks_default_secret_object) --=20 2.21.1 From nobody Thu Nov 13 20:40:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582762093; cv=none; d=zohomail.com; s=zohoarc; b=hI9er2BpPvpbrb7riwy+f6JSRpMWtf4GBSLTs7ftcsaHCgXqlPWciEX675jkDDbHCZwN8cxyeboFOMkTup6QzLVPi/i2mknIwp+sp3+8swRWIPOtJVX+SF001wydw7eo4v0GDbvltsd7163YnLcqINazAYoLAeA5LP8QGcVHaWk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582762093; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=F2/TLEFNAnR/6w7FDslSwzZinHAthOw8JkWxuNg8xwY=; b=e0LV0IdaGSbcK6SXfXMj2GStQDglIwYQ7gEAs2VHNNiZftEBVHn1mroOPmmNzTAgyB7ADvrI7hXPliHNJCUPOrdrvQgQZLCZGQXzQYCogiUeLJozPfFQatPQnhpcJbLvRkv9GANgkGXpZzpoyBWbvmKYGJGmAqqo0x8+eLd9yNE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582762093411606.0860101526582; Wed, 26 Feb 2020 16:08:13 -0800 (PST) Received: from localhost ([::1]:51958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76iq-0007Mt-4x for importer@patchew.org; Wed, 26 Feb 2020 19:08:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43616) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j76hn-0005SD-DT for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:07:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j76hm-0006Xm-C6 for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:07:07 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:21851 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j76hm-00069l-7Y for qemu-devel@nongnu.org; Wed, 26 Feb 2020 19:07:06 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-287-VMiw1pFgN9W-VOmcYnoqNw-1; Wed, 26 Feb 2020 19:06:51 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 95FE918FF661; Thu, 27 Feb 2020 00:06:50 +0000 (UTC) Received: from probe.redhat.com (ovpn-123-58.rdu2.redhat.com [10.10.123.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17963390; Thu, 27 Feb 2020 00:06:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582762017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F2/TLEFNAnR/6w7FDslSwzZinHAthOw8JkWxuNg8xwY=; b=CDxs1mCzJDl2iWWht0/T9y/PgM6RW8RuryXxtizXeLsrWyUxMJsWAGPRYUOp+LejJS9Nfz 6VWdDR6Q5M16guw8/nXyj2ngwiVmXssHjlLgdOQSrAXLrVrKS14Xe1IqzreOMdAubikZnQ /gAWSQau7Ig83ZKfIDNWme4vQ6+elZk= X-MC-Unique: VMiw1pFgN9W-VOmcYnoqNw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v6 9/9] iotests: add pylintrc file Date: Wed, 26 Feb 2020 19:06:39 -0500 Message-Id: <20200227000639.9644-10-jsnow@redhat.com> In-Reply-To: <20200227000639.9644-1-jsnow@redhat.com> References: <20200227000639.9644-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , John Snow , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Repeatable results. run `pylint iotests.py` and you should get a pass. Signed-off-by: John Snow --- tests/qemu-iotests/pylintrc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/qemu-iotests/pylintrc diff --git a/tests/qemu-iotests/pylintrc b/tests/qemu-iotests/pylintrc new file mode 100644 index 0000000000..feed506f75 --- /dev/null +++ b/tests/qemu-iotests/pylintrc @@ -0,0 +1,20 @@ +[MESSAGES CONTROL] + +# Disable the message, report, category or checker with the given id(s). Y= ou +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once). You can also use "--disable=3Dal= l" to +# disable everything first and then reenable specific checks. For example,= if +# you want to run only the similarities checker, you can use "--disable=3D= all +# --enable=3Dsimilarities". If you want to run only the classes checker, b= ut have +# no Warning level messages displayed, use "--disable=3Dall --enable=3Dcla= sses +# --disable=3DW". +disable=3Dinvalid-name, + missing-docstring, + line-too-long, + too-many-lines, + too-few-public-methods, + too-many-arguments, + too-many-locals, + too-many-branches, + too-many-public-methods, \ No newline at end of file --=20 2.21.1