From nobody Sat May 18 15:38:15 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 1624884105507618.0851292881104; Mon, 28 Jun 2021 05:41:45 -0700 (PDT) Received: from localhost ([::1]:36424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqa8-0007R8-94 for importer@patchew.org; Mon, 28 Jun 2021 08:41:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqQt-0006mM-7M for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37499) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqQn-00036z-AI for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:09 -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-389-Wk0oXd13OlGbRDEhQF8z7A-1; Mon, 28 Jun 2021 08:32:01 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 17530100C685; Mon, 28 Jun 2021 12:31:57 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-69.ams2.redhat.com [10.36.114.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id A9E0D19C46; Mon, 28 Jun 2021 12:31:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624883524; 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=bghjg58GX0rJDAuujFUtFRgJCOvD2fY4XUZEchNMw4w=; b=Uq88ncwJdnBubn5UvOjezCArLcZxZFhkoXIfrwF+O6ESzTNcDalbmXyf5XOSwYTOU5gDWf 0FW+OShar1pHg1yk/Wk+/CWyuwx0kUSy41NJXvGVRl4gQgAKM5UTNc8oynsld4bwSpVxIq 5FgUBfPq10XNS7KVOl/HBNQHoAoL+hQ= X-MC-Unique: Wk0oXd13OlGbRDEhQF8z7A-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v7 01/16] python: qemu: add timer parameter for qmp.accept socket Date: Mon, 28 Jun 2021 14:31:35 +0200 Message-Id: <20210628123150.56567-2-eesposit@redhat.com> In-Reply-To: <20210628123150.56567-1-eesposit@redhat.com> References: <20210628123150.56567-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@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=eesposit@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.375, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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 , Emanuele Giuseppe Esposito , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Also add a new _qmp_timer field to the QEMUMachine class. Let's change the default socket timeout to None, so that if a subclass needs to add a timer, it can be done by modifying this private field. At the same time, restore the timer to be 15 seconds in iotests.py, to give an upper bound to the QMP monitor test command execution. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- python/qemu/machine/machine.py | 7 +++++-- python/qemu/machine/qtest.py | 5 +++-- tests/qemu-iotests/iotests.py | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index b62435528e..fdf2fc0e9c 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -95,7 +95,8 @@ def __init__(self, socket_scm_helper: Optional[str] =3D None, sock_dir: Optional[str] =3D None, drain_console: bool =3D False, - console_log: Optional[str] =3D None): + console_log: Optional[str] =3D None, + qmp_timer: Optional[float] =3D None): ''' Initialize a QEMUMachine =20 @@ -109,6 +110,7 @@ def __init__(self, @param sock_dir: where to create socket (defaults to base_temp_dir) @param drain_console: (optional) True to drain console socket to b= uffer @param console_log: (optional) path to console log file + @param qmp_timer: (optional) default QMP socket timeout @note: Qemu process is not started until launch() is used. ''' # Direct user configuration @@ -116,6 +118,7 @@ def __init__(self, self._binary =3D binary self._args =3D list(args) self._wrapper =3D wrapper + self._qmp_timer =3D qmp_timer =20 self._name =3D name or "qemu-%d" % os.getpid() self._base_temp_dir =3D base_temp_dir @@ -333,7 +336,7 @@ def _pre_launch(self) -> None: =20 def _post_launch(self) -> None: if self._qmp_connection: - self._qmp.accept() + self._qmp.accept(self._qmp_timer) =20 def _post_shutdown(self) -> None: """ diff --git a/python/qemu/machine/qtest.py b/python/qemu/machine/qtest.py index 93700684d1..33a86a9d69 100644 --- a/python/qemu/machine/qtest.py +++ b/python/qemu/machine/qtest.py @@ -115,14 +115,15 @@ def __init__(self, name: Optional[str] =3D None, base_temp_dir: str =3D "/var/tmp", socket_scm_helper: Optional[str] =3D None, - sock_dir: Optional[str] =3D None): + sock_dir: Optional[str] =3D None, + qmp_timer: Optional[float] =3D None): if name is None: name =3D "qemu-%d" % os.getpid() if sock_dir is None: sock_dir =3D base_temp_dir super().__init__(binary, args, name=3Dname, base_temp_dir=3Dbase_t= emp_dir, socket_scm_helper=3Dsocket_scm_helper, - sock_dir=3Dsock_dir) + sock_dir=3Dsock_dir, qmp_timer=3Dqmp_timer) self._qtest: Optional[QEMUQtestProtocol] =3D None self._qtest_path =3D os.path.join(sock_dir, name + "-qtest.sock") =20 diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 89663dac06..6b0db4ce54 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -570,10 +570,11 @@ class VM(qtest.QEMUQtestMachine): =20 def __init__(self, path_suffix=3D''): name =3D "qemu%s-%d" % (path_suffix, os.getpid()) + timer =3D 15.0 super().__init__(qemu_prog, qemu_opts, name=3Dname, base_temp_dir=3Dtest_dir, socket_scm_helper=3Dsocket_scm_helper, - sock_dir=3Dsock_dir) + sock_dir=3Dsock_dir, qmp_timer=3Dtimer) self._num_drives =3D 0 =20 def add_object(self, opts): --=20 2.31.1 From nobody Sat May 18 15:38:15 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 1624883650847225.41624628916338; Mon, 28 Jun 2021 05:34:10 -0700 (PDT) Received: from localhost ([::1]:43094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqSn-0001GI-Ma for importer@patchew.org; Mon, 28 Jun 2021 08:34:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqQy-0006qu-4N for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqQw-00039l-6q for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:15 -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-299-XRpyj05yNcC7pZ3-4SHuNg-1; Mon, 28 Jun 2021 08:32:09 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 76EB3BBEF8; Mon, 28 Jun 2021 12:31:59 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-69.ams2.redhat.com [10.36.114.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61A7019C46; Mon, 28 Jun 2021 12:31:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624883533; 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=lMU2fH+LADcBLsYJQ+MPbwl9mzxsilO2vHXhikPhPtY=; b=MZ1fbTjazasuvTC7d98rzPzIz25hghu/G1jS5CErCQ11UFiNgCojHqS8vSMgQM3pMQOlcA BPLdeXhwb2uNai6zP6o/pd6B5Xssha59XmaSZm9CkPzMz+9fapbQDBxBcSBQYhaAkd3/s7 eq0GCp7YgwybTa/kq0FoLAzldzlaRVI= X-MC-Unique: XRpyj05yNcC7pZ3-4SHuNg-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v7 02/16] python: Reduce strictness of pylint's duplicate-code check Date: Mon, 28 Jun 2021 14:31:36 +0200 Message-Id: <20210628123150.56567-3-eesposit@redhat.com> In-Reply-To: <20210628123150.56567-1-eesposit@redhat.com> References: <20210628123150.56567-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@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=eesposit@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.375, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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 , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: John Snow Pylint prior to 2.8.3 (We pin at >=3D 2.8.0) includes function and method signatures as part of its duplicate checking algorithm. This check does not listen to pragmas, so the only way to disable it is to turn it off completely or increase the minimum duplicate lines so that it doesn't trigger for functions with long, multi-line signatures. When we decide to upgrade to pylint 2.8.3 or greater, we will be able to use 'ignore-signatures =3D true' to the config instead. I'd prefer not to keep us on the very bleeding edge of pylint if I can help it -- 2.8.3 came out only three days ago at time of writing. See: https://github.com/PyCQA/pylint/pull/4474 Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy --- python/setup.cfg | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/setup.cfg b/python/setup.cfg index 85cecbb41b..0a57aca191 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -103,6 +103,11 @@ good-names=3Di, # Ignore imports when computing similarities. ignore-imports=3Dyes =20 +# Minimum lines number of a similarity. +# TODO: Remove after we opt in to Pylint 2.8.3. See commit msg. +min-similarity-lines=3D6 + + [isort] force_grid_wrap=3D4 force_sort_within_sections=3DTrue --=20 2.31.1 From nobody Sat May 18 15:38:15 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 1624883844006907.8609463653805; Mon, 28 Jun 2021 05:37:24 -0700 (PDT) Received: from localhost ([::1]:52428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqVt-0007c0-1c for importer@patchew.org; Mon, 28 Jun 2021 08:37:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqQw-0006q9-IG for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34892) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqQt-00038u-MD for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:14 -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-441-7Y5hqVKAMZiClVBvr-BmQA-1; Mon, 28 Jun 2021 08:32:09 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4D72F19611A7; Mon, 28 Jun 2021 12:32:02 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-69.ams2.redhat.com [10.36.114.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB2FA46; Mon, 28 Jun 2021 12:31:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624883531; 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=Y1L85CoB3wjKLuJXGJDskreXoSJA102S4oaPkBn+fYw=; b=BWmkLuaEHUuGaMwgvKMPxV0+BkG5zYppshbV2BEb7ZCNFKhHoLEe/OAqvCErArfKzk66cT n16hGq5r+tzOP5jkHrwTKsNKr2g/4DFgF7h3hetBHr16g/9wjTKfgcvNbTAX7DEgDXfPMa H9PbNX7PwK9NNaQiaBkxJWB2qRKv0QI= X-MC-Unique: 7Y5hqVKAMZiClVBvr-BmQA-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v7 03/16] python: qemu: pass the wrapper field from QEMUQtestmachine to QEMUMachine Date: Mon, 28 Jun 2021 14:31:37 +0200 Message-Id: <20210628123150.56567-4-eesposit@redhat.com> In-Reply-To: <20210628123150.56567-1-eesposit@redhat.com> References: <20210628123150.56567-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@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=eesposit@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.375, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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 , Emanuele Giuseppe Esposito , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Reviewed-by: Max Reitz --- python/qemu/machine/qtest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/qemu/machine/qtest.py b/python/qemu/machine/qtest.py index 33a86a9d69..dc2b5ccfb1 100644 --- a/python/qemu/machine/qtest.py +++ b/python/qemu/machine/qtest.py @@ -112,6 +112,7 @@ class QEMUQtestMachine(QEMUMachine): def __init__(self, binary: str, args: Sequence[str] =3D (), + wrapper: Sequence[str] =3D (), name: Optional[str] =3D None, base_temp_dir: str =3D "/var/tmp", socket_scm_helper: Optional[str] =3D None, @@ -121,7 +122,8 @@ def __init__(self, name =3D "qemu-%d" % os.getpid() if sock_dir is None: sock_dir =3D base_temp_dir - super().__init__(binary, args, name=3Dname, base_temp_dir=3Dbase_t= emp_dir, + super().__init__(binary, args, wrapper=3Dwrapper, name=3Dname, + base_temp_dir=3Dbase_temp_dir, socket_scm_helper=3Dsocket_scm_helper, sock_dir=3Dsock_dir, qmp_timer=3Dqmp_timer) self._qtest: Optional[QEMUQtestProtocol] =3D None --=20 2.31.1 From nobody Sat May 18 15:38:15 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 1624883798738222.0520971155562; Mon, 28 Jun 2021 05:36:38 -0700 (PDT) Received: from localhost ([::1]:50192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqVB-000633-Nu for importer@patchew.org; Mon, 28 Jun 2021 08:36:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqR5-00071h-LZ for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33970) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqR2-0003C5-Ef for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:23 -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-59-UtOz5mskO3iqoeukCDblyw-1; Mon, 28 Jun 2021 08:32:18 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1364056AAE; Mon, 28 Jun 2021 12:32:05 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-69.ams2.redhat.com [10.36.114.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97F4719C46; Mon, 28 Jun 2021 12:32:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624883539; 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=5Rbcrcv/g85RMKZq8FFrPPz28WGUqAMs3KM/ItTzdsw=; b=cCuzK7mTVd4cUvrXhBzNSc3TJRfZ8g8wjlF4enbTwc/7vmj6vNPfxh5qqLkKz6Hl7fSTJx 8WI55yttCHLGfp+xdJTyyqWqWHbtI63O5oT5x/ATwKAthLV69MB7+McLpvov3dzpLpVDz5 LejAwRdhk9aV4vEtkEsmGYIhDysMOZw= X-MC-Unique: UtOz5mskO3iqoeukCDblyw-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v7 04/16] docs/devel/testing: add debug section to the QEMU iotests chapter Date: Mon, 28 Jun 2021 14:31:38 +0200 Message-Id: <20210628123150.56567-5-eesposit@redhat.com> In-Reply-To: <20210628123150.56567-1-eesposit@redhat.com> References: <20210628123150.56567-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@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=eesposit@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.375, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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 , Emanuele Giuseppe Esposito , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Introduce the "Debugging a test case" section, in preparation to the additional flags that will be added in the next patches. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- docs/devel/testing.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 4e42392810..9d6a8f8636 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -224,6 +224,14 @@ another application on the host may have locked the fi= le, possibly leading to a test failure. If using such devices are explicitly desired, consider addi= ng ``locking=3Doff`` option to disable image locking. =20 +Debugging a test case +----------------------- +The following options to the ``check`` script can be useful when debugging +a failing test: + +* ``-d`` (debug) just increases the logging verbosity, showing + for example the QMP commands and answers. + Test case groups ---------------- =20 --=20 2.31.1 From nobody Sat May 18 15:38:15 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 1624883835041392.9256001137368; Mon, 28 Jun 2021 05:37:15 -0700 (PDT) Received: from localhost ([::1]:51584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqVk-00072B-T2 for importer@patchew.org; Mon, 28 Jun 2021 08:37:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqR1-0006vo-0d for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:55884) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqQy-0003Al-GM for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:18 -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-195-LmR-l3LWPeGGc_gbeVZPWQ-1; Mon, 28 Jun 2021 08:32:14 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CCF25804B82; Mon, 28 Jun 2021 12:32:07 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-69.ams2.redhat.com [10.36.114.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 709F046; Mon, 28 Jun 2021 12:32:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624883536; 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=7HsKxX1kGVLERmHm+R3mBGVQbDQhnt7g26ozv8vSgjc=; b=NcwgfAJyt+vX0JD3/BJAwblms+J/3osv5i87eBH7MgrgFw8xdp+giEo7v2SnsHc4azr44d NAqjvMBaQzVS1rAv6pMNXO3Jt6a/y6xcV5/x5DYN8ldFVW3q8P2sR1Uq/TVkeEk1xQCBmt Hz3fvK5NH/nlQJzmIKsYnYimpnwcwk4= X-MC-Unique: LmR-l3LWPeGGc_gbeVZPWQ-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v7 05/16] qemu-iotests: add option to attach gdbserver Date: Mon, 28 Jun 2021 14:31:39 +0200 Message-Id: <20210628123150.56567-6-eesposit@redhat.com> In-Reply-To: <20210628123150.56567-1-eesposit@redhat.com> References: <20210628123150.56567-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@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=eesposit@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.375, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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 , Emanuele Giuseppe Esposito , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Define -gdb flag and GDB_OPTIONS environment variable to python tests to attach a gdbserver to each qemu instance. This patch only adds and parses this flag, it does not yet add the implementation for it. if -gdb is not provided but $GDB_OPTIONS is set, ignore the environment variable. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/check | 6 +++++- tests/qemu-iotests/iotests.py | 5 +++++ tests/qemu-iotests/testenv.py | 17 +++++++++++++++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 2dd529eb75..4365bb8066 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -36,6 +36,9 @@ def make_argparser() -> argparse.ArgumentParser: help=3D'pretty print output for make check') =20 p.add_argument('-d', dest=3D'debug', action=3D'store_true', help=3D'de= bug') + p.add_argument('-gdb', action=3D'store_true', + help=3D"start gdbserver with $GDB_OPTIONS options \ + ('localhost:12345' if $GDB_OPTIONS is empty)") p.add_argument('-misalign', action=3D'store_true', help=3D'misalign memory allocations') p.add_argument('--color', choices=3D['on', 'off', 'auto'], @@ -114,7 +117,8 @@ if __name__ =3D=3D '__main__': env =3D TestEnv(imgfmt=3Dargs.imgfmt, imgproto=3Dargs.imgproto, aiomode=3Dargs.aiomode, cachemode=3Dargs.cachemode, imgopts=3Dargs.imgopts, misalign=3Dargs.misalign, - debug=3Dargs.debug, valgrind=3Dargs.valgrind) + debug=3Dargs.debug, valgrind=3Dargs.valgrind, + gdb=3Dargs.gdb) =20 if len(sys.argv) > 1 and sys.argv[-len(args.tests)-1] =3D=3D '--': if not args.tests: diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 6b0db4ce54..c86f239d81 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -74,6 +74,11 @@ qemu_prog =3D os.environ.get('QEMU_PROG', 'qemu') qemu_opts =3D os.environ.get('QEMU_OPTIONS', '').strip().split(' ') =20 +gdb_qemu_env =3D os.environ.get('GDB_OPTIONS') +qemu_gdb =3D [] +if gdb_qemu_env: + qemu_gdb =3D ['gdbserver'] + gdb_qemu_env.strip().split(' ') + imgfmt =3D os.environ.get('IMGFMT', 'raw') imgproto =3D os.environ.get('IMGPROTO', 'file') output_dir =3D os.environ.get('OUTPUT_DIR', '.') diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index 0c3fe75636..8501c6caf5 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -27,6 +27,7 @@ import glob from typing import List, Dict, Any, Optional, ContextManager =20 +DEF_GDB_OPTIONS =3D 'localhost:12345' =20 def isxfile(path: str) -> bool: return os.path.isfile(path) and os.access(path, os.X_OK) @@ -72,7 +73,8 @@ class TestEnv(ContextManager['TestEnv']): 'QEMU_NBD_OPTIONS', 'IMGOPTS', 'IMGFMT', 'IMGPROTO', 'AIOMODE', 'CACHEMODE', 'VALGRIND_QEMU', 'CACHEMODE_IS_DEFAULT', 'IMGFMT_GENERIC', 'IMGOPTSSYN= TAX', - 'IMGKEYSECRET', 'QEMU_DEFAULT_MACHINE', 'MALLOC_PERTU= RB_'] + 'IMGKEYSECRET', 'QEMU_DEFAULT_MACHINE', 'MALLOC_PERTU= RB_', + 'GDB_OPTIONS'] =20 def prepare_subprocess(self, args: List[str]) -> Dict[str, str]: if self.debug: @@ -178,7 +180,8 @@ def __init__(self, imgfmt: str, imgproto: str, aiomode:= str, imgopts: Optional[str] =3D None, misalign: bool =3D False, debug: bool =3D False, - valgrind: bool =3D False) -> None: + valgrind: bool =3D False, + gdb: bool =3D False) -> None: self.imgfmt =3D imgfmt self.imgproto =3D imgproto self.aiomode =3D aiomode @@ -186,6 +189,15 @@ def __init__(self, imgfmt: str, imgproto: str, aiomode= : str, self.misalign =3D misalign self.debug =3D debug =20 + if gdb: + self.gdb_options =3D os.getenv('GDB_OPTIONS', DEF_GDB_OPTIONS) + if not self.gdb_options: + # cover the case 'export GDB_OPTIONS=3D' + self.gdb_options =3D DEF_GDB_OPTIONS + elif 'GDB_OPTIONS' in os.environ: + # to not propagate it in prepare_subprocess() + del os.environ['GDB_OPTIONS'] + if valgrind: self.valgrind_qemu =3D 'y' =20 @@ -285,6 +297,7 @@ def print_env(self) -> None: TEST_DIR -- {TEST_DIR} SOCK_DIR -- {SOCK_DIR} SOCKET_SCM_HELPER -- {SOCKET_SCM_HELPER} +GDB_OPTIONS -- {GDB_OPTIONS} """ =20 args =3D collections.defaultdict(str, self.get_env()) --=20 2.31.1 From nobody Sat May 18 15:38:15 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 162488403534129.884968046867243; Mon, 28 Jun 2021 05:40:35 -0700 (PDT) Received: from localhost ([::1]:60950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqZ0-0004x3-6x for importer@patchew.org; Mon, 28 Jun 2021 08:40:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRD-00079W-K5 for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60874) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqR7-0003DW-EJ for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32: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-214-TA0pY82NOk6__pGkCd5QEA-1; Mon, 28 Jun 2021 08:32:22 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B0F8191288; Mon, 28 Jun 2021 12:32:10 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-69.ams2.redhat.com [10.36.114.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3597F19C46; Mon, 28 Jun 2021 12:32:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624883543; 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=kel8vziE+XTu5w9RH8seBoeyIC2vGCHNeDcB5ks4x64=; b=FUsxQkVp/JsJ1Qx5LrkOd4zHkDy6wbjc1jxKydMl56kVqt7tIrMnaSLaURMSzjrjjdxWyR 98GPc8jNnYg9XrVoMZc4zbA5pNHYU3t1X1RoMmAHs8xw8SpMPZTJ24FT9A4HMnO7ZxYEIe whgDZ9/CwRUHz0kqDfUv+5cuKolGXMs= X-MC-Unique: TA0pY82NOk6__pGkCd5QEA-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v7 06/16] qemu-iotests: delay QMP socket timers Date: Mon, 28 Jun 2021 14:31:40 +0200 Message-Id: <20210628123150.56567-7-eesposit@redhat.com> In-Reply-To: <20210628123150.56567-1-eesposit@redhat.com> References: <20210628123150.56567-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@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=eesposit@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.375, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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 , Emanuele Giuseppe Esposito , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Attaching gdbserver implies that the qmp socket should wait indefinitely for an answer from QEMU. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/iotests.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index c86f239d81..e176a84620 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -477,10 +477,14 @@ def __init__(self, seconds, errmsg=3D"Timeout"): self.seconds =3D seconds self.errmsg =3D errmsg def __enter__(self): + if qemu_gdb: + return self signal.signal(signal.SIGALRM, self.timeout) signal.setitimer(signal.ITIMER_REAL, self.seconds) return self def __exit__(self, exc_type, value, traceback): + if qemu_gdb: + return False signal.setitimer(signal.ITIMER_REAL, 0) return False def timeout(self, signum, frame): @@ -575,7 +579,7 @@ class VM(qtest.QEMUQtestMachine): =20 def __init__(self, path_suffix=3D''): name =3D "qemu%s-%d" % (path_suffix, os.getpid()) - timer =3D 15.0 + timer =3D 15.0 if not qemu_gdb else None super().__init__(qemu_prog, qemu_opts, name=3Dname, base_temp_dir=3Dtest_dir, socket_scm_helper=3Dsocket_scm_helper, --=20 2.31.1 From nobody Sat May 18 15:38:15 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 1624884205242440.7185253201545; Mon, 28 Jun 2021 05:43:25 -0700 (PDT) Received: from localhost ([::1]:43372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqbk-0003qM-6i for importer@patchew.org; Mon, 28 Jun 2021 08:43:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRK-0007J1-9l for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50617) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRB-0003FN-LH for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:38 -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-325-e7kUwqURP1yivAqnHBly-Q-1; Mon, 28 Jun 2021 08:32:26 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 735D8C73B0; Mon, 28 Jun 2021 12:32:13 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-69.ams2.redhat.com [10.36.114.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D0193B04; Mon, 28 Jun 2021 12:32:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624883548; 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=eICVYxVdUNHac6FE/G5w5tjvWZqnPdGaISiBkEw+bP4=; b=JekKxooskPmcvkjPPQ9pxGCxOHXmXinaeizTOkStujfiIxTTzt/EnbyF+W8hO07hIUhP7Z ZMpFIn8lgaatX3IgXi93HmjN2MdHYGw/ejern0O3bRCDyHCjlz41EY8hy1Hn2JmoEUj/o4 xyp8PG7arAhADcWc4azGdC8fCrM4jQI= X-MC-Unique: e7kUwqURP1yivAqnHBly-Q-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v7 07/16] qemu_iotests: insert gdbserver command line as wrapper for qemu binary Date: Mon, 28 Jun 2021 14:31:41 +0200 Message-Id: <20210628123150.56567-8-eesposit@redhat.com> In-Reply-To: <20210628123150.56567-1-eesposit@redhat.com> References: <20210628123150.56567-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@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=eesposit@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.375, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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 , Emanuele Giuseppe Esposito , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index e176a84620..e7e3d92d3e 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -580,7 +580,8 @@ class VM(qtest.QEMUQtestMachine): def __init__(self, path_suffix=3D''): name =3D "qemu%s-%d" % (path_suffix, os.getpid()) timer =3D 15.0 if not qemu_gdb else None - super().__init__(qemu_prog, qemu_opts, name=3Dname, + super().__init__(qemu_prog, qemu_opts, wrapper=3Dqemu_gdb, + name=3Dname, base_temp_dir=3Dtest_dir, socket_scm_helper=3Dsocket_scm_helper, sock_dir=3Dsock_dir, qmp_timer=3Dtimer) --=20 2.31.1 From nobody Sat May 18 15:38:15 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 1624884229625826.0476404532003; Mon, 28 Jun 2021 05:43:49 -0700 (PDT) Received: from localhost ([::1]:45704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqc8-0005Qn-GS for importer@patchew.org; Mon, 28 Jun 2021 08:43:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRC-00078u-2d for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:50654) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqR7-0003Dm-KI for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:29 -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-288-NEHaGIJlMna5UdXWH10p2A-1; Mon, 28 Jun 2021 08:32:23 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3480D81CCC7; Mon, 28 Jun 2021 12:32:16 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-69.ams2.redhat.com [10.36.114.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6F2046; Mon, 28 Jun 2021 12:32:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624883544; 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=vHWZtqNvl/YLGyLOiUuiUalq5tGvTYqCzazXdWHLgxQ=; b=IBD+MbkdedBfvvTB5k+xU7cOqLs2d9UxH5k3iZQDOZfaQ5RYa9MsmKnDr4ofXsuDxMKwlJ bqzBk1/MXrXTKvcyM+fDWEOqLfAfFvEwUcCvPHrY9RyvQijcLdxr1HM/xVhTqR2gLDMZAt xVR263Pf6Tz1L5jVp8JHdp+WwU54ueI= X-MC-Unique: NEHaGIJlMna5UdXWH10p2A-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v7 08/16] qemu-iotests: add gdbserver option to script tests too Date: Mon, 28 Jun 2021 14:31:42 +0200 Message-Id: <20210628123150.56567-9-eesposit@redhat.com> In-Reply-To: <20210628123150.56567-1-eesposit@redhat.com> References: <20210628123150.56567-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@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=eesposit@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.375, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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 , Emanuele Giuseppe Esposito , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Remove read timer in test script when GDB_OPTIONS are set, so that the bash tests won't timeout while running gdb. The only limitation here is that running a script with gdbserver will make the test output mismatch with the expected results, making the test fail. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/common.qemu | 7 ++++++- tests/qemu-iotests/common.rc | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu index 0fc52d20d7..cbca757b49 100644 --- a/tests/qemu-iotests/common.qemu +++ b/tests/qemu-iotests/common.qemu @@ -85,7 +85,12 @@ _timed_wait_for() timeout=3Dyes =20 QEMU_STATUS[$h]=3D0 - while IFS=3D read -t ${QEMU_COMM_TIMEOUT} resp <&${QEMU_OUT[$h]} + read_timeout=3D"-t ${QEMU_COMM_TIMEOUT}" + if [ ! -z ${GDB_OPTIONS} ]; then + read_timeout=3D + fi + + while IFS=3D read ${read_timeout} resp <&${QEMU_OUT[$h]} do if [ -n "$capture_events" ]; then capture=3D0 diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index cbbf6d7c7f..a1ef2b5c2f 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -166,8 +166,14 @@ _qemu_wrapper() if [ -n "${QEMU_NEED_PID}" ]; then echo $BASHPID > "${QEMU_TEST_DIR}/qemu-${_QEMU_HANDLE}.pid" fi + + GDB=3D"" + if [ ! -z ${GDB_OPTIONS} ]; then + GDB=3D"gdbserver ${GDB_OPTIONS}" + fi + VALGRIND_QEMU=3D"${VALGRIND_QEMU_VM}" _qemu_proc_exec "${VALGRIND_= LOGFILE}" \ - "$QEMU_PROG" $QEMU_OPTIONS "$@" + $GDB "$QEMU_PROG" $QEMU_OPTIONS "$@" ) RETVAL=3D$? _qemu_proc_valgrind_log "${VALGRIND_LOGFILE}" $RETVAL --=20 2.31.1 From nobody Sat May 18 15:38:15 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 1624884406201505.50775833019713; Mon, 28 Jun 2021 05:46:46 -0700 (PDT) Received: from localhost ([::1]:53106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqey-00024E-Rl for importer@patchew.org; Mon, 28 Jun 2021 08:46:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRC-00079Q-Nb for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:40742) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqR9-0003ES-OF for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32: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-244-7YV6ddUDPJO7zXu_9aYrCA-1; Mon, 28 Jun 2021 08:32:25 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A9C4980430B; Mon, 28 Jun 2021 12:32:18 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-69.ams2.redhat.com [10.36.114.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80ADB19C46; Mon, 28 Jun 2021 12:32:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624883546; 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=ERdSQhrv1dpNgYyhUXn0SP0xdRZ4+cF2nkeM4ca6HvY=; b=ZLqfqfrRul7BfjuEHy2rnUk87l2DzlGuz60hBruW+TmM8hbSdUBYJnmWxKW+wKBUG/wMcO 0q9qRIEe5IIsu/BYg1y24wCB74ZmS1IDdoPkAWL8nIR8jcAfh+T5E5J3MKXJlui1CH+Nhz 2lNYkhBm98lQFa+uCdw65SkkHe25v/o= X-MC-Unique: 7YV6ddUDPJO7zXu_9aYrCA-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v7 09/16] docs/devel/testing: add -gdb option to the debugging section of QEMU iotests Date: Mon, 28 Jun 2021 14:31:43 +0200 Message-Id: <20210628123150.56567-10-eesposit@redhat.com> In-Reply-To: <20210628123150.56567-1-eesposit@redhat.com> References: <20210628123150.56567-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@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=eesposit@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.375, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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 , Emanuele Giuseppe Esposito , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- docs/devel/testing.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 9d6a8f8636..8b24e6fb47 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -229,6 +229,17 @@ Debugging a test case The following options to the ``check`` script can be useful when debugging a failing test: =20 +* ``-gdb`` wraps every QEMU invocation in a ``gdbserver``, which waits for= a + connection from a gdb client. The options given to ``gdbserver`` (e.g. = the + address on which to listen for connections) are taken from the ``$GDB_OP= TIONS`` + environment variable. By default (if ``$GDB_OPTIONS`` is empty), it lis= tens on + ``localhost:12345``. + It is possible to connect to it for example with + ``gdb -iex "target remote $addr"``, where ``$addr`` is the address + ``gdbserver`` listens on. + If the ``-gdb`` option is not used, ``$GDB_OPTIONS`` is ignored, + regardless on whether it is set or not. + * ``-d`` (debug) just increases the logging verbosity, showing for example the QMP commands and answers. =20 --=20 2.31.1 From nobody Sat May 18 15:38:15 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 1624884653130772.4100652046586; Mon, 28 Jun 2021 05:50:53 -0700 (PDT) Received: from localhost ([::1]:60500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqiy-0007LQ-1J for importer@patchew.org; Mon, 28 Jun 2021 08:50:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRM-0007QA-0q for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:49167) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRF-0003HO-Ky for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:39 -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-258-974g0MXxNQKObRoXsFRPLw-1; Mon, 28 Jun 2021 08:32:31 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 56F87EC1A1; Mon, 28 Jun 2021 12:32:21 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-69.ams2.redhat.com [10.36.114.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 11D5B19C46; Mon, 28 Jun 2021 12:32:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624883553; 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=k2jsiDhfrKN+h9mKViT2yviKD38tba7MzbS6fXevvbM=; b=Yd3ORAOfbRF2mwdV2ZTCHb9+Dc2i9awKBCY6RL9q2evrvECRiVskTAPgk3oV+FBmVwt7IC rMKRNzkmAl66NoYWqFh2pQp4DpwZmHjv5WInja6aFzAai4IuB99R1IgfV1/FVw3TFhbu56 UG3uK2jQQ8qcYk/xUfIS1Tg9uSmGCKA= X-MC-Unique: 974g0MXxNQKObRoXsFRPLw-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v7 10/16] qemu-iotests: extend the check script to prepare supporting valgrind for python tests Date: Mon, 28 Jun 2021 14:31:44 +0200 Message-Id: <20210628123150.56567-11-eesposit@redhat.com> In-Reply-To: <20210628123150.56567-1-eesposit@redhat.com> References: <20210628123150.56567-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@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=eesposit@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.375, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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 , Emanuele Giuseppe Esposito , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Currently, the check script only parses the option and sets the VALGRIND_QEMU environmental variable to "y". Add another local python variable that prepares the command line, identical to the one provided in the test scripts. Because the python script does not know in advance the valgrind PID to assign to the log file name, use the "%p" flag in valgrind log file name that automatically puts the process PID at runtime. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/check | 7 ++++--- tests/qemu-iotests/iotests.py | 11 +++++++++++ tests/qemu-iotests/testenv.py | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 4365bb8066..ebd27946db 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -39,6 +39,10 @@ def make_argparser() -> argparse.ArgumentParser: p.add_argument('-gdb', action=3D'store_true', help=3D"start gdbserver with $GDB_OPTIONS options \ ('localhost:12345' if $GDB_OPTIONS is empty)") + p.add_argument('-valgrind', action=3D'store_true', + help=3D'use valgrind, sets VALGRIND_QEMU environment ' + 'variable') + p.add_argument('-misalign', action=3D'store_true', help=3D'misalign memory allocations') p.add_argument('--color', choices=3D['on', 'off', 'auto'], @@ -88,9 +92,6 @@ def make_argparser() -> argparse.ArgumentParser: g_bash.add_argument('-o', dest=3D'imgopts', help=3D'options to pass to qemu-img create/convert= , ' 'sets IMGOPTS environment variable') - g_bash.add_argument('-valgrind', action=3D'store_true', - help=3D'use valgrind, sets VALGRIND_QEMU environme= nt ' - 'variable') =20 g_sel =3D p.add_argument_group('test selecting options', 'The following options specify test set ' diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index e7e3d92d3e..6aa1dc48ba 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -96,6 +96,17 @@ sys.stderr.write('Please run this test via the "check" script\n') sys.exit(os.EX_USAGE) =20 +qemu_valgrind =3D [] +if os.environ.get('VALGRIND_QEMU') =3D=3D "y" and \ + os.environ.get('NO_VALGRIND') !=3D "y": + valgrind_logfile =3D "--log-file=3D" + test_dir + # %p allows to put the valgrind process PID, since + # we don't know it a priori (subprocess.Popen is + # not yet invoked) + valgrind_logfile +=3D "/%p.valgrind" + + qemu_valgrind =3D ['valgrind', valgrind_logfile, '--error-exitcode=3D9= 9'] + socket_scm_helper =3D os.environ.get('SOCKET_SCM_HELPER', 'socket_scm_help= er') =20 luks_default_secret_object =3D 'secret,id=3Dkeysec0,data=3D' + \ diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index 8501c6caf5..8bf154376f 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -298,6 +298,7 @@ def print_env(self) -> None: SOCK_DIR -- {SOCK_DIR} SOCKET_SCM_HELPER -- {SOCKET_SCM_HELPER} GDB_OPTIONS -- {GDB_OPTIONS} +VALGRIND_QEMU -- {VALGRIND_QEMU} """ =20 args =3D collections.defaultdict(str, self.get_env()) --=20 2.31.1 From nobody Sat May 18 15:38:15 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 1624883984331149.66219096752855; Mon, 28 Jun 2021 05:39:44 -0700 (PDT) Received: from localhost ([::1]:58718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqYB-0003P6-A3 for importer@patchew.org; Mon, 28 Jun 2021 08:39:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRH-0007FA-PF for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41331) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRC-0003G7-F7 for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32: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-287-OTcYjAiaM9Cp_C0ahLk7Kg-1; Mon, 28 Jun 2021 08:32:28 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 08B53801B34; Mon, 28 Jun 2021 12:32:24 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-69.ams2.redhat.com [10.36.114.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id B401119C46; Mon, 28 Jun 2021 12:32:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624883549; 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=nduGZC0I5oAaAdS7E6A1VFYPhHC4ckjrNXi8h3sMrAk=; b=hXERjgXw1HoC5i1zbfHUOaY7UgPYRozM38rpTuywQyXZUFk5KxYV8ztBntt2laMtt18bZ6 3oAlwde2C6LJ6t7fofaGktJMyUhRviLSOC1sz+ulVPRaVdrND80PfBX1mOafxKNcn6YcTO VH8o0tg2BKQzpG1x7nth37tbeWl3gBw= X-MC-Unique: OTcYjAiaM9Cp_C0ahLk7Kg-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v7 11/16] qemu-iotests: extend QMP socket timeout when using valgrind Date: Mon, 28 Jun 2021 14:31:45 +0200 Message-Id: <20210628123150.56567-12-eesposit@redhat.com> In-Reply-To: <20210628123150.56567-1-eesposit@redhat.com> References: <20210628123150.56567-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@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=eesposit@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.375, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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 , Emanuele Giuseppe Esposito , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" As with gdbserver, valgrind delays the test execution, so the default QMP socket timeout and the generic class Timeout in iotests.py timeouts too soon. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 6aa1dc48ba..26c580f9e7 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -488,13 +488,13 @@ def __init__(self, seconds, errmsg=3D"Timeout"): self.seconds =3D seconds self.errmsg =3D errmsg def __enter__(self): - if qemu_gdb: + if qemu_gdb or qemu_valgrind: return self signal.signal(signal.SIGALRM, self.timeout) signal.setitimer(signal.ITIMER_REAL, self.seconds) return self def __exit__(self, exc_type, value, traceback): - if qemu_gdb: + if qemu_gdb or qemu_valgrind: return False signal.setitimer(signal.ITIMER_REAL, 0) return False @@ -590,7 +590,7 @@ class VM(qtest.QEMUQtestMachine): =20 def __init__(self, path_suffix=3D''): name =3D "qemu%s-%d" % (path_suffix, os.getpid()) - timer =3D 15.0 if not qemu_gdb else None + timer =3D 15.0 if not (qemu_gdb or qemu_valgrind) else None super().__init__(qemu_prog, qemu_opts, wrapper=3Dqemu_gdb, name=3Dname, base_temp_dir=3Dtest_dir, --=20 2.31.1 From nobody Sat May 18 15:38:15 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 1624884082701394.6093009879054; Mon, 28 Jun 2021 05:41:22 -0700 (PDT) Received: from localhost ([::1]:34930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqZl-0006QF-E5 for importer@patchew.org; Mon, 28 Jun 2021 08:41:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRJ-0007H8-Os for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:21485) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRF-0003HE-KO for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:37 -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-80-qrn5TxsfPSulosnKaiILjA-1; Mon, 28 Jun 2021 08:32:31 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8CDA21030C20; Mon, 28 Jun 2021 12:32:26 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-69.ams2.redhat.com [10.36.114.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 569C719C46; Mon, 28 Jun 2021 12:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624883552; 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=JjI/eatHq+wW/YDjZadaObYIUBK6vvUrROY6sLPTnYQ=; b=AAEMJCBlio/zkZKQMTIa2O23zzFPKhO8IZmcesoCDztTMMKQBUeIKPdk5oLgfvJole6QnS z+ue/2HFDcAvVzOf9WF0cjS1nwdq5nB+nT5dRD+5s965XBVyYzsgchkT/oUwEzxsYm3vPp mwto9AwuCqxAp/YSb7DfC+hPnY6u5GQ= X-MC-Unique: qrn5TxsfPSulosnKaiILjA-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v7 12/16] qemu-iotests: allow valgrind to read/delete the generated log file Date: Mon, 28 Jun 2021 14:31:46 +0200 Message-Id: <20210628123150.56567-13-eesposit@redhat.com> In-Reply-To: <20210628123150.56567-1-eesposit@redhat.com> References: <20210628123150.56567-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@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=eesposit@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.375, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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 , Emanuele Giuseppe Esposito , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" When using -valgrind on the script tests, it generates a log file in $TEST_DIR that is either read (if valgrind finds problems) or otherwise deleted. Provide the same exact behavior when using -valgrind on the python tests. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 26c580f9e7..85d8c0abbb 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -598,6 +598,17 @@ def __init__(self, path_suffix=3D''): sock_dir=3Dsock_dir, qmp_timer=3Dtimer) self._num_drives =3D 0 =20 + def _post_shutdown(self) -> None: + super()._post_shutdown() + if not qemu_valgrind or not self._popen: + return + valgrind_filename =3D f"{test_dir}/{self._popen.pid}.valgrind" + if self.exitcode() =3D=3D 99: + with open(valgrind_filename) as f: + print(f.read()) + else: + os.remove(valgrind_filename) + def add_object(self, opts): self._args.append('-object') self._args.append(opts) --=20 2.31.1 From nobody Sat May 18 15:38:15 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 1624884205739364.8965882472885; Mon, 28 Jun 2021 05:43:25 -0700 (PDT) Received: from localhost ([::1]:43408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqbk-0003rp-LI for importer@patchew.org; Mon, 28 Jun 2021 08:43:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRN-0007VP-5b for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:32738) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRG-0003HT-Ci for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:40 -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-34-LzTboEO4Ptup5riRXK0TMQ-1; Mon, 28 Jun 2021 08:32:30 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 246B1802CBC; Mon, 28 Jun 2021 12:32:29 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-69.ams2.redhat.com [10.36.114.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id D667C19C46; Mon, 28 Jun 2021 12:32:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624883553; 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=upYXHE/HyjNCdv4G4C4tP3USQ3jARrS5bvmt/Ui/3y0=; b=ghY9HaJs3IhB+osCCyWi7HPVcKftr2GLiwQxReFO3zG+0Ee+FFEUfhF5FGJXgX3mwgWxi+ BD1En7+mJJnO6m+1TVGlLRO6w7eK6ERgQMDbVdafBbquuv0qyVbamNYU4Y5gN4360aUW9N PoMPm9/xroKm3jkEJYmxcHFPUA1APK0= X-MC-Unique: LzTboEO4Ptup5riRXK0TMQ-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v7 13/16] qemu-iotests: insert valgrind command line as wrapper for qemu binary Date: Mon, 28 Jun 2021 14:31:47 +0200 Message-Id: <20210628123150.56567-14-eesposit@redhat.com> In-Reply-To: <20210628123150.56567-1-eesposit@redhat.com> References: <20210628123150.56567-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@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=eesposit@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.375, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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 , Emanuele Giuseppe Esposito , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" If -gdb and -valgrind are both defined, return an error. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 85d8c0abbb..7aa6707032 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -591,7 +591,11 @@ class VM(qtest.QEMUQtestMachine): def __init__(self, path_suffix=3D''): name =3D "qemu%s-%d" % (path_suffix, os.getpid()) timer =3D 15.0 if not (qemu_gdb or qemu_valgrind) else None - super().__init__(qemu_prog, qemu_opts, wrapper=3Dqemu_gdb, + if qemu_gdb and qemu_valgrind: + sys.stderr.write('Either use gdb or valgrind, not together\n') + sys.exit(1) + wrapper =3D qemu_gdb if qemu_gdb else qemu_valgrind + super().__init__(qemu_prog, qemu_opts, wrapper=3Dwrapper, name=3Dname, base_temp_dir=3Dtest_dir, socket_scm_helper=3Dsocket_scm_helper, --=20 2.31.1 From nobody Sat May 18 15:38:15 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 162488415609778.51842871378585; Mon, 28 Jun 2021 05:42:36 -0700 (PDT) Received: from localhost ([::1]:39088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqaw-0000p5-Q6 for importer@patchew.org; Mon, 28 Jun 2021 08:42:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRM-0007Tc-RE for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35556) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRJ-0003Hz-EX for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:40 -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-487-AwIEug-4MbmRckQ9cd8lFA-1; Mon, 28 Jun 2021 08:32:32 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B466C107B11F; Mon, 28 Jun 2021 12:32:31 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-69.ams2.redhat.com [10.36.114.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7298619C46; Mon, 28 Jun 2021 12:32:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624883555; 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=n6iWdHhpUwMtfPnPmUFz9+0wxM5+3l3OS376i9qRZZ4=; b=iD94MDyuA3Vv1PeGQGUhRE24dXjTTlSUNXBxHQ62JKOKrxetIqkXLt5VubuSHvhvwyOILu rzzftOLy07igq9nqp2GYV4FFc9zn+pbY3h3rXJwEo3mDJhZD6Rdv6CvF4wy6c4i8n6KXPc uI5lZd/ICVndENkS5KYbkuHtjiy7pgY= X-MC-Unique: AwIEug-4MbmRckQ9cd8lFA-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v7 14/16] docs/devel/testing: add -valgrind option to the debug section of QEMU iotests Date: Mon, 28 Jun 2021 14:31:48 +0200 Message-Id: <20210628123150.56567-15-eesposit@redhat.com> In-Reply-To: <20210628123150.56567-1-eesposit@redhat.com> References: <20210628123150.56567-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@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=eesposit@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.375, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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 , Emanuele Giuseppe Esposito , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- docs/devel/testing.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 8b24e6fb47..fa85592a38 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -240,6 +240,13 @@ a failing test: If the ``-gdb`` option is not used, ``$GDB_OPTIONS`` is ignored, regardless on whether it is set or not. =20 +* ``-valgrind`` attaches a valgrind instance to QEMU. If it detects + warnings, it will print and save the log in + ``$TEST_DIR/.valgrind``. + The final command line will be ``valgrind --log-file=3D$TEST_DIR/ + .valgrind --error-exitcode=3D99 $QEMU ...`` + Note: if used together with ``-gdb``, this command will be ignored. + * ``-d`` (debug) just increases the logging verbosity, showing for example the QMP commands and answers. =20 --=20 2.31.1 From nobody Sat May 18 15:38:15 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 1624884509371400.6851409815898; Mon, 28 Jun 2021 05:48:29 -0700 (PDT) Received: from localhost ([::1]:56946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqge-0004ie-93 for importer@patchew.org; Mon, 28 Jun 2021 08:48:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRP-0007hH-Vx for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51125) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRJ-0003IY-Oy for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:43 -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-41-PD2tuxFjO4Odr8Ro2rqIYw-1; Mon, 28 Jun 2021 08:32:35 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 409A610066F3; Mon, 28 Jun 2021 12:32:34 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-69.ams2.redhat.com [10.36.114.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A45C19C46; Mon, 28 Jun 2021 12:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624883557; 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=FLQnv5zn/wkHLxH5PJzmEXsZfcApWl5ld1HVjGqhGvw=; b=OUaUhNCkOjycafX7n1Pj8RIzNcZ+dUfbIvplZ34Kwa1tnfDbYArlAEWevlVU7E2e60fJDd bH36ZYtvXCHWlepCX1fHEZn+zA2M/16pgi5/GCcgvA0uvghjOWTu6fQb66xtpuz6wvBFjm h+XJxwxohCgQKBQvGTeirUSPfCx4AFs= X-MC-Unique: PD2tuxFjO4Odr8Ro2rqIYw-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v7 15/16] qemu-iotests: add option to show qemu binary logs on stdout Date: Mon, 28 Jun 2021 14:31:49 +0200 Message-Id: <20210628123150.56567-16-eesposit@redhat.com> In-Reply-To: <20210628123150.56567-1-eesposit@redhat.com> References: <20210628123150.56567-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@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=eesposit@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.375, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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 , Emanuele Giuseppe Esposito , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Using the flag -p, allow the qemu binary to print to stdout. Also create the common function _close_qemu_log_file() to avoid accessing machine.py private fields directly and have duplicate code. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- python/qemu/machine/machine.py | 9 ++++++--- tests/qemu-iotests/check | 4 +++- tests/qemu-iotests/iotests.py | 8 ++++++++ tests/qemu-iotests/testenv.py | 9 +++++++-- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index fdf2fc0e9c..c9d344d955 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -338,6 +338,11 @@ def _post_launch(self) -> None: if self._qmp_connection: self._qmp.accept(self._qmp_timer) =20 + def _close_qemu_log_file(self) -> None: + if self._qemu_log_file is not None: + self._qemu_log_file.close() + self._qemu_log_file =3D None + def _post_shutdown(self) -> None: """ Called to cleanup the VM instance after the process has exited. @@ -350,9 +355,7 @@ def _post_shutdown(self) -> None: self._qmp.close() self._qmp_connection =3D None =20 - if self._qemu_log_file is not None: - self._qemu_log_file.close() - self._qemu_log_file =3D None + self._close_qemu_log_file() =20 self._load_io_log() =20 diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index ebd27946db..da1bfb839e 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -36,6 +36,8 @@ def make_argparser() -> argparse.ArgumentParser: help=3D'pretty print output for make check') =20 p.add_argument('-d', dest=3D'debug', action=3D'store_true', help=3D'de= bug') + p.add_argument('-p', dest=3D'print', action=3D'store_true', + help=3D'redirects qemu\'s stdout and stderr to the test ou= tput') p.add_argument('-gdb', action=3D'store_true', help=3D"start gdbserver with $GDB_OPTIONS options \ ('localhost:12345' if $GDB_OPTIONS is empty)") @@ -119,7 +121,7 @@ if __name__ =3D=3D '__main__': aiomode=3Dargs.aiomode, cachemode=3Dargs.cachemode, imgopts=3Dargs.imgopts, misalign=3Dargs.misalign, debug=3Dargs.debug, valgrind=3Dargs.valgrind, - gdb=3Dargs.gdb) + gdb=3Dargs.gdb, qprint=3Dargs.print) =20 if len(sys.argv) > 1 and sys.argv[-len(args.tests)-1] =3D=3D '--': if not args.tests: diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 7aa6707032..eee6fb7a9f 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -79,6 +79,8 @@ if gdb_qemu_env: qemu_gdb =3D ['gdbserver'] + gdb_qemu_env.strip().split(' ') =20 +qemu_print =3D os.environ.get('PRINT_QEMU', False) + imgfmt =3D os.environ.get('IMGFMT', 'raw') imgproto =3D os.environ.get('IMGPROTO', 'file') output_dir =3D os.environ.get('OUTPUT_DIR', '.') @@ -613,6 +615,12 @@ def _post_shutdown(self) -> None: else: os.remove(valgrind_filename) =20 + def _pre_launch(self) -> None: + super()._pre_launch() + if qemu_print: + # set QEMU binary output to stdout + self._close_qemu_log_file() + def add_object(self, opts): self._args.append('-object') self._args.append(opts) diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index 8bf154376f..70da0d60c8 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -74,7 +74,7 @@ class TestEnv(ContextManager['TestEnv']): 'AIOMODE', 'CACHEMODE', 'VALGRIND_QEMU', 'CACHEMODE_IS_DEFAULT', 'IMGFMT_GENERIC', 'IMGOPTSSYN= TAX', 'IMGKEYSECRET', 'QEMU_DEFAULT_MACHINE', 'MALLOC_PERTU= RB_', - 'GDB_OPTIONS'] + 'GDB_OPTIONS', 'PRINT_QEMU'] =20 def prepare_subprocess(self, args: List[str]) -> Dict[str, str]: if self.debug: @@ -181,7 +181,8 @@ def __init__(self, imgfmt: str, imgproto: str, aiomode:= str, misalign: bool =3D False, debug: bool =3D False, valgrind: bool =3D False, - gdb: bool =3D False) -> None: + gdb: bool =3D False, + qprint: bool =3D False) -> None: self.imgfmt =3D imgfmt self.imgproto =3D imgproto self.aiomode =3D aiomode @@ -189,6 +190,9 @@ def __init__(self, imgfmt: str, imgproto: str, aiomode:= str, self.misalign =3D misalign self.debug =3D debug =20 + if qprint: + self.print_qemu =3D 'y' + if gdb: self.gdb_options =3D os.getenv('GDB_OPTIONS', DEF_GDB_OPTIONS) if not self.gdb_options: @@ -299,6 +303,7 @@ def print_env(self) -> None: SOCKET_SCM_HELPER -- {SOCKET_SCM_HELPER} GDB_OPTIONS -- {GDB_OPTIONS} VALGRIND_QEMU -- {VALGRIND_QEMU} +PRINT_QEMU_OUTPUT -- {PRINT_QEMU} """ =20 args =3D collections.defaultdict(str, self.get_env()) --=20 2.31.1 From nobody Sat May 18 15:38:15 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 1624884268355114.90051792030056; Mon, 28 Jun 2021 05:44:28 -0700 (PDT) Received: from localhost ([::1]:47638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqck-0006gN-8W for importer@patchew.org; Mon, 28 Jun 2021 08:44:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRO-0007af-GH for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54267) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqRL-0003Jd-TM for qemu-devel@nongnu.org; Mon, 28 Jun 2021 08:32:42 -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-105-U7Nf3PnUMoGEwvCe9QYnJg-1; Mon, 28 Jun 2021 08:32:38 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1F566100CECF; Mon, 28 Jun 2021 12:32:37 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-69.ams2.redhat.com [10.36.114.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9BB0719C46; Mon, 28 Jun 2021 12:32:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624883559; 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=gPiC5z6m4jnmh2itE5RumYmcgy0d0h1nvWpIYmP58Mk=; b=H39UwrIGlOlNasSJtGPw73QFtyebdQiy7x4pnpgnWRNWRYyYaNmX5vQQEtOjPAEBq7kqqm DP/RUrnN3uAwgx3y6G6xGT7pVuXtl3rVTqbv3iqR+h/oTDqlq5EXS8RESSWYuoZceS0hsu w+COBle/NNqMZEBJhAIRLcaSKtBMx3Y= X-MC-Unique: U7Nf3PnUMoGEwvCe9QYnJg-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v7 16/16] docs/devel/testing: add -p option to the debug section of QEMU iotests Date: Mon, 28 Jun 2021 14:31:50 +0200 Message-Id: <20210628123150.56567-17-eesposit@redhat.com> In-Reply-To: <20210628123150.56567-1-eesposit@redhat.com> References: <20210628123150.56567-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=eesposit@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.375, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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 , Emanuele Giuseppe Esposito , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- docs/devel/testing.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index fa85592a38..28a0b37b84 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -250,6 +250,10 @@ a failing test: * ``-d`` (debug) just increases the logging verbosity, showing for example the QMP commands and answers. =20 +* ``-p`` (print) redirect QEMU=E2=80=99s stdout and stderr to the test out= put, + instead of saving it into a log file in + ``$TEST_DIR/qemu-machine-``. + Test case groups ---------------- =20 --=20 2.31.1