From nobody Sat May 18 10:48:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; spf=pass (zoho.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=1568712308; cv=none; d=zoho.com; s=zohoarc; b=hr3OPR1VAp91Z9VfTdd+kuUD2Ye1OMQBgtkGC940eYOfCNjIkGp0BOA/U/y5sZAGjPd3/cdoLcDdRgaRkKgMJ8PSjtplahsI/h5r+r+sTUBBd87OtEjgBz5Y8xG/EVH/fzkV9DZ0wZMolgAalzUkh2Dpo2wvAtJuLc6gYcqFNCw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568712308; h=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:ARC-Authentication-Results; bh=uEsQPTL2saPfvTj0lVTZq8vVG14SMiijYG9huG18ZJI=; b=D9O4ov2zBBZvmNXB7SHtVYUhGSFbyLV43kDez/y0femUm8MUyyc0CMXzHoaxAymk/WIpxClZ8CcjTonxHo06TWOzfawpm8MUSfO/yJ0R3u0hndJ2l0uWyWpDsNVhNqblD3/HlrCcLte8iGiLXOguK5coxU71EbSQYqAdm5plPUw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568712308937989.3504376675287; Tue, 17 Sep 2019 02:25:08 -0700 (PDT) Received: from localhost ([::1]:43150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iA9jL-0006HY-Vh for importer@patchew.org; Tue, 17 Sep 2019 05:25:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34425) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iA9em-0001WF-A2 for qemu-devel@nongnu.org; Tue, 17 Sep 2019 05:20:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iA9el-0004Ud-3v for qemu-devel@nongnu.org; Tue, 17 Sep 2019 05:20:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60736) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iA9eh-0004S9-Tg; Tue, 17 Sep 2019 05:20:16 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CFA4D10CC1ED; Tue, 17 Sep 2019 09:20:14 +0000 (UTC) Received: from localhost (ovpn-116-130.ams2.redhat.com [10.36.116.130]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 037995D6C8; Tue, 17 Sep 2019 09:20:11 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Tue, 17 Sep 2019 11:19:58 +0200 Message-Id: <20190917092004.999-2-mreitz@redhat.com> In-Reply-To: <20190917092004.999-1-mreitz@redhat.com> References: <20190917092004.999-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Tue, 17 Sep 2019 09:20:15 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v4 1/7] iotests: Prefer null-co over null-aio 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 , Thomas Huth , qemu-devel@nongnu.org, Max Reitz , Andrey Shinkevich , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We use null-co basically everywhere in the iotests. Unless we want to test null-aio specifically, we should use it instead (for consistency). Signed-off-by: Max Reitz Reviewed-by: John Snow Reviewed-by: Thomas Huth Reviewed-by: Andrey Shinkevich --- tests/qemu-iotests/093 | 7 +++---- tests/qemu-iotests/245 | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093 index 3c4f5173ce..50c1e7f2ec 100755 --- a/tests/qemu-iotests/093 +++ b/tests/qemu-iotests/093 @@ -267,13 +267,12 @@ class ThrottleTestCoroutine(ThrottleTestCase): test_img =3D "null-co://" =20 class ThrottleTestGroupNames(iotests.QMPTestCase): - test_img =3D "null-aio://" max_drives =3D 3 =20 def setUp(self): self.vm =3D iotests.VM() for i in range(0, self.max_drives): - self.vm.add_drive(self.test_img, + self.vm.add_drive("null-co://", "throttling.iops-total=3D100,file.read-zeroe= s=3Don") self.vm.launch() =20 @@ -376,10 +375,10 @@ class ThrottleTestRemovableMedia(iotests.QMPTestCase): =20 def test_removable_media(self): # Add a couple of dummy nodes named cd0 and cd1 - result =3D self.vm.qmp("blockdev-add", driver=3D"null-aio", + result =3D self.vm.qmp("blockdev-add", driver=3D"null-co", read_zeroes=3DTrue, node_name=3D"cd0") self.assert_qmp(result, 'return', {}) - result =3D self.vm.qmp("blockdev-add", driver=3D"null-aio", + result =3D self.vm.qmp("blockdev-add", driver=3D"null-co", read_zeroes=3DTrue, node_name=3D"cd1") self.assert_qmp(result, 'return', {}) =20 diff --git a/tests/qemu-iotests/245 b/tests/qemu-iotests/245 index 41218d5f1d..e66a23c5f0 100644 --- a/tests/qemu-iotests/245 +++ b/tests/qemu-iotests/245 @@ -598,7 +598,7 @@ class TestBlockdevReopen(iotests.QMPTestCase): ################## ###### null ###### ################## - opts =3D {'driver': 'null-aio', 'node-name': 'root', 'size': 1024} + opts =3D {'driver': 'null-co', 'node-name': 'root', 'size': 1024} =20 result =3D self.vm.qmp('blockdev-add', conv_keys =3D False, **opts) self.assert_qmp(result, 'return', {}) --=20 2.21.0 From nobody Sat May 18 10:48:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; spf=pass (zoho.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=1568712148; cv=none; d=zoho.com; s=zohoarc; b=IMJB9dD0f5hynNL/VpuPnx6jcFTRI7mG5iIVinJActICAh+xHnoBhz+4ihI4nzcKSeWMTFZBnfw2DmlGAYZF3tC5PTqZOdic5/hbVYEa9VAnhprB7WSW5gicvwlAGSN3Jv+lMXfAvA/UNISprrcp2munWPFNPn4xC38Fn9P+uMg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568712148; h=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:ARC-Authentication-Results; bh=+PgVulsZHicaYxKRgY9ZgIChnqd5CwtID83eJj/3LXw=; b=VecDvK2/YUSKC2sWKXr9eAjomJKKf3pGYFjkf7O8uPiVWRQHZhA0k8Q0E+dNN5zMp9EdTIkIBeTL9h2at8qPDXOzY9F/7DNq23QycBwKlQR/clPxmQvNzibxBUq4My1iEOZskbaFyR+DkuEZPON/X/fDLN7iMwICEZC/aHVt6ZQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1568712148069946.2360314663673; Tue, 17 Sep 2019 02:22:28 -0700 (PDT) Received: from localhost ([::1]:43122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iA9go-0003W9-Dh for importer@patchew.org; Tue, 17 Sep 2019 05:22:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34456) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iA9er-0001eC-8l for qemu-devel@nongnu.org; Tue, 17 Sep 2019 05:20:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iA9ep-0004Xz-Tv for qemu-devel@nongnu.org; Tue, 17 Sep 2019 05:20:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38065) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iA9en-0004VZ-4U; Tue, 17 Sep 2019 05:20:21 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6B63B3CA16; Tue, 17 Sep 2019 09:20:20 +0000 (UTC) Received: from localhost (ovpn-116-130.ams2.redhat.com [10.36.116.130]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6A3CF60126; Tue, 17 Sep 2019 09:20:17 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Tue, 17 Sep 2019 11:19:59 +0200 Message-Id: <20190917092004.999-3-mreitz@redhat.com> In-Reply-To: <20190917092004.999-1-mreitz@redhat.com> References: <20190917092004.999-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 17 Sep 2019 09:20:20 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v4 2/7] iotests: Allow skipping test cases 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 , Thomas Huth , qemu-devel@nongnu.org, Max Reitz , Andrey Shinkevich , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" case_notrun() does not actually skip the current test case. It just adds a "notrun" note and then returns to the caller, who manually has to skip the test. Generally, skipping a test case is as simple as returning from the current function, but not always: For example, this model does not allow skipping tests already in the setUp() function. Thus, add a QMPTestCase.case_skip() function that invokes case_notrun() and then self.skipTest(). To make this work, we need to filter the information on how many test cases were skipped from the unittest output. Signed-off-by: Max Reitz Reviewed-by: John Snow Reviewed-by: Andrey Shinkevich --- tests/qemu-iotests/iotests.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index b26271187c..e46f3b6aed 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -802,6 +802,11 @@ class QMPTestCase(unittest.TestCase): return self.pause_wait(job_id) return result =20 + def case_skip(self, reason): + '''Skip this test case''' + case_notrun(reason) + self.skipTest(reason) + =20 def notrun(reason): '''Skip this test suite''' @@ -813,7 +818,11 @@ def notrun(reason): sys.exit(0) =20 def case_notrun(reason): - '''Skip this test case''' + '''Mark this test case as not having been run (without actually + skipping it, that is left to the caller). See + QMPTestCase.case_skip() for a variant that actually skips the + current test case.''' + # Each test in qemu-iotests has a number ("seq") seq =3D os.path.basename(sys.argv[0]) =20 @@ -904,8 +913,15 @@ def execute_unittest(output, verbosity, debug): unittest.main(testRunner=3Drunner) finally: if not debug: - sys.stderr.write(re.sub(r'Ran (\d+) tests? in [\d.]+s', - r'Ran \1 tests', output.getvalue())) + out =3D output.getvalue() + out =3D re.sub(r'Ran (\d+) tests? in [\d.]+s', r'Ran \1 tests'= , out) + + # Hide skipped tests from the reference output + out =3D re.sub(r'OK \(skipped=3D\d+\)', 'OK', out) + out_first_line, out_rest =3D out.split('\n', 1) + out =3D out_first_line.replace('s', '.') + '\n' + out_rest + + sys.stderr.write(out) =20 def execute_test(test_function=3DNone, supported_fmts=3D[], supported_oses=3D['linux'], --=20 2.21.0 From nobody Sat May 18 10:48:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; spf=pass (zoho.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=1568712459; cv=none; d=zoho.com; s=zohoarc; b=b+XCyBru2GlHtOdQEOLTUL7lNZ0j+1Uo1FpJNAbXJojAMjTFCHzZg0eZ275qtMo2IcNmoTUpw19+Vc6SPEVAA12U6KG2eAIXiak2gTBI+nyodxcxYSl5x9PTqOoNpJXbNOvoN8acFYivU0toiLrHfjN1Qe7M0/uqxIPFqu9Yhss= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568712459; h=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:ARC-Authentication-Results; bh=KfWvi6zbqfKAu4mt4sLdfj7ROEL9Cgx1pZL0Jk0VqQk=; b=M1sFNk+HrmO259dCr4L62cHD1D9jBtYnZnHfw3K88Qp74UTHaC60QQ+OCo20wQW5BCGrNwx6WcBCtWLHpLQ0mPtUQJaYZX1jKK2pomkw+TE1h4QzZ2vMQ0fyM6l1ZZyWsZkaM+ppWWYfUl0DnxvCyBspoxe5cFdZOodrw2AfK8s= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1568712459704460.2626763950643; Tue, 17 Sep 2019 02:27:39 -0700 (PDT) Received: from localhost ([::1]:43172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iA9lq-0000XJ-Hd for importer@patchew.org; Tue, 17 Sep 2019 05:27:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34479) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iA9eu-0001jA-2x for qemu-devel@nongnu.org; Tue, 17 Sep 2019 05:20:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iA9es-0004aK-Sp for qemu-devel@nongnu.org; Tue, 17 Sep 2019 05:20:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43715) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iA9eq-0004Xu-BH; Tue, 17 Sep 2019 05:20:24 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A073F3680A; Tue, 17 Sep 2019 09:20:23 +0000 (UTC) Received: from localhost (ovpn-116-130.ams2.redhat.com [10.36.116.130]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0FACB5D6B2; Tue, 17 Sep 2019 09:20:22 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Tue, 17 Sep 2019 11:20:00 +0200 Message-Id: <20190917092004.999-4-mreitz@redhat.com> In-Reply-To: <20190917092004.999-1-mreitz@redhat.com> References: <20190917092004.999-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 17 Sep 2019 09:20:23 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v4 3/7] iotests: Use case_skip() in skip_if_unsupported() 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 , Thomas Huth , qemu-devel@nongnu.org, Max Reitz , Andrey Shinkevich , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" skip_if_unsupported() should use the stronger variant case_skip(), because this allows it to be used even with setUp() (in a meaningful way). In the process, make it explicit what we expect the first argument of the func_wrapper to be (namely something derived of QMPTestCase). Signed-off-by: Max Reitz Reviewed-by: Andrey Shinkevich Reviewed-by: John Snow --- tests/qemu-iotests/iotests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index e46f3b6aed..427c34697a 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -893,14 +893,14 @@ def skip_if_unsupported(required_formats=3D[], read_o= nly=3DFalse): '''Skip Test Decorator Runs the test if all the required formats are whitelisted''' def skip_test_decorator(func): - def func_wrapper(*args, **kwargs): + def func_wrapper(test_case: QMPTestCase, *args, **kwargs): usf_list =3D list(set(required_formats) - set(supported_formats(read_only))) if usf_list: - case_notrun('{}: formats {} are not whitelisted'.format( - args[0], usf_list)) + test_case.case_skip('{}: formats {} are not whitelisted'.f= ormat( + test_case, usf_list)) else: - return func(*args, **kwargs) + return func(test_case, *args, **kwargs) return func_wrapper return skip_test_decorator =20 --=20 2.21.0 From nobody Sat May 18 10:48:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; spf=pass (zoho.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=1568712308; cv=none; d=zoho.com; s=zohoarc; b=aKkNBq6dD2085zQCa0DtwnFOqLYwLWXDFM2nCBvyoNoKePAzbz1+xD/xaNf74m4cLrJn2i3+5bJsNbFxuNcwZU4/3F11Ovrx2JslOsmGkVonKIURBh8zgyNglLbZXR3z2jmD0AdGOR1zXSisFP8OATzfhX5D7uWSXQ4gn+xShX4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568712308; h=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:ARC-Authentication-Results; bh=GKs3GuJALYANRM11CjWcqyW2b2ET5rzLQ/KoaacfvRo=; b=Zo7Dkl4c0Djyw3HQ75PjHifTVSELiHpUOhhAKvbrq1sdFQVQYQCE5UD6DE2+xQ0d+Vx9DfL8TLQO3dHVk2gl0+bBpQmgSPd+lWs7rqgMODr0wv+rq4IAHgGwraxPgeFpuP3zEZx8xg3TapnR6wSJxrXuxIuUTVx8Wf4cZhkZwMs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568712308921458.620809393047; Tue, 17 Sep 2019 02:25:08 -0700 (PDT) Received: from localhost ([::1]:43146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iA9jH-00068t-VP for importer@patchew.org; Tue, 17 Sep 2019 05:24:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34524) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iA9ez-0001sq-Mr for qemu-devel@nongnu.org; Tue, 17 Sep 2019 05:20:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iA9ey-0004j2-Ih for qemu-devel@nongnu.org; Tue, 17 Sep 2019 05:20:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45404) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iA9ev-0004cq-Ng; Tue, 17 Sep 2019 05:20:29 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 13759308FC4E; Tue, 17 Sep 2019 09:20:29 +0000 (UTC) Received: from localhost (ovpn-116-130.ams2.redhat.com [10.36.116.130]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E4EF5D9D5; Tue, 17 Sep 2019 09:20:25 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Tue, 17 Sep 2019 11:20:01 +0200 Message-Id: <20190917092004.999-5-mreitz@redhat.com> In-Reply-To: <20190917092004.999-1-mreitz@redhat.com> References: <20190917092004.999-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 17 Sep 2019 09:20:29 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v4 4/7] iotests: Let skip_if_unsupported accept a function 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 , Thomas Huth , qemu-devel@nongnu.org, Max Reitz , Andrey Shinkevich , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This lets tests use skip_if_unsupported() with a potentially variable list of required formats. Suggested-by: Kevin Wolf Signed-off-by: Max Reitz Reviewed-by: Andrey Shinkevich --- tests/qemu-iotests/iotests.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 427c34697a..a42702b6b9 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -894,8 +894,12 @@ def skip_if_unsupported(required_formats=3D[], read_on= ly=3DFalse): Runs the test if all the required formats are whitelisted''' def skip_test_decorator(func): def func_wrapper(test_case: QMPTestCase, *args, **kwargs): - usf_list =3D list(set(required_formats) - - set(supported_formats(read_only))) + if callable(required_formats): + fmts =3D required_formats(test_case) + else: + fmts =3D required_formats + + usf_list =3D list(set(fmts) - set(supported_formats(read_only)= )) if usf_list: test_case.case_skip('{}: formats {} are not whitelisted'.f= ormat( test_case, usf_list)) --=20 2.21.0 From nobody Sat May 18 10:48:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; spf=pass (zoho.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=1568712307; cv=none; d=zoho.com; s=zohoarc; b=VSbOl4kpMcDH6vTP9gLr4iLSl+YPp8/Urq+0TxE+7QRE8bCnW9KG7rTRcc56+rhuk1xF9AaBDRAZvRJGWW2HsTG2vh6GQm8weNjzaLnMBBpjlxd7sOiwoxhtVWIJLUnTPFKGm905Lk6YtURkHvvPni0b1ZgYYS3UnFPe2wnl/xA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568712307; h=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:ARC-Authentication-Results; bh=Hi9FgMjtopJNf3UjAu7GtTIFGNPQ6OVJHT8FYcIF724=; b=XZn4CFG+AihYwF9jEuZQdFITJVfWl49/9nEAOnTQ/zZu5k6s9NHV2oN5t+IL4ht7MREI74ayLKUR5xfxM4K30+MKJIdJ7dxMWxi2SPua+TasdI9hvVyO961ljq7IfhzwDCJVs3z2W0NW11i1oYPo+VAtA0hOut5BxAiaaJejT5s= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 156871230710714.314248109722598; Tue, 17 Sep 2019 02:25:07 -0700 (PDT) Received: from localhost ([::1]:43148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iA9jK-0006FD-QK for importer@patchew.org; Tue, 17 Sep 2019 05:25:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34556) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iA9f2-0001w6-Az for qemu-devel@nongnu.org; Tue, 17 Sep 2019 05:20:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iA9f1-0004l2-5X for qemu-devel@nongnu.org; Tue, 17 Sep 2019 05:20:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60846) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iA9ey-0004in-Nl; Tue, 17 Sep 2019 05:20:32 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0C05010CC1ED; Tue, 17 Sep 2019 09:20:32 +0000 (UTC) Received: from localhost (ovpn-116-130.ams2.redhat.com [10.36.116.130]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77BB55D9DC; Tue, 17 Sep 2019 09:20:31 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Tue, 17 Sep 2019 11:20:02 +0200 Message-Id: <20190917092004.999-6-mreitz@redhat.com> In-Reply-To: <20190917092004.999-1-mreitz@redhat.com> References: <20190917092004.999-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Tue, 17 Sep 2019 09:20:32 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v4 5/7] iotests: Test driver whitelisting in 093 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 , Thomas Huth , qemu-devel@nongnu.org, Max Reitz , Andrey Shinkevich , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" null-aio may not be whitelisted. Skip all test cases that require it. (And skip the whole test if null-co is not whitelisted.) Signed-off-by: Max Reitz Reviewed-by: Andrey Shinkevich Reviewed-by: John Snow --- tests/qemu-iotests/093 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093 index 50c1e7f2ec..f03fa24a07 100755 --- a/tests/qemu-iotests/093 +++ b/tests/qemu-iotests/093 @@ -24,7 +24,7 @@ import iotests nsec_per_sec =3D 1000000000 =20 class ThrottleTestCase(iotests.QMPTestCase): - test_img =3D "null-aio://" + test_driver =3D "null-aio" max_drives =3D 3 =20 def blockstats(self, device): @@ -35,10 +35,14 @@ class ThrottleTestCase(iotests.QMPTestCase): return stat['rd_bytes'], stat['rd_operations'], stat['wr_b= ytes'], stat['wr_operations'] raise Exception("Device not found for blockstats: %s" % device) =20 + def required_drivers(self): + return [self.test_driver] + + @iotests.skip_if_unsupported(required_drivers) def setUp(self): self.vm =3D iotests.VM() for i in range(0, self.max_drives): - self.vm.add_drive(self.test_img, "file.read-zeroes=3Don") + self.vm.add_drive(self.test_driver + "://", "file.read-zeroes= =3Don") self.vm.launch() =20 def tearDown(self): @@ -264,7 +268,7 @@ class ThrottleTestCase(iotests.QMPTestCase): self.assertEqual(self.blockstats('drive1')[0], 4096) =20 class ThrottleTestCoroutine(ThrottleTestCase): - test_img =3D "null-co://" + test_driver =3D "null-co" =20 class ThrottleTestGroupNames(iotests.QMPTestCase): max_drives =3D 3 @@ -425,4 +429,6 @@ class ThrottleTestRemovableMedia(iotests.QMPTestCase): =20 =20 if __name__ =3D=3D '__main__': + if 'null-co' not in iotests.supported_formats(): + iotests.notrun('null-co driver support missing') iotests.main(supported_fmts=3D["raw"]) --=20 2.21.0 From nobody Sat May 18 10:48:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; spf=pass (zoho.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=1568712587; cv=none; d=zoho.com; s=zohoarc; b=kU+/7JRnc46oSPSiUsW45QJu/NBNFvX55bukHc1XgdBbIAKV3EqWWdBx6c2dCoXBKyee5yFgyoJHHTLFqYccJq44eqAyH7TvtEQz4cFh7HXbL4utA72D1xU1MJ1s5lIrt5JP4Sz3jfKin7/DHDi5PfQQPiMmueBhHOJyEDkq+sw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568712587; h=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:ARC-Authentication-Results; bh=jumx+FiElCQNcn5GqzMXSJ2z2rwzu7TCNWh0ckk7Pto=; b=TEZOOVoWHZ8Rz34rIDJYC4Eg6aQXIrcmBu7c9HquJ7c1QedQ/aVQz9pQDYrfWP25GXqV95X9T54lP/hkTIxn29oM7cnO7RvzWkVnf5ZQhoOG+OSO3q+NVDe2J4xQNGMGBd/Bvd/xjYI6U8FQkH2JBtwF2l0FyLVtQb6AHW1EL0w= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1568712587965473.1135655623516; Tue, 17 Sep 2019 02:29:47 -0700 (PDT) Received: from localhost ([::1]:43190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iA9nu-0002iL-Mq for importer@patchew.org; Tue, 17 Sep 2019 05:29:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34614) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iA9f8-00026B-VV for qemu-devel@nongnu.org; Tue, 17 Sep 2019 05:20:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iA9f7-0004oL-He for qemu-devel@nongnu.org; Tue, 17 Sep 2019 05:20:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47500) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iA9f4-0004mY-CP; Tue, 17 Sep 2019 05:20:38 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9EB2E18C891B; Tue, 17 Sep 2019 09:20:37 +0000 (UTC) Received: from localhost (ovpn-116-130.ams2.redhat.com [10.36.116.130]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8F159608C2; Tue, 17 Sep 2019 09:20:34 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Tue, 17 Sep 2019 11:20:03 +0200 Message-Id: <20190917092004.999-7-mreitz@redhat.com> In-Reply-To: <20190917092004.999-1-mreitz@redhat.com> References: <20190917092004.999-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.70]); Tue, 17 Sep 2019 09:20:37 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v4 6/7] iotests: Test driver whitelisting in 136 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 , Thomas Huth , qemu-devel@nongnu.org, Max Reitz , Andrey Shinkevich , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" null-aio may not be whitelisted. Skip all test cases that require it. Signed-off-by: Max Reitz Reviewed-by: Andrey Shinkevich Reviewed-by: John Snow --- tests/qemu-iotests/136 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/136 b/tests/qemu-iotests/136 index a46a7b7630..012ea111ac 100755 --- a/tests/qemu-iotests/136 +++ b/tests/qemu-iotests/136 @@ -30,7 +30,7 @@ bad_offset =3D bad_sector * 512 blkdebug_file =3D os.path.join(iotests.test_dir, 'blkdebug.conf') =20 class BlockDeviceStatsTestCase(iotests.QMPTestCase): - test_img =3D "null-aio://" + test_driver =3D "null-aio" total_rd_bytes =3D 0 total_rd_ops =3D 0 total_wr_bytes =3D 0 @@ -67,6 +67,10 @@ sector =3D "%d" ''' % (bad_sector, bad_sector)) file.close() =20 + def required_drivers(self): + return [self.test_driver] + + @iotests.skip_if_unsupported(required_drivers) def setUp(self): drive_args =3D [] drive_args.append("stats-intervals.0=3D%d" % interval_length) @@ -76,8 +80,8 @@ sector =3D "%d" (self.account_failed and "on" or "off")) drive_args.append("file.image.read-zeroes=3Don") self.create_blkdebug_file() - self.vm =3D iotests.VM().add_drive('blkdebug:%s:%s' % - (blkdebug_file, self.test_img), + self.vm =3D iotests.VM().add_drive('blkdebug:%s:%s://' % + (blkdebug_file, self.test_driver), ','.join(drive_args)) self.vm.launch() # Set an initial value for the clock @@ -337,7 +341,9 @@ class BlockDeviceStatsTestAccountBoth(BlockDeviceStatsT= estCase): account_failed =3D True =20 class BlockDeviceStatsTestCoroutine(BlockDeviceStatsTestCase): - test_img =3D "null-co://" + test_driver =3D "null-co" =20 if __name__ =3D=3D '__main__': + if 'null-co' not in iotests.supported_formats(): + iotests.notrun('null-co driver support missing') iotests.main(supported_fmts=3D["raw"]) --=20 2.21.0 From nobody Sat May 18 10:48:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; spf=pass (zoho.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=1568712459; cv=none; d=zoho.com; s=zohoarc; b=OHIk5f94GT18Jtf7TmZwZHHmiRlmHn/pnwRGCv0hpP/KRlfR+1r7zFwbJvE07wuXrkuYlIkSzt/DGXFgTVCdmCjhRMpKafNSb5iXZrL+x44/4Jg/N4z9L4AMo5vvlh3sIJexlN1QDKSM9W9gIIMseJDZpu+Chs+gvfO1hpzV+bs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568712459; h=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:ARC-Authentication-Results; bh=lHU1x8TjR2FiMagChSovgibonqpqWBN2czVRIM4W5+s=; b=Ee5OgyYYXRLdHiVG23CkTkKyb2/VG2GqP4BuPGKkA3vtAR2z/iIGzB+h09sLmpuz7FL9k+Az2VI+vs5i7anrAxtJ1pRcFWxzOOB4wE4YN50F0SCB1naFdv5HEDnOdPIh74a6KnNQOjlOlZCcvo0T20lCcTjusfmdNJpIKrHkGuw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1568712459689663.433148290201; Tue, 17 Sep 2019 02:27:39 -0700 (PDT) Received: from localhost ([::1]:43170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iA9lp-0000Wt-CK for importer@patchew.org; Tue, 17 Sep 2019 05:27:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34632) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iA9fC-0002BF-B9 for qemu-devel@nongnu.org; Tue, 17 Sep 2019 05:20:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iA9fA-0004ps-Q8 for qemu-devel@nongnu.org; Tue, 17 Sep 2019 05:20:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55586) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iA9f7-0004o1-KO; Tue, 17 Sep 2019 05:20:41 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B91E5309175F; Tue, 17 Sep 2019 09:20:40 +0000 (UTC) Received: from localhost (ovpn-116-130.ams2.redhat.com [10.36.116.130]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 341C260BE1; Tue, 17 Sep 2019 09:20:39 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Tue, 17 Sep 2019 11:20:04 +0200 Message-Id: <20190917092004.999-8-mreitz@redhat.com> In-Reply-To: <20190917092004.999-1-mreitz@redhat.com> References: <20190917092004.999-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 17 Sep 2019 09:20:40 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v4 7/7] iotests: Cache supported_formats() 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 , Thomas Huth , qemu-devel@nongnu.org, Max Reitz , Andrey Shinkevich , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: Max Reitz Reviewed-by: John Snow Reviewed-by: Andrey Shinkevich --- tests/qemu-iotests/iotests.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index a42702b6b9..b30044e1cc 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -885,9 +885,17 @@ def qemu_pipe(*args): def supported_formats(read_only=3DFalse): '''Set 'read_only' to True to check ro-whitelist Otherwise, rw-whitelist is checked''' - format_message =3D qemu_pipe("-drive", "format=3Dhelp") - line =3D 1 if read_only else 0 - return format_message.splitlines()[line].split(":")[1].split() + + if not hasattr(supported_formats, "formats"): + supported_formats.formats =3D {} + + if read_only not in supported_formats.formats: + format_message =3D qemu_pipe("-drive", "format=3Dhelp") + line =3D 1 if read_only else 0 + supported_formats.formats[read_only] =3D \ + format_message.splitlines()[line].split(":")[1].split() + + return supported_formats.formats[read_only] =20 def skip_if_unsupported(required_formats=3D[], read_only=3DFalse): '''Skip Test Decorator --=20 2.21.0