From nobody Mon Feb 9 09:28:29 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=1569961415; cv=none; d=zoho.com; s=zohoarc; b=kee9eyr9VgK7RZjxjPDWCEOCvbN7YRZviOYcY+9MYRjTLP7yYH+MsDEcL3OCvYjX6SoPEZ3HpmAKvDyJ68z4+eUgUtuzmeTCJId8dHzDeLyjv6AyHYx0NGTcbGm4M82G+UedBoRQXGRcpLc08UBvWVweMr4fq2o3L3VPYvJG5gc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569961415; 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=rUAtQHRbhfpxU+GvoR9Yxr+wF/sWH1nACWiIOTMoJWQ=; b=BuKOQoKxXDPSCsiQ5gciMr8XhIUIi7giwDKKl9mrGrf8ljy5i97fuaCjP87diMfoBV+obQNyAxxyTGqdSvpN4Wi0kcW39IQ4TVKWDKq+vA5AMMQS6ZYW2uSRs17NZ90gKnivbBObQ3/d3Aj0DBVS5gNW9GtwAnDohtzxb7fHgeA= 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 1569961415203213.51733467932218; Tue, 1 Oct 2019 13:23:35 -0700 (PDT) Received: from localhost ([::1]:47806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFOgE-0001D2-1w for importer@patchew.org; Tue, 01 Oct 2019 16:23:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54470) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFO87-0004uU-Oo for qemu-devel@nongnu.org; Tue, 01 Oct 2019 15:48:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFO85-00082S-Kp for qemu-devel@nongnu.org; Tue, 01 Oct 2019 15:48:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52996) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFO7z-0007zf-Ts; Tue, 01 Oct 2019 15:48:08 -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 14D643084025; Tue, 1 Oct 2019 19:48:07 +0000 (UTC) Received: from localhost (unknown [10.40.205.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A3139261B7; Tue, 1 Oct 2019 19:48:06 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PATCH 21/67] iotests/056: Honor $IMGOPTS Date: Tue, 1 Oct 2019 21:46:29 +0200 Message-Id: <20191001194715.2796-22-mreitz@redhat.com> In-Reply-To: <20191001194715.2796-1-mreitz@redhat.com> References: <20191001194715.2796-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.40]); Tue, 01 Oct 2019 19:48:07 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 , 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 --- tests/qemu-iotests/056 | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/tests/qemu-iotests/056 b/tests/qemu-iotests/056 index 98c55d8e5a..58b4103cd9 100755 --- a/tests/qemu-iotests/056 +++ b/tests/qemu-iotests/056 @@ -23,7 +23,7 @@ import time import os import iotests -from iotests import qemu_img, qemu_io, create_image +from iotests import create_test_image, remove_test_image, qemu_io, create_= image =20 backing_img =3D os.path.join(iotests.test_dir, 'backing.img') test_img =3D os.path.join(iotests.test_dir, 'test.img') @@ -31,18 +31,12 @@ target_img =3D os.path.join(iotests.test_dir, 'target.i= mg') =20 def img_create(img, fmt=3Diotests.imgfmt, size=3D'64M', **kwargs): fullname =3D os.path.join(iotests.test_dir, '%s.%s' % (img, fmt)) - optargs =3D [] - for k,v in kwargs.items(): - optargs =3D optargs + ['-o', '%s=3D%s' % (k,v)] - args =3D ['create', '-f', fmt] + optargs + [fullname, size] - iotests.qemu_img(*args) + opts =3D [] + for k, v in kwargs.items(): + opts.append('%s=3D%s' % (k, v)) + create_test_image(fullname, size, fmt=3Dfmt, opts=3Dopts) return fullname =20 -def try_remove(img): - try: - os.remove(img) - except OSError: - pass =20 def io_write_patterns(img, patterns): for pattern in patterns: @@ -54,7 +48,7 @@ class TestSyncModesNoneAndTop(iotests.QMPTestCase): =20 def setUp(self): create_image(backing_img, TestSyncModesNoneAndTop.image_len) - qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=3D%s'= % backing_img, test_img) + create_test_image(test_img, backing_file=3Dbacking_img) qemu_io('-c', 'write -P0x41 0 512', test_img) qemu_io('-c', 'write -P0xd5 1M 32k', test_img) qemu_io('-c', 'write -P0xdc 32M 124k', test_img) @@ -64,7 +58,7 @@ class TestSyncModesNoneAndTop(iotests.QMPTestCase): =20 def tearDown(self): self.vm.shutdown() - os.remove(test_img) + remove_test_image(test_img) os.remove(backing_img) try: os.remove(target_img) @@ -103,6 +97,8 @@ class TestSyncModesNoneAndTop(iotests.QMPTestCase): self.assertEqual(-1, qemu_io('-c', 'read -P0x41 0 512', target_img= ).find("verification failed")) =20 class TestBeforeWriteNotifier(iotests.QMPTestCase): + # blkdebug does not work with an external data file + @iotests.skip_for_imgopts(['data_file']) def setUp(self): self.vm =3D iotests.VM().add_drive_raw("file=3Dblkdebug::null-co:/= /,id=3Ddrive0,align=3D65536,driver=3Dblkdebug") self.vm.launch() @@ -139,9 +135,9 @@ class BackupTest(iotests.QMPTestCase): =20 def tearDown(self): self.vm.shutdown() - try_remove(self.test_img) - try_remove(self.dest_img) - try_remove(self.ref_img) + remove_test_image(self.test_img) + remove_test_image(self.dest_img) + remove_test_image(self.ref_img) =20 def hmp_io_writes(self, drive, patterns): for pattern in patterns: @@ -268,6 +264,8 @@ class BackupTest(iotests.QMPTestCase): sync=3D'full', target=3Dself.dest_img, auto_dismiss=3DFalse) =20 + # blkdebug does not work with an external data file + @iotests.skip_for_imgopts(['data_file']) def dismissal_failure(self, dismissal_opt): res =3D self.vm.qmp('query-block-jobs') self.assert_qmp(res, 'return', []) --=20 2.21.0