From nobody Sun Feb 8 22:54:15 2026 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=1566247001; cv=none; d=zoho.com; s=zohoarc; b=XzVvu0MBvkfEU8jonpEIcImpXdcGcFBeNNIhOyEASLDFX7DcA6Iq2o74AcAawKImbq0dfCTEVH1MKOCtpyqrITi2dgxcjW1Gjh+8kOh+kcfeHVsfND9wLoeLwBsbJBCZSFrjMc0UznlD7f9QJkp+TzC8HleuAz71cw6MqHMfYa8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566247001; 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:ARC-Authentication-Results; bh=S6T07BxbgahDlQAwxon91DL9d58RV7pwv65i5b0CIJM=; b=jendOkjzENG+CXKI8pHanq6PbIk9gqKwQqxiYBg5gGVIj1LBcc5SJRiMLzzC+Rp60coPHmFKYEvnYfsiQpAJNOtQqYy1Ulew1pBSeFsPLI8ZgoHfwpoKXHVLob5zfxvTSuA4ceYoY0gwqCveOdCU3TS0cMS3w4xgr5+qquJKEyg= 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 15662470010271020.375389869747; Mon, 19 Aug 2019 13:36:41 -0700 (PDT) Received: from localhost ([::1]:57558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzoOL-0007HS-T5 for importer@patchew.org; Mon, 19 Aug 2019 16:36:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45776) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzo7N-00015U-17 for qemu-devel@nongnu.org; Mon, 19 Aug 2019 16:19:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzo7M-0004KF-1R for qemu-devel@nongnu.org; Mon, 19 Aug 2019 16:19:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54946) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hzo7J-0004JS-Uq; Mon, 19 Aug 2019 16:19:02 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4DAF930860DC; Mon, 19 Aug 2019 20:19:01 +0000 (UTC) Received: from localhost (ovpn-204-64.brq.redhat.com [10.40.204.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5AB6A104812F; Mon, 19 Aug 2019 20:18:58 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 19 Aug 2019 22:18:44 +0200 Message-Id: <20190819201851.24418-2-mreitz@redhat.com> In-Reply-To: <20190819201851.24418-1-mreitz@redhat.com> References: <20190819201851.24418-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 19 Aug 2019 20:19:01 +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 v3 1/8] iotests: Add -display none to the qemu options 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 , John Snow , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Without this argument, qemu will print an angry message about not being able to connect to a display server if $DISPLAY is not set. For me, that breaks iotests.supported_formats() because it thus only sees ["Could", "not", "connect"] as the supported formats. Signed-off-by: Max Reitz Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- tests/qemu-iotests/check | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index c24874ff4a..a58232eefb 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -581,13 +581,13 @@ export QEMU_PROG=3D"$(type -p "$QEMU_PROG")" =20 case "$QEMU_PROG" in *qemu-system-arm|*qemu-system-aarch64) - export QEMU_OPTIONS=3D"-nodefaults -machine virt,accel=3Dqtest" + export QEMU_OPTIONS=3D"-nodefaults -display none -machine virt,acc= el=3Dqtest" ;; *qemu-system-tricore) - export QEMU_OPTIONS=3D"-nodefaults -machine tricore_testboard,acce= l=3Dqtest" + export QEMU_OPTIONS=3D"-nodefaults -display none -machine tricore_= testboard,accel=3Dqtest" ;; *) - export QEMU_OPTIONS=3D"-nodefaults -machine accel=3Dqtest" + export QEMU_OPTIONS=3D"-nodefaults -display none -machine accel=3D= qtest" ;; esac =20 --=20 2.21.0 From nobody Sun Feb 8 22:54:15 2026 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=1566246740; cv=none; d=zoho.com; s=zohoarc; b=lK4K8IA2gNSaX6ReEWeiGHqy2+NFqBsmc5lSM+LF9NKbZNyX87gdF3wbCP+Hwk9qR5T3BATPZ00c6KE5YpmsMHJ9TAZOa4uqZww9bxNYBu3Mk7vzr7ex6+/eCLDgdLuLBbJCDrwBsMwoophkKEwYtKDXyCk45G3rzbtA4ly00Fc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566246740; 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=1vPpkQyUB0/lmCUnU5xRuA9sMrjXah7LtnUJDnnghGU=; b=jXmr5c5KoO8QQWKj6eQ38Mukv60B7xDZbbTwWq+xlMaaCsVJxNlOV2K9cs4BVh2IV556ZGgmqSdgT1RzorrOdb7/uVFuXhLDkeYhV0wIDjh/Mk7EOg1hCMQPGYRQEeqWUmwlj64rl97MJU27o2jFtm3FCStTqezhcGY1+15wmnI= 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 1566246739988389.4731631102378; Mon, 19 Aug 2019 13:32:19 -0700 (PDT) Received: from localhost ([::1]:57500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzoKA-0001JJ-Ce for importer@patchew.org; Mon, 19 Aug 2019 16:32:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45821) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzo7S-0001F4-1I for qemu-devel@nongnu.org; Mon, 19 Aug 2019 16:19:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzo7R-0004Oi-05 for qemu-devel@nongnu.org; Mon, 19 Aug 2019 16:19:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44036) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hzo7O-0004L1-PW; Mon, 19 Aug 2019 16:19:06 -0400 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 mx1.redhat.com (Postfix) with ESMTPS id 12FDD1FAA66; Mon, 19 Aug 2019 20:19:06 +0000 (UTC) Received: from localhost (ovpn-204-64.brq.redhat.com [10.40.204.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2A6E5452B; Mon, 19 Aug 2019 20:19:02 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 19 Aug 2019 22:18:45 +0200 Message-Id: <20190819201851.24418-3-mreitz@redhat.com> In-Reply-To: <20190819201851.24418-1-mreitz@redhat.com> References: <20190819201851.24418-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Mon, 19 Aug 2019 20:19:06 +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 v3 2/8] 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 , John Snow , qemu-devel@nongnu.org, Max Reitz 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 --- 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 bc1ceb9792..ae169778b0 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 Sun Feb 8 22:54:15 2026 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=1566247104; cv=none; d=zoho.com; s=zohoarc; b=h63kmQ3TJgM2TOa/ANtojTXWOkFt/k1fZsuuOUMJbniAfyYeMr2AApbRl6xvnlNSd4mOXNOJDIzREo9VvbKb+u48+KmOZuNG0/hbJZPZK9hRcfPMVGt8tIu1p5GmirBo6VI+0mtHS7mozfdNpcdSW/mIWJy4GC/VcRCmTqFdC8M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566247104; 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=rznVv1a0Txp4PxguI32gBp+/jB6BzPAfJodX84+kB44=; b=Bfw59mrBTfFsT7WFhI8G4aGjsVOlwW+JyeSVA76lkigMNQUkP8rEuxgKPNZer4Gi7Ao1VA/cOUQIRy4XlurgfO33XQ4e9J8pnAvtrDzIjB7ypPP7UIqXaAnh1HtjU+OvRWEAOxBBf2Ti76c82X9AWLQvLj1md3E7/ltXxNiHLkA= 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 1566247104095684.086222590506; Mon, 19 Aug 2019 13:38:24 -0700 (PDT) Received: from localhost ([::1]:57580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzoQ0-0001Xu-Go for importer@patchew.org; Mon, 19 Aug 2019 16:38:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45850) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzo7U-0001Jf-Om for qemu-devel@nongnu.org; Mon, 19 Aug 2019 16:19:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzo7T-0004Pn-Kw for qemu-devel@nongnu.org; Mon, 19 Aug 2019 16:19:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52216) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hzo7R-0004Oa-4i; Mon, 19 Aug 2019 16:19:09 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5953E3001AB7; Mon, 19 Aug 2019 20:19:08 +0000 (UTC) Received: from localhost (ovpn-204-64.brq.redhat.com [10.40.204.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E400C1001959; Mon, 19 Aug 2019 20:19:07 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 19 Aug 2019 22:18:46 +0200 Message-Id: <20190819201851.24418-4-mreitz@redhat.com> In-Reply-To: <20190819201851.24418-1-mreitz@redhat.com> References: <20190819201851.24418-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 19 Aug 2019 20:19:08 +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 v3 3/8] 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 , John Snow , qemu-devel@nongnu.org, Max Reitz 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: Andrey Shinkevich Reviewed-by: John Snow --- tests/qemu-iotests/iotests.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 84438e837c..2f53baf633 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,10 @@ def notrun(reason): sys.exit(0) =20 def case_notrun(reason): - '''Skip this test case''' + '''Mark this test case as not having been run, but do not actually + skip 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 +912,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 Sun Feb 8 22:54:15 2026 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=1566246556; cv=none; d=zoho.com; s=zohoarc; b=Nix9HD/AtvkdjI2996DITqf7pWzz2cbrjwIBVAd7Z3PS5ynzYQp8nF5Dy0uoliWBT/joR1Au56RE6JvR3qFb1oe5MSGOCYEVh8pc0H2GwBU1IdlSj+WaqJtMmyd4zUcaGvCM4KbNuIoSgKI7AEBJXp2q/rjH+XsBy9QqtxVVlXQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566246556; 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=9xQuudM/9ZNmwVX2U+RbKINUJO27njgMHAKvXqtvbJs=; b=Feaf+PwZJdpVjfD7VLsQ6h0grCTOWfbFXVQa1AZGTjNmfYM7iVVeb/RmHggMP/ODgEnMKAa3dMVjHLrBZOjwN6vQ5VvceccPygW0hIro7VX4oSttxK20Xuqn3Cil+rjgwoE96VTN/pZZg4sM4FfoN29bZspp1JyKcgNafyHtXyg= 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 1566246556192825.9476680838783; Mon, 19 Aug 2019 13:29:16 -0700 (PDT) Received: from localhost ([::1]:57452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzoHD-0006To-0l for importer@patchew.org; Mon, 19 Aug 2019 16:29:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45893) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzo7a-0001Sd-14 for qemu-devel@nongnu.org; Mon, 19 Aug 2019 16:19:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzo7Z-0004RY-3L for qemu-devel@nongnu.org; Mon, 19 Aug 2019 16:19:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45798) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hzo7X-0004QU-3Y; Mon, 19 Aug 2019 16:19:15 -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 6E96D19AED9F; Mon, 19 Aug 2019 20:19:14 +0000 (UTC) Received: from localhost (ovpn-204-64.brq.redhat.com [10.40.204.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3B0055D9C3; Mon, 19 Aug 2019 20:19:10 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 19 Aug 2019 22:18:47 +0200 Message-Id: <20190819201851.24418-5-mreitz@redhat.com> In-Reply-To: <20190819201851.24418-1-mreitz@redhat.com> References: <20190819201851.24418-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.63]); Mon, 19 Aug 2019 20:19:14 +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 v3 4/8] 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 , John Snow , qemu-devel@nongnu.org, Max Reitz 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). Signed-off-by: Max Reitz --- tests/qemu-iotests/iotests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 2f53baf633..726f904f50 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -896,7 +896,7 @@ def skip_if_unsupported(required_formats=3D[], read_onl= y=3DFalse): usf_list =3D list(set(required_formats) - set(supported_formats(read_only))) if usf_list: - case_notrun('{}: formats {} are not whitelisted'.format( + args[0].case_skip('{}: formats {} are not whitelisted'.for= mat( args[0], usf_list)) else: return func(*args, **kwargs) --=20 2.21.0 From nobody Sun Feb 8 22:54:15 2026 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=1566246869; cv=none; d=zoho.com; s=zohoarc; b=Z3CJ9kDc0RieDhUgq5AQLHx+YHCZLMO5Nl61PhUDDUbwblK31bEMrHCZVvXPFR5gXCm4lEGj1wfxViooH4vomuuQTTUFo6qe6FwOA9Y1QfbH2anYaC3zFbfFDyj6ObZ5il84d2urCEKuFccDLDChfVVPNW81QWVSfRPBIfhbzOI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566246869; 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=VFaxs5V2ARkbfQICaJaZECD/syS4OlgnLmmVZv1PmTM=; b=P6cetS6V6QsAuscHeqLCzAWCPUqFsKQTVpBB8WxDqCNn/4cYR1DoQL4oF8TbCdvpteKYC7XjnOh6W9l2h9XXB3N9Ns+jSWxeOtzc2XMTnvlAVBrX+ecObZDYOo5f5naXrV8EjuHOShXvI3Tvdb09kBr4Qkbglkog+zrH9Zes/qo= 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 1566246869772714.4784062462221; Mon, 19 Aug 2019 13:34:29 -0700 (PDT) Received: from localhost ([::1]:57528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzoMG-0003zC-3L for importer@patchew.org; Mon, 19 Aug 2019 16:34:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45929) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzo7c-0001Wr-FC for qemu-devel@nongnu.org; Mon, 19 Aug 2019 16:19:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzo7b-0004Xh-Gc for qemu-devel@nongnu.org; Mon, 19 Aug 2019 16:19:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40810) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hzo7Z-0004RN-D5; Mon, 19 Aug 2019 16:19:17 -0400 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 mx1.redhat.com (Postfix) with ESMTPS id B2BA78D5BAB; Mon, 19 Aug 2019 20:19:16 +0000 (UTC) Received: from localhost (ovpn-204-64.brq.redhat.com [10.40.204.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 44AA57E51; Mon, 19 Aug 2019 20:19:16 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 19 Aug 2019 22:18:48 +0200 Message-Id: <20190819201851.24418-6-mreitz@redhat.com> In-Reply-To: <20190819201851.24418-1-mreitz@redhat.com> References: <20190819201851.24418-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Mon, 19 Aug 2019 20:19:16 +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 v3 5/8] iotests: Let skip_if_unsupported() accept a method 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 , John Snow , qemu-devel@nongnu.org, Max Reitz 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: John Snow --- 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 726f904f50..8f315538e9 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -893,8 +893,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(*args, **kwargs): - usf_list =3D list(set(required_formats) - - set(supported_formats(read_only))) + if callable(required_formats): + fmts =3D required_formats(args[0]) + else: + fmts =3D required_formats + + usf_list =3D list(set(fmts) - set(supported_formats(read_only)= )) if usf_list: args[0].case_skip('{}: formats {} are not whitelisted'.for= mat( args[0], usf_list)) --=20 2.21.0 From nobody Sun Feb 8 22:54:15 2026 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=1566246975; cv=none; d=zoho.com; s=zohoarc; b=AarQV5vAm2SScMYtOCwkxNHiG8kT/4X4+AIMDhzWVOzLeiH7KXFw/Fn9W7bxma7Z4+f3DdnHr2+IgOuQ3kK7YZhBe/bzmK2gHKCz6slMTSJydMkVWWQuOc4cdtPma62VmgmiI7Tmns2W5ZiSpVNC9VK4BieXPotCi88rOISEwz8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566246975; 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=Dz1afH1Np3EGFazQwe240PkDSLZPV8qoJ6cP46+F8js=; b=DNOnH6Wx9fwbh3nbNALNGfgmNabvpuZ0QfubgSIKJ1EHRlr2C6rrUhQ/BJRAG0OUQJEoKYAm5z0gbaMxhJ4jEedujsN7RBggbi4SQlsuSxz22XyG4/1B91t4H1bGM6mj184qo3Nz2Pm1+H0RaW9qF+vinSS/zj/BQZWJdyI9WBo= 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 1566246975722484.00598844065473; Mon, 19 Aug 2019 13:36:15 -0700 (PDT) Received: from localhost ([::1]:57546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzoNy-0006aI-J1 for importer@patchew.org; Mon, 19 Aug 2019 16:36:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45974) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzo7i-0001hH-NA for qemu-devel@nongnu.org; Mon, 19 Aug 2019 16:19:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzo7h-0004cX-Mw for qemu-devel@nongnu.org; Mon, 19 Aug 2019 16:19:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52306) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hzo7e-0004b6-Bm; Mon, 19 Aug 2019 16:19:22 -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 A9744300BEA9; Mon, 19 Aug 2019 20:19:21 +0000 (UTC) Received: from localhost (ovpn-204-64.brq.redhat.com [10.40.204.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8FB2B18C6B; Mon, 19 Aug 2019 20:19:18 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 19 Aug 2019 22:18:49 +0200 Message-Id: <20190819201851.24418-7-mreitz@redhat.com> In-Reply-To: <20190819201851.24418-1-mreitz@redhat.com> References: <20190819201851.24418-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.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 19 Aug 2019 20:19:21 +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 v3 6/8] 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 , John Snow , qemu-devel@nongnu.org, Max Reitz 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 --- 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 Sun Feb 8 22:54:15 2026 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=1566247199; cv=none; d=zoho.com; s=zohoarc; b=XugUi6MFc58fBK0aTCGwXKy+DZ/CsOr96g9NwxKBskwi1Z5nPor+Rhb/g5Ipp6gRh/zdDWT9TLzqsmxSAz0v+NfmlJz7q8qT+gy72iGANhSxgrfybF/YlZ3OgZULfZvmpceDtfjDOClYYvdw0Je5OYJ7GexFN5mTAyo4c64186U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566247199; 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=jL3OaHBVIXnDz1Vjy29hbtYfl32MYbAwgF5wnfRVZhlYizGUEIo8m3P04x+jIJlWow3yuYdQwaPIPqTSSZd2MJI0IPTNxuJ87Wok0Pvnb5GV//CJEXweWFwQqWuL3m6pE65iaoysVNgLAMhURfWc6s6lu6VGCurJPD7BS76944E= 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 1566247199299326.58121505574184; Mon, 19 Aug 2019 13:39:59 -0700 (PDT) Received: from localhost ([::1]:57610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzoRa-0004F2-3i for importer@patchew.org; Mon, 19 Aug 2019 16:39:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46011) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzo7m-0001n8-AQ for qemu-devel@nongnu.org; Mon, 19 Aug 2019 16:19:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzo7l-0004e8-7D for qemu-devel@nongnu.org; Mon, 19 Aug 2019 16:19:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50650) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hzo7j-0004cr-03; Mon, 19 Aug 2019 16:19:27 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 54907182316C; Mon, 19 Aug 2019 20:19:26 +0000 (UTC) Received: from localhost (ovpn-204-64.brq.redhat.com [10.40.204.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8EA8F1001925; Mon, 19 Aug 2019 20:19:23 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 19 Aug 2019 22:18:50 +0200 Message-Id: <20190819201851.24418-8-mreitz@redhat.com> In-Reply-To: <20190819201851.24418-1-mreitz@redhat.com> References: <20190819201851.24418-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.70]); Mon, 19 Aug 2019 20:19:26 +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 v3 7/8] 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 , John Snow , qemu-devel@nongnu.org, Max Reitz 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 --- 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 Sun Feb 8 22:54:15 2026 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=1566246741; cv=none; d=zoho.com; s=zohoarc; b=QPJxT7MiCSaDKLkpK5CtCEJjvavHpavDoRV/IxarhaAdeFAa562h7HMKQ8CBtzGypoB+RFSjRIb3EuympBhy8b6AbRCxYm0Xn3JZ0YajZ/sHLNHqiXURLHXTHX0fs1nS1R4nuqOocc2rMRQXK7qcGKiwtlR65a136sGiXS/qyr8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566246741; 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=fSv0Ik20al+iQEzWs4hlQPUQOXXpOtUJAkp8B9yOcoQ=; b=cewG0xrhxhJ2kIJYkn+0FsgMcZBOiIcVh8L+yxb2QaC3eXVY+i5HpyKdwC/fAJ4IyOPO5kh+fiZJ8LRipy8G32Ks2VElZIgVAo8MQZ6D7eBTVXqI+/aTws+qBf1KF+FLzfOINR/HYaX0xN+27Cj3fZ1eWO1QEUFhvGSFZOVoSyc= 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 1566246741760243.89171972484075; Mon, 19 Aug 2019 13:32:21 -0700 (PDT) Received: from localhost ([::1]:57502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzoKC-0001K8-D8 for importer@patchew.org; Mon, 19 Aug 2019 16:32:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46028) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzo7o-0001qj-BX for qemu-devel@nongnu.org; Mon, 19 Aug 2019 16:19:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzo7n-0004f4-Dt for qemu-devel@nongnu.org; Mon, 19 Aug 2019 16:19:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43908) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hzo7l-0004e0-A1; Mon, 19 Aug 2019 16:19:29 -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 9BC05C057E16; Mon, 19 Aug 2019 20:19:28 +0000 (UTC) Received: from localhost (ovpn-204-64.brq.redhat.com [10.40.204.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 365591D0; Mon, 19 Aug 2019 20:19:28 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 19 Aug 2019 22:18:51 +0200 Message-Id: <20190819201851.24418-9-mreitz@redhat.com> In-Reply-To: <20190819201851.24418-1-mreitz@redhat.com> References: <20190819201851.24418-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.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 19 Aug 2019 20:19:28 +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 v3 8/8] 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 , John Snow , qemu-devel@nongnu.org, Max Reitz 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 --- 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 8f315538e9..f6492b355f 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -884,9 +884,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