From nobody Tue May 7 15:48:52 2024 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 1630575922187300.914226091048; Thu, 2 Sep 2021 02:45:22 -0700 (PDT) Received: from localhost ([::1]:35196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLjHd-0002QQ-6r for importer@patchew.org; Thu, 02 Sep 2021 05:45:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLjCw-0001wh-JO for qemu-devel@nongnu.org; Thu, 02 Sep 2021 05:40:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31479) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLjCs-0008DB-8j for qemu-devel@nongnu.org; Thu, 02 Sep 2021 05:40:30 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-600-j6XREpLZOQyPAwj_4rg5TQ-1; Thu, 02 Sep 2021 05:40:23 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 13987188E3CA; Thu, 2 Sep 2021 09:40:22 +0000 (UTC) Received: from localhost (unknown [10.39.193.237]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B02213ADB; Thu, 2 Sep 2021 09:40:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630575624; 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=t6OF07sb0SyCVTfZxQfE2VDis2lkR5Ytc7hTqjhrYzQ=; b=Tvz/2OUD2HTWl9Zk9PYdGaY+LnoOsoE5LAFQ2W8rhC2TuvHCkryT9v6mBzjiAEp7xWuAUr hqiV73FuOJj3LExauhxo9kmk2jZVqAY66xz0fe8LDXi2UlYgTo506p+MZBnu6jPo6kaa4k Nhp2ZK3wEf65gufYVjSoqEQmOjauwh4= X-MC-Unique: j6XREpLZOQyPAwj_4rg5TQ-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PATCH v4 1/5] iotests/297: Drop 169 and 199 from the skip list Date: Thu, 2 Sep 2021 11:40:13 +0200 Message-Id: <20210902094017.32902-2-hreitz@redhat.com> In-Reply-To: <20210902094017.32902-1-hreitz@redhat.com> References: <20210902094017.32902-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.392, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , Vladimir Sementsov-Ogievskiy , John Snow , qemu-devel@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: 1630575922828100001 Content-Type: text/plain; charset="utf-8" 169 and 199 have been renamed and moved to tests/ (commit a44be0334be: "iotests: rename and move 169 and 199 tests"), so we can drop them from the skip list. Signed-off-by: Hanna Reitz Reviewed-by: Willian Rampazzo Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Kevin Wolf --- tests/qemu-iotests/297 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/297 b/tests/qemu-iotests/297 index 345b617b34..c7d709cf50 100755 --- a/tests/qemu-iotests/297 +++ b/tests/qemu-iotests/297 @@ -29,7 +29,7 @@ import iotests SKIP_FILES =3D ( '030', '040', '041', '044', '045', '055', '056', '057', '065', '093', '096', '118', '124', '132', '136', '139', '147', '148', '149', - '151', '152', '155', '163', '165', '169', '194', '196', '199', '202', + '151', '152', '155', '163', '165', '194', '196', '202', '203', '205', '206', '207', '208', '210', '211', '212', '213', '216', '218', '219', '224', '228', '234', '235', '236', '237', '238', '240', '242', '245', '246', '248', '255', '256', '257', '258', '260', --=20 2.31.1 From nobody Tue May 7 15:48:52 2024 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 1630575973318498.3958852164301; Thu, 2 Sep 2021 02:46:13 -0700 (PDT) Received: from localhost ([::1]:38258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLjIS-0004b3-7R for importer@patchew.org; Thu, 02 Sep 2021 05:46:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLjCx-000204-SR for qemu-devel@nongnu.org; Thu, 02 Sep 2021 05:40:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:32472) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLjCt-0008Fv-F8 for qemu-devel@nongnu.org; Thu, 02 Sep 2021 05:40:31 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-416-sMYBz5YtMkmFJjlEogiUDA-1; Thu, 02 Sep 2021 05:40:25 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0EF36824FA7; Thu, 2 Sep 2021 09:40:24 +0000 (UTC) Received: from localhost (unknown [10.39.193.237]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AE3745C1D0; Thu, 2 Sep 2021 09:40:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630575626; 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=qiB3dUTaWE/YvWmyDmGZU2vTy2KE0kjhPKZIdFCe9jA=; b=Q/Dv6KChHl9IcPxyAdpZcxy10GYfhy62TW0TlhmccM4+n+YzSsa3jA+UMac1u8ZOEl133X qrLsfPIz5+A34B6EGfV3CqTAtzK7j4kfJObhx1D9Q6L7xvg3waI5BUSMGA+Hq2uDn356Rh O3w0lpeNfwiYw+3/aUUJaRQKjP6IYGE= X-MC-Unique: sMYBz5YtMkmFJjlEogiUDA-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PATCH v4 2/5] migrate-bitmaps-postcopy-test: Fix pylint warnings Date: Thu, 2 Sep 2021 11:40:14 +0200 Message-Id: <20210902094017.32902-3-hreitz@redhat.com> In-Reply-To: <20210902094017.32902-1-hreitz@redhat.com> References: <20210902094017.32902-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.392, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , Vladimir Sementsov-Ogievskiy , John Snow , qemu-devel@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: 1630575974977100001 Content-Type: text/plain; charset="utf-8" pylint complains that discards1_sha256 and all_discards_sha256 are first set in non-__init__ methods. These variables are not really class-variables anyway, so let them instead be returned by start_postcopy(), thus silencing pylint. Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Hanna Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- .../tests/migrate-bitmaps-postcopy-test | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test b/tests= /qemu-iotests/tests/migrate-bitmaps-postcopy-test index 584062b412..00ebb5c251 100755 --- a/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test +++ b/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test @@ -132,10 +132,10 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTes= tCase): =20 result =3D self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256', node=3D'drive0', name=3D'bitmap0') - self.discards1_sha256 =3D result['return']['sha256'] + discards1_sha256 =3D result['return']['sha256'] =20 # Check, that updating the bitmap by discards works - assert self.discards1_sha256 !=3D empty_sha256 + assert discards1_sha256 !=3D empty_sha256 =20 # We want to calculate resulting sha256. Do it in bitmap0, so, dis= able # other bitmaps @@ -148,7 +148,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestC= ase): =20 result =3D self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256', node=3D'drive0', name=3D'bitmap0') - self.all_discards_sha256 =3D result['return']['sha256'] + all_discards_sha256 =3D result['return']['sha256'] =20 # Now, enable some bitmaps, to be updated during migration for i in range(2, nb_bitmaps, 2): @@ -173,10 +173,11 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTes= tCase): =20 event_resume =3D self.vm_b.event_wait('RESUME') self.vm_b_events.append(event_resume) - return event_resume + return (event_resume, discards1_sha256, all_discards_sha256) =20 def test_postcopy_success(self): - event_resume =3D self.start_postcopy() + event_resume, discards1_sha256, all_discards_sha256 =3D \ + self.start_postcopy() =20 # enabled bitmaps should be updated apply_discards(self.vm_b, discards2) @@ -217,7 +218,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestC= ase): for i in range(0, nb_bitmaps, 5): result =3D self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256', node=3D'drive0', name=3D'bitmap{}'.form= at(i)) - sha =3D self.discards1_sha256 if i % 2 else self.all_discards_= sha256 + sha =3D discards1_sha256 if i % 2 else all_discards_sha256 self.assert_qmp(result, 'return/sha256', sha) =20 def test_early_shutdown_destination(self): --=20 2.31.1 From nobody Tue May 7 15:48:52 2024 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 1630576140608734.4772520329387; Thu, 2 Sep 2021 02:49:00 -0700 (PDT) Received: from localhost ([::1]:45434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLjL9-00011l-51 for importer@patchew.org; Thu, 02 Sep 2021 05:48:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLjD0-000283-RN for qemu-devel@nongnu.org; Thu, 02 Sep 2021 05:40:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:53877) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLjCw-0008Gr-1h for qemu-devel@nongnu.org; Thu, 02 Sep 2021 05:40:34 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-152-V0H_SdjGPye1hcqg6UEqXg-1; Thu, 02 Sep 2021 05:40:27 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2B283188E3C9; Thu, 2 Sep 2021 09:40:26 +0000 (UTC) Received: from localhost (unknown [10.39.193.237]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C5EE660BD9; Thu, 2 Sep 2021 09:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630575628; 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=QRfQpHE4nZw0UlJHCBb1/Xg9MB/mofhaARaIflvlpbk=; b=Xs8S/Ny3mxE3ESeEbpfBDoY6G0oYlZnnTCtIRbaaFO/Pt6t0Z6RSz9ak83DqpCIA5CvN2K ZKzQCgYAr4m/0azEnvgJ2fvTdcKZEQCF5NoFAWbH0pK6Mjsgj9yawtt60g5i4urUiviJiw PA5kZ1SPe/Wd3XARmcLY5+L2YC751zE= X-MC-Unique: V0H_SdjGPye1hcqg6UEqXg-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PATCH v4 3/5] migrate-bitmaps-test: Fix pylint warnings Date: Thu, 2 Sep 2021 11:40:15 +0200 Message-Id: <20210902094017.32902-4-hreitz@redhat.com> In-Reply-To: <20210902094017.32902-1-hreitz@redhat.com> References: <20210902094017.32902-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.392, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , Vladimir Sementsov-Ogievskiy , John Snow , qemu-devel@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: 1630576141735100001 Content-Type: text/plain; charset="utf-8" There are a couple of things pylint takes issue with: - The "time" import is unused - The import order (iotests should come last) - get_bitmap_hash() doesn't use @self and so should be a function - Semicolons at the end of some lines - Parentheses after "if" - Some lines are too long (80 characters instead of 79) - inject_test_case()'s @name parameter shadows a top-level @name variable - "lambda self: mc(self)" were equivalent to just "mc", but in inject_test_case(), it is not equivalent, so add a comment and disable the warning locally - Always put two empty lines after a function - f'exec: cat > /dev/null' does not need to be an f-string Fix them. Signed-off-by: Hanna Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/tests/migrate-bitmaps-test | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/tests/qemu-iotests/tests/migrate-bitmaps-test b/tests/qemu-iot= ests/tests/migrate-bitmaps-test index a5c7bc83e0..dc431c35b3 100755 --- a/tests/qemu-iotests/tests/migrate-bitmaps-test +++ b/tests/qemu-iotests/tests/migrate-bitmaps-test @@ -20,11 +20,10 @@ # =20 import os -import iotests -import time import itertools import operator import re +import iotests from iotests import qemu_img, qemu_img_create, Timeout =20 =20 @@ -37,6 +36,12 @@ mig_cmd =3D 'exec: cat > ' + mig_file incoming_cmd =3D 'exec: cat ' + mig_file =20 =20 +def get_bitmap_hash(vm): + result =3D vm.qmp('x-debug-block-dirty-bitmap-sha256', + node=3D'drive0', name=3D'bitmap0') + return result['return']['sha256'] + + class TestDirtyBitmapMigration(iotests.QMPTestCase): def tearDown(self): self.vm_a.shutdown() @@ -62,21 +67,16 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase): params['persistent'] =3D True =20 result =3D vm.qmp('block-dirty-bitmap-add', **params) - self.assert_qmp(result, 'return', {}); - - def get_bitmap_hash(self, vm): - result =3D vm.qmp('x-debug-block-dirty-bitmap-sha256', - node=3D'drive0', name=3D'bitmap0') - return result['return']['sha256'] + self.assert_qmp(result, 'return', {}) =20 def check_bitmap(self, vm, sha256): result =3D vm.qmp('x-debug-block-dirty-bitmap-sha256', node=3D'drive0', name=3D'bitmap0') if sha256: - self.assert_qmp(result, 'return/sha256', sha256); + self.assert_qmp(result, 'return/sha256', sha256) else: self.assert_qmp(result, 'error/desc', - "Dirty bitmap 'bitmap0' not found"); + "Dirty bitmap 'bitmap0' not found") =20 def do_test_migration_resume_source(self, persistent, migrate_bitmaps): granularity =3D 512 @@ -97,7 +97,7 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase): self.add_bitmap(self.vm_a, granularity, persistent) for r in regions: self.vm_a.hmp_qemu_io('drive0', 'write %d %d' % r) - sha256 =3D self.get_bitmap_hash(self.vm_a) + sha256 =3D get_bitmap_hash(self.vm_a) =20 result =3D self.vm_a.qmp('migrate', uri=3Dmig_cmd) while True: @@ -106,7 +106,7 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase): break while True: result =3D self.vm_a.qmp('query-status') - if (result['return']['status'] =3D=3D 'postmigrate'): + if result['return']['status'] =3D=3D 'postmigrate': break =20 # test that bitmap is still here @@ -164,7 +164,7 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase): self.add_bitmap(self.vm_a, granularity, persistent) for r in regions: self.vm_a.hmp_qemu_io('drive0', 'write %d %d' % r) - sha256 =3D self.get_bitmap_hash(self.vm_a) + sha256 =3D get_bitmap_hash(self.vm_a) =20 if pre_shutdown: self.vm_a.shutdown() @@ -214,16 +214,22 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase): self.check_bitmap(self.vm_b, sha256 if persistent else False) =20 =20 -def inject_test_case(klass, name, method, *args, **kwargs): +def inject_test_case(klass, suffix, method, *args, **kwargs): mc =3D operator.methodcaller(method, *args, **kwargs) - setattr(klass, 'test_' + method + name, lambda self: mc(self)) + # We want to add a function attribute to `klass`, so that it is + # correctly converted to a method on instantiation. The + # methodcaller object `mc` is a callable, not a function, so we + # need the lambda to turn it into a function. + # pylint: disable=3Dunnecessary-lambda + setattr(klass, 'test_' + method + suffix, lambda self: mc(self)) + =20 for cmb in list(itertools.product((True, False), repeat=3D5)): name =3D ('_' if cmb[0] else '_not_') + 'persistent_' name +=3D ('_' if cmb[1] else '_not_') + 'migbitmap_' name +=3D '_online' if cmb[2] else '_offline' name +=3D '_shared' if cmb[3] else '_nonshared' - if (cmb[4]): + if cmb[4]: name +=3D '__pre_shutdown' =20 inject_test_case(TestDirtyBitmapMigration, name, 'do_test_migration', @@ -270,7 +276,8 @@ class TestDirtyBitmapBackingMigration(iotests.QMPTestCa= se): self.assert_qmp(result, 'return', {}) =20 # Check that the bitmaps are there - for node in self.vm.qmp('query-named-block-nodes', flat=3DTrue)['r= eturn']: + nodes =3D self.vm.qmp('query-named-block-nodes', flat=3DTrue)['ret= urn'] + for node in nodes: if 'node0' in node['node-name']: self.assert_qmp(node, 'dirty-bitmaps[0]/name', 'bmap0') =20 @@ -287,7 +294,7 @@ class TestDirtyBitmapBackingMigration(iotests.QMPTestCa= se): """ Continue the source after migration. """ - result =3D self.vm.qmp('migrate', uri=3Df'exec: cat > /dev/null') + result =3D self.vm.qmp('migrate', uri=3D'exec: cat > /dev/null') self.assert_qmp(result, 'return', {}) =20 with Timeout(10, 'Migration timeout'): --=20 2.31.1 From nobody Tue May 7 15:48:52 2024 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 1630575778754208.22891727723652; Thu, 2 Sep 2021 02:42:58 -0700 (PDT) Received: from localhost ([::1]:54890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLjFJ-00053D-NQ for importer@patchew.org; Thu, 02 Sep 2021 05:42:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLjD0-00028J-TX for qemu-devel@nongnu.org; Thu, 02 Sep 2021 05:40:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60800) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLjCx-0008Im-RG for qemu-devel@nongnu.org; Thu, 02 Sep 2021 05:40:34 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-230-0p1URKvEMZmKtpYKaF0FBQ-1; Thu, 02 Sep 2021 05:40:29 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 030C0824FA7; Thu, 2 Sep 2021 09:40:29 +0000 (UTC) Received: from localhost (unknown [10.39.193.237]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C889F69CAD; Thu, 2 Sep 2021 09:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630575631; 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=eIoSV2XvZaVQChmCu4JJ9shFsJvKu7OIDT0fBbhKbkY=; b=d+tbpdRfbsCbFOizFMjZWIHfy8Swmrz6G2pT0Rr3c6HQVGETPsbQWv1J+/LwBHnYg1L3NY zgRmNMaKY3JMQ8yaBBBinjd3ar6FpH+TaDASwT8pz4IAEOrMyVD9w1UVbLHsse1/Yu3DHC jqjT/mFtepggmWl1Z7CzeNnKzatoEnE= X-MC-Unique: 0p1URKvEMZmKtpYKaF0FBQ-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PATCH v4 4/5] mirror-top-perms: Fix AbnormalShutdown path Date: Thu, 2 Sep 2021 11:40:16 +0200 Message-Id: <20210902094017.32902-5-hreitz@redhat.com> In-Reply-To: <20210902094017.32902-1-hreitz@redhat.com> References: <20210902094017.32902-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.392, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , Vladimir Sementsov-Ogievskiy , John Snow , qemu-devel@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: 1630575779381100003 Content-Type: text/plain; charset="utf-8" The AbnormalShutdown exception class is not in qemu.machine, but in qemu.machine.machine. (qemu.machine.AbnormalShutdown was enough for Python to find it in order to run this test, but pylint complains about it.) Signed-off-by: Hanna Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/tests/mirror-top-perms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/tests/mirror-top-perms b/tests/qemu-iotests= /tests/mirror-top-perms index 451a0666f8..2fc8dd66e0 100755 --- a/tests/qemu-iotests/tests/mirror-top-perms +++ b/tests/qemu-iotests/tests/mirror-top-perms @@ -47,7 +47,7 @@ class TestMirrorTopPerms(iotests.QMPTestCase): def tearDown(self): try: self.vm.shutdown() - except qemu.machine.AbnormalShutdown: + except qemu.machine.machine.AbnormalShutdown: pass =20 if self.vm_b is not None: --=20 2.31.1 From nobody Tue May 7 15:48:52 2024 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 1630575909426901.8361073058215; Thu, 2 Sep 2021 02:45:09 -0700 (PDT) Received: from localhost ([::1]:34664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLjHQ-00024T-EL for importer@patchew.org; Thu, 02 Sep 2021 05:45:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLjD2-000299-NT for qemu-devel@nongnu.org; Thu, 02 Sep 2021 05:40:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLjCz-0008KG-S9 for qemu-devel@nongnu.org; Thu, 02 Sep 2021 05:40:35 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-145-S3UW1j1EPkqLB7BY8Zdw3Q-1; Thu, 02 Sep 2021 05:40:32 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 226E3107ACC7; Thu, 2 Sep 2021 09:40:31 +0000 (UTC) Received: from localhost (unknown [10.39.193.237]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C152B5C3DF; Thu, 2 Sep 2021 09:40:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630575633; 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=2iZSvmdbAOFhL8QwxIestDXCWnDFmtF0JepevFXT1QI=; b=I9+G1kTMf/aWHfCYx451fD/TM6WYKIlcvgBYPIEDxuDvh463+0biegLSUlCHsh8BTsvvW+ zxaY/r9AoCig1aPV5n93pij+AuMgR650nyW9kFKz+k7gsA7pIwFn6K1kbQ4aEle/o8GG/L /KLUH2qNGJnnAZaz/XuFdU5108mKvn8= X-MC-Unique: S3UW1j1EPkqLB7BY8Zdw3Q-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PATCH v4 5/5] iotests/297: Cover tests/ Date: Thu, 2 Sep 2021 11:40:17 +0200 Message-Id: <20210902094017.32902-6-hreitz@redhat.com> In-Reply-To: <20210902094017.32902-1-hreitz@redhat.com> References: <20210902094017.32902-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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=216.205.24.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.392, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Hanna Reitz , Vladimir Sementsov-Ogievskiy , John Snow , qemu-devel@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: 1630575910025100001 Content-Type: text/plain; charset="utf-8" 297 so far does not check the named tests, which reside in the tests/ directory (i.e. full path tests/qemu-iotests/tests). Fix it. Thanks to the previous two commits, all named tests pass its scrutiny, so we do not have to add anything to SKIP_FILES. Signed-off-by: Hanna Reitz Reviewed-by: Willian Rampazzo Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Kevin Wolf --- tests/qemu-iotests/297 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/297 b/tests/qemu-iotests/297 index c7d709cf50..ac10bd1e1a 100755 --- a/tests/qemu-iotests/297 +++ b/tests/qemu-iotests/297 @@ -55,8 +55,9 @@ def is_python_file(filename): =20 =20 def run_linters(): - files =3D [filename for filename in (set(os.listdir('.')) - set(SKIP_F= ILES)) - if is_python_file(filename)] + named_tests =3D [f'tests/{entry}' for entry in os.listdir('tests')] + check_tests =3D set(os.listdir('.') + named_tests) - set(SKIP_FILES) + files =3D [filename for filename in check_tests if is_python_file(file= name)] =20 iotests.logger.debug('Files to be checked:') iotests.logger.debug(', '.join(sorted(files))) --=20 2.31.1