From patchwork Fri May 3 00:41:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094604 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wCyT0HsDz9s7T for ; Fri, 3 May 2019 10:42:25 +1000 (AEST) Received: from localhost ([127.0.0.1]:60440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMHO-0003Sm-Vz for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:42:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMGg-0003QF-3s for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMGf-0006fO-3n for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47546) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMGe-0006ea-UW for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41: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 92FEF308FF14; Fri, 3 May 2019 00:41:34 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 22ADC1001E61; Fri, 3 May 2019 00:41:33 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:12 -0300 Message-Id: <20190503004130.8285-2-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> MIME-Version: 1.0 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]); Fri, 03 May 2019 00:41:34 +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] [PULL 01/19] tests/acceptance: show avocado test execution by default 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa The current version of the "check-acceptance" target will only show one line for execution of all tests. That's probably OK if the tests to be run are quick enough and they're always the same. But, there's already one test alone that takes on average ~5 seconds to run, we intend to adapt the list of tests to match the user's build environment (among other choices). Because of that, let's present the default Avocado UI by default. Users can always choose a different output by setting the AVOCADO_SHOW variable. Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Cornelia Huck Message-Id: <20190312171824.5134-2-crosa@redhat.com> Signed-off-by: Eduardo Habkost --- .travis.yml | 2 +- tests/Makefile.include | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e06aee9d0..e6f951e01a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -224,7 +224,7 @@ matrix: # Acceptance (Functional) tests - env: - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu" - - TEST_CMD="make AVOCADO_SHOW=app check-acceptance" + - TEST_CMD="make check-acceptance" addons: apt: packages: diff --git a/tests/Makefile.include b/tests/Makefile.include index e2432d5e77..445aa0bb12 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -1133,7 +1133,7 @@ TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results # Controls the output generated by Avocado when running tests. # Any number of command separated loggers are accepted. For more # information please refer to "avocado --help". -AVOCADO_SHOW=none +AVOCADO_SHOW=app ifneq ($(findstring v2,"v$(PYTHON_VERSION)"),v2) $(TESTS_VENV_DIR): $(TESTS_VENV_REQ) From patchwork Fri May 3 00:41:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094606 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wCyt0bHfz9s9N for ; Fri, 3 May 2019 10:42:46 +1000 (AEST) Received: from localhost ([127.0.0.1]:60448 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMHj-0003i8-V8 for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:42:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMGl-0003Ue-EC for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMGk-0006iA-Di for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49642) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMGk-0006hh-8I for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:42 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D55288318; Fri, 3 May 2019 00:41:41 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1BEFB60BFB; Fri, 3 May 2019 00:41:40 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:13 -0300 Message-Id: <20190503004130.8285-3-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 03 May 2019 00:41:41 +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] [PULL 02/19] tests/acceptance: 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa Making it clear what is returned by this utility function. Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck Message-Id: <20190312171824.5134-3-crosa@redhat.com> Signed-off-by: Eduardo Habkost --- tests/acceptance/avocado_qemu/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index a66ec72daa..b7c5d598d8 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 = os.uname()[4] qemu_bin_relative_path = os.path.join("%s-softmmu" % arch, From patchwork Fri May 3 00:41:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094608 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wD1T0Kx0z9s9N for ; Fri, 3 May 2019 10:45:01 +1000 (AEST) Received: from localhost ([127.0.0.1]:60464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMJv-0005nB-0z for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:44:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMGn-0003WV-BC for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMGm-0006jB-FS for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38460) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMGm-0006it-9l for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:44 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 90E0330917AA; Fri, 3 May 2019 00:41:43 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2507D5C26A; Fri, 3 May 2019 00:41:42 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:14 -0300 Message-Id: <20190503004130.8285-4-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 03 May 2019 00:41:43 +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] [PULL 03/19] tests/acceptance: fix doc reference to avocado_qemu directory 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa The "this directory" reference is misleading and confusing, it's a leftover from when this text was proposed in a README file inside the "tests/acceptance/avocado_qemu" directory. When that text was moved to the top level docs directory, the reference was not updated. Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck Message-Id: <20190312171824.5134-4-crosa@redhat.com> Signed-off-by: Eduardo Habkost --- docs/devel/testing.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 60f897d915..7c1b199323 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -590,8 +590,9 @@ Alternatively, follow the instructions on this link: Overview -------- -This directory provides the ``avocado_qemu`` Python module, containing -the ``avocado_qemu.Test`` class. Here's a simple usage example: +The ``tests/acceptance/avocado_qemu`` directory provides the +``avocado_qemu`` Python module, containing the ``avocado_qemu.Test`` +class. Here's a simple usage example: .. code:: From patchwork Fri May 3 00:41:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094609 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wD1r4tRRz9s7T for ; Fri, 3 May 2019 10:45:20 +1000 (AEST) Received: from localhost ([127.0.0.1]:60471 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMKE-00066p-En for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:45:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMGp-0003YK-Tt for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMGo-0006kG-LV for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41748) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMGo-0006jq-Dd for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:46 -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 B469658E5B; Fri, 3 May 2019 00:41:45 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4984F10027BA; Fri, 3 May 2019 00:41:45 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:15 -0300 Message-Id: <20190503004130.8285-5-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> MIME-Version: 1.0 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.39]); Fri, 03 May 2019 00:41:45 +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] [PULL 04/19] tests/acceptance: 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa It's useful to define the architecture that should be used in situations such as: * the intended target of the QEMU binary to be used on tests * the architecture of code to be run within the QEMU binary, such as a kernel image or a full blown guest OS image This commit introduces both a test parameter and a test instance attribute, that will contain such a value. Now, when the "arch" test parameter is given, it will influence the selection of the default QEMU binary, if one is not given explicitly by means of the "qemu_img" parameter. Signed-off-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck Message-Id: <20190312171824.5134-5-crosa@redhat.com> Signed-off-by: Eduardo Habkost --- docs/devel/testing.rst | 28 +++++++++++++++++++++++ tests/acceptance/avocado_qemu/__init__.py | 14 +++++++++--- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 7c1b199323..83bf9f09ac 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -727,6 +727,21 @@ vm A QEMUMachine instance, initially configured according to the given ``qemu_bin`` parameter. +arch +~~~~ + +The architecture can be used on different levels of the stack, e.g. by +the framework or by the test itself. At the framework level, it will +currently influence the selection of a QEMU binary (when one is not +explicitly given). + +Tests are also free to use this attribute value, for their own needs. +A test may, for instance, use the same value when selecting the +architecture of a kernel or disk image to boot a VM with. + +The ``arch`` attribute will be set to the test parameter of the same +name, and if one is not given explicitly, it will be set to ``None``. + qemu_bin ~~~~~~~~ @@ -749,6 +764,19 @@ like the following: PARAMS (key=qemu_bin, path=*, default=x86_64-softmmu/qemu-system-x86_64) => 'x86_64-softmmu/qemu-system-x86_64 +arch +~~~~ + +The architecture that will influence the selection of a QEMU binary +(when one is not explicitly given). + +Tests are also free to use this parameter value, for their own needs. +A test may, for instance, use the same value when selecting the +architecture of a kernel or disk image to boot a VM with. + +This parameter has a direct relation with the ``arch`` attribute. If +not given, it will default to None. + qemu_bin ~~~~~~~~ diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index b7c5d598d8..688a0746a2 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) -def pick_default_qemu_bin(): +def pick_default_qemu_bin(arch=None): """ Picks the path of a QEMU binary, starting either in the current working directory or in the source tree root directory. + :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`). + :type arch: str :returns: the path to the default QEMU binary or None if one could not be found :rtype: str or None """ - arch = os.uname()[4] + if arch is None: + arch = os.uname()[4] qemu_bin_relative_path = os.path.join("%s-softmmu" % arch, "qemu-system-%s" % arch) if is_readable_executable_file(qemu_bin_relative_path): @@ -47,8 +53,10 @@ def pick_default_qemu_bin(): class Test(avocado.Test): def setUp(self): self._vms = {} + self.arch = self.params.get('arch') + default_qemu_bin = pick_default_qemu_bin(arch=self.arch) self.qemu_bin = self.params.get('qemu_bin', - default=pick_default_qemu_bin()) + default=default_qemu_bin) if self.qemu_bin is None: self.cancel("No QEMU binary defined or found in the source tree") From patchwork Fri May 3 00:41:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094607 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wD1S67JTz9s7T for ; Fri, 3 May 2019 10:45:00 +1000 (AEST) Received: from localhost ([127.0.0.1]:60462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMJu-0005mw-PK for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:44:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMGr-0003a5-Sl for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMGq-0006lE-NZ for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45252) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMGq-0006kt-Db for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:48 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B906C3082E60; Fri, 3 May 2019 00:41:47 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45DF35D9C4; Fri, 3 May 2019 00:41:47 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:16 -0300 Message-Id: <20190503004130.8285-6-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 03 May 2019 00:41:47 +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] [PULL 05/19] tests/acceptance: use "arch:" tag to filter target specific tests 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa Currently, some tests contains target architecture information, in the form of a "x86_64" tag. But that tag is not respected in the default execution, that is, "make check-acceptance" doesn't do anything with it. That said, even the target architecture handling currently present in the "avocado_qemu.Test" class is pretty limited. For instance, by default, it chooses a target based on the host architecture. Because the original implementation of the tags feature in Avocado did not include any time of namespace or "key:val" mechanism, no tag has relation to another tag. The new implementation of the tags feature from version 67.0 onwards, allows "key:val" tags, and because of that, a test can be classified with a tag in a given key. For instance, the new proposed version of the "boot_linux_console.py" test, which downloads and attempts to run a x86_64 kernel, is now tagged as: :avocado: tags=arch:x86_64 This means that it can be filtered (out) when no x86_64 target is available. At the same time, tests that don't have a "arch:" tag, will not be filtered out. Signed-off-by: Cleber Rosa Reviewed-by: Cornelia Huck Message-Id: <20190312171824.5134-6-crosa@redhat.com> Signed-off-by: Eduardo Habkost --- tests/Makefile.include | 3 +++ tests/acceptance/boot_linux_console.py | 2 +- tests/acceptance/linux_initrd.py | 2 +- tests/acceptance/virtio_version.py | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 445aa0bb12..7c8b9c84b2 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -1134,6 +1134,7 @@ TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results # Any number of command separated loggers are accepted. For more # information please refer to "avocado --help". AVOCADO_SHOW=app +AVOCADO_TAGS=$(patsubst %-softmmu,-t arch:%, $(filter %-softmmu,$(TARGET_DIRS))) ifneq ($(findstring v2,"v$(PYTHON_VERSION)"),v2) $(TESTS_VENV_DIR): $(TESTS_VENV_REQ) @@ -1159,6 +1160,8 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR) $(call quiet-command, \ $(TESTS_VENV_DIR)/bin/python -m avocado \ --show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \ + --filter-by-tags-include-empty --filter-by-tags-include-empty-key \ + $(AVOCADO_TAGS) \ --failfast=on $(SRC_PATH)/tests/acceptance, \ "AVOCADO", "tests/acceptance") diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index beeb1e59e8..fa4594f612 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -18,7 +18,7 @@ class BootLinuxConsole(Test): Boots a x86_64 Linux kernel and checks that the console is operational and the kernel command line is properly passed from QEMU to the kernel - :avocado: tags=x86_64 + :avocado: tags=arch:x86_64 """ timeout = 60 diff --git a/tests/acceptance/linux_initrd.py b/tests/acceptance/linux_initrd.py index fbdb48e43f..23be5a63aa 100644 --- a/tests/acceptance/linux_initrd.py +++ b/tests/acceptance/linux_initrd.py @@ -19,7 +19,7 @@ class LinuxInitrd(Test): """ Checks QEMU evaluates correctly the initrd file passed as -initrd option. - :avocado: tags=x86_64 + :avocado: tags=arch:x86_64 """ timeout = 300 diff --git a/tests/acceptance/virtio_version.py b/tests/acceptance/virtio_version.py index 37fc01ea18..8b97453ff8 100644 --- a/tests/acceptance/virtio_version.py +++ b/tests/acceptance/virtio_version.py @@ -61,7 +61,7 @@ class VirtioVersionCheck(Test): same device tree created by `disable-modern` and `disable-legacy`. - :avocado: tags=x86_64 + :avocado: tags=arch:x86_64 """ # just in case there are failures, show larger diff: From patchwork Fri May 3 00:41:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094612 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wD4y2Dbgz9s9N for ; Fri, 3 May 2019 10:48:01 +1000 (AEST) Received: from localhost ([127.0.0.1]:60523 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMMp-00009u-GL for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:47:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMGu-0003cQ-8m for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMGt-0006m8-6Y for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42592) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMGs-0006lr-Ux for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41: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 mx1.redhat.com (Postfix) with ESMTPS id 4DA42F74D4; Fri, 3 May 2019 00:41:50 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 59D60608E1; Fri, 3 May 2019 00:41:49 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:17 -0300 Message-Id: <20190503004130.8285-7-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 03 May 2019 00:41:50 +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] [PULL 06/19] tests/acceptance: look for target architecture in test tags first 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa A test can, optionally, be tagged for one or many architectures. If a test has been tagged for a single architecture, there's a high chance that the test won't run on other architectures. This changes the default order of choosing a default target architecture to use based on the 'arch' tag value first. The precedence order is for choosing a QEMU binary to use for a test is now: * qemu_bin parameter * arch parameter * arch tag value (for example, x86_64 if ":avocado: tags=arch:x86_64 is used) This means that if one runs: $ avocado run -p qemu_bin=/usr/bin/qemu-system-x86_64 test.py No arch parameter or tag will influence the selection of the QEMU target binary. If one runs: $ avocado run -p arch=ppc64 test.py The target binary selection mechanism will attempt to find a binary such as "ppc64-softmmu/qemu-system-ppc64". And finally, if one runs a test that is tagged (in its docstring) with "arch:aarch64": $ avocado run aarch64.py The target binary selection mechanism will attempt to find a binary such as "aarch64-softmmu/qemu-system-aarch64". At this time, no provision is made to cancel the execution of tests if the arch parameter given (manually) does not match the test "arch" tag, but it may be a useful default behavior to be added in the future. Signed-off-by: Cleber Rosa Reviewed-by: Cornelia Huck Message-Id: <20190312171824.5134-7-crosa@redhat.com> Signed-off-by: Eduardo Habkost --- docs/devel/testing.rst | 4 +++- tests/acceptance/avocado_qemu/__init__.py | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 83bf9f09ac..da2d0fc964 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -740,7 +740,9 @@ A test may, for instance, use the same value when selecting the architecture of a kernel or disk image to boot a VM with. The ``arch`` attribute will be set to the test parameter of the same -name, and if one is not given explicitly, it will be set to ``None``. +name. If one is not given explicitly, it will either be set to +``None``, or, if the test is tagged with one (and only one) +``:avocado: tags=arch:VALUE`` tag, it will be set to ``VALUE``. qemu_bin ~~~~~~~~ diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 688a0746a2..2b236a1cf0 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -53,7 +53,12 @@ def pick_default_qemu_bin(arch=None): class Test(avocado.Test): def setUp(self): self._vms = {} - self.arch = self.params.get('arch') + arches = self.tags.get('arch', []) + if len(arches) == 1: + arch = arches.pop() + else: + arch = None + self.arch = self.params.get('arch', default=arch) default_qemu_bin = pick_default_qemu_bin(arch=self.arch) self.qemu_bin = self.params.get('qemu_bin', default=default_qemu_bin) From patchwork Fri May 3 00:41:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094605 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wCyr6XWrz9s7T for ; Fri, 3 May 2019 10:42:44 +1000 (AEST) Received: from localhost ([127.0.0.1]:60446 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMHh-0003gt-Ck for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:42:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMGw-0003eQ-C9 for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMGv-0006ms-7S for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49428) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMGv-0006me-1r for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:53 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 60869330260; Fri, 3 May 2019 00:41:52 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id E0F365C26A; Fri, 3 May 2019 00:41:51 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:18 -0300 Message-Id: <20190503004130.8285-8-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 03 May 2019 00:41:52 +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] [PULL 07/19] tests/boot_linux_console: rename the x86_64 after the arch and machine 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa Given that the test is specific to x86_64 and pc, and new tests are going to be added to the same class, let's rename it accordingly. Also, let's make the class documentation not architecture specific. Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck Message-Id: <20190312171824.5134-8-crosa@redhat.com> Signed-off-by: Eduardo Habkost --- tests/acceptance/boot_linux_console.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index fa4594f612..4d57741bd8 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -15,15 +15,17 @@ from avocado_qemu import Test class BootLinuxConsole(Test): """ - Boots a x86_64 Linux kernel and checks that the console is operational - and the kernel command line is properly passed from QEMU to the kernel - - :avocado: tags=arch:x86_64 + Boots a Linux kernel and checks that the console is operational and the + kernel command line is properly passed from QEMU to the kernel """ timeout = 60 - def test(self): + def test_x86_64_pc(self): + """ + :avocado: tags=arch:x86_64 + :avocado: tags=machine:pc + """ kernel_url = ('https://mirrors.kernel.org/fedora/releases/28/' 'Everything/x86_64/os/images/pxeboot/vmlinuz') kernel_hash = '238e083e114c48200f80d889f7e32eeb2793e02a' From patchwork Fri May 3 00:41:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094611 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wD4y11dnz9s7T for ; Fri, 3 May 2019 10:48:01 +1000 (AEST) Received: from localhost ([127.0.0.1]:60521 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMMo-00008f-Ia for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:47:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMH2-0003jo-0e for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMH1-0006pB-1D for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35756) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMH0-0006op-Rb for qemu-devel@nongnu.org; Thu, 02 May 2019 20:41:58 -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 33B2D308620F; Fri, 3 May 2019 00:41:58 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA00D1001DF6; Fri, 3 May 2019 00:41:56 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:19 -0300 Message-Id: <20190503004130.8285-9-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> MIME-Version: 1.0 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.42]); Fri, 03 May 2019 00:41:58 +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] [PULL 08/19] tests/boot_linux_console: update the x86_64 kernel 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa Update to the stock Fedora 29 kernel, from the Fedora 28. New tests will be added using the 29 kernel, so for consistency, let's also update it here. Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Acked-by: Cornelia Huck CC: Daniel P. Berrangé Message-Id: <20190312171824.5134-9-crosa@redhat.com> Signed-off-by: Eduardo Habkost --- tests/acceptance/boot_linux_console.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index 4d57741bd8..03a4445176 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -26,9 +26,9 @@ class BootLinuxConsole(Test): :avocado: tags=arch:x86_64 :avocado: tags=machine:pc """ - kernel_url = ('https://mirrors.kernel.org/fedora/releases/28/' - 'Everything/x86_64/os/images/pxeboot/vmlinuz') - kernel_hash = '238e083e114c48200f80d889f7e32eeb2793e02a' + kernel_url = ('https://download.fedoraproject.org/pub/fedora/linux/' + 'releases/29/Everything/x86_64/os/images/pxeboot/vmlinuz') + kernel_hash = '23bebd2680757891cf7adedb033532163a792495' kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) self.vm.set_machine('pc') From patchwork Fri May 3 00:41:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094616 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wD8S5Mtwz9s9N for ; Fri, 3 May 2019 10:51:03 +1000 (AEST) Received: from localhost ([127.0.0.1]:60580 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMPl-0002Zw-Rn for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:51:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMH3-0003lt-W0 for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMH3-0006qB-37 for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35760) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMH2-0006pu-UG for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:01 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C77A308620F; Fri, 3 May 2019 00:42:00 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0017183FF; Fri, 3 May 2019 00:41:59 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:20 -0300 Message-Id: <20190503004130.8285-10-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 03 May 2019 00:42:00 +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] [PULL 09/19] tests/boot_linux_console: add common kernel command line options 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa The 'printk.time=0' option makes it easier to parse the console output. Let's set it as a default, and reusable, kernel command line options for this and future similar tests. Signed-off-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck Message-Id: <20190312171824.5134-10-crosa@redhat.com> Signed-off-by: Eduardo Habkost --- tests/acceptance/boot_linux_console.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index 03a4445176..a94f5cd2c8 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -21,6 +21,8 @@ class BootLinuxConsole(Test): timeout = 60 + KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 ' + def test_x86_64_pc(self): """ :avocado: tags=arch:x86_64 @@ -33,7 +35,7 @@ class BootLinuxConsole(Test): self.vm.set_machine('pc') self.vm.set_console() - kernel_command_line = 'console=ttyS0' + kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' self.vm.add_args('-kernel', kernel_path, '-append', kernel_command_line) self.vm.launch() From patchwork Fri May 3 00:41:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094615 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wD8S4Jmnz9s55 for ; Fri, 3 May 2019 10:51:03 +1000 (AEST) Received: from localhost ([127.0.0.1]:60578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMPk-0002WF-It for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:51:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMHC-0003tX-1T for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMHA-0006vI-7f for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59964) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMHA-0006v6-2b for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:08 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 647DD81F13; Fri, 3 May 2019 00:42:07 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id E67E3183C0; Fri, 3 May 2019 00:42:06 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:21 -0300 Message-Id: <20190503004130.8285-11-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 03 May 2019 00:42:07 +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] [PULL 10/19] tests/boot_linux_console: increase timeout 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: =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa When running on very low powered environments, some tests may time out causing false negatives. As a conservative change, and for considering that human time (investigating false negatives) is worth more than some extra machine cycles (and time), let's increase the overall timeout. CC: Alex Bennée Signed-off-by: Cleber Rosa Reviewed-by: Cornelia Huck Message-Id: <20190312171824.5134-11-crosa@redhat.com> Signed-off-by: Eduardo Habkost --- tests/acceptance/boot_linux_console.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index a94f5cd2c8..bfcae3771b 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -19,7 +19,7 @@ class BootLinuxConsole(Test): kernel command line is properly passed from QEMU to the kernel """ - timeout = 60 + timeout = 90 KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 ' From patchwork Fri May 3 00:41:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094613 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wD5N4Kddz9s7T for ; Fri, 3 May 2019 10:48:24 +1000 (AEST) Received: from localhost ([127.0.0.1]:60531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMNC-0000Sk-Hx for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:48:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMHH-0003z2-Q0 for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMHF-0006wh-2D for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37662) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMHE-0006wU-Tr for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:13 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0854A3082AF4; Fri, 3 May 2019 00:42:12 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id F380E60BF7; Fri, 3 May 2019 00:42:08 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:22 -0300 Message-Id: <20190503004130.8285-12-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 03 May 2019 00:42:12 +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] [PULL 11/19] tests/boot_linux_console: refactor the console watcher into utility method 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa This introduces a utility method that monitors the console device and looks for either a message that signals the test success or failure. Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck Message-Id: <20190312171824.5134-12-crosa@redhat.com> Signed-off-by: Eduardo Habkost --- tests/acceptance/boot_linux_console.py | 30 ++++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index bfcae3771b..32f1d4d0bf 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -23,6 +23,25 @@ class BootLinuxConsole(Test): KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 ' + def wait_for_console_pattern(self, success_message, + failure_message='Kernel panic - not syncing'): + """ + Waits for messages to appear on the console, while logging the content + + :param success_message: if this message appears, test succeeds + :param failure_message: if this message appears, test fails + """ + console = self.vm.console_socket.makefile() + console_logger = logging.getLogger('console') + while True: + msg = console.readline() + console_logger.debug(msg.strip()) + if success_message in msg: + break + if failure_message in msg: + fail = 'Failure message found in console: %s' % failure_message + self.fail(fail) + def test_x86_64_pc(self): """ :avocado: tags=arch:x86_64 @@ -39,12 +58,5 @@ class BootLinuxConsole(Test): self.vm.add_args('-kernel', kernel_path, '-append', kernel_command_line) self.vm.launch() - console = self.vm.console_socket.makefile() - console_logger = logging.getLogger('console') - while True: - msg = console.readline() - console_logger.debug(msg.strip()) - if 'Kernel command line: %s' % kernel_command_line in msg: - break - if 'Kernel panic - not syncing' in msg: - self.fail("Kernel panic reached") + console_pattern = 'Kernel command line: %s' % kernel_command_line + self.wait_for_console_pattern(console_pattern) From patchwork Fri May 3 00:41:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094610 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wD1s6fdJz9s7T for ; Fri, 3 May 2019 10:45:21 +1000 (AEST) Received: from localhost ([127.0.0.1]:60473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMKF-000675-Q3 for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:45:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMHJ-00042z-NC for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMHH-0006xs-WA for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59984) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMHH-0006x6-OR for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:15 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2438881F1B; Fri, 3 May 2019 00:42:14 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2C5D60BF7; Fri, 3 May 2019 00:42:13 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:23 -0300 Message-Id: <20190503004130.8285-13-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 03 May 2019 00:42:14 +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] [PULL 12/19] scripts/qemu.py: support adding a console with the default serial device 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa The set_console() utility function either adds a device based on the explicitly given device type, or adds a known good type of device based on the machine type. But, for a number of machine types, it may be impossible or inconvenient to add the devices by means of "-device" command line options, and then it may better to just use the "-serial" option and let QEMU itself, based on the machine type, set the device accordingly. To achieve that, the behavior of set_console() now flags the intention to add a console device on launch(), and if no explicit device type is given the "-serial" option is going to be added to the QEMU command line, instead of raising exceptions. Based on testing with different machine types, the CONSOLE_DEV_TYPES is not necessary anymore, so it's being removed, as is the logic to use it. Signed-off-by: Cleber Rosa Reviewed-by: Cornelia Huck Message-Id: <20190312171824.5134-13-crosa@redhat.com> Signed-off-by: Eduardo Habkost --- python/qemu/__init__.py | 50 ++++++++++++++--------------------------- 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/python/qemu/__init__.py b/python/qemu/__init__.py index fd144c0006..81d9657ec0 100644 --- a/python/qemu/__init__.py +++ b/python/qemu/__init__.py @@ -41,17 +41,6 @@ def kvm_available(target_arch=None): return os.access("/dev/kvm", os.R_OK | os.W_OK) -#: Maps machine types to the preferred console device types -CONSOLE_DEV_TYPES = { - r'^clipper$': 'isa-serial', - r'^malta': 'isa-serial', - r'^(pc.*|q35.*|isapc)$': 'isa-serial', - r'^(40p|powernv|prep)$': 'isa-serial', - r'^pseries.*': 'spapr-vty', - r'^s390-ccw-virtio.*': 'sclpconsole', - } - - class QEMUMachineError(Exception): """ Exception called when an error in QEMUMachine happens. @@ -130,6 +119,7 @@ class QEMUMachine(object): self._temp_dir = None self._launched = False self._machine = None + self._console_set = False self._console_device_type = None self._console_address = None self._console_socket = None @@ -248,13 +238,17 @@ class QEMUMachine(object): '-display', 'none', '-vga', 'none'] if self._machine is not None: args.extend(['-machine', self._machine]) - if self._console_device_type is not None: + if self._console_set: self._console_address = os.path.join(self._temp_dir, self._name + "-console.sock") chardev = ('socket,id=console,path=%s,server,nowait' % self._console_address) - device = '%s,chardev=console' % self._console_device_type - args.extend(['-chardev', chardev, '-device', device]) + args.extend(['-chardev', chardev]) + if self._console_device_type is None: + args.extend(['-serial', 'chardev:console']) + else: + device = '%s,chardev=console' % self._console_device_type + args.extend(['-device', device]) return args def _pre_launch(self): @@ -480,30 +474,20 @@ class QEMUMachine(object): line. This is a convenience method that will either use the provided - device type, of if not given, it will used the device type set - on CONSOLE_DEV_TYPES. + device type, or default to a "-serial chardev:console" command + line argument. The actual setting of command line arguments will be be done at machine launch time, as it depends on the temporary directory to be created. - @param device_type: the device type, such as "isa-serial" - @raises: QEMUMachineAddDeviceError if the device type is not given - and can not be determined. - """ - if device_type is None: - if self._machine is None: - raise QEMUMachineAddDeviceError("Can not add a console device:" - " QEMU instance without a " - "defined machine type") - for regex, device in CONSOLE_DEV_TYPES.items(): - if re.match(regex, self._machine): - device_type = device - break - if device_type is None: - raise QEMUMachineAddDeviceError("Can not add a console device:" - " no matching console device " - "type definition") + @param device_type: the device type, such as "isa-serial". If + None is given (the default value) a "-serial + chardev:console" command line argument will + be used instead, resorting to the machine's + default device type. + """ + self._console_set = True self._console_device_type = device_type @property From patchwork Fri May 3 00:41:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094614 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wD5R3r14z9s9N for ; Fri, 3 May 2019 10:48:27 +1000 (AEST) Received: from localhost ([127.0.0.1]:60533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMNF-0000Uf-8X for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:48:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMHN-00046q-EI for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMHK-00070A-06 for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60966) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMHJ-0006xx-OW for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:17 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2F42130820E6; Fri, 3 May 2019 00:42:16 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id A19AA5D9C4; Fri, 3 May 2019 00:42:15 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:24 -0300 Message-Id: <20190503004130.8285-14-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 03 May 2019 00:42:16 +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] [PULL 13/19] tests/boot_linux_console: add a test for mips + malta 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: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Similar to the x86_64 + pc test, it boots a Linux kernel on a Malta board and verify the serial is working. Also, it relies on the serial device set by the machine itself. If mips is a target being built, "make check-acceptance" will automatically include this test by the use of the "arch:mips" tags. Alternatively, this test can be run using: $ avocado run -t arch:mips tests/acceptance $ avocado run -t machine:malta tests/acceptance $ avocado run -t endian:big tests/acceptance Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Cleber Rosa Reviewed-by: Aleksandar Markovic Tested-by: Philippe Mathieu-Daudé Message-Id: <20190312171824.5134-14-crosa@redhat.com> Signed-off-by: Eduardo Habkost --- .travis.yml | 2 +- tests/acceptance/boot_linux_console.py | 41 ++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e6f951e01a..f6f5d39aca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -223,7 +223,7 @@ matrix: # Acceptance (Functional) tests - env: - - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu" + - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu" - TEST_CMD="make check-acceptance" addons: apt: diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index 32f1d4d0bf..028fefd7ee 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -8,9 +8,12 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. +import os import logging from avocado_qemu import Test +from avocado.utils import process +from avocado.utils import archive class BootLinuxConsole(Test): @@ -42,6 +45,21 @@ class BootLinuxConsole(Test): fail = 'Failure message found in console: %s' % failure_message self.fail(fail) + def extract_from_deb(self, deb, path): + """ + Extracts a file from a deb package into the test workdir + + :param deb: path to the deb archive + :param file: path within the deb archive of the file to be extracted + :returns: path of the extracted file + """ + cwd = os.getcwd() + os.chdir(self.workdir) + process.run("ar x %s data.tar.gz" % deb) + archive.extract("data.tar.gz", self.workdir) + os.chdir(cwd) + return self.workdir + path + def test_x86_64_pc(self): """ :avocado: tags=arch:x86_64 @@ -60,3 +78,26 @@ class BootLinuxConsole(Test): self.vm.launch() console_pattern = 'Kernel command line: %s' % kernel_command_line self.wait_for_console_pattern(console_pattern) + + def test_mips_malta(self): + """ + :avocado: tags=arch:mips + :avocado: tags=machine:malta + :avocado: tags=endian:big + """ + deb_url = ('http://snapshot.debian.org/archive/debian/' + '20130217T032700Z/pool/main/l/linux-2.6/' + 'linux-image-2.6.32-5-4kc-malta_2.6.32-48_mips.deb') + deb_hash = 'a8cfc28ad8f45f54811fc6cf74fc43ffcfe0ba04' + deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) + kernel_path = self.extract_from_deb(deb_path, + '/boot/vmlinux-2.6.32-5-4kc-malta') + + self.vm.set_machine('malta') + self.vm.set_console() + kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' + self.vm.add_args('-kernel', kernel_path, + '-append', kernel_command_line) + self.vm.launch() + console_pattern = 'Kernel command line: %s' % kernel_command_line + self.wait_for_console_pattern(console_pattern) From patchwork Fri May 3 00:41:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094624 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wDGP5P7gz9s5c for ; Fri, 3 May 2019 10:56:09 +1000 (AEST) Received: from localhost ([127.0.0.1]:60682 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMUg-0006sk-AQ for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:56:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMHQ-0004A3-RZ for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMHP-00072F-Hm for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38006) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMHN-00070c-G3 for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:21 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 55B7D30832D1; Fri, 3 May 2019 00:42:19 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE36919C4F; Fri, 3 May 2019 00:42:18 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:25 -0300 Message-Id: <20190503004130.8285-15-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 03 May 2019 00:42:19 +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] [PULL 14/19] tests/boot_linux_console: add a test for mips64el + malta 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa Similar to the x86_64 + pc test, it boots a Linux kernel on a Malta board and verify the serial is working. If mips64el is a target being built, "make check-acceptance" will automatically include this test by the use of the "arch:mips64el" tags. Alternatively, this test can be run using: $ avocado run -t arch:mips64el tests/acceptance $ avocado run -t machine:malta tests/acceptance Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Cleber Rosa Reviewed-by: Aleksandar Markovic Message-Id: <20190312171824.5134-15-crosa@redhat.com> Signed-off-by: Eduardo Habkost --- .travis.yml | 2 +- tests/acceptance/boot_linux_console.py | 33 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f6f5d39aca..cb46098972 100644 --- a/.travis.yml +++ b/.travis.yml @@ -223,7 +223,7 @@ matrix: # Acceptance (Functional) tests - env: - - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu" + - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu" - TEST_CMD="make check-acceptance" addons: apt: diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index 028fefd7ee..38b33b25f7 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -101,3 +101,36 @@ class BootLinuxConsole(Test): self.vm.launch() console_pattern = 'Kernel command line: %s' % kernel_command_line self.wait_for_console_pattern(console_pattern) + + def test_mips64el_malta(self): + """ + This test requires the ar tool to extract "data.tar.gz" from + the Debian package. + + The kernel can be rebuilt using this Debian kernel source [1] and + following the instructions on [2]. + + [1] http://snapshot.debian.org/package/linux-2.6/2.6.32-48/ + #linux-source-2.6.32_2.6.32-48 + [2] https://kernel-team.pages.debian.net/kernel-handbook/ + ch-common-tasks.html#s-common-official + + :avocado: tags=arch:mips64el + :avocado: tags=machine:malta + """ + deb_url = ('http://snapshot.debian.org/archive/debian/' + '20130217T032700Z/pool/main/l/linux-2.6/' + 'linux-image-2.6.32-5-5kc-malta_2.6.32-48_mipsel.deb') + deb_hash = '1aaec92083bf22fda31e0d27fa8d9a388e5fc3d5' + deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) + kernel_path = self.extract_from_deb(deb_path, + '/boot/vmlinux-2.6.32-5-5kc-malta') + + self.vm.set_machine('malta') + self.vm.set_console() + kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' + self.vm.add_args('-kernel', kernel_path, + '-append', kernel_command_line) + self.vm.launch() + console_pattern = 'Kernel command line: %s' % kernel_command_line + self.wait_for_console_pattern(console_pattern) From patchwork Fri May 3 00:41:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094625 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wDJ92HZpz9s5c for ; Fri, 3 May 2019 10:57:45 +1000 (AEST) Received: from localhost ([127.0.0.1]:60700 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMWF-00084O-9S for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:57:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMHQ-0004A9-Uj for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMHP-00072j-So for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49514) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMHP-00071Y-NN for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:23 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 809853D37; Fri, 3 May 2019 00:42:21 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B9F85C26A; Fri, 3 May 2019 00:42:20 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:26 -0300 Message-Id: <20190503004130.8285-16-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 03 May 2019 00:42:21 +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] [PULL 15/19] tests/boot_linux_console: add a test for aarch64 + virt 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa Just like the previous tests, boots a Linux kernel on a aarch64 target using the virt machine. One special option added is the CPU type, given that the kernel selected fails to boot on the virt machine's default CPU (cortex-a15). Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara Message-Id: <20190312171824.5134-18-crosa@redhat.com> Signed-off-by: Eduardo Habkost --- .travis.yml | 2 +- tests/acceptance/boot_linux_console.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cb46098972..753e40a115 100644 --- a/.travis.yml +++ b/.travis.yml @@ -223,7 +223,7 @@ matrix: # Acceptance (Functional) tests - env: - - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu" + - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu" - TEST_CMD="make check-acceptance" addons: apt: diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index 38b33b25f7..6d9362922f 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -134,3 +134,24 @@ class BootLinuxConsole(Test): self.vm.launch() console_pattern = 'Kernel command line: %s' % kernel_command_line self.wait_for_console_pattern(console_pattern) + + def test_aarch64_virt(self): + """ + :avocado: tags=arch:aarch64 + :avocado: tags=machine:virt + """ + kernel_url = ('https://download.fedoraproject.org/pub/fedora/linux/' + 'releases/29/Everything/aarch64/os/images/pxeboot/vmlinuz') + kernel_hash = '8c73e469fc6ea06a58dc83a628fc695b693b8493' + kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) + + self.vm.set_machine('virt') + self.vm.set_console() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + + 'console=ttyAMA0') + self.vm.add_args('-cpu', 'cortex-a53', + '-kernel', kernel_path, + '-append', kernel_command_line) + self.vm.launch() + console_pattern = 'Kernel command line: %s' % kernel_command_line + self.wait_for_console_pattern(console_pattern) From patchwork Fri May 3 00:41:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wD8t1Y35z9s55 for ; Fri, 3 May 2019 10:51:26 +1000 (AEST) Received: from localhost ([127.0.0.1]:60586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMQ8-0002sT-6C for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:51:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMHR-0004Aj-I5 for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMHQ-00072w-F1 for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39328) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMHQ-00072f-9u for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:24 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A395A8665F; Fri, 3 May 2019 00:42:23 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 310DC5D70A; Fri, 3 May 2019 00:42:22 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:27 -0300 Message-Id: <20190503004130.8285-17-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 03 May 2019 00:42:23 +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] [PULL 16/19] tests/boot_linux_console: add a test for arm + virt 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa Just like the previous tests, boots a Linux kernel on an arm target using the virt machine. Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara Message-Id: <20190312171824.5134-19-crosa@redhat.com> Signed-off-by: Eduardo Habkost --- .travis.yml | 2 +- tests/acceptance/boot_linux_console.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 753e40a115..268df60345 100644 --- a/.travis.yml +++ b/.travis.yml @@ -223,7 +223,7 @@ matrix: # Acceptance (Functional) tests - env: - - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu" + - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu" - TEST_CMD="make check-acceptance" addons: apt: diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index 6d9362922f..54b6e2625d 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -155,3 +155,23 @@ class BootLinuxConsole(Test): self.vm.launch() console_pattern = 'Kernel command line: %s' % kernel_command_line self.wait_for_console_pattern(console_pattern) + + def test_arm_virt(self): + """ + :avocado: tags=arch:arm + :avocado: tags=machine:virt + """ + kernel_url = ('https://download.fedoraproject.org/pub/fedora/linux/' + 'releases/29/Everything/armhfp/os/images/pxeboot/vmlinuz') + kernel_hash = 'e9826d741b4fb04cadba8d4824d1ed3b7fb8b4d4' + kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) + + self.vm.set_machine('virt') + self.vm.set_console() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + + 'console=ttyAMA0') + self.vm.add_args('-kernel', kernel_path, + '-append', kernel_command_line) + self.vm.launch() + console_pattern = 'Kernel command line: %s' % kernel_command_line + self.wait_for_console_pattern(console_pattern) From patchwork Fri May 3 00:41:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094620 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wDCg0P9Tz9s9N for ; Fri, 3 May 2019 10:53:50 +1000 (AEST) Received: from localhost ([127.0.0.1]:60615 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMSN-0004rh-EQ for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:53:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMHT-0004Cp-Ix for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMHS-00074M-DZ for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47674) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMHS-00073n-7v for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:26 -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 8A262309E9A1; Fri, 3 May 2019 00:42:25 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E8D51001DF6; Fri, 3 May 2019 00:42:24 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:28 -0300 Message-Id: <20190503004130.8285-18-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@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]); Fri, 03 May 2019 00:42:25 +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] [PULL 17/19] tests/boot_linux_console: add a test for s390x + s390-ccw-virtio 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa Just like the previous tests, boots a Linux kernel on a s390x target using the s390-ccw-virtio machine. Because it's not possible to have multiple VT220 consoles, '-nodefaults' is used, so that the one set with set_console() works correctly. Signed-off-by: Cleber Rosa Reviewed-by: Cornelia Huck Reviewed-by: Caio Carrara Message-Id: <20190312171824.5134-20-crosa@redhat.com> [ehabkost: Updated kernel URL to point to fedoraproject.org] Signed-off-by: Eduardo Habkost --- .travis.yml | 2 +- tests/acceptance/boot_linux_console.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 268df60345..9b271b963d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -223,7 +223,7 @@ matrix: # Acceptance (Functional) tests - env: - - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu" + - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu" - TEST_CMD="make check-acceptance" addons: apt: diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index 54b6e2625d..7c1099e5c8 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -175,3 +175,23 @@ class BootLinuxConsole(Test): self.vm.launch() console_pattern = 'Kernel command line: %s' % kernel_command_line self.wait_for_console_pattern(console_pattern) + + def test_s390x_s390_ccw_virtio(self): + """ + :avocado: tags=arch:s390x + :avocado: tags=machine:s390_ccw_virtio + """ + kernel_url = ('https://download.fedoraproject.org/pub/fedora-secondary/' + 'releases/29/Everything/s390x/os/images/kernel.img') + kernel_hash = 'e8e8439103ef8053418ef062644ffd46a7919313' + kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) + + self.vm.set_machine('s390-ccw-virtio') + self.vm.set_console() + kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=sclp0' + self.vm.add_args('-nodefaults', + '-kernel', kernel_path, + '-append', kernel_command_line) + self.vm.launch() + console_pattern = 'Kernel command line: %s' % kernel_command_line + self.wait_for_console_pattern(console_pattern) From patchwork Fri May 3 00:41:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094623 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wDG12vhtz9s5c for ; Fri, 3 May 2019 10:55:53 +1000 (AEST) Received: from localhost ([127.0.0.1]:60676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMUR-0006kM-EB for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:55:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMHV-0004F0-NV for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMHU-000754-Hz for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60988) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMHU-00074q-AX for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:28 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A810830ADBCC; Fri, 3 May 2019 00:42:27 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2FC0760BF7; Fri, 3 May 2019 00:42:26 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:29 -0300 Message-Id: <20190503004130.8285-19-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 03 May 2019 00:42:27 +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] [PULL 18/19] tests/boot_linux_console: add a test for alpha + clipper 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa Similar to the x86_64 + pc test, it boots a Linux kernel on a Malta board and verify the serial is working. One extra command added to the QEMU command line is '-vga std', because the kernel used is known to crash without it. If alpha is a target being built, "make check-acceptance" will automatically include this test by the use of the "arch:alpha" tags. Alternatively, this test can be run using: $ avocado run -t arch:alpha tests/acceptance $ avocado run -t machine:clipper tests/acceptance Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara Message-Id: <20190312171824.5134-21-crosa@redhat.com> Signed-off-by: Eduardo Habkost --- .travis.yml | 2 +- tests/acceptance/boot_linux_console.py | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9b271b963d..66448d99d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -223,7 +223,7 @@ matrix: # Acceptance (Functional) tests - env: - - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu" + - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu" - TEST_CMD="make check-acceptance" addons: apt: diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index 7c1099e5c8..d5c500ea30 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -195,3 +195,25 @@ class BootLinuxConsole(Test): self.vm.launch() console_pattern = 'Kernel command line: %s' % kernel_command_line self.wait_for_console_pattern(console_pattern) + + def test_alpha_clipper(self): + """ + :avocado: tags=arch:alpha + :avocado: tags=machine:clipper + """ + kernel_url = ('http://archive.debian.org/debian/dists/lenny/main/' + 'installer-alpha/current/images/cdrom/vmlinuz') + kernel_hash = '3a943149335529e2ed3e74d0d787b85fb5671ba3' + kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) + + uncompressed_kernel = archive.uncompress(kernel_path, self.workdir) + + self.vm.set_machine('clipper') + self.vm.set_console() + kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' + self.vm.add_args('-vga', 'std', + '-kernel', uncompressed_kernel, + '-append', kernel_command_line) + self.vm.launch() + console_pattern = 'Kernel command line: %s' % kernel_command_line + self.wait_for_console_pattern(console_pattern) From patchwork Fri May 3 00:41:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1094626 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wDKg4JQkz9s5c for ; Fri, 3 May 2019 10:59:01 +1000 (AEST) Received: from localhost ([127.0.0.1]:60714 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMXS-0000ec-9l for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 20:58:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMMHX-0004GW-L2 for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMMHW-00075z-OY for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48510) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMMHW-00075a-Jc for qemu-devel@nongnu.org; Thu, 02 May 2019 20:42:30 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A81513092649; Fri, 3 May 2019 00:42:29 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 368E3183C0; Fri, 3 May 2019 00:42:29 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Thu, 2 May 2019 21:41:30 -0300 Message-Id: <20190503004130.8285-20-ehabkost@redhat.com> In-Reply-To: <20190503004130.8285-1-ehabkost@redhat.com> References: <20190503004130.8285-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Fri, 03 May 2019 00:42:29 +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] [PULL 19/19] configure: automatically pick python3 is available 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Daniel P. Berrangé Unless overridden via an env var or configure arg, QEMU will only look for the 'python' binary in $PATH. This is unhelpful on distros which are only shipping Python 3.x (eg Fedora) in their default install as, if they comply with PEP 394, the bare 'python' binary won't exist. This changes configure so that by default it will search for all three common python binaries, preferring to find Python 3.x versions. Signed-off-by: Daniel P. Berrangé Message-Id: <20190327170701.23798-1-berrange@redhat.com> Signed-off-by: Eduardo Habkost --- configure | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 60719ddcc5..f88011b94d 100755 --- a/configure +++ b/configure @@ -899,7 +899,18 @@ fi : ${make=${MAKE-make}} : ${install=${INSTALL-install}} -: ${python=${PYTHON-python}} +# We prefer python 3.x. A bare 'python' is traditionally +# python 2.x, but some distros have it as python 3.x, so +# we check that before python2 +python= +for binary in "${PYTHON-python3}" python python2 +do + if has "$binary" + then + python="$binary" + break + fi +done : ${smbd=${SMBD-/usr/sbin/smbd}} # Default objcc to clang if available, otherwise use CC @@ -1818,8 +1829,9 @@ EOF exit 0 fi -if ! has $python; then - error_exit "Python not found. Use --python=/path/to/python" +if test -z "$python" +then + error_exit "Python not found. Use --python=/path/to/python" fi # Note that if the Python conditional here evaluates True we will exit