From nobody Sun Feb 8 21:32:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1647636311863954.4342357048615; Fri, 18 Mar 2022 13:45:11 -0700 (PDT) Received: from localhost ([::1]:42862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVJTB-0000nW-Q0 for importer@patchew.org; Fri, 18 Mar 2022 16:45:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLK-0002Hd-No for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:33951) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLI-0005Vw-3w for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:02 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-474--aIWP6UXMNmmZA3DU0w9WA-1; Fri, 18 Mar 2022 16:36:56 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1876785A5BC; Fri, 18 Mar 2022 20:36:56 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id CC34E4292C7; Fri, 18 Mar 2022 20:36:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647635819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yJi/hAHtjTJ13G/8h6HfB1RO/hsylA4JEFGSo3I3dRI=; b=Bk8TGEQ2yTMi3IT3Z67aUQqAMnaC9V4S7Krra5ifRlUtHwOJKbHUoLSfAJd9sB3eZT0pxr KC+Nh+zDW33C80OW7k+X/dg2ty5i4f9Zk13/0Hq/fk5+1NOq+YZzREvH0PvdfvnOC8lupN PvDWpyf1qfVnrYubQS1acTZssTFPzhg= X-MC-Unique: -aIWP6UXMNmmZA3DU0w9WA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 01/15] iotests: replace calls to log(qemu_io(...)) with qemu_io_log() Date: Fri, 18 Mar 2022 16:36:41 -0400 Message-Id: <20220318203655.676907-2-jsnow@redhat.com> In-Reply-To: <20220318203655.676907-1-jsnow@redhat.com> References: <20220318203655.676907-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , John Snow , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1647636312524100001 Content-Type: text/plain; charset="utf-8" This makes these callsites a little simpler, but the real motivation is a forthcoming commit will change the return type of qemu_io(), so removing users of the return value now is helpful. Signed-off-by: John Snow Reviewed-by: Eric Blake --- tests/qemu-iotests/242 | 2 +- tests/qemu-iotests/255 | 4 +--- tests/qemu-iotests/303 | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/242 b/tests/qemu-iotests/242 index b3afd36d72..4b7ec16af6 100755 --- a/tests/qemu-iotests/242 +++ b/tests/qemu-iotests/242 @@ -61,7 +61,7 @@ def add_bitmap(bitmap_number, persistent, disabled): =20 def write_to_disk(offset, size): write =3D 'write {} {}'.format(offset, size) - log(qemu_io('-c', write, disk), filters=3D[filter_qemu_io]) + qemu_io_log('-c', write, disk) =20 =20 def toggle_flag(offset): diff --git a/tests/qemu-iotests/255 b/tests/qemu-iotests/255 index f86fa851b6..88b29d64b4 100755 --- a/tests/qemu-iotests/255 +++ b/tests/qemu-iotests/255 @@ -95,9 +95,7 @@ with iotests.FilePath('src.qcow2') as src_path, \ iotests.qemu_img_create('-f', iotests.imgfmt, src_path, size_str) iotests.qemu_img_create('-f', iotests.imgfmt, dst_path, size_str) =20 - iotests.log(iotests.qemu_io('-f', iotests.imgfmt, '-c', 'write 0 1M', - src_path), - filters=3D[iotests.filter_test_dir, iotests.filter_qemu_io= ]) + iotests.qemu_io_log('-f', iotests.imgfmt, '-c', 'write 0 1M', src_path= ), =20 vm.add_object('throttle-group,x-bps-read=3D4096,id=3Dthrottle0') =20 diff --git a/tests/qemu-iotests/303 b/tests/qemu-iotests/303 index 93aa5ce9b7..32128b1d32 100755 --- a/tests/qemu-iotests/303 +++ b/tests/qemu-iotests/303 @@ -21,7 +21,7 @@ =20 import iotests import subprocess -from iotests import qemu_img_create, qemu_io, file_path, log, filter_qemu_= io +from iotests import qemu_img_create, qemu_io_log, file_path, log =20 iotests.script_initialize(supported_fmts=3D['qcow2'], unsupported_imgopts=3D['refcount_bits', 'compat'= ]) @@ -43,7 +43,7 @@ def create_bitmap(bitmap_number, disabled): =20 def write_to_disk(offset, size): write =3D f'write {offset} {size}' - log(qemu_io('-c', write, disk), filters=3D[filter_qemu_io]) + qemu_io_log('-c', write, disk) =20 =20 def add_bitmap(num, begin, end, disabled): --=20 2.34.1 From nobody Sun Feb 8 21:32:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1647635955293623.070408679633; Fri, 18 Mar 2022 13:39:15 -0700 (PDT) Received: from localhost ([::1]:53112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVJNT-0005Fb-Hs for importer@patchew.org; Fri, 18 Mar 2022 16:39:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLJ-0002G1-KX for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:20186) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLG-0005VM-NQ for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:01 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-2-zalkpCQWOnmF8U72TEIXvw-1; Fri, 18 Mar 2022 16:36:56 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 698E38047D6; Fri, 18 Mar 2022 20:36:56 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A1B5403373; Fri, 18 Mar 2022 20:36:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647635817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LUC6Brus1rWJ6DcqNQlbZAJ0YfIyA8nO+/zf+8T9hX0=; b=Gs2LBP1ADpm/J+L0EKGcZWZnfFTgYAL2ScSMlgmtpuf4Q6xBdSAOSjMnyJ8a5mvy7juJU9 kXHINg6s9vix4nCO0YvCnn94DRRY4KNLU+NRHXQs2MTcRRNJjpAo4C0hntou87VKOkbMq8 YGuCKl4RplUallkdWXNmlonCRnOpaiM= X-MC-Unique: zalkpCQWOnmF8U72TEIXvw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 02/15] iotests/163: Fix broken qemu-io invocation Date: Fri, 18 Mar 2022 16:36:42 -0400 Message-Id: <20220318203655.676907-3-jsnow@redhat.com> In-Reply-To: <20220318203655.676907-1-jsnow@redhat.com> References: <20220318203655.676907-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , John Snow , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1647635957760100001 Content-Type: text/plain; charset="utf-8" The 'read' commands to qemu-io were malformed, and this invocation only worked by coincidence because the error messages were identical. Oops. There's no point in checking the patterning of the reference image, so just check the empty image by itself instead. (Note: as of this commit, nothing actually enforces that this command completes successfully, but a forthcoming commit in this series will enforce that qemu_io() must have a zero status code.) Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz --- tests/qemu-iotests/163 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/qemu-iotests/163 b/tests/qemu-iotests/163 index e4cd4b230f..c94ad16f4a 100755 --- a/tests/qemu-iotests/163 +++ b/tests/qemu-iotests/163 @@ -113,10 +113,7 @@ class ShrinkBaseClass(iotests.QMPTestCase): qemu_img('resize', '-f', iotests.imgfmt, '--shrink', test_img, self.shrink_size) =20 - self.assertEqual( - qemu_io('-c', 'read -P 0x00 %s'%self.shrink_size, test_img), - qemu_io('-c', 'read -P 0x00 %s'%self.shrink_size, check_img), - "Verifying image content") + qemu_io('-c', f"read -P 0x00 0 {self.shrink_size}", test_img) =20 self.image_verify() =20 --=20 2.34.1 From nobody Sun Feb 8 21:32:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 164763595525450.837922916641105; Fri, 18 Mar 2022 13:39:15 -0700 (PDT) Received: from localhost ([::1]:53072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVJNT-0005Da-0T for importer@patchew.org; Fri, 18 Mar 2022 16:39:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLI-0002FI-Oa for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:50383) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLG-0005VT-UK for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:00 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-547-g9or0jUWOyWioR_1hQ1ARA-1; Fri, 18 Mar 2022 16:36:57 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B4C8C802803; Fri, 18 Mar 2022 20:36:56 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 78463403373; Fri, 18 Mar 2022 20:36:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647635818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CKdCHBbkkpDuIpaliYdVgEa3eq2VAatS1OqTyWGItb0=; b=IAKZLXC9MFV7DmVn1ez7zHaUolmfqsD316q2wX3qZfbx29d5ElvJNAB9j/PFDvuVomKlHX Wlm4sNYn+DJ9xG2Zi/Mmdd9PZiuFmpIjEKvoiHf8lL+K2cNygxbgaxrRiw1smxIfERNLqx KAznXSI2k7NR7a+e07xWWginbSSJ+co= X-MC-Unique: g9or0jUWOyWioR_1hQ1ARA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 03/15] iotests: Don't check qemu_io() output for specific error strings Date: Fri, 18 Mar 2022 16:36:43 -0400 Message-Id: <20220318203655.676907-4-jsnow@redhat.com> In-Reply-To: <20220318203655.676907-1-jsnow@redhat.com> References: <20220318203655.676907-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , John Snow , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1647635957802100002 Content-Type: text/plain; charset="utf-8" A forthcoming commit updates qemu_io() to raise an exception on non-zero return by default, and changes its return type. In preparation, simplify some calls to qemu_io() that assert that specific error message strings do not appear in qemu-io's output. Asserting that all of these calls return a status code of zero will be a more robust way to guard against failure. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz --- tests/qemu-iotests/040 | 33 ++++++++++++++++----------------- tests/qemu-iotests/056 | 2 +- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040 index 0e1cfd7e49..adf5815781 100755 --- a/tests/qemu-iotests/040 +++ b/tests/qemu-iotests/040 @@ -101,13 +101,13 @@ class TestSingleDrive(ImageCommitTestCase): =20 def test_commit(self): self.run_commit_test(mid_img, backing_img) - self.assertEqual(-1, qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 52= 4288', backing_img).find("verification failed")) - self.assertEqual(-1, qemu_io('-f', 'raw', '-c', 'read -P 0xef 5242= 88 524288', backing_img).find("verification failed")) + qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 524288', backing_img) + qemu_io('-f', 'raw', '-c', 'read -P 0xef 524288 524288', backing_i= mg) =20 def test_commit_node(self): self.run_commit_test("mid", "base", node_names=3DTrue) - self.assertEqual(-1, qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 52= 4288', backing_img).find("verification failed")) - self.assertEqual(-1, qemu_io('-f', 'raw', '-c', 'read -P 0xef 5242= 88 524288', backing_img).find("verification failed")) + qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 524288', backing_img) + qemu_io('-f', 'raw', '-c', 'read -P 0xef 524288 524288', backing_i= mg) =20 @iotests.skip_if_unsupported(['throttle']) def test_commit_with_filter_and_quit(self): @@ -192,13 +192,13 @@ class TestSingleDrive(ImageCommitTestCase): =20 def test_top_is_active(self): self.run_commit_test(test_img, backing_img, need_ready=3DTrue) - self.assertEqual(-1, qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 52= 4288', backing_img).find("verification failed")) - self.assertEqual(-1, qemu_io('-f', 'raw', '-c', 'read -P 0xef 5242= 88 524288', backing_img).find("verification failed")) + qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 524288', backing_img) + qemu_io('-f', 'raw', '-c', 'read -P 0xef 524288 524288', backing_i= mg) =20 def test_top_is_default_active(self): self.run_default_commit_test() - self.assertEqual(-1, qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 52= 4288', backing_img).find("verification failed")) - self.assertEqual(-1, qemu_io('-f', 'raw', '-c', 'read -P 0xef 5242= 88 524288', backing_img).find("verification failed")) + qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 524288', backing_img) + qemu_io('-f', 'raw', '-c', 'read -P 0xef 524288 524288', backing_i= mg) =20 def test_top_and_base_reversed(self): self.assert_no_active_block_jobs() @@ -334,8 +334,8 @@ class TestRelativePaths(ImageCommitTestCase): =20 def test_commit(self): self.run_commit_test(self.mid_img, self.backing_img) - self.assertEqual(-1, qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 52= 4288', self.backing_img_abs).find("verification failed")) - self.assertEqual(-1, qemu_io('-f', 'raw', '-c', 'read -P 0xef 5242= 88 524288', self.backing_img_abs).find("verification failed")) + qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 524288', self.backing_i= mg_abs) + qemu_io('-f', 'raw', '-c', 'read -P 0xef 524288 524288', self.back= ing_img_abs) =20 def test_device_not_found(self): result =3D self.vm.qmp('block-commit', device=3D'nonexistent', top= =3D'%s' % self.mid_img) @@ -361,8 +361,8 @@ class TestRelativePaths(ImageCommitTestCase): =20 def test_top_is_active(self): self.run_commit_test(self.test_img, self.backing_img) - self.assertEqual(-1, qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 52= 4288', self.backing_img_abs).find("verification failed")) - self.assertEqual(-1, qemu_io('-f', 'raw', '-c', 'read -P 0xef 5242= 88 524288', self.backing_img_abs).find("verification failed")) + qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 524288', self.backing_i= mg_abs) + qemu_io('-f', 'raw', '-c', 'read -P 0xef 524288 524288', self.back= ing_img_abs) =20 def test_top_and_base_reversed(self): self.assert_no_active_block_jobs() @@ -738,11 +738,10 @@ class TestCommitWithFilters(iotests.QMPTestCase): =20 def do_test_io(self, read_or_write): for index, pattern_file in enumerate(self.pattern_files): - result =3D qemu_io('-f', iotests.imgfmt, - '-c', - f'{read_or_write} -P {index + 1} {index}M 1M', - pattern_file) - self.assertFalse('Pattern verification failed' in result) + qemu_io('-f', iotests.imgfmt, + '-c', + f'{read_or_write} -P {index + 1} {index}M 1M', + pattern_file) =20 @iotests.skip_if_unsupported(['throttle']) def setUp(self): diff --git a/tests/qemu-iotests/056 b/tests/qemu-iotests/056 index b459a3f1e8..bef865eec4 100755 --- a/tests/qemu-iotests/056 +++ b/tests/qemu-iotests/056 @@ -102,7 +102,7 @@ class TestSyncModesNoneAndTop(iotests.QMPTestCase): =20 self.vm.shutdown() time.sleep(1) - self.assertEqual(-1, qemu_io('-c', 'read -P0x41 0 512', target_img= ).find("verification failed")) + qemu_io('-c', 'read -P0x41 0 512', target_img) =20 class TestBeforeWriteNotifier(iotests.QMPTestCase): def setUp(self): --=20 2.34.1 From nobody Sun Feb 8 21:32:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1647636132731823.4428734291824; Fri, 18 Mar 2022 13:42:12 -0700 (PDT) Received: from localhost ([::1]:34278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVJQJ-0003Fv-NY for importer@patchew.org; Fri, 18 Mar 2022 16:42:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLK-0002Fl-Mn for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:42651) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLH-0005VV-0Z for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:01 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-549-2jM8ilDFPY6q27NQC2EfRQ-1; Fri, 18 Mar 2022 16:36:57 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0E05E1C05ED4; Fri, 18 Mar 2022 20:36:57 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4729403373; Fri, 18 Mar 2022 20:36:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647635818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0+arT6JCSGhKqJ7wfuQkr0z7Iyo3ZiuWhnNod+ki/a0=; b=XpmF6UcTCESwWc9s8soLkMcLz6Ya/0ZdfdMFWBxZWzooeVy3XQVUQCUZZ+0V53OGtllgYA JfLY20eBBtEj9+J3nGCqVFYriNExHoqQrhW3xR9E4K9HjqNzyJsy8HFcddHxXcmP2/CzB3 gmDTdsFKBT8gbFS1eIsuvsSN7XV1Sxo= X-MC-Unique: 2jM8ilDFPY6q27NQC2EfRQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 04/15] iotests/040: Don't check image pattern on zero-length image Date: Fri, 18 Mar 2022 16:36:44 -0400 Message-Id: <20220318203655.676907-5-jsnow@redhat.com> In-Reply-To: <20220318203655.676907-1-jsnow@redhat.com> References: <20220318203655.676907-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , John Snow , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1647636134615100001 Content-Type: text/plain; charset="utf-8" qemu-io fails on read/write with zero-length raw images, so skip these when running the zero-length image tests. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz --- tests/qemu-iotests/040 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040 index adf5815781..c4a90937dc 100755 --- a/tests/qemu-iotests/040 +++ b/tests/qemu-iotests/040 @@ -86,8 +86,10 @@ class TestSingleDrive(ImageCommitTestCase): qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=3D%s' % mid_img, '-F', iotests.imgfmt, test_img) - qemu_io('-f', 'raw', '-c', 'write -P 0xab 0 524288', backing_img) - qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288',= mid_img) + if self.image_len: + qemu_io('-f', 'raw', '-c', 'write -P 0xab 0 524288', backing_i= mg) + qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 5242= 88', + mid_img) self.vm =3D iotests.VM().add_drive(test_img, "node-name=3Dtop,back= ing.node-name=3Dmid,backing.backing.node-name=3Dbase", interface=3D"none") self.vm.add_device('virtio-scsi') self.vm.add_device("scsi-hd,id=3Dscsi0,drive=3Ddrive0") @@ -101,11 +103,15 @@ class TestSingleDrive(ImageCommitTestCase): =20 def test_commit(self): self.run_commit_test(mid_img, backing_img) + if not self.image_len: + return qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 524288', backing_img) qemu_io('-f', 'raw', '-c', 'read -P 0xef 524288 524288', backing_i= mg) =20 def test_commit_node(self): self.run_commit_test("mid", "base", node_names=3DTrue) + if not self.image_len: + return qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 524288', backing_img) qemu_io('-f', 'raw', '-c', 'read -P 0xef 524288 524288', backing_i= mg) =20 @@ -192,11 +198,15 @@ class TestSingleDrive(ImageCommitTestCase): =20 def test_top_is_active(self): self.run_commit_test(test_img, backing_img, need_ready=3DTrue) + if not self.image_len: + return qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 524288', backing_img) qemu_io('-f', 'raw', '-c', 'read -P 0xef 524288 524288', backing_i= mg) =20 def test_top_is_default_active(self): self.run_default_commit_test() + if not self.image_len: + return qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 524288', backing_img) qemu_io('-f', 'raw', '-c', 'read -P 0xef 524288 524288', backing_i= mg) =20 --=20 2.34.1 From nobody Sun Feb 8 21:32:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1647636466961150.52315470200892; Fri, 18 Mar 2022 13:47:46 -0700 (PDT) Received: from localhost ([::1]:50812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVJVh-0006cG-Lm for importer@patchew.org; Fri, 18 Mar 2022 16:47:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLM-0002OH-NB for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:45378) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLI-0005XO-V7 for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:04 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-86-tOBmENyvM9SWWK6Zo5U9Kg-1; Fri, 18 Mar 2022 16:36:57 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5FD07811E78; Fri, 18 Mar 2022 20:36:57 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D29E403373; Fri, 18 Mar 2022 20:36:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647635820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UWgjy6sf0tGyIgGhXmp/UdMcvcRYigEUPNFCapbHzAM=; b=H+0FJw6MwT0l4L882auybKmdDHiPwZhcw0pnV/vFyKdVb1+NhEdgfBKP8GU0ZqUSExlO9G fqI7RqyfW3G0DZ1Tuc4/EzSb1NNaw80ara6vtk6NHvPucemcjSa7T1ZnPa0ksot5Y3fzkk TyElLkk2nj3RCHV/D8ZnkE+56a3dzXc= X-MC-Unique: tOBmENyvM9SWWK6Zo5U9Kg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 05/15] iotests: create generic qemu_tool() function Date: Fri, 18 Mar 2022 16:36:45 -0400 Message-Id: <20220318203655.676907-6-jsnow@redhat.com> In-Reply-To: <20220318203655.676907-1-jsnow@redhat.com> References: <20220318203655.676907-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , John Snow , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1647636467782100001 Content-Type: text/plain; charset="utf-8" reimplement qemu_img() in terms of qemu_tool() in preparation for doing the same with qemu_io(). Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz --- tests/qemu-iotests/iotests.py | 37 +++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 6cd8374c81..974a2b0c8d 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -207,15 +207,13 @@ def qemu_img_create_prepare_args(args: List[str]) -> = List[str]: =20 return result =20 -def qemu_img(*args: str, check: bool =3D True, combine_stdio: bool =3D True + +def qemu_tool(*args: str, check: bool =3D True, combine_stdio: bool =3D Tr= ue ) -> subprocess.CompletedProcess[str]: """ - Run qemu_img and return the status code and console output. + Run a qemu tool and return its status code and console output. =20 - This function always prepends QEMU_IMG_OPTIONS and may further alter - the args for 'create' commands. - - :param args: command-line arguments to qemu-img. + :param args: command-line arguments to a QEMU cli tool. :param check: Enforce a return code of zero. :param combine_stdio: set to False to keep stdout/stderr separated. =20 @@ -227,14 +225,13 @@ def qemu_img(*args: str, check: bool =3D True, combin= e_stdio: bool =3D True handled, the command-line, return code, and all console output will be included at the bottom of the stack trace. =20 - :return: a CompletedProcess. This object has args, returncode, and - stdout properties. If streams are not combined, it will also - have a stderr property. + :return: + A CompletedProcess. This object has args, returncode, and stdout + properties. If streams are not combined, it will also have a + stderr property. """ - full_args =3D qemu_img_args + qemu_img_create_prepare_args(list(args)) - subp =3D subprocess.run( - full_args, + args, stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.STDOUT if combine_stdio else subprocess.PIPE, universal_newlines=3DTrue, @@ -243,7 +240,7 @@ def qemu_img(*args: str, check: bool =3D True, combine_= stdio: bool =3D True =20 if check and subp.returncode or (subp.returncode < 0): raise VerboseProcessError( - subp.returncode, full_args, + subp.returncode, args, output=3Dsubp.stdout, stderr=3Dsubp.stderr, ) @@ -251,6 +248,20 @@ def qemu_img(*args: str, check: bool =3D True, combine= _stdio: bool =3D True return subp =20 =20 +def qemu_img(*args: str, check: bool =3D True, combine_stdio: bool =3D True + ) -> subprocess.CompletedProcess[str]: + """ + Run QEMU_IMG_PROG and return its status code and console output. + + This function always prepends QEMU_IMG_OPTIONS and may further alter + the args for 'create' commands. + + See `qemu_tool()` for greater detail. + """ + full_args =3D qemu_img_args + qemu_img_create_prepare_args(list(args)) + return qemu_tool(*full_args, check=3Dcheck, combine_stdio=3Dcombine_st= dio) + + def ordered_qmp(qmsg, conv_keys=3DTrue): # Dictionaries are not ordered prior to 3.6, therefore: if isinstance(qmsg, list): --=20 2.34.1 From nobody Sun Feb 8 21:32:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1647635965908730.0408801777436; Fri, 18 Mar 2022 13:39:25 -0700 (PDT) Received: from localhost ([::1]:54198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVJNe-00060z-9u for importer@patchew.org; Fri, 18 Mar 2022 16:39:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLK-0002GZ-De for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:56217) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLH-0005Vo-SH for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:01 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-611-j4JPnC4EMU6HwUwkOWlPWQ-1; Fri, 18 Mar 2022 16:36:58 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BD3D0801585; Fri, 18 Mar 2022 20:36:57 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F6FE403373; Fri, 18 Mar 2022 20:36:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647635819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FUb41VY02U+Uhz3seQ+bxDve0B5jiBuop7l1o+z2L10=; b=GTA2/Vm2x3KVPqG5kM7uU7I45Jc8RMZLVK7eUoD586YMnxK4gY0azONuYDSZLRLEl2peUN NqNidErOahIw1ah5+zl4VrTjCvpEpwtO9XT0gHfh2dWuMefsof/phmhV65PV4L29ojhpKo MeFFWEt68s3nYSmAamADh/EGrXS/7tg= X-MC-Unique: j4JPnC4EMU6HwUwkOWlPWQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 06/15] iotests: rebase qemu_io() on top of qemu_tool() Date: Fri, 18 Mar 2022 16:36:46 -0400 Message-Id: <20220318203655.676907-7-jsnow@redhat.com> In-Reply-To: <20220318203655.676907-1-jsnow@redhat.com> References: <20220318203655.676907-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , John Snow , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1647635985146100001 Content-Type: text/plain; charset="utf-8" Rework qemu_io() to be analogous to qemu_img(); a function that requires a return code of zero by default unless disabled explicitly. Tests that use qemu_io(): 030 040 041 044 055 056 093 124 129 132 136 148 149 151 152 163 165 205 209 219 236 245 248 254 255 257 260 264 280 298 300 302 304 image-fleecing migrate-bitmaps-postcopy-test migrate-bitmaps-test migrate-during-backup migration-permissions Test that use qemu_io_log(): 242 245 255 274 303 307 nbd-reconnect-on-open Signed-off-by: John Snow --- Note: This breaks several tests at this point. I'll be fixing each broken test one by one in the subsequent commits. We can squash them all on merge to avoid test regressions. (Seems like a way to have your cake and eat it too with regards to maintaining bisectability while also having nice mailing list patches.) Copy-pastables: ./check -qcow2 030 040 041 044 055 056 124 129 132 151 152 163 165 209 \ 219 236 242 245 248 254 255 257 260 264 274 \ 280 298 300 302 303 304 307 image-fleecing \ migrate-bitmaps-postcopy-test migrate-bitmaps-test \ migrate-during-backup nbd-reconnect-on-open ./check -raw 093 136 148 migration-permissions ./check -nbd 205 # ./configure configure --disable-gnutls --enable-gcrypt # this ALSO requires passwordless sudo. ./check -luks 149 # Just the ones that fail: ./check -qcow2 030 040 242 245 ./check -raw migration-permissions ./check -nbd 205 ./check -luks 149 Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 974a2b0c8d..58ea766568 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -354,16 +354,23 @@ def qemu_io_wrap_args(args: Sequence[str]) -> List[st= r]: def qemu_io_popen(*args): return qemu_tool_popen(qemu_io_wrap_args(args)) =20 -def qemu_io(*args): - '''Run qemu-io and return the stdout data''' - return qemu_tool_pipe_and_status('qemu-io', qemu_io_wrap_args(args))[0] +def qemu_io(*args: str, check: bool =3D True, combine_stdio: bool =3D True + ) -> subprocess.CompletedProcess[str]: + """ + Run QEMU_IO_PROG and return the status code and console output. + + This function always prepends either QEMU_IO_OPTIONS or + QEMU_IO_OPTIONS_NO_FMT. + """ + return qemu_tool(*qemu_io_wrap_args(args), + check=3Dcheck, combine_stdio=3Dcombine_stdio) =20 def qemu_io_pipe_and_status(*args): return qemu_tool_pipe_and_status('qemu-io', qemu_io_wrap_args(args)) =20 -def qemu_io_log(*args): - result =3D qemu_io(*args) - log(result, filters=3D[filter_testfiles, filter_qemu_io]) +def qemu_io_log(*args: str) -> subprocess.CompletedProcess[str]: + result =3D qemu_io(*args, check=3DFalse) + log(result.stdout, filters=3D[filter_testfiles, filter_qemu_io]) return result =20 def qemu_io_silent(*args): --=20 2.34.1 From nobody Sun Feb 8 21:32:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1647636725423579.8094195655854; Fri, 18 Mar 2022 13:52:05 -0700 (PDT) Received: from localhost ([::1]:33190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVJZs-0005Ls-9A for importer@patchew.org; Fri, 18 Mar 2022 16:52:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLQ-0002Wy-Gk for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLK-0005Yb-7r for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:06 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-612-A_Rcp6wVPF6Zh7m2GzwsQg-1; Fri, 18 Mar 2022 16:36:58 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1967A1C05ED6; Fri, 18 Mar 2022 20:36:58 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE2D0403373; Fri, 18 Mar 2022 20:36:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647635821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=97D4Idh/djdPoW1N9ZTKA71f6UmfRm1Hbv4LkFpvs0s=; b=L2A88HGaudgf6tlUm/P6wmTtfnSz4UxiYNHdiwKpcpu6rsVPWLgOHbqIpK5NoyfmCzoH8l rKL8mDzuse+ifPllpFVX3JSMXymEIGm/RM1hhrJaTaabUIQboEcaJCqNEWbxzi1x3FEfPC YQ74Wb95SCBuHZ7NpR4QSfwJilw0Jw4= X-MC-Unique: A_Rcp6wVPF6Zh7m2GzwsQg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 07/15] iotests/030: fixup Date: Fri, 18 Mar 2022 16:36:47 -0400 Message-Id: <20220318203655.676907-8-jsnow@redhat.com> In-Reply-To: <20220318203655.676907-1-jsnow@redhat.com> References: <20220318203655.676907-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , John Snow , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1647636725802100001 Content-Type: text/plain; charset="utf-8" (Merge into prior patch.) Signed-off-by: John Snow --- tests/qemu-iotests/030 | 85 ++++++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 567bf1da67..3a2de920a3 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -64,16 +64,18 @@ class TestSingleDrive(iotests.QMPTestCase): self.assert_no_active_block_jobs() self.vm.shutdown() =20 - self.assertEqual(qemu_io('-f', 'raw', '-c', 'map', backing_img), - qemu_io('-f', iotests.imgfmt, '-c', 'map', test_i= mg), - 'image file map does not match backing file after= streaming') + self.assertEqual( + qemu_io('-f', 'raw', '-c', 'map', backing_img).stdout, + qemu_io('-f', iotests.imgfmt, '-c', 'map', test_img).stdout, + 'image file map does not match backing file after streaming') =20 def test_stream_intermediate(self): self.assert_no_active_block_jobs() =20 - self.assertNotEqual(qemu_io('-f', 'raw', '-rU', '-c', 'map', backi= ng_img), - qemu_io('-f', iotests.imgfmt, '-rU', '-c', 'ma= p', mid_img), - 'image file map matches backing file before st= reaming') + self.assertNotEqual( + qemu_io('-f', 'raw', '-rU', '-c', 'map', backing_img).stdout, + qemu_io('-f', iotests.imgfmt, '-rU', '-c', 'map', mid_img).std= out, + 'image file map matches backing file before streaming') =20 result =3D self.vm.qmp('block-stream', device=3D'mid', job_id=3D's= tream-mid') self.assert_qmp(result, 'return', {}) @@ -83,9 +85,10 @@ class TestSingleDrive(iotests.QMPTestCase): self.assert_no_active_block_jobs() self.vm.shutdown() =20 - self.assertEqual(qemu_io('-f', 'raw', '-c', 'map', backing_img), - qemu_io('-f', iotests.imgfmt, '-c', 'map', mid_im= g), - 'image file map does not match backing file after= streaming') + self.assertEqual( + qemu_io('-f', 'raw', '-c', 'map', backing_img).stdout, + qemu_io('-f', iotests.imgfmt, '-c', 'map', mid_img).stdout, + 'image file map does not match backing file after streaming') =20 def test_stream_pause(self): self.assert_no_active_block_jobs() @@ -113,15 +116,17 @@ class TestSingleDrive(iotests.QMPTestCase): self.assert_no_active_block_jobs() self.vm.shutdown() =20 - self.assertEqual(qemu_io('-f', 'raw', '-c', 'map', backing_img), - qemu_io('-f', iotests.imgfmt, '-c', 'map', test_i= mg), - 'image file map does not match backing file after= streaming') + self.assertEqual( + qemu_io('-f', 'raw', '-c', 'map', backing_img).stdout, + qemu_io('-f', iotests.imgfmt, '-c', 'map', test_img).stdout, + 'image file map does not match backing file after streaming') =20 def test_stream_no_op(self): self.assert_no_active_block_jobs() =20 # The image map is empty before the operation - empty_map =3D qemu_io('-f', iotests.imgfmt, '-rU', '-c', 'map', te= st_img) + empty_map =3D qemu_io( + '-f', iotests.imgfmt, '-rU', '-c', 'map', test_img).stdout =20 # This is a no-op: no data should ever be copied from the base ima= ge result =3D self.vm.qmp('block-stream', device=3D'drive0', base=3Dm= id_img) @@ -132,8 +137,9 @@ class TestSingleDrive(iotests.QMPTestCase): self.assert_no_active_block_jobs() self.vm.shutdown() =20 - self.assertEqual(qemu_io('-f', iotests.imgfmt, '-c', 'map', test_i= mg), - empty_map, 'image file map changed after a no-op') + self.assertEqual( + qemu_io('-f', iotests.imgfmt, '-c', 'map', test_img).stdout, + empty_map, 'image file map changed after a no-op') =20 def test_stream_partial(self): self.assert_no_active_block_jobs() @@ -146,9 +152,10 @@ class TestSingleDrive(iotests.QMPTestCase): self.assert_no_active_block_jobs() self.vm.shutdown() =20 - self.assertEqual(qemu_io('-f', iotests.imgfmt, '-c', 'map', mid_im= g), - qemu_io('-f', iotests.imgfmt, '-c', 'map', test_i= mg), - 'image file map does not match backing file after= streaming') + self.assertEqual( + qemu_io('-f', iotests.imgfmt, '-c', 'map', mid_img).stdout, + qemu_io('-f', iotests.imgfmt, '-c', 'map', test_img).stdout, + 'image file map does not match backing file after streaming') =20 def test_device_not_found(self): result =3D self.vm.qmp('block-stream', device=3D'nonexistent') @@ -236,9 +243,10 @@ class TestParallelOps(iotests.QMPTestCase): =20 # Check that the maps don't match before the streaming operations for i in range(2, self.num_imgs, 2): - self.assertNotEqual(qemu_io('-f', iotests.imgfmt, '-rU', '-c',= 'map', self.imgs[i]), - qemu_io('-f', iotests.imgfmt, '-rU', '-c',= 'map', self.imgs[i-1]), - 'image file map matches backing file befor= e streaming') + self.assertNotEqual( + qemu_io('-f', iotests.imgfmt, '-rU', '-c', 'map', self.img= s[i]).stdout, + qemu_io('-f', iotests.imgfmt, '-rU', '-c', 'map', self.img= s[i-1]).stdout, + 'image file map matches backing file before streaming') =20 # Create all streaming jobs pending_jobs =3D [] @@ -278,9 +286,10 @@ class TestParallelOps(iotests.QMPTestCase): =20 # Check that all maps match now for i in range(2, self.num_imgs, 2): - self.assertEqual(qemu_io('-f', iotests.imgfmt, '-c', 'map', se= lf.imgs[i]), - qemu_io('-f', iotests.imgfmt, '-c', 'map', se= lf.imgs[i-1]), - 'image file map does not match backing file a= fter streaming') + self.assertEqual( + qemu_io('-f', iotests.imgfmt, '-c', 'map', self.imgs[i]).s= tdout, + qemu_io('-f', iotests.imgfmt, '-c', 'map', self.imgs[i-1])= .stdout, + 'image file map does not match backing file after streamin= g') =20 # Test that it's not possible to perform two block-stream # operations if there are nodes involved in both. @@ -509,9 +518,10 @@ class TestParallelOps(iotests.QMPTestCase): def test_stream_base_node_name(self): self.assert_no_active_block_jobs() =20 - self.assertNotEqual(qemu_io('-f', iotests.imgfmt, '-rU', '-c', 'ma= p', self.imgs[4]), - qemu_io('-f', iotests.imgfmt, '-rU', '-c', 'ma= p', self.imgs[3]), - 'image file map matches backing file before st= reaming') + self.assertNotEqual( + qemu_io('-f', iotests.imgfmt, '-rU', '-c', 'map', self.imgs[4]= ).stdout, + qemu_io('-f', iotests.imgfmt, '-rU', '-c', 'map', self.imgs[3]= ).stdout, + 'image file map matches backing file before streaming') =20 # Error: the base node does not exist result =3D self.vm.qmp('block-stream', device=3D'node4', base_node= =3D'none', job_id=3D'stream') @@ -542,9 +552,10 @@ class TestParallelOps(iotests.QMPTestCase): self.assert_no_active_block_jobs() self.vm.shutdown() =20 - self.assertEqual(qemu_io('-f', iotests.imgfmt, '-c', 'map', self.i= mgs[4]), - qemu_io('-f', iotests.imgfmt, '-c', 'map', self.i= mgs[3]), - 'image file map matches backing file after stream= ing') + self.assertEqual( + qemu_io('-f', iotests.imgfmt, '-c', 'map', self.imgs[4]).stdou= t, + qemu_io('-f', iotests.imgfmt, '-c', 'map', self.imgs[3]).stdou= t, + 'image file map matches backing file after streaming') =20 class TestQuorum(iotests.QMPTestCase): num_children =3D 3 @@ -583,9 +594,10 @@ class TestQuorum(iotests.QMPTestCase): os.remove(img) =20 def test_stream_quorum(self): - self.assertNotEqual(qemu_io('-f', iotests.imgfmt, '-rU', '-c', 'ma= p', self.children[0]), - qemu_io('-f', iotests.imgfmt, '-rU', '-c', 'ma= p', self.backing[0]), - 'image file map matches backing file before st= reaming') + self.assertNotEqual( + qemu_io('-f', iotests.imgfmt, '-rU', '-c', 'map', self.childre= n[0]).stdout, + qemu_io('-f', iotests.imgfmt, '-rU', '-c', 'map', self.backing= [0]).stdout, + 'image file map matches backing file before streaming') =20 self.assert_no_active_block_jobs() =20 @@ -597,9 +609,10 @@ class TestQuorum(iotests.QMPTestCase): self.assert_no_active_block_jobs() self.vm.shutdown() =20 - self.assertEqual(qemu_io('-f', iotests.imgfmt, '-c', 'map', self.c= hildren[0]), - qemu_io('-f', iotests.imgfmt, '-c', 'map', self.b= acking[0]), - 'image file map does not match backing file after= streaming') + self.assertEqual( + qemu_io('-f', iotests.imgfmt, '-c', 'map', self.children[0]).s= tdout, + qemu_io('-f', iotests.imgfmt, '-c', 'map', self.backing[0]).st= dout, + 'image file map does not match backing file after streaming') =20 class TestSmallerBackingFile(iotests.QMPTestCase): backing_len =3D 1 * 1024 * 1024 # MB --=20 2.34.1 From nobody Sun Feb 8 21:32:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16476363535751.717856622349359; Fri, 18 Mar 2022 13:45:53 -0700 (PDT) Received: from localhost ([::1]:44456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVJTs-00023K-3w for importer@patchew.org; Fri, 18 Mar 2022 16:45:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLQ-0002Wz-H3 for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:50812) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLK-0005Yk-CZ for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:06 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-152-lxLDbBMUNmeXoai5TTIdIw-1; Fri, 18 Mar 2022 16:36:58 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 773D33800E9C; Fri, 18 Mar 2022 20:36:58 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34CCB403373; Fri, 18 Mar 2022 20:36:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647635821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l8RXLOLugEcJ24QsV9+uRJHuw3V8Sk3+hI/0hns61nI=; b=aj2zdvs7Hf48AM7SmeTGsUnUdTEvIyhlai/SkuF1H0OVDAsFRLZqUpoUPFuVFO9oIN+lYp 6JeNzMOZAAH50audfGT3SGdinvg41aFBjeFBx/dT94Co8n2Rz7hsxW949ZqWUntatYGuX6 Ngt5DSgG6Md4dFwjGnpTVCVfeC2FX6s= X-MC-Unique: lxLDbBMUNmeXoai5TTIdIw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 08/15] iotests/149: fixup Date: Fri, 18 Mar 2022 16:36:48 -0400 Message-Id: <20220318203655.676907-9-jsnow@redhat.com> In-Reply-To: <20220318203655.676907-1-jsnow@redhat.com> References: <20220318203655.676907-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , John Snow , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1647636354723100001 Content-Type: text/plain; charset="utf-8" (Merge into prior patch.) Notes: I don't quite like this change, but I'm at a loss for what would be cleaner. This is a funky test. Signed-off-by: John Snow --- tests/qemu-iotests/149 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/149 b/tests/qemu-iotests/149 index 9bb96d6a1d..2ae318f16f 100755 --- a/tests/qemu-iotests/149 +++ b/tests/qemu-iotests/149 @@ -295,7 +295,8 @@ def qemu_io_write_pattern(config, pattern, offset_mb, s= ize_mb, dev=3DFalse): args =3D ["-c", "write -P 0x%x %dM %dM" % (pattern, offset_mb, size_mb= )] args.extend(qemu_io_image_args(config, dev)) iotests.log("qemu-io " + " ".join(args), filters=3D[iotests.filter_tes= t_dir]) - iotests.log(check_cipher_support(config, iotests.qemu_io(*args)), + output =3D iotests.qemu_io(*args, check=3DFalse).stdout + iotests.log(check_cipher_support(config, output), filters=3D[iotests.filter_test_dir, iotests.filter_qemu_io= ]) =20 =20 @@ -307,7 +308,8 @@ def qemu_io_read_pattern(config, pattern, offset_mb, si= ze_mb, dev=3DFalse): args =3D ["-c", "read -P 0x%x %dM %dM" % (pattern, offset_mb, size_mb)] args.extend(qemu_io_image_args(config, dev)) iotests.log("qemu-io " + " ".join(args), filters=3D[iotests.filter_tes= t_dir]) - iotests.log(check_cipher_support(config, iotests.qemu_io(*args)), + output =3D iotests.qemu_io(*args, check=3DFalse).stdout + iotests.log(check_cipher_support(config, output), filters=3D[iotests.filter_test_dir, iotests.filter_qemu_io= ]) =20 =20 --=20 2.34.1 From nobody Sun Feb 8 21:32:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1647636188346543.490025104644; Fri, 18 Mar 2022 13:43:08 -0700 (PDT) Received: from localhost ([::1]:37036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVJRE-00058U-Sx for importer@patchew.org; Fri, 18 Mar 2022 16:43:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLQ-0002X0-Gh for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:47214) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLL-0005Z8-1U for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:06 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-427-jT-_lbYKOu-QaGC3571ENA-1; Fri, 18 Mar 2022 16:36:59 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CBC288002BF; Fri, 18 Mar 2022 20:36:58 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87E06403373; Fri, 18 Mar 2022 20:36:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647635822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bLr6zY9XqLosGuNpmqH3mBnTHxejKtvuQqrh/NZR/dE=; b=Lbpw07jcSHHZoNHjMgLZEnIGmV9or+vIvzh/2nJtYttc9/SZ02zpT6EV3gEbtVzvy+7X+o c6UGO1ktiQZuGNxmZWyuKm6XQlZzGOwyk2DVBRXr4HxPK43az442n1N/CMOdrp9omd9vV1 y01yH+wtRh5ngoApmGnEXpIVPVfCkIM= X-MC-Unique: jT-_lbYKOu-QaGC3571ENA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 09/15] iotests/205: fixup Date: Fri, 18 Mar 2022 16:36:49 -0400 Message-Id: <20220318203655.676907-10-jsnow@redhat.com> In-Reply-To: <20220318203655.676907-1-jsnow@redhat.com> References: <20220318203655.676907-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , John Snow , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1647636196054100001 Content-Type: text/plain; charset="utf-8" (Merge into prior patch.) Signed-off-by: John Snow --- tests/qemu-iotests/205 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/205 b/tests/qemu-iotests/205 index c0e107328f..15f798288a 100755 --- a/tests/qemu-iotests/205 +++ b/tests/qemu-iotests/205 @@ -85,13 +85,13 @@ class TestNbdServerRemove(iotests.QMPTestCase): =20 def do_test_connect_after_remove(self, mode=3DNone): args =3D ('-r', '-f', 'raw', '-c', 'read 0 512', nbd_uri) - self.assertReadOk(qemu_io(*args)) + self.assertReadOk(qemu_io(*args).stdout) =20 result =3D self.remove_export('exp', mode) self.assert_qmp(result, 'return', {}) =20 self.assertExportNotFound('exp') - self.assertConnectFailed(qemu_io(*args)) + self.assertConnectFailed(qemu_io(*args, check=3DFalse).stdout) =20 def test_connect_after_remove_default(self): self.do_test_connect_after_remove() --=20 2.34.1 From nobody Sun Feb 8 21:32:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1647636483140488.303511121184; Fri, 18 Mar 2022 13:48:03 -0700 (PDT) Received: from localhost ([::1]:51952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVJVz-0007Nb-Kx for importer@patchew.org; Fri, 18 Mar 2022 16:48:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLQ-0002XC-Ju for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:20587) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLL-0005ZU-Gp for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:07 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-563-1VKAQpjeMYGIJ7fmuym0hQ-1; Fri, 18 Mar 2022 16:36:59 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2A3C7185A7A4; Fri, 18 Mar 2022 20:36:59 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id DBB054292C7; Fri, 18 Mar 2022 20:36:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647635822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=46s02IKfPzEHeky+CL14PRQ7s2txOzrx2qlksONgEv0=; b=F6Njlt7Xv/IdkAzUWKAQ66dTMowy+D7nFdpJ9eBYNIPWqSVO3mkUAWDIcmZz10BfRfSYDu bDGe1V1Dy91M6JkD1aZYzqhiYrBvDZiRiQ7BFyjWurJGRb4jn/SXWWhHfABhP17bxWu1J4 Mf7hM3CUqgTentMOW6R2yJntuXFSTg8= X-MC-Unique: 1VKAQpjeMYGIJ7fmuym0hQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 10/15] iotests/245: fixup Date: Fri, 18 Mar 2022 16:36:50 -0400 Message-Id: <20220318203655.676907-11-jsnow@redhat.com> In-Reply-To: <20220318203655.676907-1-jsnow@redhat.com> References: <20220318203655.676907-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , John Snow , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1647636497044100004 Content-Type: text/plain; charset="utf-8" (Merge with prior patch.) Signed-off-by: John Snow Reviewed-by: Eric Blake Tested-by: Eric Blake --- tests/qemu-iotests/242 | 2 +- tests/qemu-iotests/245 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/242 b/tests/qemu-iotests/242 index 4b7ec16af6..ecc851582a 100755 --- a/tests/qemu-iotests/242 +++ b/tests/qemu-iotests/242 @@ -22,7 +22,7 @@ import iotests import json import struct -from iotests import qemu_img_create, qemu_io, qemu_img_info, \ +from iotests import qemu_img_create, qemu_io_log, qemu_img_info, \ file_path, img_info_log, log, filter_qemu_io =20 iotests.script_initialize(supported_fmts=3D['qcow2'], diff --git a/tests/qemu-iotests/245 b/tests/qemu-iotests/245 index 8cbed7821b..efdad1a0c4 100755 --- a/tests/qemu-iotests/245 +++ b/tests/qemu-iotests/245 @@ -217,7 +217,7 @@ class TestBlockdevReopen(iotests.QMPTestCase): # Reopen an image several times changing some of its options def test_reopen(self): # Check whether the filesystem supports O_DIRECT - if 'O_DIRECT' in qemu_io('-f', 'raw', '-t', 'none', '-c', 'quit', = hd_path[0]): + if 'O_DIRECT' in qemu_io('-f', 'raw', '-t', 'none', '-c', 'quit', = hd_path[0]).stdout: supports_direct =3D False else: supports_direct =3D True --=20 2.34.1 From nobody Sun Feb 8 21:32:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1647636012054910.0149213647769; Fri, 18 Mar 2022 13:40:12 -0700 (PDT) Received: from localhost ([::1]:56764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVJON-0007kL-2K for importer@patchew.org; Fri, 18 Mar 2022 16:40:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLQ-0002Wx-Fx for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:41709) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLL-0005Zb-OP for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:07 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-577-eTJxuFi8NbivNBVBi8htTQ-1; Fri, 18 Mar 2022 16:37:00 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7744B811E75; Fri, 18 Mar 2022 20:36:59 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BA98403373; Fri, 18 Mar 2022 20:36:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647635823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o/qldgWi4lnWYA2nvmDxAvwHKsTQwe81x73WtjYyKX0=; b=QrihKP0vooZevZp3SPHvG9doc/o+t4ScVdpuSY/qYmvPdqRYvmASY9lQRjuM9AGo6u2bnP +AAfmQiajUDQ5TCQbFMPx0f+hJW1UZtYWOu6D/OeY3bQK6QfzyeKHHrvByEfJYYQ+ajyp+ e0+LIhfp1d8oB2+15g9R92JScthd15Q= X-MC-Unique: eTJxuFi8NbivNBVBi8htTQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 11/15] iotests/migration-permissions: fixup Date: Fri, 18 Mar 2022 16:36:51 -0400 Message-Id: <20220318203655.676907-12-jsnow@redhat.com> In-Reply-To: <20220318203655.676907-1-jsnow@redhat.com> References: <20220318203655.676907-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , John Snow , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1647636013946100001 Content-Type: text/plain; charset="utf-8" (Merge into prior commit) Note, this is a quick hack band-aid, but a follow-up patch spends the time to refactor it a bit. This is just the quick stop-gap to prevent bisection failures. Signed-off-by: John Snow --- tests/qemu-iotests/tests/migration-permissions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/tests/migration-permissions b/tests/qemu-io= tests/tests/migration-permissions index 6be02581c7..c7afb1bd2c 100755 --- a/tests/qemu-iotests/tests/migration-permissions +++ b/tests/qemu-iotests/tests/migration-permissions @@ -69,7 +69,7 @@ class TestMigrationPermissions(iotests.QMPTestCase): def test_post_migration_permissions(self): # Try to access the image R/W, which should fail because virtio-blk # has not been configured with share-rw=3Don - log =3D qemu_io('-f', imgfmt, '-c', 'quit', test_img) + log =3D qemu_io('-f', imgfmt, '-c', 'quit', test_img, check=3DFals= e).stdout if not log.strip(): print('ERROR (pre-migration): qemu-io should not be able to ' 'access this image, but it reported no error') @@ -84,7 +84,7 @@ class TestMigrationPermissions(iotests.QMPTestCase): =20 # Try the same qemu-io access again, verifying that the WRITE # permission remains unshared - log =3D qemu_io('-f', imgfmt, '-c', 'quit', test_img) + log =3D qemu_io('-f', imgfmt, '-c', 'quit', test_img, check=3DFals= e).stdout if not log.strip(): print('ERROR (post-migration): qemu-io should not be able to ' 'access this image, but it reported no error') --=20 2.34.1 From nobody Sun Feb 8 21:32:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1647636164612762.064428546999; Fri, 18 Mar 2022 13:42:44 -0700 (PDT) Received: from localhost ([::1]:35310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVJQp-0003yE-Lh for importer@patchew.org; Fri, 18 Mar 2022 16:42:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLQ-0002X1-Gn for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:26731) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLL-0005Zh-Rl for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:07 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-507-Dqt1wrsfN5WowKF41UT3hg-1; Fri, 18 Mar 2022 16:37:00 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C40DA296A62A; Fri, 18 Mar 2022 20:36:59 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84941403373; Fri, 18 Mar 2022 20:36:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647635823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CxRa1scYqM2h39goUwgSoA1uibtEpQhk2NK/W5svTpE=; b=fVKPcYvK/lwtvXhSX2deoGgmEQ1GxJVBnbwPtHwGeOvsoNh8Xv0xgOV4t79Dl5dTSBuqWH mCTg7roZHgYyKwjmIESHE2MjwPkOERNdlaIfWdZ0zqNSg+vSCM4aaSEpdeyK0Cp4JZkBL5 mH0Gt4Qr5tNHGlDOobLwpkyobjsYMmo= X-MC-Unique: Dqt1wrsfN5WowKF41UT3hg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 12/15] iotests/migration-permissions: use assertRaises() for qemu_io() negative test Date: Fri, 18 Mar 2022 16:36:52 -0400 Message-Id: <20220318203655.676907-13-jsnow@redhat.com> In-Reply-To: <20220318203655.676907-1-jsnow@redhat.com> References: <20220318203655.676907-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , John Snow , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1647636165171100001 Content-Type: text/plain; charset="utf-8" Modify this test to use assertRaises for its negative testing of qemu_io. If the exception raised does not match the one we tell it to expect, we get *that* exception unhandled. If we get no exception, we get a unittest assertion failure and the provided emsg printed to screen. If we get the CalledProcessError exception but the output is not what we expect, we re-raise the original CalledProcessError. Tidy. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz Tested-by: Eric Blake --- .../qemu-iotests/tests/migration-permissions | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/qemu-iotests/tests/migration-permissions b/tests/qemu-io= tests/tests/migration-permissions index c7afb1bd2c..4e1da369c9 100755 --- a/tests/qemu-iotests/tests/migration-permissions +++ b/tests/qemu-iotests/tests/migration-permissions @@ -18,6 +18,8 @@ # =20 import os +from subprocess import CalledProcessError + import iotests from iotests import imgfmt, qemu_img_create, qemu_io =20 @@ -69,13 +71,12 @@ class TestMigrationPermissions(iotests.QMPTestCase): def test_post_migration_permissions(self): # Try to access the image R/W, which should fail because virtio-blk # has not been configured with share-rw=3Don - log =3D qemu_io('-f', imgfmt, '-c', 'quit', test_img, check=3DFals= e).stdout - if not log.strip(): - print('ERROR (pre-migration): qemu-io should not be able to ' - 'access this image, but it reported no error') - else: - # This is the expected output - assert 'Is another process using the image' in log + emsg =3D ('ERROR (pre-migration): qemu-io should not be able to ' + 'access this image, but it reported no error') + with self.assertRaises(CalledProcessError, msg=3Demsg) as ctx: + qemu_io('-f', imgfmt, '-c', 'quit', test_img) + if 'Is another process using the image' not in ctx.exception.stdou= t: + raise ctx.exception =20 # Now migrate the VM self.vm_s.qmp('migrate', uri=3Df'unix:{mig_sock}') @@ -84,13 +85,12 @@ class TestMigrationPermissions(iotests.QMPTestCase): =20 # Try the same qemu-io access again, verifying that the WRITE # permission remains unshared - log =3D qemu_io('-f', imgfmt, '-c', 'quit', test_img, check=3DFals= e).stdout - if not log.strip(): - print('ERROR (post-migration): qemu-io should not be able to ' - 'access this image, but it reported no error') - else: - # This is the expected output - assert 'Is another process using the image' in log + emsg =3D ('ERROR (post-migration): qemu-io should not be able to ' + 'access this image, but it reported no error') + with self.assertRaises(CalledProcessError, msg=3Demsg) as ctx: + qemu_io('-f', imgfmt, '-c', 'quit', test_img) + if 'Is another process using the image' not in ctx.exception.stdou= t: + raise ctx.exception =20 =20 if __name__ =3D=3D '__main__': --=20 2.34.1 From nobody Sun Feb 8 21:32:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1647636595284117.47139795300234; Fri, 18 Mar 2022 13:49:55 -0700 (PDT) Received: from localhost ([::1]:57146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVJXn-0002Q7-LZ for importer@patchew.org; Fri, 18 Mar 2022 16:49:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLQ-0002X3-Hp for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:27719) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLK-0005Yg-Aj for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:06 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-330-qUzQ2dg9MoqazUEojYUmbA-1; Fri, 18 Mar 2022 16:37:00 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2017A1044564; Fri, 18 Mar 2022 20:37:00 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id D2F0D4292CE; Fri, 18 Mar 2022 20:36:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647635821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Sr2yL2ScHLiwNKfeNb0bCWVWw0mci9k85N8h6FJzlr4=; b=hqVGzbGgWjNVHaG/vXSJRfGiwtuDEcKK2yi0qeiAwTcxL2a74WjG/Lx4CSg3Qe2QxQPUYc UDMWbzQhSKdPRkUMWUbYOMP2q2fWp/3h2hwGWkFWWsSqUeFXc4bWiVycw6Kzm32hu6SrRl oIFCPW+k64R3xiXddDV4GpP6mnrpw2A= X-MC-Unique: qUzQ2dg9MoqazUEojYUmbA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 13/15] iotests: remove qemu_io_pipe_and_status() Date: Fri, 18 Mar 2022 16:36:53 -0400 Message-Id: <20220318203655.676907-14-jsnow@redhat.com> In-Reply-To: <20220318203655.676907-1-jsnow@redhat.com> References: <20220318203655.676907-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , John Snow , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1647636617780100001 Content-Type: text/plain; charset="utf-8" I know we just added it, sorry. This is done in favor of qemu_io() which *also* returns the console output and status, but with more robust error handling on failure. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz --- tests/qemu-iotests/iotests.py | 3 --- tests/qemu-iotests/tests/image-fleecing | 12 +++--------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 58ea766568..e8f38e7ad3 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -365,9 +365,6 @@ def qemu_io(*args: str, check: bool =3D True, combine_s= tdio: bool =3D True return qemu_tool(*qemu_io_wrap_args(args), check=3Dcheck, combine_stdio=3Dcombine_stdio) =20 -def qemu_io_pipe_and_status(*args): - return qemu_tool_pipe_and_status('qemu-io', qemu_io_wrap_args(args)) - def qemu_io_log(*args: str) -> subprocess.CompletedProcess[str]: result =3D qemu_io(*args, check=3DFalse) log(result.stdout, filters=3D[filter_testfiles, filter_qemu_io]) diff --git a/tests/qemu-iotests/tests/image-fleecing b/tests/qemu-iotests/t= ests/image-fleecing index b7e5076104..07a4ea7bc4 100755 --- a/tests/qemu-iotests/tests/image-fleecing +++ b/tests/qemu-iotests/tests/image-fleecing @@ -23,8 +23,7 @@ # Creator/Owner: John Snow =20 import iotests -from iotests import log, qemu_img, qemu_io, qemu_io_silent, \ - qemu_io_pipe_and_status +from iotests import log, qemu_img, qemu_io, qemu_io_silent =20 iotests.script_initialize( supported_fmts=3D['qcow2'], @@ -185,10 +184,7 @@ def do_test(vm, use_cbw, use_snapshot_access_filter, b= ase_img_path, for p in patterns + zeroes: cmd =3D 'read -P%s %s %s' % p log(cmd) - out, ret =3D qemu_io_pipe_and_status('-r', '-f', 'raw', '-c', = cmd, - nbd_uri) - if ret !=3D 0: - print(out) + qemu_io('-r', '-f', 'raw', '-c', cmd, nbd_uri) =20 log('') log('--- Testing COW ---') @@ -228,9 +224,7 @@ def do_test(vm, use_cbw, use_snapshot_access_filter, ba= se_img_path, args +=3D [target_img_path] else: args +=3D ['-f', 'raw', nbd_uri] - out, ret =3D qemu_io_pipe_and_status(*args) - if ret !=3D 0: - print(out) + qemu_io(*args) =20 log('') log('--- Cleanup ---') --=20 2.34.1 From nobody Sun Feb 8 21:32:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1647636354159972.5190667390268; Fri, 18 Mar 2022 13:45:54 -0700 (PDT) Received: from localhost ([::1]:44774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVJTu-0002KQ-Ke for importer@patchew.org; Fri, 18 Mar 2022 16:45:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLS-0002Zp-8X for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:56344) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLM-0005a5-R9 for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:09 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-621-AVieNFZOP9an1HrbgiUq9w-1; Fri, 18 Mar 2022 16:37:00 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9EF21833942; Fri, 18 Mar 2022 20:37:00 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30EC5403373; Fri, 18 Mar 2022 20:37:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647635824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bMNytcSELbcuNsTcao8h13ldHnJ8AWsFdXzOxlUpTdU=; b=hNuLx4OWEd7gJMKOgH+WLjdEe4hvvG6V9/4LjJS57bn2we1y74uruDAIGPZICcAwyXwMEF 58J9E+W4Ep7DwlR9P+7ylxA60NQ56x+guDUg31TwB24CD07F0KF2N2VxWus+a8Nbtf612E Y+l5RJrIvDBX11wbXUzvdoPN2xJs1TA= X-MC-Unique: AVieNFZOP9an1HrbgiUq9w-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 14/15] iotests: remove qemu_io_silent() and qemu_io_silent_check(). Date: Fri, 18 Mar 2022 16:36:54 -0400 Message-Id: <20220318203655.676907-15-jsnow@redhat.com> In-Reply-To: <20220318203655.676907-1-jsnow@redhat.com> References: <20220318203655.676907-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , John Snow , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1647636376971100001 Content-Type: text/plain; charset="utf-8" Like qemu-img, qemu-io returning 0 should be the norm and not the exception. Remove all calls to qemu_io_silent that just assert the return code is zero (That's every last call, as it turns out), and replace them with a normal qemu_io() call. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz --- tests/qemu-iotests/216 | 12 +++++----- tests/qemu-iotests/218 | 5 ++--- tests/qemu-iotests/224 | 4 ++-- tests/qemu-iotests/258 | 12 +++++----- tests/qemu-iotests/298 | 16 ++++++-------- tests/qemu-iotests/310 | 22 +++++++++---------- tests/qemu-iotests/iotests.py | 16 -------------- tests/qemu-iotests/tests/image-fleecing | 4 ++-- .../tests/mirror-ready-cancel-error | 2 +- .../qemu-iotests/tests/stream-error-on-reset | 4 ++-- 10 files changed, 39 insertions(+), 58 deletions(-) diff --git a/tests/qemu-iotests/216 b/tests/qemu-iotests/216 index 88b385afa3..97de1cda61 100755 --- a/tests/qemu-iotests/216 +++ b/tests/qemu-iotests/216 @@ -21,7 +21,7 @@ # Creator/Owner: Max Reitz =20 import iotests -from iotests import log, qemu_img, qemu_io_silent +from iotests import log, qemu_img, qemu_io =20 # Need backing file support iotests.script_initialize(supported_fmts=3D['qcow2', 'qcow', 'qed', 'vmdk'= ], @@ -52,10 +52,10 @@ with iotests.FilePath('base.img') as base_img_path, \ log('') =20 qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M') - assert qemu_io_silent(base_img_path, '-c', 'write -P 1 0M 1M') =3D=3D 0 + qemu_io(base_img_path, '-c', 'write -P 1 0M 1M') qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path, '-F', iotests.imgfmt, top_img_path) - assert qemu_io_silent(top_img_path, '-c', 'write -P 2 1M 1M') =3D=3D 0 + qemu_io(top_img_path, '-c', 'write -P 2 1M 1M') =20 log('Done') =20 @@ -110,8 +110,8 @@ with iotests.FilePath('base.img') as base_img_path, \ log('--- Checking COR result ---') log('') =20 - assert qemu_io_silent(base_img_path, '-c', 'discard 0 64M') =3D=3D 0 - assert qemu_io_silent(top_img_path, '-c', 'read -P 1 0M 1M') =3D=3D 0 - assert qemu_io_silent(top_img_path, '-c', 'read -P 2 1M 1M') =3D=3D 0 + qemu_io(base_img_path, '-c', 'discard 0 64M') + qemu_io(top_img_path, '-c', 'read -P 1 0M 1M') + qemu_io(top_img_path, '-c', 'read -P 2 1M 1M') =20 log('Done') diff --git a/tests/qemu-iotests/218 b/tests/qemu-iotests/218 index 853ed52b34..0c717c9b7f 100755 --- a/tests/qemu-iotests/218 +++ b/tests/qemu-iotests/218 @@ -28,7 +28,7 @@ # Creator/Owner: Max Reitz =20 import iotests -from iotests import log, qemu_img, qemu_io_silent +from iotests import log, qemu_img, qemu_io =20 iotests.script_initialize(supported_fmts=3D['qcow2', 'raw']) =20 @@ -146,8 +146,7 @@ with iotests.VM() as vm, \ iotests.FilePath('src.img') as src_img_path: =20 qemu_img('create', '-f', iotests.imgfmt, src_img_path, '64M') - assert qemu_io_silent('-f', iotests.imgfmt, src_img_path, - '-c', 'write -P 42 0M 64M') =3D=3D 0 + qemu_io('-f', iotests.imgfmt, src_img_path, '-c', 'write -P 42 0M 64M') =20 vm.launch() =20 diff --git a/tests/qemu-iotests/224 b/tests/qemu-iotests/224 index c31c55b49d..8eb3ceb8d1 100755 --- a/tests/qemu-iotests/224 +++ b/tests/qemu-iotests/224 @@ -22,7 +22,7 @@ # Creator/Owner: Max Reitz =20 import iotests -from iotests import log, qemu_img, qemu_io_silent, filter_qmp_testfiles, \ +from iotests import log, qemu_img, qemu_io, filter_qmp_testfiles, \ filter_qmp_imgfmt import json =20 @@ -54,7 +54,7 @@ for filter_node_name in False, True: '-F', iotests.imgfmt, top_img_path) =20 # Something to commit - assert qemu_io_silent(mid_img_path, '-c', 'write -P 1 0 1M') =3D= =3D 0 + qemu_io(mid_img_path, '-c', 'write -P 1 0 1M') =20 vm.launch() =20 diff --git a/tests/qemu-iotests/258 b/tests/qemu-iotests/258 index 7798a04d7d..e11a0e09b3 100755 --- a/tests/qemu-iotests/258 +++ b/tests/qemu-iotests/258 @@ -21,7 +21,7 @@ # Creator/Owner: Max Reitz =20 import iotests -from iotests import log, qemu_img, qemu_io_silent, \ +from iotests import log, qemu_img, qemu_io, \ filter_qmp_testfiles, filter_qmp_imgfmt =20 # Returns a node for blockdev-add @@ -86,15 +86,15 @@ def test_concurrent_finish(write_to_stream_node): if write_to_stream_node: # This is what (most of the time) makes commit finish # earlier and then pull in stream - assert qemu_io_silent(node2_path, - '-c', 'write %iK 64K' % (65536 - 192), - '-c', 'write %iK 64K' % (65536 - 64)) = =3D=3D 0 + qemu_io(node2_path, + '-c', 'write %iK 64K' % (65536 - 192), + '-c', 'write %iK 64K' % (65536 - 64)) =20 stream_throttle=3D'tg' else: # And this makes stream finish earlier - assert qemu_io_silent(node1_path, - '-c', 'write %iK 64K' % (65536 - 64)) = =3D=3D 0 + qemu_io(node1_path, + '-c', 'write %iK 64K' % (65536 - 64)) =20 commit_throttle=3D'tg' =20 diff --git a/tests/qemu-iotests/298 b/tests/qemu-iotests/298 index fae72211b1..9d6d95d953 100755 --- a/tests/qemu-iotests/298 +++ b/tests/qemu-iotests/298 @@ -129,16 +129,14 @@ class TestTruncate(iotests.QMPTestCase): os.remove(refdisk) =20 def do_test(self, prealloc_mode, new_size): - ret =3D iotests.qemu_io_silent('--image-opts', '-c', 'write 0 10M'= , '-c', - f'truncate -m {prealloc_mode} {new_si= ze}', - drive_opts) - self.assertEqual(ret, 0) + iotests.qemu_io('--image-opts', '-c', 'write 0 10M', '-c', + f'truncate -m {prealloc_mode} {new_size}', + drive_opts) =20 - ret =3D iotests.qemu_io_silent('-f', iotests.imgfmt, '-c', 'write = 0 10M', - '-c', - f'truncate -m {prealloc_mode} {new_si= ze}', - refdisk) - self.assertEqual(ret, 0) + iotests.qemu_io('-f', iotests.imgfmt, '-c', 'write 0 10M', + '-c', + f'truncate -m {prealloc_mode} {new_size}', + refdisk) =20 stat =3D os.stat(disk) refstat =3D os.stat(refdisk) diff --git a/tests/qemu-iotests/310 b/tests/qemu-iotests/310 index e3bfedc7fd..2496495f50 100755 --- a/tests/qemu-iotests/310 +++ b/tests/qemu-iotests/310 @@ -21,7 +21,7 @@ # =20 import iotests -from iotests import log, qemu_img, qemu_io_silent +from iotests import log, qemu_img, qemu_io =20 # Need backing file support iotests.script_initialize(supported_fmts=3D['qcow2'], @@ -44,15 +44,15 @@ with iotests.FilePath('base.img') as base_img_path, \ log('') =20 qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M') - assert qemu_io_silent(base_img_path, '-c', 'write -P 1 0M 1M') =3D=3D 0 - assert qemu_io_silent(base_img_path, '-c', 'write -P 1 3M 1M') =3D=3D 0 + qemu_io(base_img_path, '-c', 'write -P 1 0M 1M') + qemu_io(base_img_path, '-c', 'write -P 1 3M 1M') qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path, '-F', iotests.imgfmt, mid_img_path) - assert qemu_io_silent(mid_img_path, '-c', 'write -P 3 2M 1M') =3D=3D 0 - assert qemu_io_silent(mid_img_path, '-c', 'write -P 3 4M 1M') =3D=3D 0 + qemu_io(mid_img_path, '-c', 'write -P 3 2M 1M') + qemu_io(mid_img_path, '-c', 'write -P 3 4M 1M') qemu_img('create', '-f', iotests.imgfmt, '-b', mid_img_path, '-F', iotests.imgfmt, top_img_path) - assert qemu_io_silent(top_img_path, '-c', 'write -P 2 1M 1M') =3D=3D 0 + qemu_io(top_img_path, '-c', 'write -P 2 1M 1M') =20 # 0 1 2 3 4 # top 2 @@ -107,10 +107,10 @@ with iotests.FilePath('base.img') as base_img_path, \ # Detach backing to check that we can read the data from the top level= now qemu_img('rebase', '-u', '-b', '', '-f', iotests.imgfmt, top_img_path) =20 - assert qemu_io_silent(top_img_path, '-c', 'read -P 0 0 1M') =3D=3D 0 - assert qemu_io_silent(top_img_path, '-c', 'read -P 2 1M 1M') =3D=3D 0 - assert qemu_io_silent(top_img_path, '-c', 'read -P 3 2M 1M') =3D=3D 0 - assert qemu_io_silent(top_img_path, '-c', 'read -P 0 3M 1M') =3D=3D 0 - assert qemu_io_silent(top_img_path, '-c', 'read -P 3 4M 1M') =3D=3D 0 + qemu_io(top_img_path, '-c', 'read -P 0 0 1M') + qemu_io(top_img_path, '-c', 'read -P 2 1M 1M') + qemu_io(top_img_path, '-c', 'read -P 3 2M 1M') + qemu_io(top_img_path, '-c', 'read -P 0 3M 1M') + qemu_io(top_img_path, '-c', 'read -P 3 4M 1M') =20 log('Done') diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index e8f38e7ad3..0b631e1f8c 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -370,22 +370,6 @@ def qemu_io_log(*args: str) -> subprocess.CompletedPro= cess[str]: log(result.stdout, filters=3D[filter_testfiles, filter_qemu_io]) return result =20 -def qemu_io_silent(*args): - '''Run qemu-io and return the exit code, suppressing stdout''' - args =3D qemu_io_wrap_args(args) - result =3D subprocess.run(args, stdout=3Dsubprocess.DEVNULL, check=3DF= alse) - if result.returncode < 0: - sys.stderr.write('qemu-io received signal %i: %s\n' % - (-result.returncode, ' '.join(args))) - return result.returncode - -def qemu_io_silent_check(*args): - '''Run qemu-io and return the true if subprocess returned 0''' - args =3D qemu_io_wrap_args(args) - result =3D subprocess.run(args, stdout=3Dsubprocess.DEVNULL, - stderr=3Dsubprocess.STDOUT, check=3DFalse) - return result.returncode =3D=3D 0 - class QemuIoInteractive: def __init__(self, *args): self.args =3D qemu_io_wrap_args(args) diff --git a/tests/qemu-iotests/tests/image-fleecing b/tests/qemu-iotests/t= ests/image-fleecing index 07a4ea7bc4..8d5b0192c6 100755 --- a/tests/qemu-iotests/tests/image-fleecing +++ b/tests/qemu-iotests/tests/image-fleecing @@ -23,7 +23,7 @@ # Creator/Owner: John Snow =20 import iotests -from iotests import log, qemu_img, qemu_io, qemu_io_silent +from iotests import log, qemu_img, qemu_io =20 iotests.script_initialize( supported_fmts=3D['qcow2'], @@ -254,7 +254,7 @@ def do_test(vm, use_cbw, use_snapshot_access_filter, ba= se_img_path, for p in overwrite + remainder: cmd =3D 'read -P%s %s %s' % p log(cmd) - assert qemu_io_silent(base_img_path, '-c', cmd) =3D=3D 0 + qemu_io(base_img_path, '-c', cmd) =20 log('') log('Done') diff --git a/tests/qemu-iotests/tests/mirror-ready-cancel-error b/tests/qem= u-iotests/tests/mirror-ready-cancel-error index 1d0e333b5e..01217459b9 100755 --- a/tests/qemu-iotests/tests/mirror-ready-cancel-error +++ b/tests/qemu-iotests/tests/mirror-ready-cancel-error @@ -37,7 +37,7 @@ class TestMirrorReadyCancelError(iotests.QMPTestCase): # Ensure that mirror will copy something before READY so the # target format layer will forward the pre-READY flush to its # file child - assert iotests.qemu_io_silent('-c', 'write -P 1 0 64k', source) = =3D=3D 0 + iotests.qemu_io('-c', 'write -P 1 0 64k', source) =20 self.vm =3D iotests.VM() self.vm.launch() diff --git a/tests/qemu-iotests/tests/stream-error-on-reset b/tests/qemu-io= tests/tests/stream-error-on-reset index 389ae822b8..5a8c3a9e8d 100755 --- a/tests/qemu-iotests/tests/stream-error-on-reset +++ b/tests/qemu-iotests/tests/stream-error-on-reset @@ -21,7 +21,7 @@ =20 import os import iotests -from iotests import imgfmt, qemu_img_create, qemu_io_silent, QMPTestCase +from iotests import imgfmt, qemu_img_create, qemu_io, QMPTestCase =20 =20 image_size =3D 1 * 1024 * 1024 @@ -55,7 +55,7 @@ class TestStreamErrorOnReset(QMPTestCase): - top image is attached to a virtio-scsi device """ qemu_img_create('-f', imgfmt, base, str(image_size)) - assert qemu_io_silent('-c', f'write 0 {data_size}', base) =3D=3D 0 + qemu_io('-c', f'write 0 {data_size}', base) qemu_img_create('-f', imgfmt, top, str(image_size)) =20 self.vm =3D iotests.VM() --=20 2.34.1 From nobody Sun Feb 8 21:32:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1647636606000917.842136782714; Fri, 18 Mar 2022 13:50:06 -0700 (PDT) Received: from localhost ([::1]:57552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVJXv-0002gF-7w for importer@patchew.org; Fri, 18 Mar 2022 16:50:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLS-0002Zo-87 for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:25302) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVJLN-0005aG-2z for qemu-devel@nongnu.org; Fri, 18 Mar 2022 16:37:09 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-137-l0ZAcr6gOL2fLLHC5Ld4wA-1; Fri, 18 Mar 2022 16:37:01 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 06E25185A7BA; Fri, 18 Mar 2022 20:37:01 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF65F4292C7; Fri, 18 Mar 2022 20:37:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647635824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3aRHqLWIRbpT+6OSgc9rN8L3pp706CEQFljyX7sIHhU=; b=DKGo3bR0vnFYJ4+dq1vkAfRxoymRswyZ5pEcWZIvCOCuEtX/wEgmtoRuaHfkmoDfX934gp Exjpbb5a5gEDWICUYUrYcIN7RBGIhJvQciiAqtYQ/OvFJw3400eYQ/tl7mqGJWff6hw1uk yL8h8fY3uC9kT8Q8HxR0rtTE/cKbNUY= X-MC-Unique: l0ZAcr6gOL2fLLHC5Ld4wA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 15/15] iotests: make qemu_io_log() check return codes by default Date: Fri, 18 Mar 2022 16:36:55 -0400 Message-Id: <20220318203655.676907-16-jsnow@redhat.com> In-Reply-To: <20220318203655.676907-1-jsnow@redhat.com> References: <20220318203655.676907-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , John Snow , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1647636606949100001 Content-Type: text/plain; charset="utf-8" Just like qemu_img_log(), upgrade qemu_io_log() to enforce a return code of zero by default. Affected tests: 242 245 255 274 303 307 nbd-reconnect-on-open Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz --- tests/qemu-iotests/iotests.py | 5 +++-- tests/qemu-iotests/tests/nbd-reconnect-on-open | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 0b631e1f8c..c05637bd57 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -365,8 +365,9 @@ def qemu_io(*args: str, check: bool =3D True, combine_s= tdio: bool =3D True return qemu_tool(*qemu_io_wrap_args(args), check=3Dcheck, combine_stdio=3Dcombine_stdio) =20 -def qemu_io_log(*args: str) -> subprocess.CompletedProcess[str]: - result =3D qemu_io(*args, check=3DFalse) +def qemu_io_log(*args: str, check: bool =3D True + ) -> subprocess.CompletedProcess[str]: + result =3D qemu_io(*args, check=3Dcheck) log(result.stdout, filters=3D[filter_testfiles, filter_qemu_io]) return result =20 diff --git a/tests/qemu-iotests/tests/nbd-reconnect-on-open b/tests/qemu-io= tests/tests/nbd-reconnect-on-open index 8be721a24f..d0b401b060 100755 --- a/tests/qemu-iotests/tests/nbd-reconnect-on-open +++ b/tests/qemu-iotests/tests/nbd-reconnect-on-open @@ -39,7 +39,7 @@ def check_fail_to_connect(open_timeout): log(f'Check fail to connect with {open_timeout} seconds of timeout') =20 start_t =3D time.time() - qemu_io_log(*create_args(open_timeout)) + qemu_io_log(*create_args(open_timeout), check=3DFalse) delta_t =3D time.time() - start_t =20 max_delta =3D open_timeout + 0.2 --=20 2.34.1