From nobody Sat May 4 19:25:17 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622798372; cv=none; d=zohomail.com; s=zohoarc; b=P2+30TZbXCOC4xycI/3PHzqReLqqXPGPFm+wBH/ZHKZa+FEwiUbi3TwmQdaBE5H79pLof0gcwM9vHGmLPB+OVDaLhN/XmLqcN3jrqu2nH768U8Yge1Y4RX/b5hiQ97XX313trpqsWjHoKeoXV9yNTmHB0VlRNtkSX3PJPV+E4xw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622798372; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZSMyQtY24MSWMhEjkphk1olSB5upxYb0HYfShEk3/FQ=; b=aTniywBPYAJ6+cjKMf4BQKeht1xY/PB5PxfkTvKdGFPRxMDfdSax5z+uWQisoS/hAxh4QBgJtXKZ/ZaRLuv92NuCuH+1BxniHzk0hoQOCnu0WNuzoI344lR5+3L8PRg32DF9XeQBB6DTvuZ2tZWq0nah8l4MN+od1R/JJOqMXQw= ARC-Authentication-Results: i=1; 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+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622798372769522.5738911996956; Fri, 4 Jun 2021 02:19:32 -0700 (PDT) Received: from localhost ([::1]:46654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp5zH-0005TL-KY for importer2@patchew.org; Fri, 04 Jun 2021 05:19:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xY-00028s-R8 for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:17:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:21153) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xU-0002oe-J7 for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:17:44 -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-529-vEES1K0COemJ-_0a3YcMAg-1; Fri, 04 Jun 2021 05:17:37 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4EA458049CA; Fri, 4 Jun 2021 09:17:36 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-43.ams2.redhat.com [10.36.115.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id CAC646A04A; Fri, 4 Jun 2021 09:17:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622798259; 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=ZSMyQtY24MSWMhEjkphk1olSB5upxYb0HYfShEk3/FQ=; b=JHMDLw9f/ul4pVycSKJdDi58wqVoKT89EFHRI+JI+PSpk5H8487aorrkUwJyCk9TT2zFt3 T/DXFVfGXDtt+Bo9SjTlyKLItX13+OI6WNNl3qosdgXfmkUu+gvaj7ZDw1LKkmF25mmIko M1LA28+JBDafHzMBbD/qDMIUL+t0zzs= X-MC-Unique: vEES1K0COemJ-_0a3YcMAg-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v5 01/16] python: qemu: add timer parameter for qmp.accept socket Date: Fri, 4 Jun 2021 11:17:08 +0200 Message-Id: <20210604091723.13419-2-eesposit@redhat.com> In-Reply-To: <20210604091723.13419-1-eesposit@redhat.com> References: <20210604091723.13419-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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+importer2=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.37, 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+importer2=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 --- 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.30.2 From nobody Sat May 4 19:25:17 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622798518; cv=none; d=zohomail.com; s=zohoarc; b=QBPCMKSXfimjVs5gPySr0l1Rxc5iS4Hd/u+bQwRVxMV9QS/Y1M3vTcl+ERQxibXVhW6Z1Ucnew2DYrIOQqoyJYcCIZ93V5Lrtg8XuFsWOmye1+Bee5VvyL5EY5Ob8nj1+BKGRFEYP+VKZLbFMenhr7N0zOo15PozgciiO2BbU5k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622798518; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5UGUHJSZmFDiUdcjShfSEbx47dF5oVwF8cBjtnlJCgo=; b=EkXl+p10U1EwY29MiLDPFTxMPSmIJ7vx0cKSS9HKMr8ldJ6N0cphK8jqGPcKn56t2pqpeEEyZWj3kuw8K3cZmB+YGERykEmvbvh0+VY7iEnTXt1LSk5XwReIc4FUXjXe1kw01joqfkwBBMfBnr5d7wznnRpOixaawW0sJGyp/TI= ARC-Authentication-Results: i=1; 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+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622798518621557.0290791183791; Fri, 4 Jun 2021 02:21:58 -0700 (PDT) Received: from localhost ([::1]:54792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp61d-0002UB-FF for importer2@patchew.org; Fri, 04 Jun 2021 05:21:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xa-0002B0-73 for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:17:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:24548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xY-0002rP-9D for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:17:45 -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-260-e3rJyzmrP7KieVnUcRWszQ-1; Fri, 04 Jun 2021 05:17:39 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DBC178049CB; Fri, 4 Jun 2021 09:17:38 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-43.ams2.redhat.com [10.36.115.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD9216A04A; Fri, 4 Jun 2021 09:17:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622798263; 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=5UGUHJSZmFDiUdcjShfSEbx47dF5oVwF8cBjtnlJCgo=; b=dmwbWLKgFOcKcysKpNkWXPo/8taDTjTEpfDheJ6D1TPpCX4aVJ1EvuHGV5WTWvGkeePhtI BLCl+yO7otNwtt5T0Aa4Rg40xBV74gwXp9jUJ4JVDhgGPU3vkVI3R3SlTN4Mi2EmyxbSfM /RcF3fYB8JZkVlh1frilRJqwAXnl0R8= X-MC-Unique: e3rJyzmrP7KieVnUcRWszQ-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v5 02/16] python: Reduce strictness of pylint's duplicate-code check Date: Fri, 4 Jun 2021 11:17:09 +0200 Message-Id: <20210604091723.13419-3-eesposit@redhat.com> In-Reply-To: <20210604091723.13419-1-eesposit@redhat.com> References: <20210604091723.13419-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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+importer2=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.37, 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 , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer2=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 0fcdec6f32..d82c39aa46 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -78,6 +78,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.30.2 From nobody Sat May 4 19:25:17 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622798533; cv=none; d=zohomail.com; s=zohoarc; b=Jx7I0MrURRDDGOoH8mD4CRlEg//k71a/Oo8ne8uVRFOmb8oPM8c2y4uxk96RxFS8VBzRUJuyakSRjAMq9sYYZHxhPMALaOR8kRozRvB5IC0H4uQE1dxGcaRQT7p9xWAIobefU7pMTGoSJMyiaBmqXSJ9e2bsopvdIP98O8QAW2Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622798533; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZAGkGe1Mb8ciYVL3spuijyboF/FqU4JfBfMBjl3BBoo=; b=Fzs9o0lER/nCGZBihSUactp8FGXtNB9T9DluDqfHoSfVR4tYv2367lKBFsfaUKHjIdqVzi7XFB2B4xVZ2mny1HnMInhVFdWMOS+M6IHmbmaNbIOSEAd50oU92tf/cE1C5zbsi10me/iySnAU3RlBiqdwb4U9apyD/s5Mj2jEy8o= ARC-Authentication-Results: i=1; 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+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162279853338970.94316806345796; Fri, 4 Jun 2021 02:22:13 -0700 (PDT) Received: from localhost ([::1]:55254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp61r-0002ma-Fg for importer2@patchew.org; Fri, 04 Jun 2021 05:22:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xa-0002BF-Ct for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:17:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:48858) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xY-0002rc-Q2 for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:17:46 -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-307-0gf_RFSuN7yGjzZm7pgxww-1; Fri, 04 Jun 2021 05:17:42 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 97D028015F8; Fri, 4 Jun 2021 09:17:41 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-43.ams2.redhat.com [10.36.115.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 426886A04A; Fri, 4 Jun 2021 09:17:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622798264; 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=ZAGkGe1Mb8ciYVL3spuijyboF/FqU4JfBfMBjl3BBoo=; b=gKfYL4y0vL4dn4EtfDjaWOBpWNDgJxK8Jub2hiUpzEzgENn3IQZP833sCRHJGZg7dit1zL CsWjrjiL3IniXD1dHvvHHUDpSKzuHhC7Grp4SxSbfLX+DI7pCNK0soO1byLSvMCG21ZBNt I8xs7aPrsdSnjBKZ+OehGz3jG5XuKKw= X-MC-Unique: 0gf_RFSuN7yGjzZm7pgxww-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v5 03/16] python: qemu: pass the wrapper field from QEMUQtestmachine to QEMUMachine Date: Fri, 4 Jun 2021 11:17:10 +0200 Message-Id: <20210604091723.13419-4-eesposit@redhat.com> In-Reply-To: <20210604091723.13419-1-eesposit@redhat.com> References: <20210604091723.13419-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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+importer2=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.37, 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+importer2=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.30.2 From nobody Sat May 4 19:25:17 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622798372; cv=none; d=zohomail.com; s=zohoarc; b=JufK+AVbvZyF+cOmNE2ZTG+GCMhdqn1O9jSifzAyqiMFtnckcoapatjx56WuTf+F3KzU9qJVG9AlzhgqfDcwU/9oLEUyZBGU2PTNbJlXKj2bYWIIOj/Q6YoNi3FkEAjbXKxWBzwf7RwxYyCkFeqlkcCoHxsi8QyEoDQvd/KtClk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622798372; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BEyjPhDYu888mBXKgEgYrXHbdeIod5R+ZZmN8CRaIrg=; b=eo4xcVJxVWvL1GyOKRJCxF2/JkAFpai8a13xVkxw6P+mlcNb14QnwBFUQsH6Ro7kN2JmEXqe0576iQYUzhpH+9RasII4SQdLsToAuxq03VLJxMPGMQPrQpFNwV/qCFTcNCE1nZIKSV22q4WzCMSlESMzZ0DsPFoWxYDCiLl/HR8= ARC-Authentication-Results: i=1; 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+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622798372408121.05249115677395; Fri, 4 Jun 2021 02:19:32 -0700 (PDT) Received: from localhost ([::1]:46212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp5zD-0005BI-5K for importer2@patchew.org; Fri, 04 Jun 2021 05:19:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xg-0002Fz-2W for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:17:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60237) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xd-0002wY-Bx for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:17:51 -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-548-Dd0GxU-DNnyh0jrqwd0k3A-1; Fri, 04 Jun 2021 05:17:45 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 796E1107ACC7; Fri, 4 Jun 2021 09:17:44 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-43.ams2.redhat.com [10.36.115.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD7976A044; Fri, 4 Jun 2021 09:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622798268; 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=BEyjPhDYu888mBXKgEgYrXHbdeIod5R+ZZmN8CRaIrg=; b=aAA4JXVlnAvVJZ4ifUv8Ah+mNgH51bGJgSZ5Puu1O/aCL3/Vncsyy21yWQrNp+LeP0mplZ 9ZEmUbxhMYBMSejW+yyeTgdPPBcvhzAiE+k77Yw70AO54OrlFxfM7OclqtFEjk9IQ5C7OG +fRxWvVj7jSHNWsISaEjU0pzxQmfGKQ= X-MC-Unique: Dd0GxU-DNnyh0jrqwd0k3A-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v5 04/16] docs/devel/testing: add debug section to the QEMU iotests chapter Date: Fri, 4 Jun 2021 11:17:11 +0200 Message-Id: <20210604091723.13419-5-eesposit@redhat.com> In-Reply-To: <20210604091723.13419-1-eesposit@redhat.com> References: <20210604091723.13419-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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+importer2=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.37, 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+importer2=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.30.2 From nobody Sat May 4 19:25:17 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622798517; cv=none; d=zohomail.com; s=zohoarc; b=aEHHtXOBhOFFVApRYRtRHZ9g/UFdbnLgiHlBSDlgKYFJTf24YPMQDyt1J6iYcV2P0ToSVc2my9tb7QEi2kbDqdchHEN0EcViM7wsFVxSPBZHHpv3OUZFCgi1oiNBsIdAGjxBUiLWyMwSbjdXvd5YW1Ng7rzfw8kbGT4Ju8+JFq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622798517; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=M+OgVN/q+HT1l3GQFIJXwHX0ZByEXAa+u0ctJOkBjaU=; b=mIl6uocAfacVc2rY8UjC7OD1D+4ymMEDOxlIjcqREsNxwtOel5intb/nNb1lEwTEU3iH7jfEMU0muO9DksHfthWRrxV3q/agxTgg/HADRUxll5DySp7fp6oPfF1PqXVYm5Iv8Umovyw5AAjtk0Kp6yJJlFzkr/jBuL9Hvz2APhU= ARC-Authentication-Results: i=1; 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+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622798517828479.77101169656146; Fri, 4 Jun 2021 02:21:57 -0700 (PDT) Received: from localhost ([::1]:54730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp61c-0002Ra-MG for importer2@patchew.org; Fri, 04 Jun 2021 05:21:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xj-0002Hm-AR for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:17:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26126) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xf-0002xO-QD for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:17:54 -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-190-Ac1_3BJONcWiOF-7q93GqQ-1; Fri, 04 Jun 2021 05:17:48 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 448416D4E0; Fri, 4 Jun 2021 09:17:47 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-43.ams2.redhat.com [10.36.115.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id DBEFF60CEC; Fri, 4 Jun 2021 09:17:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622798271; 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=M+OgVN/q+HT1l3GQFIJXwHX0ZByEXAa+u0ctJOkBjaU=; b=Iydqj6uKLxbls/BihhNqIX7amCE0l4NrvgcKGGMNlU5ZCe75SgYK2vvD1dZjkCrLnAicyc uafWCnD5MwVbeHsCqTe/EUibO2RR9X1WH7IBETD8FqFok0d0eO3b0lLZe/M5p4v967MiYv SzrvaMPB7+u444iwRx1Dqwxt2WSK2x8= X-MC-Unique: Ac1_3BJONcWiOF-7q93GqQ-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v5 05/16] qemu-iotests: add option to attach gdbserver Date: Fri, 4 Jun 2021 11:17:12 +0200 Message-Id: <20210604091723.13419-6-eesposit@redhat.com> In-Reply-To: <20210604091723.13419-1-eesposit@redhat.com> References: <20210604091723.13419-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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+importer2=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.37, 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+importer2=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 3f3962dd75..1dba4218c0 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.30.2 From nobody Sat May 4 19:25:17 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622798669; cv=none; d=zohomail.com; s=zohoarc; b=IBoskT9qQ9pfxGR/5utiiyvMELXwZKv6h2dLJuuBZvU1hACJMnfdp3cvVaCGOQkTLH9YUcoNSOPmwJcMGYbcDay2FKwV8LE6nztbpWNcnq+7IpHoSiC0aMQdbPMdYzuo0ZQW4f6/DxXZWUi1p2RqTEle67XXO9ohhZhYr71703c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622798669; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KhcfXVHxzNLXL+k2plj5xrIS4V+w4h4Hd0qpMlqkG0s=; b=S1h1ykQiF8XioczZHhx/xicunW+caXXgS+73Mj7mHhucemeUaAwUi18TM5h9CqT09REyw16OaSyqJdj3wOtPA0ZwBbl+rt8gTPNTEibesXLcQUj4uTowFIY155rPyRMConlZ11hcQ/2UZJe+MDeDFzegX+e5ms6zngoE76znQQ8= ARC-Authentication-Results: i=1; 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+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622798669124141.1709825126103; Fri, 4 Jun 2021 02:24:29 -0700 (PDT) Received: from localhost ([::1]:36348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp643-0000h5-Tm for importer2@patchew.org; Fri, 04 Jun 2021 05:24:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xl-0002ID-LD for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:17:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58765) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xi-0002yz-Ir for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:17:57 -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-302-nnaViwWoOpqk6DBySI-Ldw-1; Fri, 04 Jun 2021 05:17:51 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0B8D0107ACCD; Fri, 4 Jun 2021 09:17:50 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-43.ams2.redhat.com [10.36.115.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id A32D260CEC; Fri, 4 Jun 2021 09:17:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622798273; 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=KhcfXVHxzNLXL+k2plj5xrIS4V+w4h4Hd0qpMlqkG0s=; b=ff1um3sC4GEAurtjoadW3riJR5CMnw4D6ESms0DpdwD9LvwjV2dWxIW5Z/H4Eo/tF0b0EJ y+iyu5ESLm/y6+/HZxWToHPm2Jbnql9oyjBH318LoEI50CMbgHeZmrrHJJfzddvncC2+oY wM5mQjy3PwUO8Idt3I9j0yw/q73ijs0= X-MC-Unique: nnaViwWoOpqk6DBySI-Ldw-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v5 06/16] qemu-iotests: delay QMP socket timers Date: Fri, 4 Jun 2021 11:17:13 +0200 Message-Id: <20210604091723.13419-7-eesposit@redhat.com> In-Reply-To: <20210604091723.13419-1-eesposit@redhat.com> References: <20210604091723.13419-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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+importer2=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.37, 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+importer2=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. For Timeout class, create a @contextmanager that switches Timeout with NoTimeout (empty context manager) so that if --gdb is set, no timeout will be triggered. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index c86f239d81..d4bfd8f1d6 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -486,6 +486,13 @@ def __exit__(self, exc_type, value, traceback): def timeout(self, signum, frame): raise Exception(self.errmsg) =20 +@contextmanager +def NoTimeout(): + yield + +if qemu_gdb: + Timeout =3D NoTimeout + def file_pattern(name): return "{0}-{1}".format(os.getpid(), name) =20 @@ -575,7 +582,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.30.2 From nobody Sat May 4 19:25:17 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622798658; cv=none; d=zohomail.com; s=zohoarc; b=mdamLzBa2YJWdTBoIwc6r2sX53q767r+2ovKJZiPNsqs5LCX5yxm0YtzcyYSCLlggaf5xhcZOCCR1yAGSRhaSKbnd4CUqGGp+XfBIC1yY4K+JK+gfLY9UR03dnnHgGCRcrzjv5AjscX1EP2arjV9JOHf3qAkhqOL5WdIxa2PKZc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622798658; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lLKR/Ny73NSB+2oEn49iE4pWtNLW27mP8X9A3MVkg54=; b=KGPVAfHHscp7Auh0NDAcjfgBX4At70lyhDTi0RQFzLF6PSeRYFojUWW9vi+OH7BqDTHJMIUbxIcy9bdvSRUCx/KLcTrCzfOVIxO8J00KhCEMelutmPJcYr6/ROct/RljwXg7XTkdMIOvXsYfC53u7z09ene4xveDy5X3E4SL1o8= ARC-Authentication-Results: i=1; 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+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622798658506783.709480697485; Fri, 4 Jun 2021 02:24:18 -0700 (PDT) Received: from localhost ([::1]:35074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp63t-0008GW-EI for importer2@patchew.org; Fri, 04 Jun 2021 05:24:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xm-0002JM-T3 for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:17:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:23314) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xk-0002zM-VZ for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:17:58 -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-498-cTwK-0zWN6OmkbhtKwRapg-1; Fri, 04 Jun 2021 05:17:53 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ABCCF801817; Fri, 4 Jun 2021 09:17:52 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-43.ams2.redhat.com [10.36.115.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6991260CEC; Fri, 4 Jun 2021 09:17:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622798275; 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=lLKR/Ny73NSB+2oEn49iE4pWtNLW27mP8X9A3MVkg54=; b=Q/xn784jUGj778jx09v4Ql5sVzeKwSzV8GQLS4GfCC3ihdzmr+KmvUf3kY7P2jPZ2RrMY3 nqwDzUuLb+dORZZW497Qi25ZqEnS+8DYDVsg6BEiql/miqO/xRWVK744ZcoclJv1V/S/jB 7FTFInKB2MDipPkVO1X0IBUz1DL7eBA= X-MC-Unique: cTwK-0zWN6OmkbhtKwRapg-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v5 07/16] qemu_iotests: insert gdbserver command line as wrapper for qemu binary Date: Fri, 4 Jun 2021 11:17:14 +0200 Message-Id: <20210604091723.13419-8-eesposit@redhat.com> In-Reply-To: <20210604091723.13419-1-eesposit@redhat.com> References: <20210604091723.13419-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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+importer2=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.37, 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+importer2=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 d4bfd8f1d6..c547e8c07b 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -583,7 +583,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.30.2 From nobody Sat May 4 19:25:17 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622798824; cv=none; d=zohomail.com; s=zohoarc; b=BpetUqJCpW6NHtNnf8HiMI68ZTv95t0fbh/aKzb7xj+qpkW/3tKTUhSvhCXWihlCdMHOrRxWdN2DQXkus1Bdr5UEOXWdcGhQmzPaSJNj6KoGtlpTCKwRrAsZDGJdMzUhQEtQ56caej1arGB4dLAY+hrxoiHPLW4z4r6vo09j2BA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622798824; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5a2BmVfEEkHjOY+zCGoKZBiPMuACLwcCbgkzHuyqUgU=; b=ksRCpJE5tw2U1lTxF/ALH9Afu1Gcfd9xZ/BkjhG6vNSMztEq0371/SgdOwwBsJEyxo8Jt0y1IrVzMdmthpi5ZxkhVS4nF3GOh5Ru0iXA4k2hrk9f9rVC825oojC4fEdM9m2lMoPv1uAqtaidvNFhqPm8UMxoMCpOD+eNnfy9WtI= ARC-Authentication-Results: i=1; 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+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162279882467476.57295755997177; Fri, 4 Jun 2021 02:27:04 -0700 (PDT) Received: from localhost ([::1]:43616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp66Z-0005bz-MC for importer2@patchew.org; Fri, 04 Jun 2021 05:27:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xn-0002K9-JM for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:18:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54433) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xm-00031M-29 for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:17:59 -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-10-OuYhVJK7NKiEGoNEq7R7Gw-1; Fri, 04 Jun 2021 05:17:55 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 08B74107AD29; Fri, 4 Jun 2021 09:17:55 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-43.ams2.redhat.com [10.36.115.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 000A477F12; Fri, 4 Jun 2021 09:17:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622798277; 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=5a2BmVfEEkHjOY+zCGoKZBiPMuACLwcCbgkzHuyqUgU=; b=JKEZuQ7V6UCbT8SkUZfejBBzGP0DQwzYpaJrTsdJsyY0EGdghgBbCD4va60gdafJ9AzoK1 uvn+eRqVzOcj3zWUCrhKuzn3wtp3Yk42qwP/Tmkg1KjwUKeDOUHNZatxMyzsBoAf1xLEf4 2sM5aE2Qhhy7S9Wz+mvr+hryIEi1KgM= X-MC-Unique: OuYhVJK7NKiEGoNEq7R7Gw-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v5 08/16] qemu-iotests: add gdbserver option to script tests too Date: Fri, 4 Jun 2021 11:17:15 +0200 Message-Id: <20210604091723.13419-9-eesposit@redhat.com> In-Reply-To: <20210604091723.13419-1-eesposit@redhat.com> References: <20210604091723.13419-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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+importer2=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.37, 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/common.rc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index e2f81cd41b..ad0c449863 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.30.2 From nobody Sat May 4 19:25:17 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622798709; cv=none; d=zohomail.com; s=zohoarc; b=cEjH9jqG+84SWDirES6xokSYu7WgmOmO5XvYUJKGgL4sYsH7w3h4PXYENPvXH3bQ831vPcREWz7LY50HWY5xjH1sNzqVNo3DSIoQuVIBdcdTDNLpaXgU52XvpkzWNsc7UJE7u++PwiH9Q4aYlZ19ubCxtj+YaWWq4yIl0jn9pz8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622798709; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ihyFd4Q27trUad5U1XblK/J4dl9dB4wj+LF/BGVOeVo=; b=CPw+cxyt6bTPu66nswSrefXTlFBUJdvNUI9LIBaxdP92PuQZlAwEZf652LdE6yHdJ6bqbOS6qHEpkOYbsiv53r661bO+kBuIk+RvW6VXJ4x1Z0u1rVj1eDdlWA/rbQI0DoBRwU08Fe4FDJfdFNPNZ9eNRwsdoCAV9KbW0RivZ8I= ARC-Authentication-Results: i=1; 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+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622798709430497.4694383571871; Fri, 4 Jun 2021 02:25:09 -0700 (PDT) Received: from localhost ([::1]:38914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp64i-0002Op-EW for importer2@patchew.org; Fri, 04 Jun 2021 05:25:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xs-0002NV-6s for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:18:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26383) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xq-00033y-P0 for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:18:03 -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-321-KjtayC8BODyYE1DXPl4MEw-1; Fri, 04 Jun 2021 05:17:58 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B0AD21854E21; Fri, 4 Jun 2021 09:17:57 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-43.ams2.redhat.com [10.36.115.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6D95B60CEC; Fri, 4 Jun 2021 09:17:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622798281; 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=ihyFd4Q27trUad5U1XblK/J4dl9dB4wj+LF/BGVOeVo=; b=Bsyhux7eLjrR6rNU+TR1cy+bTJihloKeApKT5QV+cCYpNfBTGaaMNzAK+X011IJUrPY5Xc X2+ubXtdBaK0bw0L9plDAs9vU+0cbbx3Uf4Ef6BhECOPe3TzIVyJ8AbHaurkLLMJgx4j// T0hPFgtbkl6dUk3cisNWbUz80TG7Yo4= X-MC-Unique: KjtayC8BODyYE1DXPl4MEw-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v5 09/16] docs/devel/testing: add --gdb option to the debugging section of QEMU iotests Date: Fri, 4 Jun 2021 11:17:16 +0200 Message-Id: <20210604091723.13419-10-eesposit@redhat.com> In-Reply-To: <20210604091723.13419-1-eesposit@redhat.com> References: <20210604091723.13419-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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+importer2=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.37, 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+importer2=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..11a0359218 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 fo= r 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.30.2 From nobody Sat May 4 19:25:17 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622798396; cv=none; d=zohomail.com; s=zohoarc; b=PbKG5y9459U42ds11qs/vWjoyeccHPtU8gxMkccCyK1xTK8R56BbzXcm20b9tUkFuzFCofeQTINhXfbJBWf1FVx9HknCUWWIcjKC5QQ45J7iWbFK6jkxaftM0lE/WOBzW63joxYy6A7wozJ6QmFXFz5HQh5b93h5XpGCQQ3fsjE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622798396; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7NJdasig8ZZuZl852tVbu7I3CTPxp3eSOQa5BSsNJIY=; b=lKkZOiqcXV4gQNyOimzEMQJSxDUqZEK8PD3HLrQem2ODMzw21KpRdkF1EzrXbEurY9HRzVxiKwBItnVt2VgJgF/5MbyjP5x5EtET2eEBnrfdBAyQeyuvCmHCelPS3CTZ4h82XbEkhuWv4Qt0UA9L11IrU9gK42DmIRYbcHlJfDc= ARC-Authentication-Results: i=1; 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+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622798396979465.7844501650942; Fri, 4 Jun 2021 02:19:56 -0700 (PDT) Received: from localhost ([::1]:48890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp5ze-0006xL-Rm for importer2@patchew.org; Fri, 04 Jun 2021 05:19:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xt-0002O7-6f for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:18:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xr-00034c-Ab for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:18:04 -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-475-ZiSVStR1OqOTwIdnh5n9Zg-1; Fri, 04 Jun 2021 05:18:01 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2CC94802B4F; Fri, 4 Jun 2021 09:18:00 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-43.ams2.redhat.com [10.36.115.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0FCF36A042; Fri, 4 Jun 2021 09:17:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622798282; 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=7NJdasig8ZZuZl852tVbu7I3CTPxp3eSOQa5BSsNJIY=; b=Unq6cq6IGqaq8+hoh8xH/QFWL46hpgQtLaym+EAyFN+9w0B8jJCkv6BbLqwJZaVNULq1bT GUkjD+hNBtwPvOD0y7cT8f3iCG0TQWbjBpL/8r5u/mG5AXI6MpWVLnN5RfBzfAOebYJfLB CuW7jc2k1/aps9uB6+RrwptQlwo1Q7I= X-MC-Unique: ZiSVStR1OqOTwIdnh5n9Zg-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v5 10/16] qemu-iotests: extend the check script to prepare supporting valgrind for python tests Date: Fri, 4 Jun 2021 11:17:17 +0200 Message-Id: <20210604091723.13419-11-eesposit@redhat.com> In-Reply-To: <20210604091723.13419-1-eesposit@redhat.com> References: <20210604091723.13419-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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+importer2=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.37, 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+importer2=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 1dba4218c0..e6aa110715 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 c547e8c07b..3fa1bd0ab5 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.30.2 From nobody Sat May 4 19:25:17 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622798850; cv=none; d=zohomail.com; s=zohoarc; b=GIyENADmaq1LxERafT4gmOWvFqTaRMsWjIacLKiHpsTisDPD6jdK9UJ27GJ9pvwFgYsCk47vc/mmSpBFFFnaW/gL6n1qWcuWvHvipIOPgdsN2z7HMjgGEkgYRegX4Doxs++YZ2ARdOfg9YkikRJst0fv+WqNUu2u+fZ/DsaEUbE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622798850; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=t/c9Ng2mhMMGjKmpEuwmcl/0yHu2PZ2j/ZiO9/xT/Y4=; b=YcBl4q2ZDl5NBMY2TDaSliuL8SVM4GwTmpIGo9u94Z2tlvEGNtrS31uInQRDRJg9I+m8IU0qie9m324yF3SFM+r/6bk4DFNhb6/wqszI0r1L2z3EZekjwiZIZ+dE49hiq4ov5epaAs6q4freoRT5HpyATOAHCS1oTqmflsgmkhU= ARC-Authentication-Results: i=1; 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+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622798850539891.1354533736486; Fri, 4 Jun 2021 02:27:30 -0700 (PDT) Received: from localhost ([::1]:45372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp66y-0006nP-FH for importer2@patchew.org; Fri, 04 Jun 2021 05:27:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xz-0002Z4-7A for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:18:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26822) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xw-000382-7G for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:18:10 -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-555-JmvLF_pRNjeTm26KN1_tYQ-1; Fri, 04 Jun 2021 05:18:04 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 00DD380364C; Fri, 4 Jun 2021 09:18:03 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-43.ams2.redhat.com [10.36.115.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8CB966A042; Fri, 4 Jun 2021 09:18:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622798287; 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=t/c9Ng2mhMMGjKmpEuwmcl/0yHu2PZ2j/ZiO9/xT/Y4=; b=MqA3befE5Ux3EhwQJvx3GgW7eUnAqKxQ5ackzVFJORbE9uCt2dGZmqnE/lBvHg9poXfMt+ xY1AINQGfSWNbQESVtVVEYPR7FHIW3ZJxjbC5r2SsJzcWH2uX0zPtk48J2JTKQDbv0lVbW WeLluHIMzVaD92vM2drF7MjtvtV81zA= X-MC-Unique: JmvLF_pRNjeTm26KN1_tYQ-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v5 11/16] qemu-iotests: extend QMP socket timeout when using valgrind Date: Fri, 4 Jun 2021 11:17:18 +0200 Message-Id: <20210604091723.13419-12-eesposit@redhat.com> In-Reply-To: <20210604091723.13419-1-eesposit@redhat.com> References: <20210604091723.13419-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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+importer2=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.37, 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+importer2=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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 3fa1bd0ab5..e4a299b9f3 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -501,7 +501,7 @@ def timeout(self, signum, frame): def NoTimeout(): yield =20 -if qemu_gdb: +if qemu_gdb or qemu_valgrind: Timeout =3D NoTimeout =20 def file_pattern(name): @@ -593,7 +593,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.30.2 From nobody Sat May 4 19:25:17 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622798956; cv=none; d=zohomail.com; s=zohoarc; b=bJ3PM3NsLHoR/W3Jv8xzG52C/BXRqts8cygzTuA3Y1kusPo+VtLB/XUei10YnX+YJXtCtVDOYRYN+YXrHHeDkNRideZ7oeC1+eUWJnw1UABZJH16yZ+DRAcd43XKNpgQgHzI2f1BOvUeqOU9c7F81wWm/mpHHJrlRDi3yvkTftg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622798956; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KDonHJZerteoi5dK7ji+31Ra1Plb4CdTRf6DlSZAn44=; b=Xh9kwWTtEqTx+L8AGqHs6kx4IbSnm4VpzOkOJYKq4sKseQyP3qLslKAGNyqnW5VzgFcfU9jv2eFVhhDu1/2hM8yeOM+ZECZqsB5e2wbPYsXVMLL4hjGTSfWdTxZBfJd3cRqCy7fTiQ/Z3X9cRlcbDWvvmS7m/2L9E/fVR4KCaH4= ARC-Authentication-Results: i=1; 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+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622798956661409.5971479565985; Fri, 4 Jun 2021 02:29:16 -0700 (PDT) Received: from localhost ([::1]:52834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp68h-0003LB-Ko for importer2@patchew.org; Fri, 04 Jun 2021 05:29:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5y0-0002dW-C3 for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:18:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:22213) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xy-00039k-Jj for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:18:12 -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-530-ZqV_BMpPPseUlN6XY0954w-1; Fri, 04 Jun 2021 05:18:06 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9618A801B12; Fri, 4 Jun 2021 09:18:05 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-43.ams2.redhat.com [10.36.115.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6AF766A042; Fri, 4 Jun 2021 09:18:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622798290; 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=KDonHJZerteoi5dK7ji+31Ra1Plb4CdTRf6DlSZAn44=; b=MIXj74SrZ2A4uJY+Xc+ecTuwdqu33jBls/1PXdZX1RHdBcV1YQkoLb0XUi6uMHE0AHKgIy owl9qXbkqCCAxjjlgIp7k/Tul6ENy+5X5tRJCFSFx3hG+2SHZVErfDU+deG7LdcYadFXgP 1X21nf8BEVwNNBB6vrqIEV+GB3V3glQ= X-MC-Unique: ZqV_BMpPPseUlN6XY0954w-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v5 12/16] qemu-iotests: allow valgrind to read/delete the generated log file Date: Fri, 4 Jun 2021 11:17:19 +0200 Message-Id: <20210604091723.13419-13-eesposit@redhat.com> In-Reply-To: <20210604091723.13419-1-eesposit@redhat.com> References: <20210604091723.13419-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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+importer2=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.37, 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+importer2=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 e4a299b9f3..89099c13e6 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -601,6 +601,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.30.2 From nobody Sat May 4 19:25:17 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622798866; cv=none; d=zohomail.com; s=zohoarc; b=FHi6LGXPptNDw28bLL4QLf2TRzVAeAWGBUuytHvJjihBKBVhD/ekP2GwEcKJlae9o34Dfgr0p5kwdzQyj7BKoG2iGJoh1ObuZU+/DBxSAgnip5SnGP2HOZ120KNrw5PjTQ2pDgMpaCwihj6jHKSTC08bPw5s+8amWeGxtRzcdFw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622798866; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vN45Ueszfa9nhfU7081WFxJHOmzSyF59jtNdm6DW16M=; b=XGLHYiFsS+8197OdCdxZtCrgPBR2aRhVAqezYvVjSs0QZSZUh1ajVoSX5nkvsTHfNkNwQr3MNFvT+KPIKQhauzaEY7fhtvcy6LgNL0DvDdgtdMN5zWY6mz8M+XNNd7pWF9cKgAyov/gCpqtx5wr/ASeMb4KZ2kcChS8/Fu2AIQA= ARC-Authentication-Results: i=1; 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+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622798866655350.6023625816549; Fri, 4 Jun 2021 02:27:46 -0700 (PDT) Received: from localhost ([::1]:46838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp67F-0007ku-L2 for importer2@patchew.org; Fri, 04 Jun 2021 05:27:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40662) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5y1-0002hw-Aa for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:18:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41559) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5xz-0003AZ-MK for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:18:13 -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-17-k-aXvbhxMwacutB9mYyNvg-1; Fri, 04 Jun 2021 05:18:09 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5CBBD107ACF7; Fri, 4 Jun 2021 09:18:08 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-43.ams2.redhat.com [10.36.115.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id E113C60CEC; Fri, 4 Jun 2021 09:18:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622798290; 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=vN45Ueszfa9nhfU7081WFxJHOmzSyF59jtNdm6DW16M=; b=L3OlyrxPHTXEurhHRpFjlHVpjtQRaSFWq88tM45b1qSjsM/vojORDq5NqlHlj8dBcU0Rn4 qA+5M1PLsOKzYWS0kTc+BLQMDaZuuSOCB+M/8BDcvbqydGnY0LQ7bYWywIxBst07kIPW6P wtF42tSCVh0X2M1Np94v9K+QGpFMcM8= X-MC-Unique: k-aXvbhxMwacutB9mYyNvg-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v5 13/16] qemu-iotests: insert valgrind command line as wrapper for qemu binary Date: Fri, 4 Jun 2021 11:17:20 +0200 Message-Id: <20210604091723.13419-14-eesposit@redhat.com> In-Reply-To: <20210604091723.13419-1-eesposit@redhat.com> References: <20210604091723.13419-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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+importer2=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.37, 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+importer2=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 89099c13e6..b9f0ac0ddd 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -594,7 +594,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.30.2 From nobody Sat May 4 19:25:17 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622799047; cv=none; d=zohomail.com; s=zohoarc; b=DyXPTH7iGNpkQ+dT9O+5bY6quPABoKsc0aN+SssulDRRsX97VtH18jw7Gc5ba2ieeNqcVxftKiNiS8KVDypCPs0Wqh8I00MECKqzdLTZ0mgvWG+iss043wO/+zS5Ee6fHELv4zGyc3G0eUm5/mBJpQbQXXxfO9fT25vhCjAAjmU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622799047; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=O6wd85K+aoftHPLHxd4fFwLrJN1hMNXPfaLKbl3ww8U=; b=cAzG5qkb1S1odwy/5ilm4enQKPDjQtQ60NGZtQ0Afh1Inw8roDLpy/EJ8fn2241voiQh9d5OcPcEUtpBjXrIBZIQkIQ6HXWx94FkgwjuOIKOoy1uow9hQgruHV5i+6v1KrR3nQXcl+8OzG5xW3rWve9eMPHUdRrkTRxu52VUBDs= ARC-Authentication-Results: i=1; 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+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622799047690259.91113818878443; Fri, 4 Jun 2021 02:30:47 -0700 (PDT) Received: from localhost ([::1]:57706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp6AA-0006bM-JY for importer2@patchew.org; Fri, 04 Jun 2021 05:30:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5y6-000354-VK for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:18:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49715) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5y4-0003Df-2Z for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:18: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-165-A0eZI4jnPiqnB8EqxV_Gpg-1; Fri, 04 Jun 2021 05:18:12 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 32E5B101371C; Fri, 4 Jun 2021 09:18:11 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-43.ams2.redhat.com [10.36.115.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA6DF6A042; Fri, 4 Jun 2021 09:18:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622798295; 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=O6wd85K+aoftHPLHxd4fFwLrJN1hMNXPfaLKbl3ww8U=; b=aUxRJUZ+raKVDmTTL0mg626YvVq22TaiAaWtzK9U4kWl8FEQYsvmESOiip45ZVXTWHJHtT MbhH9vy+ftRD3xd95pxd9R+Of3L/hie294SG2417Qb9J9MaMYvwFH7/zn7rYzBY37R9Wz+ eC2AIG/fs/6klu//e+ENRXEOxM077gs= X-MC-Unique: A0eZI4jnPiqnB8EqxV_Gpg-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v5 14/16] docs/devel/testing: add --valgrind option to the debug section of QEMU iotests Date: Fri, 4 Jun 2021 11:17:21 +0200 Message-Id: <20210604091723.13419-15-eesposit@redhat.com> In-Reply-To: <20210604091723.13419-1-eesposit@redhat.com> References: <20210604091723.13419-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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+importer2=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.37, 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+importer2=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 11a0359218..9cac707ee5 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.30.2 From nobody Sat May 4 19:25:17 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622799128; cv=none; d=zohomail.com; s=zohoarc; b=H9q1n867bIsj/CbCopkBT1/SebGPLPYaZl8Lp8yasqzO7dI+m6R7TTTBz/vfpww5eHvh4TZUDU//JRzAwzKo8BSY7olQ90tXTPNNZK44OOFq2Ay3/GLx7SsEjdnl2qq4SGnu1yyooxkSOOeMkBwjNNcsvEBAcsUUiNHS/XgfIBk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622799128; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LGnYBo7nfm7+PvbBwulqOvGOR0lpYal3Pg0J+2HBRnY=; b=VtwnT8pxN7K7eTkf4vIAYRr0IfYOO/zUxPiYGobgJci49s1/VZZSYfGOEE14hHOd2rWiHKd61dmLGCtvcFpAGd8YMy9ZM927BKHZKMiTOwWZravAXWloLE0A+f7faNsbTJ70HLmjO96h+fcQRyipUz2Ckg/ec0mJ1G8PHAif8d8= ARC-Authentication-Results: i=1; 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+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622799128211377.23138284116305; Fri, 4 Jun 2021 02:32:08 -0700 (PDT) Received: from localhost ([::1]:60772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp6BT-0000HZ-5D for importer2@patchew.org; Fri, 04 Jun 2021 05:32:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5yA-0003Ii-An for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:18:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58513) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5y7-0003Fw-WB for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:18:22 -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-391-AWrwJKWlO1G6aAkxCWq0gQ-1; Fri, 04 Jun 2021 05:18:17 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5D65F101372A; Fri, 4 Jun 2021 09:18:16 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-43.ams2.redhat.com [10.36.115.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80C776A05A; Fri, 4 Jun 2021 09:18:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622798299; 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=LGnYBo7nfm7+PvbBwulqOvGOR0lpYal3Pg0J+2HBRnY=; b=f9MkQssZvFjnZWAqTA8rXZj97hGRh6qIoK/ze7fxjv1Qcrhpornw7zSvTZ0uzTMuWnxEoX Oee9IEoB59siuwAbRe1iKHmOoGROZCZksswNrvcX8+XJN0aNQgJ/avrqsWY9/bs70o4NWl aBm2fWMC8+hcS6gDjEWgqEeys0Embmo= X-MC-Unique: AWrwJKWlO1G6aAkxCWq0gQ-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v5 15/16] qemu-iotests: add option to show qemu binary logs on stdout Date: Fri, 4 Jun 2021 11:17:22 +0200 Message-Id: <20210604091723.13419-16-eesposit@redhat.com> In-Reply-To: <20210604091723.13419-1-eesposit@redhat.com> References: <20210604091723.13419-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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+importer2=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.37, 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+importer2=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 e6aa110715..2371d13c8e 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 b9f0ac0ddd..ac2391f380 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', '.') @@ -616,6 +618,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.30.2 From nobody Sat May 4 19:25:17 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622798578; cv=none; d=zohomail.com; s=zohoarc; b=bXP78H1A4fClC82b/B/vmI+NY97pUz1yvPrpAKfEtoK4DDMrj51awNYpo2fQlXS7jN6dvLqNtIj6gltBm4dg3FEvOJ9aYgAuHmaXyBMOE2qzmkeTpERX9dTY2Y5GR/2Xe7dZouNzfnFWJytmE/FsP84WTGXWWhlinYeNQNP1vrM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622798578; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0/RgPuHGLRxUGh1foCSBAM/xt+P5Sg/bNpcwuLMaKOc=; b=KYzltbmxSG2kx5qLLV9IlLmENKV67miI1l0YmPtqukSaHul7hBsVFpnh46c+m5mfv1yOdRk74fxdHWqrbrE0hNqsqxblj3rZum9gYWI3yZ8nps5swP21vks3CKTRbhM81cROLi4MFxOsazJG3PcoPhe2/i5XOCVZLu4TrndXX3I= ARC-Authentication-Results: i=1; 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+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622798578335684.9387186729786; Fri, 4 Jun 2021 02:22:58 -0700 (PDT) Received: from localhost ([::1]:58078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp62b-0004mn-A7 for importer2@patchew.org; Fri, 04 Jun 2021 05:22:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5yC-0003Rt-Ov for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:18:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50086) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp5yA-0003Hr-5A for qemu-devel@nongnu.org; Fri, 04 Jun 2021 05:18:24 -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-251-E_Gaat4PODuK-3tIFpg5zA-1; Fri, 04 Jun 2021 05:18:20 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EEB3B80364C; Fri, 4 Jun 2021 09:18:18 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-43.ams2.redhat.com [10.36.115.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id BDBE86A042; Fri, 4 Jun 2021 09:18:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622798301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0/RgPuHGLRxUGh1foCSBAM/xt+P5Sg/bNpcwuLMaKOc=; b=ej8kFEyv98hp2FdGKbtKODIDFDPAZV0b3AIi1unyMx0XfkoEjwkYRKaXxlqlWMRLJnQVyA MmXCMG1X0bV4Rl1BcZWka0aJqAiUOLgDQgmISuidgWEs/vAPbfnMxaQtRcLSA+0ViosbzQ K22jFOkmJ7/uyAZQhoszznJGUyEfvik= X-MC-Unique: E_Gaat4PODuK-3tIFpg5zA-1 From: Emanuele Giuseppe Esposito To: qemu-block@nongnu.org Subject: [PATCH v5 16/16] docs/devel/testing: add -p option to the debug section of QEMU iotests Date: Fri, 4 Jun 2021 11:17:23 +0200 Message-Id: <20210604091723.13419-17-eesposit@redhat.com> In-Reply-To: <20210604091723.13419-1-eesposit@redhat.com> References: <20210604091723.13419-1-eesposit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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+importer2=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.37, 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+importer2=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 9cac707ee5..c038ca93d4 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.30.2