From nobody Tue May 7 23:02:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538666208393320.93159115402364; Thu, 4 Oct 2018 08:16:48 -0700 (PDT) Received: from localhost ([::1]:56253 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g85Mp-0007RD-RZ for importer@patchew.org; Thu, 04 Oct 2018 11:16:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g85Kp-0005vl-8l for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g85Km-0006Bf-5W for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54254) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g85Kl-0006BD-VZ for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:36 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 47A6D3002710; Thu, 4 Oct 2018 15:14:35 +0000 (UTC) Received: from dhcp-17-10.bos.redhat.com (dhcp-17-10.bos.redhat.com [10.18.17.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4CBAF1062258; Thu, 4 Oct 2018 15:14:34 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Date: Thu, 4 Oct 2018 11:14:23 -0400 Message-Id: <20181004151429.7232-2-crosa@redhat.com> In-Reply-To: <20181004151429.7232-1-crosa@redhat.com> References: <20181004151429.7232-1-crosa@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 04 Oct 2018 15:14:35 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/7] Acceptance Tests: improve docstring on pick_default_qemu_bin() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Eduardo Habkost , Laszlo Ersek , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Caio Carrara , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Making it clear what is returned by this utility function. Signed-off-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/acceptance/avocado_qemu/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 1e54fd5932..d8d5b48dac 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -27,6 +27,10 @@ def pick_default_qemu_bin(): """ Picks the path of a QEMU binary, starting either in the current working directory or in the source tree root directory. + + :returns: the path to the default QEMU binary or None if one could not + be found + :rtype: str or None """ arch =3D os.uname()[4] qemu_bin_relative_path =3D os.path.join("%s-softmmu" % arch, --=20 2.17.1 From nobody Tue May 7 23:02:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15386662068961021.8998233200007; Thu, 4 Oct 2018 08:16:46 -0700 (PDT) Received: from localhost ([::1]:56252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g85Mr-0007Qu-HK for importer@patchew.org; Thu, 04 Oct 2018 11:16:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g85Kp-0005vk-8a for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g85Kn-0006CX-Fe for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54278) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g85Kn-0006By-66 for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:37 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 752E530E6852; Thu, 4 Oct 2018 15:14:36 +0000 (UTC) Received: from dhcp-17-10.bos.redhat.com (dhcp-17-10.bos.redhat.com [10.18.17.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 691D81062253; Thu, 4 Oct 2018 15:14:35 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Date: Thu, 4 Oct 2018 11:14:24 -0400 Message-Id: <20181004151429.7232-3-crosa@redhat.com> In-Reply-To: <20181004151429.7232-1-crosa@redhat.com> References: <20181004151429.7232-1-crosa@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 04 Oct 2018 15:14:36 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/7] Acceptance Tests: introduce arch parameter and attribute X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Eduardo Habkost , Laszlo Ersek , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Caio Carrara , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" On a number of different scenarios, such as when choosing a QEMU binary to be used on tests (or a image to use to boot a test VM), it's useful to define the architecture that should be used. This introduces both a test parameter and a test instance attribute, that will contain such a value. The selection of the default QEMU binary, if one is not given explicitly, has also been changed to look at the arch attribute. Signed-off-by: Cleber Rosa --- docs/devel/testing.rst | 18 ++++++++++++++++++ tests/acceptance/avocado_qemu/__init__.py | 13 ++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 727c4019b5..4178ae5022 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -659,6 +659,17 @@ vm A QEMUMachine instance, initially configured according to the given ``qemu_bin`` parameter. =20 +arch +~~~~ + +The architecture that will be used on a number of different +scenarios. For instance, when a QEMU binary is not explicitly given, +the one selected will depend on this attribute. + +The ``arch`` attribute will be set to the test parameter of the same +name, and if one is not given explicitly, it will default to the +system architecture (as given by ``uname``). + qemu_bin ~~~~~~~~ =20 @@ -681,6 +692,13 @@ like the following: =20 PARAMS (key=3Dqemu_bin, path=3D*, default=3Dx86_64-softmmu/qemu-system-x= 86_64) =3D> 'x86_64-softmmu/qemu-system-x86_64 =20 +arch +~~~~ + +The architecture that will be used on a number of different scenarios. +This parameter has a direct relation with the ``arch`` attribute. If +not given, it will default to None. + qemu_bin ~~~~~~~~ =20 diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index d8d5b48dac..9329d9b9ec 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -23,16 +23,22 @@ def is_readable_executable_file(path): return os.path.isfile(path) and os.access(path, os.R_OK | os.X_OK) =20 =20 -def pick_default_qemu_bin(): +def pick_default_qemu_bin(arch=3DNone): """ Picks the path of a QEMU binary, starting either in the current working directory or in the source tree root directory. =20 + :param arch: the arch to use when looking for a QEMU binary (the target + will match the arch given). If None (the default) arch + will be the current host system arch (as given by + :func:`os.uname`). + :param arch: str :returns: the path to the default QEMU binary or None if one could not be found :rtype: str or None """ - arch =3D os.uname()[4] + if arch is None: + arch =3D os.uname()[4] qemu_bin_relative_path =3D os.path.join("%s-softmmu" % arch, "qemu-system-%s" % arch) if is_readable_executable_file(qemu_bin_relative_path): @@ -47,8 +53,9 @@ def pick_default_qemu_bin(): class Test(avocado.Test): def setUp(self): self.vm =3D None + self.arch =3D self.params.get('arch', default=3Dos.uname()[4]) self.qemu_bin =3D self.params.get('qemu_bin', - default=3Dpick_default_qemu_bin()) + default=3Dpick_default_qemu_bin(se= lf.arch)) if self.qemu_bin is None: self.cancel("No QEMU binary defined or found in the source tre= e") self.vm =3D QEMUMachine(self.qemu_bin) --=20 2.17.1 From nobody Tue May 7 23:02:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538666205951542.6188213292296; Thu, 4 Oct 2018 08:16:45 -0700 (PDT) Received: from localhost ([::1]:56251 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g85Mq-0007QH-PK for importer@patchew.org; Thu, 04 Oct 2018 11:16:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g85Kp-0005vj-8Y for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g85Ko-0006D8-Dz for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58526) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g85Ko-0006Cm-7o for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:38 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8F4D688309; Thu, 4 Oct 2018 15:14:37 +0000 (UTC) Received: from dhcp-17-10.bos.redhat.com (dhcp-17-10.bos.redhat.com [10.18.17.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B0691062253; Thu, 4 Oct 2018 15:14:36 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Date: Thu, 4 Oct 2018 11:14:25 -0400 Message-Id: <20181004151429.7232-4-crosa@redhat.com> In-Reply-To: <20181004151429.7232-1-crosa@redhat.com> References: <20181004151429.7232-1-crosa@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 04 Oct 2018 15:14:37 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/7] scripts/qemu.py: add method and private attribute for arch X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Eduardo Habkost , Laszlo Ersek , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Caio Carrara , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Because some sane defaults may require the knowledge of the arch, let's give the QEMUMachine the opportunity to hold that information. Signed-off-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- scripts/qemu.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/qemu.py b/scripts/qemu.py index f099ce7278..d9e24a0c1a 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -113,6 +113,7 @@ class QEMUMachine(object): self._test_dir =3D test_dir self._temp_dir =3D None self._launched =3D False + self._arch =3D None self._machine =3D None self._console_device_type =3D None self._console_address =3D None @@ -406,6 +407,12 @@ class QEMUMachine(object): ''' self._args.extend(args) =20 + def set_arch(self, arch): + """ + Sets the architecture of this machine + """ + self._arch =3D arch + def set_machine(self, machine_type): ''' Sets the machine type --=20 2.17.1 From nobody Tue May 7 23:02:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538666408037957.1598103399929; Thu, 4 Oct 2018 08:20:08 -0700 (PDT) Received: from localhost ([::1]:56266 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g85Q1-0001aG-7s for importer@patchew.org; Thu, 04 Oct 2018 11:20:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g85Kq-0005w4-FD for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g85Kp-0006Dw-NJ for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52308) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g85Kp-0006DO-Ep for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:39 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AADA931524D3; Thu, 4 Oct 2018 15:14:38 +0000 (UTC) Received: from dhcp-17-10.bos.redhat.com (dhcp-17-10.bos.redhat.com [10.18.17.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A8A961062253; Thu, 4 Oct 2018 15:14:37 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Date: Thu, 4 Oct 2018 11:14:26 -0400 Message-Id: <20181004151429.7232-5-crosa@redhat.com> In-Reply-To: <20181004151429.7232-1-crosa@redhat.com> References: <20181004151429.7232-1-crosa@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 04 Oct 2018 15:14:38 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 4/7] scripts/qemu.py: set predefined machine type based on arch X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Eduardo Habkost , Laszlo Ersek , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Caio Carrara , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Some targets require a machine type to be set, as there's no default (aarch64 is one example). To give a consistent interface to users of this API, this changes set_machine() so that a predefined default can be used, if one is not given. The approach used is exactly the same with the console device type. Also, even when there's a default machine type, for some purposes, testing included, it's better if outside code is explicit about the machine type, instead of relying on whatever is set internally. Signed-off-by: Cleber Rosa --- scripts/qemu.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/scripts/qemu.py b/scripts/qemu.py index d9e24a0c1a..fca9b76990 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -36,6 +36,15 @@ CONSOLE_DEV_TYPES =3D { r'^s390-ccw-virtio.*': 'sclpconsole', } =20 +#: Maps archictures to the preferred machine type +MACHINE_TYPES =3D { + r'^aarch64$': 'virt', + r'^ppc$': 'g3beige', + r'^ppc64$': 'pseries', + r'^s390x$': 's390-ccw-virtio', + r'^x86_64$': 'q35', + } + =20 class QEMUMachineError(Exception): """ @@ -413,13 +422,24 @@ class QEMUMachine(object): """ self._arch =3D arch =20 - def set_machine(self, machine_type): + def set_machine(self, machine_type=3DNone): ''' Sets the machine type =20 If set, the machine type will be added to the base arguments of the resulting QEMU command line. ''' + if machine_type is None: + if self._arch is None: + raise QEMUMachineError("Can not set a default machine type= : " + "QEMU instance without a defined ar= ch") + for regex, machine in MACHINE_TYPES.items(): + if re.match(regex, self._arch): + machine_type =3D machine + break + if machine_type is None: + raise QEMUMachineError("Can not set a machine type: no " + "matching machine type definition") self._machine =3D machine_type =20 def set_console(self, device_type=3DNone): --=20 2.17.1 From nobody Tue May 7 23:02:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538666407624261.7347624568688; Thu, 4 Oct 2018 08:20:07 -0700 (PDT) Received: from localhost ([::1]:56267 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g85Q3-0001c7-Ua for importer@patchew.org; Thu, 04 Oct 2018 11:20:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g85Kr-0005wS-D7 for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g85Kq-0006EZ-Kc for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49216) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g85Kq-0006EB-Eh for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:40 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C2DBD30001E1; Thu, 4 Oct 2018 15:14:39 +0000 (UTC) Received: from dhcp-17-10.bos.redhat.com (dhcp-17-10.bos.redhat.com [10.18.17.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C49671062253; Thu, 4 Oct 2018 15:14:38 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Date: Thu, 4 Oct 2018 11:14:27 -0400 Message-Id: <20181004151429.7232-6-crosa@redhat.com> In-Reply-To: <20181004151429.7232-1-crosa@redhat.com> References: <20181004151429.7232-1-crosa@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Thu, 04 Oct 2018 15:14:39 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 5/7] Acceptance Tests: set machine type X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Eduardo Habkost , Laszlo Ersek , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Caio Carrara , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" By setting the machine type, even if it's the one that will be picked based on the arch, it's possible to run the same tests with targets that require a machine type (in addition to those that don't). Given that only boot_linux_console.py contains code specific to x86_64 (an explicit reference to the kernel image that will be used) the other tests can be used to test different targets: $ avocado run -p arch=3Daarch64 --filter-by-tags=3D'-x86_64' -- tests/acc= eptance/ Eventually, to reduce boiler plate code, the idea is to concentrate the basic configuration (arch, machine, console) in either another utility method, or make that happen by default. This is of course the subject of a future discussion. Signed-off-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- tests/acceptance/boot_linux_console.py | 3 ++- tests/acceptance/version.py | 2 ++ tests/acceptance/vnc.py | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot= _linux_console.py index 98324f7591..58032f971c 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -30,7 +30,8 @@ class BootLinuxConsole(Test): kernel_hash =3D '238e083e114c48200f80d889f7e32eeb2793e02a' kernel_path =3D self.fetch_asset(kernel_url, asset_hash=3Dkernel_h= ash) =20 - self.vm.set_machine('pc') + self.vm.set_arch(self.arch) + self.vm.set_machine() self.vm.set_console() kernel_command_line =3D 'console=3DttyS0' self.vm.add_args('-kernel', kernel_path, diff --git a/tests/acceptance/version.py b/tests/acceptance/version.py index 13b0a7440d..7a3a20945f 100644 --- a/tests/acceptance/version.py +++ b/tests/acceptance/version.py @@ -18,6 +18,8 @@ class Version(Test): :avocado: tags=3Dquick """ def test_qmp_human_info_version(self): + self.vm.set_arch(self.arch) + self.vm.set_machine() self.vm.launch() res =3D self.vm.command('human-monitor-command', command_line=3D'info version') diff --git a/tests/acceptance/vnc.py b/tests/acceptance/vnc.py index b1ef9d71b1..4a8a83025f 100644 --- a/tests/acceptance/vnc.py +++ b/tests/acceptance/vnc.py @@ -16,6 +16,11 @@ class Vnc(Test): :avocado: enable :avocado: tags=3Dvnc,quick """ + def setUp(self): + super(Vnc, self).setUp() + self.vm.set_arch(self.arch) + self.vm.set_machine() + def test_no_vnc(self): self.vm.add_args('-nodefaults', '-S') self.vm.launch() --=20 2.17.1 From nobody Tue May 7 23:02:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 153866641018868.93590180820388; Thu, 4 Oct 2018 08:20:10 -0700 (PDT) Received: from localhost ([::1]:56264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g85Q0-0001Yz-3a for importer@patchew.org; Thu, 04 Oct 2018 11:20:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g85Ks-0005xf-DP for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g85Kr-0006F7-OB for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28557) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g85Kr-0006Ei-IB for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:41 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DCA8681DED; Thu, 4 Oct 2018 15:14:40 +0000 (UTC) Received: from dhcp-17-10.bos.redhat.com (dhcp-17-10.bos.redhat.com [10.18.17.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E01351062258; Thu, 4 Oct 2018 15:14:39 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Date: Thu, 4 Oct 2018 11:14:28 -0400 Message-Id: <20181004151429.7232-7-crosa@redhat.com> In-Reply-To: <20181004151429.7232-1-crosa@redhat.com> References: <20181004151429.7232-1-crosa@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 04 Oct 2018 15:14:40 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 6/7] Acceptance Tests: add variants definition for architectures X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Eduardo Habkost , Laszlo Ersek , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Caio Carrara , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" One of the Avocado features relevant to virtualization testing is the ability to reuse tests in different scenarios, known as variants. This adds a JSON based variants file, that can be used to run most tests in a number of different architectures. It can be run with: $ avocado run \ --json-variants-load=3Dtests/acceptance/variants/arch.json \ --filter-by-tags=3D'-x86_64' -- tests/acceptance/ Currently this covers 5 architectures, resulting in the execution of 25 different combinations. Signed-off-by: Cleber Rosa --- tests/acceptance/variants/arch.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/acceptance/variants/arch.json diff --git a/tests/acceptance/variants/arch.json b/tests/acceptance/variant= s/arch.json new file mode 100644 index 0000000000..a7a2570553 --- /dev/null +++ b/tests/acceptance/variants/arch.json @@ -0,0 +1 @@ +[{"paths":["/run/*"],"variant":[["/run/aarch64",[["/run/aarch64", "arch", = "aarch64"]]]],"variant_id": "aarch64"},{"paths":["/run/*"],"variant":[["/ru= n/ppc",[["/run/ppc", "arch", "ppc"]]]],"variant_id": "ppc"},{"paths":["/run= /*"],"variant":[["/run/ppc64",[["/run/ppc64", "arch", "ppc64"]]]],"variant_= id": "ppc64"},{"paths":["/run/*"],"variant":[["/run/s390x",[["/run/s390x", = "arch", "s390x"]]]],"variant_id": "s390x"},{"paths":["/run/*"],"variant":[[= "/run/x86_64",[["/run/x86_64", "arch", "x86_64"]]]],"variant_id": "x86_64"}] --=20 2.17.1 From nobody Tue May 7 23:02:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538666588897528.0354147223449; Thu, 4 Oct 2018 08:23:08 -0700 (PDT) Received: from localhost ([::1]:56285 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g85T1-0003pu-Of for importer@patchew.org; Thu, 04 Oct 2018 11:23:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g85Kt-0005yz-Lf for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g85Ks-0006FX-Sb for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53468) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g85Ks-0006FG-Mq for qemu-devel@nongnu.org; Thu, 04 Oct 2018 11:14:42 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 06C4730832EE; Thu, 4 Oct 2018 15:14:42 +0000 (UTC) Received: from dhcp-17-10.bos.redhat.com (dhcp-17-10.bos.redhat.com [10.18.17.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A1491062253; Thu, 4 Oct 2018 15:14:40 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Date: Thu, 4 Oct 2018 11:14:29 -0400 Message-Id: <20181004151429.7232-8-crosa@redhat.com> In-Reply-To: <20181004151429.7232-1-crosa@redhat.com> References: <20181004151429.7232-1-crosa@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 04 Oct 2018 15:14:42 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 7/7] Acceptance Tests: change the handling of tests for specific archs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Eduardo Habkost , Laszlo Ersek , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Caio Carrara , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" With the introduction of a variants file that can run the same tests on various architectures, it makes sense to make most tests to be reusable on those environments. The exception should be when a test is really testing a specific architecture feature. With the change proposed here, on a command line such as: $ avocado run \ --json-variants-load=3Dtests/acceptance/variants/arch.json \ -- tests/acceptance/ The boot_linux_console.py tests will appear as "CANCELED: Currently specific to the x86_64 arch", which is as a good thing when compared to being ignored by tags because: * The architecture specific parts can be addressed * It will be run on the matching architecture (as opposed to always being filtered out by the tags mechanism) * CANCELED tests do no influence negatively the overall job results, they're not considered an error or failure Signed-off-by: Cleber Rosa --- tests/acceptance/boot_linux_console.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot= _linux_console.py index 58032f971c..2fb5da63cb 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -19,12 +19,13 @@ class BootLinuxConsole(Test): and the kernel command line is properly passed from QEMU to the kernel =20 :avocado: enable - :avocado: tags=3Dx86_64 """ =20 timeout =3D 60 =20 def test(self): + if self.arch !=3D 'x86_64': + self.cancel('Currently specific to the x86_64 arch') kernel_url =3D ('https://mirrors.kernel.org/fedora/releases/28/' 'Everything/x86_64/os/images/pxeboot/vmlinuz') kernel_hash =3D '238e083e114c48200f80d889f7e32eeb2793e02a' --=20 2.17.1