From nobody Wed May 1 23:15:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1523274642101562.4757569951045; Mon, 9 Apr 2018 04:50:42 -0700 (PDT) Received: from localhost ([::1]:60257 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5VJp-0002Ri-9S for importer@patchew.org; Mon, 09 Apr 2018 07:50:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5VDk-00067q-SV for qemu-devel@nongnu.org; Mon, 09 Apr 2018 07:44:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5VDh-0001Cc-RV for qemu-devel@nongnu.org; Mon, 09 Apr 2018 07:44:24 -0400 Received: from relay.sw.ru ([185.231.240.75]:46262) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f5VDh-0001BJ-Ip; Mon, 09 Apr 2018 07:44:21 -0400 Received: from msk-vpn.virtuozzo.com ([195.214.232.6] helo=kvm.sw.ru) by relay.sw.ru with esmtp (Exim 4.90_1) (envelope-from ) id 1f5VDe-0005TA-RK; Mon, 09 Apr 2018 14:44:18 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Mon, 9 Apr 2018 14:44:17 +0300 Message-Id: <20180409114418.16615-2-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20180409114418.16615-1-vsementsov@virtuozzo.com> References: <20180409114418.16615-1-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH v2 1/2] iotests.py: improve verify_image_format helper 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: kwolf@redhat.com, vsementsov@virtuozzo.com, mreitz@redhat.com, stefanha@redhat.com, den@openvz.org, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Support "generic" formats like in bash tests with their _supported_fmt generic The test, supporting "generic" formats will run if IMGFMT_GENERIC =3D true, which is default, except for bochs and cloop. However, you can use verify_image_format(['generic', 'bochs']), which will run for all except cloop (for this moment). Also, add an assert (we don't want set both arguments) and remove duplication. Signed-off-by: Vladimir Sementsov-Ogievskiy --- 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 b5d7945af8..1a2b83893c 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -532,9 +532,17 @@ def notrun(reason): sys.exit(0) =20 def verify_image_format(supported_fmts=3D[], unsupported_fmts=3D[]): - if supported_fmts and (imgfmt not in supported_fmts): - notrun('not suitable for this image format: %s' % imgfmt) - if unsupported_fmts and (imgfmt in unsupported_fmts): + assert not (supported_fmts and unsupported_fmts) + + if 'generic' in supported_fmts and \ + os.environ.get('IMGFMT_GENERIC', 'true') =3D=3D 'true': + # similar to + # _supported_fmt generic + # for bash tests + return + + not_sup =3D supported_fmts and (imgfmt not in supported_fmts) + if not_sup or (imgfmt in unsupported_fmts): notrun('not suitable for this image format: %s' % imgfmt) =20 def verify_platform(supported_oses=3D['linux']): --=20 2.11.1 From nobody Wed May 1 23:15:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1523274495734658.0282138984455; Mon, 9 Apr 2018 04:48:15 -0700 (PDT) Received: from localhost ([::1]:60105 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5VHR-0000JW-UB for importer@patchew.org; Mon, 09 Apr 2018 07:48:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5VDk-00067p-ST for qemu-devel@nongnu.org; Mon, 09 Apr 2018 07:44:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5VDh-0001CX-RH for qemu-devel@nongnu.org; Mon, 09 Apr 2018 07:44:24 -0400 Received: from relay.sw.ru ([185.231.240.75]:46260) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f5VDh-0001BI-Is; Mon, 09 Apr 2018 07:44:21 -0400 Received: from msk-vpn.virtuozzo.com ([195.214.232.6] helo=kvm.sw.ru) by relay.sw.ru with esmtp (Exim 4.90_1) (envelope-from ) id 1f5VDe-0005TA-Uq; Mon, 09 Apr 2018 14:44:19 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Mon, 9 Apr 2018 14:44:18 +0300 Message-Id: <20180409114418.16615-3-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20180409114418.16615-1-vsementsov@virtuozzo.com> References: <20180409114418.16615-1-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH v2 2/2] iotests: blacklist bochs and cloop for 205 and 208 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: kwolf@redhat.com, vsementsov@virtuozzo.com, mreitz@redhat.com, stefanha@redhat.com, den@openvz.org, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Blacklist these formats, as they don't support image creation, as they say: > ./qemu-img create -f bochs x 1m qemu-img: x: Format driver 'bochs' does not support image creation > ./qemu-img create -f cloop x 1m qemu-img: x: Format driver 'cloop' does not support image creation Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/205 | 2 +- tests/qemu-iotests/208 | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/205 b/tests/qemu-iotests/205 index e7b2eae51d..31b2f5707a 100755 --- a/tests/qemu-iotests/205 +++ b/tests/qemu-iotests/205 @@ -153,4 +153,4 @@ class TestNbdServerRemove(iotests.QMPTestCase): =20 =20 if __name__ =3D=3D '__main__': - iotests.main() + iotests.main(supported_fmts=3D['generic']) diff --git a/tests/qemu-iotests/208 b/tests/qemu-iotests/208 index 18f59ada94..1e202388dc 100755 --- a/tests/qemu-iotests/208 +++ b/tests/qemu-iotests/208 @@ -22,6 +22,8 @@ =20 import iotests =20 +iotests.verify_image_format(supported_fmts=3D['generic']) + with iotests.FilePath('disk.img') as disk_img_path, \ iotests.FilePath('disk-snapshot.img') as disk_snapshot_img_path, \ iotests.FilePath('nbd.sock') as nbd_sock_path, \ --=20 2.11.1