From nobody Fri Nov 7 15:40:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1548255265517513.536082864462; Wed, 23 Jan 2019 06:54:25 -0800 (PST) Received: from localhost ([127.0.0.1]:36162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmJv1-0005Hj-GN for importer@patchew.org; Wed, 23 Jan 2019 09:54:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmJni-0008Fo-Ph for qemu-devel@nongnu.org; Wed, 23 Jan 2019 09:46:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gmJne-0000Dz-5M for qemu-devel@nongnu.org; Wed, 23 Jan 2019 09:46:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38558) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gmJna-00007p-Ca; Wed, 23 Jan 2019 09:46:39 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5B84B89ACD; Wed, 23 Jan 2019 14:46:32 +0000 (UTC) Received: from localhost (unknown [10.40.206.13]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DE5E719743; Wed, 23 Jan 2019 14:46:31 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Wed, 23 Jan 2019 15:46:05 +0100 Message-Id: <20190123144610.8842-5-mreitz@redhat.com> In-Reply-To: <20190123144610.8842-1-mreitz@redhat.com> References: <20190123144610.8842-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 23 Jan 2019 14:46:32 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 4/9] iotests: Fix 207 to use QMP filters for qmp_log X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , John Snow , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Fixes: 08fcd6111e1949f456e1b232ebeeb0cc17019a92 Signed-off-by: Max Reitz Reviewed-by: John Snow --- tests/qemu-iotests/207 | 10 +++++++--- tests/qemu-iotests/207.out | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/207 b/tests/qemu-iotests/207 index c617ee7453..dfd3c51bd1 100755 --- a/tests/qemu-iotests/207 +++ b/tests/qemu-iotests/207 @@ -27,12 +27,16 @@ import re iotests.verify_image_format(supported_fmts=3D['raw']) iotests.verify_protocol(supported=3D['ssh']) =20 -def filter_hash(msg): - return re.sub('"hash": "[0-9a-f]+"', '"hash": HASH', msg) +def filter_hash(qmsg): + def _filter(key, value): + if key =3D=3D 'hash' and re.match('[0-9a-f]+', value): + return 'HASH' + return value + return iotests.filter_qmp(qmsg, _filter) =20 def blockdev_create(vm, options): result =3D vm.qmp_log('blockdev-create', job_id=3D'job0', options=3Dop= tions, - filters=3D[iotests.filter_testfiles, filter_hash]) + filters=3D[iotests.filter_qmp_testfiles, filter_ha= sh]) =20 if 'return' in result: assert result['return'] =3D=3D {} diff --git a/tests/qemu-iotests/207.out b/tests/qemu-iotests/207.out index 45ac7c2a8f..88d2240f54 100644 --- a/tests/qemu-iotests/207.out +++ b/tests/qemu-iotests/207.out @@ -40,7 +40,7 @@ Job failed: remote host key does not match host_key_check= 'wrong' {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} =20 -{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "ssh", "location": {"host-key-check": {"hash": HASH, "mode": "ha= sh", "type": "md5"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "127.= 0.0.1", "port": "22"}}, "size": 8388608}}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "ssh", "location": {"host-key-check": {"hash": "HASH", "mode": "= hash", "type": "md5"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "12= 7.0.0.1", "port": "22"}}, "size": 8388608}}} {"return": {}} {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} @@ -55,7 +55,7 @@ Job failed: remote host key does not match host_key_check= 'wrong' {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} =20 -{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "ssh", "location": {"host-key-check": {"hash": HASH, "mode": "ha= sh", "type": "sha1"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "127= .0.0.1", "port": "22"}}, "size": 4194304}}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "ssh", "location": {"host-key-check": {"hash": "HASH", "mode": "= hash", "type": "sha1"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "1= 27.0.0.1", "port": "22"}}, "size": 4194304}}} {"return": {}} {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} --=20 2.20.1