From nobody Sat May 18 09:22:58 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=1558088009; cv=none; d=zoho.com; s=zohoarc; b=kOJ7Uso37Zt3eEQeBz4OuzIVJ/5iktBaQEFpk6KUctjaKgLtMLqOJKlPr8urWfINTvC/xoX0DQqo9Gss6NWd1ZjR41g05PBrMqtFRXmFG8mjxtO4rf6niwVWGmRgmn9ZW6qLEq/SREKZhG7b0caDIT3zCrMIzVTCPQbF6ulVYO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558088009; 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=KAaLRpoW6BTniG+D3YQiWtKJqQKZXhbdKkqiB3vdfNU=; b=N+q5QGb9c7D7Nfn2Zz8+Y3Qu11dKUvo13IJ1lxB2+f0M8nwNRu1hi89ptoHcYQvg/7QeU2amgnpd++C6O6bFfpe9mUKPPwPJlzjJghi0e5GHRD1NcPH8yIKSRy8c+rn+g28CUhtCD/dU/nUYjJEepc1dVXeJC1+VxEMbq9QatPE= 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 1558088009390295.5223749069701; Fri, 17 May 2019 03:13:29 -0700 (PDT) Received: from localhost ([127.0.0.1]:45668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRZrd-0001kY-Tt for importer@patchew.org; Fri, 17 May 2019 06:13:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRZn2-0005l7-C1 for qemu-devel@nongnu.org; Fri, 17 May 2019 06:08:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRZba-0005me-4Y for qemu-devel@nongnu.org; Fri, 17 May 2019 05:56:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38764) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hRZbZ-0005bP-0x; Fri, 17 May 2019 05:56:45 -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 A5EAB3086209; Fri, 17 May 2019 09:56:35 +0000 (UTC) Received: from localhost (unknown [10.40.205.117]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3162F60D0B; Fri, 17 May 2019 09:56:34 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 17 May 2019 11:56:25 +0200 Message-Id: <20190517095628.10119-2-mreitz@redhat.com> In-Reply-To: <20190517095628.10119-1-mreitz@redhat.com> References: <20190517095628.10119-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]); Fri, 17 May 2019 09:56:35 +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 1/4] iotests: Add -display none to the qemu options X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , 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: Alex Benn=C3=A9e Reviewed-by: Thomas Huth --- tests/qemu-iotests/check | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index f9c24b6753..d6fec4bf3c 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -130,7 +130,7 @@ export CACHEMODE=3D"writeback" export QEMU_IO_OPTIONS=3D"" export QEMU_IO_OPTIONS_NO_FMT=3D"" export CACHEMODE_IS_DEFAULT=3Dtrue -export QEMU_OPTIONS=3D"-nodefaults -machine accel=3Dqtest" +export QEMU_OPTIONS=3D"-nodefaults -machine accel=3Dqtest -display none" export VALGRIND_QEMU=3D export IMGKEYSECRET=3D export IMGOPTSSYNTAX=3Dfalse --=20 2.21.0 From nobody Sat May 18 09:22:58 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=1558087881; cv=none; d=zoho.com; s=zohoarc; b=TchG1nLs0IhQh0J/4E1ljKwEeQ6AIHOIDHDyLNm5Au0Zya4mktRcER93+TxEUKuKnefjAcbdmgdK5fooulghFExpm6xKGPrZ3rSQoC0yOy/5/BhljYipEecQ5VbMwydb+8JHCOJS/toaFSFw+clmaGKwVxh0wKu2ZJxsTWtt4Gg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558087881; 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=v+DbYtVKskGtnnRLQmsfvciqQ536xouCZ2aBchkzMY0=; b=YdUxokCkIz2veQzG5QQr6Lkago4uhQ6Gvvs4yb+EgCHNmrZbeH/s8kVK6jBNbFv51oVhZyimTK0ESKLm2cp3YqjrW++0Q33cCak7GcplQXj8I3HammDyZkTsAurUkxp99/5T7lvTXqJiLrz8no+xhKDeMOEeD4e5mKJq6t/B2F0= 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 1558087881749464.8679451323334; Fri, 17 May 2019 03:11:21 -0700 (PDT) Received: from localhost ([127.0.0.1]:45635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRZpa-00085u-IE for importer@patchew.org; Fri, 17 May 2019 06:11:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRZn2-00063L-1R for qemu-devel@nongnu.org; Fri, 17 May 2019 06:08:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRZbf-0005uq-FU for qemu-devel@nongnu.org; Fri, 17 May 2019 05:56:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64520) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hRZbe-0005bp-8U; Fri, 17 May 2019 05:56:50 -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 123367E429; Fri, 17 May 2019 09:56:39 +0000 (UTC) Received: from localhost (unknown [10.40.205.117]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 905EA348F4; Fri, 17 May 2019 09:56:37 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 17 May 2019 11:56:26 +0200 Message-Id: <20190517095628.10119-3-mreitz@redhat.com> In-Reply-To: <20190517095628.10119-1-mreitz@redhat.com> References: <20190517095628.10119-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.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 17 May 2019 09:56:39 +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 2/4] iotests: Prefer null-co over null-aio X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , 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 --- 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 d88fbc182e..bd56c94708 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, "throttling.iops-total=3D100") + self.vm.add_drive("null-co://", "throttling.iops-total=3D100") self.vm.launch() =20 def tearDown(self): @@ -377,10 +376,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", 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", node_name=3D"cd1") self.assert_qmp(result, 'return', {}) =20 diff --git a/tests/qemu-iotests/245 b/tests/qemu-iotests/245 index a04c6235c1..d888a1354c 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 09:22:58 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=1558087807; cv=none; d=zoho.com; s=zohoarc; b=Y+K6xRgAz2IoOdtEP5EiimvRkYDOeg5VnKokbiDX8SJLsb/H4H3IuclKXjsI5tW0zORR8G7gOhIvMXcCMZYarY0DuphQ/uAl2Z/8Zcv0zuZIGWnGvw9ImIwPcTmA4AO2v6k/fGcsicJp4qMhOWME2PmvlMmJsfff3n1h7ISi3c0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558087807; 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=yIWuN1q8BT16Psiw2MEGvHaWrXY3xFIA+8Q5Q3sSD54=; b=LX+2S3UOJGQvDiAQ/CWzxAfus0wDo+J2+xDA3JzUch87QY59TTW3Au4Srl0swNPw7fnxafUmgXAyXURk8dZJ2NqiC/CNrpw5DIKnbmcgV2F/KVgONKDwNfQNe3U7XGv2vhTl6SUDi5et0SRxFZj/jvo5/kqnaE/HaOqXM2rPQcI= 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 1558087807758972.1985408172894; Fri, 17 May 2019 03:10:07 -0700 (PDT) Received: from localhost ([127.0.0.1]:45599 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRZoJ-0006vy-6R for importer@patchew.org; Fri, 17 May 2019 06:09:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRZmT-0005mF-3Y for qemu-devel@nongnu.org; Fri, 17 May 2019 06:08:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRZbl-00066T-JU for qemu-devel@nongnu.org; Fri, 17 May 2019 05:57:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60930) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hRZbk-00063j-4s; Fri, 17 May 2019 05:56:56 -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 A91A93082E21; Fri, 17 May 2019 09:56:43 +0000 (UTC) Received: from localhost (unknown [10.40.205.117]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 42AE3348F4; Fri, 17 May 2019 09:56:40 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 17 May 2019 11:56:27 +0200 Message-Id: <20190517095628.10119-4-mreitz@redhat.com> In-Reply-To: <20190517095628.10119-1-mreitz@redhat.com> References: <20190517095628.10119-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.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 17 May 2019 09:56:51 +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 3/4] iotests: Test driver whitelisting in 093 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , 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. If it is not, fall back to null-co. This may run tests twice in the same configuration, but this is the simplest way to effectively skip the tests in setUp() (without changing the output, and while having the respective driver in a class attribute). Signed-off-by: Max Reitz --- tests/qemu-iotests/093 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093 index bd56c94708..d6f285001a 100755 --- a/tests/qemu-iotests/093 +++ b/tests/qemu-iotests/093 @@ -22,9 +22,11 @@ import iotests =20 nsec_per_sec =3D 1000000000 +supported_null_drivers =3D list(filter(lambda f: f.startswith('null-'), + iotests.supported_formats())) =20 class ThrottleTestCase(iotests.QMPTestCase): - test_img =3D "null-aio://" + test_driver =3D "null-aio" max_drives =3D 3 =20 def blockstats(self, device): @@ -36,9 +38,14 @@ class ThrottleTestCase(iotests.QMPTestCase): raise Exception("Device not found for blockstats: %s" % device) =20 def setUp(self): + global supported_null_drivers + if self.test_driver not in supported_null_drivers: + # Silently fall back to supported driver + self.test_driver =3D supported_null_drivers[0] + self.vm =3D iotests.VM() for i in range(0, self.max_drives): - self.vm.add_drive(self.test_img) + self.vm.add_drive(self.test_driver + "://") self.vm.launch() =20 def tearDown(self): @@ -264,7 +271,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 @@ -426,4 +433,6 @@ class ThrottleTestRemovableMedia(iotests.QMPTestCase): =20 =20 if __name__ =3D=3D '__main__': + if 'null-co' not in supported_null_drivers: + iotests.notrun('null-co driver support missing') iotests.main(supported_fmts=3D["raw"]) --=20 2.21.0 From nobody Sat May 18 09:22:58 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=1558087841; cv=none; d=zoho.com; s=zohoarc; b=XXSCkWtylZFNtakwyonongYJUCG30HseAeOUtapNMcA7GYZhU9eCLrBIOrO9td/58VEVUlzP1oXKtZi/Srzlt2At5i/1FKEuBk++JlRmJ0xsigGsmv/3Jwc+M2DBB9Z4zZ2UyqMHdglEU6HK3cNR+Kk82WvWO/zuMV/LRlsWH2M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558087841; 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=ONa2+UwyehFtA4bB4MEUEDKaRO1k7MGFrncwwqDgj+s=; b=d+1gQpCVqKAT2DUIEJJlL0XMlyZS196ay4c1QFQX+2C6rpzil5TVOo/RvTlxqlaFokk3d3qfWOeALBcNs5WplHQ6yFsYlBDxt5q/uGcw1BujQblxMCh+Pdha+S3Tnbp3TDymTCW/9KEWWgWPfbJXjZCtIoQlbFGdMi13YuTqKA8= 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 1558087841804349.92452041275294; Fri, 17 May 2019 03:10:41 -0700 (PDT) Received: from localhost ([127.0.0.1]:45601 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRZox-0007Tj-Mx for importer@patchew.org; Fri, 17 May 2019 06:10:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRZmx-00068u-5D for qemu-devel@nongnu.org; Fri, 17 May 2019 06:08:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRZbk-00064e-Aa for qemu-devel@nongnu.org; Fri, 17 May 2019 05:56:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48812) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hRZbi-00060H-Pq; Fri, 17 May 2019 05:56:54 -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 17DDC307D96F; Fri, 17 May 2019 09:56:48 +0000 (UTC) Received: from localhost (unknown [10.40.205.117]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A1F4348F5; Fri, 17 May 2019 09:56:45 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 17 May 2019 11:56:28 +0200 Message-Id: <20190517095628.10119-5-mreitz@redhat.com> In-Reply-To: <20190517095628.10119-1-mreitz@redhat.com> References: <20190517095628.10119-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.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 17 May 2019 09:56:48 +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 4/4] iotests: Test driver whitelisting in 136 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , 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. If it is not, fall back to null-co. This may run tests twice in the same configuration, but this is the simplest way to effectively skip the tests in setUp() (without changing the output, and while having the respective driver in a class attribute). Signed-off-by: Max Reitz --- tests/qemu-iotests/136 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/136 b/tests/qemu-iotests/136 index af7ffa4540..44e3bc1575 100755 --- a/tests/qemu-iotests/136 +++ b/tests/qemu-iotests/136 @@ -28,9 +28,11 @@ op_latency =3D nsec_per_sec // 1000 # See qtest_latency_= ns in accounting.c bad_sector =3D 8192 bad_offset =3D bad_sector * 512 blkdebug_file =3D os.path.join(iotests.test_dir, 'blkdebug.conf') +supported_null_drivers =3D list(filter(lambda f: f.startswith('null-'), + iotests.supported_formats())) =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 @@ -68,6 +70,11 @@ sector =3D "%d" file.close() =20 def setUp(self): + global supported_null_drivers + if self.test_driver not in supported_null_drivers: + # Silently fall back to supported driver + self.test_driver =3D supported_null_drivers[0] + drive_args =3D [] drive_args.append("stats-intervals.0=3D%d" % interval_length) drive_args.append("stats-account-invalid=3D%s" % @@ -75,8 +82,8 @@ sector =3D "%d" drive_args.append("stats-account-failed=3D%s" % (self.account_failed and "on" or "off")) 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 @@ -336,7 +343,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 supported_null_drivers: + iotests.notrun('null-co driver support missing') iotests.main(supported_fmts=3D["raw"]) --=20 2.21.0