All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support
@ 2019-02-02  0:55 Cleber Rosa
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 01/20] scripts/qemu.py: log QEMU launch command line Cleber Rosa
                   ` (25 more replies)
  0 siblings, 26 replies; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

The current acceptance tests don't provide any type of architecture
information that can be used to influence the selection of the QEMU
binary used on them[1].  If one is running tests on a x86_64 host, the
default QEMU binary will be "x86_64-softmmu/qemu-system-x86_64".

Given the nature of QEMU, some tests will be architecture agnostic,
while others will be architecture dependent.  The "check-qtest" and
"check-qtest-TARGET" make targets exemplify that pattern.

For the acceptance tests, the same requirement exists.  Tests should
be allowed to influence the binary used, and when they don't, a
default selection mechanism should kick in[2].  The proposed solution
here requires only that an Avocado tag is set, such as:

   class My(Test):
       def test_nx_cpu_flag(self):
           """
           :avocado: tags=arch:x86_64
           """
           test_code()

The value of the "arch" key, in this case, "x86_64" will be used when
selecting the QEMU binary to use in the test.  At the same time, if
"x86_64-softmmu" is not a built target, the test will be filtered out
by "make check-acceptance"[3].

Besides the convention explained above, where the binary will be
selected from the "arch" tag, it's also possible to set an "arch"
*parameter* that will also influence the QEMU binary selection:

  $ avocado run -p arch=aarch64 works-on-many-arches.py

Finally, it's also posible to set the "qemu_bin" parameter, which will
define (instead of just influencing) the QEMU binary to be used:

 $ avocado run -p qemu_bin=qemu-bin-aarch64 test.py

As examples for the idea proposed here, a number of "boot linux
console" tests have been added, for a number of different target
architectures.  When the build environment includes them (as it has
been added to Travis CI jobs) the architecture specific tests will be
automatically executed.

As mentioned previously, this patch series include ideas present in
other patch series, and from different authors.  I tried by best
to include the information about authorship, but if I missed any,
please accept my apologies and let me know.

---

[1] - The "boot_linux_console.py" contains a "x86_64" test tag, but
      that is informational only, in the sense that it's not consumed
      by the test itself, or used by "make check-acceptance" to filter
      out tests.

[2] - This patch series doesn't attempt to change the default selection
      mechanism.  Possible changes in this area may include looking for
      any one built binary first, no matter the host architecture.

[3] - On a previous proposed version, the test class would look at the
      "arch" parameter given, and would cancel the test if there wasn't
      a match.

---

Open issues on this version:
============================

 * A possible race condition has been identified in the aarch64
   target, when running on an environment with more than 1 CPUs
   (initially reported by Wainer).
   - https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg00192.html

 * The timeout change to 90s may not be necessary, or the best
   idea, given that a possible tcg+ppc64 performance regression
   has been identified.
   - https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg00338.html

Changes from v1:
================

 * On "Acceptance tests: introduce arch parameter and attribute":
   - Added explicit *host system architecture* to the "arch" parameter
     behavior documentation (Caio / Philippe)
   - Added explicit arch parameter name in call to pick_default_qemu_bin()
     (Caio)
   - Fixed the documentation about the value of the "arch" attribute when
     a parameter is not given (Wainer).

 * On "Acceptance tests: use "arch:" tag to filter target specific tests":
   - Updated "arch" tag on tests "linux_initrd.py" and
     "virtio_version.py" (Cornelia)
   - Fixed the documentation about the value of the "arch" attribute (Wainer)

 * On "Acceptance tests: look for target architecture in test tags first"
   - Fixed the documentation given that starting with this patch, the
     "arch" attribute can also be depend on the "arch:" tag (based on
     previous patch point raised by Wainer).

 * New patch "Boot Linux Console Test: add common kernel command line
   options" (Philippe)

 * New patch "Boot Linux Console Test: increase timeout" (based on
   reports from Alex)

 * On "scripts/qemu.py: support adding a console with the default serial device":
   - Removed all non-essential console device type defintions from
     CONSOLE_DEV_TYPES.  At this point, setting the console will
     attempt to use "-serial" on all but the "s390-ccw-virtio*"
     machines (Philippe).
   - Updated documentation to make it clear that a specific device
     type will only be picked from CONSOLE_DEV_TYPES if the machine
     type is set, and a matching entry exists (Wainer).

 * On "Boot Linux Console Test: add a test for mips + malta":
   - Replaced "not easily reproducible kernel" for a kernel built and
     packaged by the Debian distro (Philippe, and previously Alex)
   - With the change to a kernel within a Debian package, and its use
     on another commit, added an utility function,
     "extract_from_deb()", to extract the kernel from the package
     (Philippe)
   - Switched to using common kernel command line options (Philippe)

 * On "Boot Linux Console Test: add a test for mips64el + malta":
   - Used the "extract_from_deb()" utility function introduced in the
     previous patch (Philippe)
   - Switched to using common kernel command line options (Philippe)
   - Fixed numbered references on the docstring (Wainer)
   - Fixed tag name on commit message (s/mips/mips64el/) (Wainer)

 * On "Boot Linux Console Test: add a test for ppc64 + pseries":
    - Switched to using common kernel command line options (Philippe)

 * On "Boot Linux Console Test: add a test for aarch64 + virt":
    - Switched to using common kernel command line options (Philippe)

 * On "Boot Linux Console Test: add a test for arm + virt"
     - Switched to using common kernel command line options (Philippe)

 * On "Boot Linux Console Test: add a test for s390x + s390-ccw-virtio":
     - Switched to using common kernel command line options (Philippe)

 * On "Boot Linux Console Test: add a test for alpha + clipper":
    - Switched to using common kernel command line options (Philippe)

---

Git Info:
  - URI: https://github.com/clebergnu/qemu/tree/sent/target_arch_v2
  - Remote: https://github.com/clebergnu/qemu
  - Branch: sent/target_arch_v2

Cleber Rosa (19):
  scripts/qemu.py: log QEMU launch command line
  Acceptance tests: show avocado test execution by default
  Acceptance tests: improve docstring on pick_default_qemu_bin()
  Acceptance tests: fix doc reference to avocado_qemu directory
  Acceptance tests: introduce arch parameter and attribute
  Acceptance tests: use "arch:" tag to filter target specific tests
  Acceptance tests: look for target architecture in test tags first
  Boot Linux Console Test: rename the x86_64 after the arch and machine
  Boot Linux Console Test: update the x86_64 kernel
  Boot Linux Console Test: add common kernel command line options
  Boot Linux Console Test: increase timeout
  Boot Linux Console Test: refactor the console watcher into utility
    method
  scripts/qemu.py: support adding a console with the default serial
    device
  Boot Linux Console Test: add a test for mips64el + malta
  Boot Linux Console Test: add a test for ppc64 + pseries
  Boot Linux Console Test: add a test for aarch64 + virt
  Boot Linux Console Test: add a test for arm + virt
  Boot Linux Console Test: add a test for s390x + s390-ccw-virtio
  Boot Linux Console Test: add a test for alpha + clipper

Philippe Mathieu-Daudé (1):
  Boot Linux Console Test: add a test for mips + malta

 .travis.yml                               |   4 +-
 docs/devel/testing.rst                    |  24 ++-
 scripts/qemu.py                           |  40 ++--
 tests/Makefile.include                    |   5 +-
 tests/acceptance/avocado_qemu/__init__.py |  23 ++-
 tests/acceptance/boot_linux_console.py    | 226 ++++++++++++++++++++--
 tests/acceptance/linux_initrd.py          |   2 +-
 tests/acceptance/virtio_version.py        |   2 +-
 tests/requirements.txt                    |   2 +-
 9 files changed, 279 insertions(+), 49 deletions(-)

-- 
2.20.1

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 01/20] scripts/qemu.py: log QEMU launch command line
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
@ 2019-02-02  0:55 ` Cleber Rosa
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 02/20] Acceptance tests: show avocado test execution by default Cleber Rosa
                   ` (24 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

Even when the launch of QEMU succeeds, it's useful to have the command
line recorded.

Reviewed-by: Caio Carrara <ccarrara@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 scripts/qemu.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/qemu.py b/scripts/qemu.py
index 0a5e02eb56..eeaab99906 100644
--- a/scripts/qemu.py
+++ b/scripts/qemu.py
@@ -312,6 +312,7 @@ class QEMUMachine(object):
         self._pre_launch()
         self._qemu_full_args = (self._wrapper + [self._binary] +
                                 self._base_args() + self._args)
+        LOG.debug('VM launch command: %r', ' '.join(self._qemu_full_args))
         self._popen = subprocess.Popen(self._qemu_full_args,
                                        stdin=devnull,
                                        stdout=self._qemu_log_file,
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 02/20] Acceptance tests: show avocado test execution by default
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 01/20] scripts/qemu.py: log QEMU launch command line Cleber Rosa
@ 2019-02-02  0:55 ` Cleber Rosa
  2019-02-06 14:36   ` Cornelia Huck
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 03/20] Acceptance tests: improve docstring on pick_default_qemu_bin() Cleber Rosa
                   ` (23 subsequent siblings)
  25 siblings, 1 reply; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

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.

Reviewed-by: Caio Carrara <ccarrara@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 .travis.yml            | 2 +-
 tests/Makefile.include | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 87d9fa971c..1b43ed4df6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -190,7 +190,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 75ad9c0dd3..67e222eeff 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -1093,7 +1093,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)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 03/20] Acceptance tests: improve docstring on pick_default_qemu_bin()
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 01/20] scripts/qemu.py: log QEMU launch command line Cleber Rosa
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 02/20] Acceptance tests: show avocado test execution by default Cleber Rosa
@ 2019-02-02  0:55 ` Cleber Rosa
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 04/20] Acceptance tests: fix doc reference to avocado_qemu directory Cleber Rosa
                   ` (22 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

Making it clear what is returned by this utility function.

Reviewed-by: Caio Carrara <ccarrara@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 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 1e54fd5932..d8d5b48dac 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -27,6 +27,10 @@ def pick_default_qemu_bin():
     """
     Picks the path of a QEMU binary, starting either in the current working
     directory or in the source tree root directory.
+
+    :returns: the path to the default QEMU binary or None if one could not
+              be found
+    :rtype: str or None
     """
     arch = os.uname()[4]
     qemu_bin_relative_path = os.path.join("%s-softmmu" % arch,
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 04/20] Acceptance tests: fix doc reference to avocado_qemu directory
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (2 preceding siblings ...)
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 03/20] Acceptance tests: improve docstring on pick_default_qemu_bin() Cleber Rosa
@ 2019-02-02  0:55 ` Cleber Rosa
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 05/20] Acceptance tests: introduce arch parameter and attribute Cleber Rosa
                   ` (21 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

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.

Reviewed-by: Caio Carrara <ccarrara@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 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 18e2c0868a..44c9b3ae74 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::
 
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 05/20] Acceptance tests: introduce arch parameter and attribute
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (3 preceding siblings ...)
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 04/20] Acceptance tests: fix doc reference to avocado_qemu directory Cleber Rosa
@ 2019-02-02  0:55 ` Cleber Rosa
  2019-02-06 15:40   ` Cornelia Huck
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 06/20] Acceptance tests: use "arch:" tag to filter target specific tests Cleber Rosa
                   ` (20 subsequent siblings)
  25 siblings, 1 reply; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

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.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 docs/devel/testing.rst                    | 17 +++++++++++++++++
 tests/acceptance/avocado_qemu/__init__.py | 14 +++++++++++---
 2 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
index 44c9b3ae74..d37c4b0e77 100644
--- a/docs/devel/testing.rst
+++ b/docs/devel/testing.rst
@@ -689,6 +689,16 @@ vm
 A QEMUMachine instance, initially configured according to the given
 ``qemu_bin`` parameter.
 
+arch
+~~~~
+
+The architecture that will be used on a number of different
+scenarios.  For instance, when a QEMU binary is not explicitly given,
+the one selected will depend on this attribute.
+
+The ``arch`` attribute will be set to the test parameter of the same
+name, and if one is not given explicitly, it will be set to ``None``.
+
 qemu_bin
 ~~~~~~~~
 
@@ -711,6 +721,13 @@ 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 be used on a number of different scenarios.
+This parameter has a direct relation with the ``arch`` attribute.  If
+not given, it will default to None.
+
 qemu_bin
 ~~~~~~~~
 
diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index d8d5b48dac..f580582602 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.vm = None
+        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")
         self.vm = QEMUMachine(self.qemu_bin)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 06/20] Acceptance tests: use "arch:" tag to filter target specific tests
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (4 preceding siblings ...)
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 05/20] Acceptance tests: introduce arch parameter and attribute Cleber Rosa
@ 2019-02-02  0:55 ` Cleber Rosa
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 07/20] Acceptance tests: look for target architecture in test tags first Cleber Rosa
                   ` (19 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

Currently, the only test that contains some target architecture
information is "boot_linux_console.py" which test contains 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, 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 <crosa@redhat.com>
---
 tests/Makefile.include                 | 3 +++
 tests/acceptance/boot_linux_console.py | 2 +-
 tests/acceptance/linux_initrd.py       | 2 +-
 tests/acceptance/virtio_version.py     | 2 +-
 tests/requirements.txt                 | 2 +-
 5 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/Makefile.include b/tests/Makefile.include
index 67e222eeff..e9e60117f8 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -1094,6 +1094,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)
@@ -1119,6 +1120,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 98324f7591..46b20bdfe2 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -19,7 +19,7 @@ class BootLinuxConsole(Test):
     and the kernel command line is properly passed from QEMU to the kernel
 
     :avocado: enable
-    :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 737355c2ef..c75e29be70 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: enable
-    :avocado: tags=x86_64
+    :avocado: tags=arch:x86_64
     """
 
     timeout = 60
diff --git a/tests/acceptance/virtio_version.py b/tests/acceptance/virtio_version.py
index ce990250d8..3b280e7fc3 100644
--- a/tests/acceptance/virtio_version.py
+++ b/tests/acceptance/virtio_version.py
@@ -62,7 +62,7 @@ class VirtioVersionCheck(Test):
     `disable-legacy`.
 
     :avocado: enable
-    :avocado: tags=x86_64
+    :avocado: tags=arch:x86_64
     """
 
     # just in case there are failures, show larger diff:
diff --git a/tests/requirements.txt b/tests/requirements.txt
index 64c6e27a94..426a9e8a9a 100644
--- a/tests/requirements.txt
+++ b/tests/requirements.txt
@@ -1,4 +1,4 @@
 # Add Python module requirements, one per line, to be installed
 # in the tests/venv Python virtual environment. For more info,
 # refer to: https://pip.pypa.io/en/stable/user_guide/#id1
-avocado-framework==65.0
+avocado-framework==67.0
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 07/20] Acceptance tests: look for target architecture in test tags first
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (5 preceding siblings ...)
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 06/20] Acceptance tests: use "arch:" tag to filter target specific tests Cleber Rosa
@ 2019-02-02  0:55 ` Cleber Rosa
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 08/20] Boot Linux Console Test: rename the x86_64 after the arch and machine Cleber Rosa
                   ` (18 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

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 <crosa@redhat.com>
---
 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 d37c4b0e77..94ef894047 100644
--- a/docs/devel/testing.rst
+++ b/docs/devel/testing.rst
@@ -697,7 +697,9 @@ scenarios.  For instance, when a QEMU binary is not explicitly given,
 the one selected will depend on this attribute.
 
 The ``arch`` attribute will be set to the test parameter of the same
-name, and if one is not given explicitly, it will 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 f580582602..9e98d113cb 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.vm = None
-        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)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 08/20] Boot Linux Console Test: rename the x86_64 after the arch and machine
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (6 preceding siblings ...)
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 07/20] Acceptance tests: look for target architecture in test tags first Cleber Rosa
@ 2019-02-02  0:55 ` Cleber Rosa
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 09/20] Boot Linux Console Test: update the x86_64 kernel Cleber Rosa
                   ` (17 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

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.

Reviewed-by: Caio Carrara <ccarrara@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 tests/acceptance/boot_linux_console.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 46b20bdfe2..89df7f6e4f 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -15,16 +15,19 @@ 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
+    Boots a Linux kernel and checks that the console is operational and the
+    kernel command line is properly passed from QEMU to the kernel
 
     :avocado: enable
-    :avocado: tags=arch:x86_64
     """
 
     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'
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 09/20] Boot Linux Console Test: update the x86_64 kernel
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (7 preceding siblings ...)
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 08/20] Boot Linux Console Test: rename the x86_64 after the arch and machine Cleber Rosa
@ 2019-02-02  0:55 ` Cleber Rosa
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 10/20] Boot Linux Console Test: add common kernel command line options Cleber Rosa
                   ` (16 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

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.

Reviewed-by: Caio Carrara <ccarrara@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 tests/acceptance/boot_linux_console.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 89df7f6e4f..35b31162d4 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -28,9 +28,9 @@ class BootLinuxConsole(Test):
         :avocado: tags=arch:x86_64
         :avocado: tags=machine:pc
         """
-        kernel_url = ('https://mirrors.kernel.org/fedora/releases/28/'
+        kernel_url = ('https://mirrors.kernel.org/fedora/releases/29/'
                       'Everything/x86_64/os/images/pxeboot/vmlinuz')
-        kernel_hash = '238e083e114c48200f80d889f7e32eeb2793e02a'
+        kernel_hash = '23bebd2680757891cf7adedb033532163a792495'
         kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
 
         self.vm.set_machine('pc')
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 10/20] Boot Linux Console Test: add common kernel command line options
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (8 preceding siblings ...)
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 09/20] Boot Linux Console Test: update the x86_64 kernel Cleber Rosa
@ 2019-02-02  0:56 ` Cleber Rosa
  2019-02-02  1:01   ` Philippe Mathieu-Daudé
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 11/20] Boot Linux Console Test: increase timeout Cleber Rosa
                   ` (15 subsequent siblings)
  25 siblings, 1 reply; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

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 <crosa@redhat.com>
---
 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 35b31162d4..cc5dcd7373 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -23,6 +23,8 @@ class BootLinuxConsole(Test):
 
     timeout = 60
 
+    KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
+
     def test_x86_64_pc(self):
         """
         :avocado: tags=arch:x86_64
@@ -35,7 +37,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()
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 11/20] Boot Linux Console Test: increase timeout
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (9 preceding siblings ...)
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 10/20] Boot Linux Console Test: add common kernel command line options Cleber Rosa
@ 2019-02-02  0:56 ` Cleber Rosa
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 12/20] Boot Linux Console Test: refactor the console watcher into utility method Cleber Rosa
                   ` (14 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

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 <alex.bennee@linaro.org>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 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 cc5dcd7373..fa721a7355 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -21,7 +21,7 @@ class BootLinuxConsole(Test):
     :avocado: enable
     """
 
-    timeout = 60
+    timeout = 90
 
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
 
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 12/20] Boot Linux Console Test: refactor the console watcher into utility method
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (10 preceding siblings ...)
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 11/20] Boot Linux Console Test: increase timeout Cleber Rosa
@ 2019-02-02  0:56 ` Cleber Rosa
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 13/20] scripts/qemu.py: support adding a console with the default serial device Cleber Rosa
                   ` (13 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

This introduces a utility method that monitors the console device and
looks for either a message that signals the test success or failure.

Reviewed-by: Caio Carrara <ccarrara@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 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 fa721a7355..e2ef43e7ce 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -25,6 +25,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
@@ -41,12 +60,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)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 13/20] scripts/qemu.py: support adding a console with the default serial device
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (11 preceding siblings ...)
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 12/20] Boot Linux Console Test: refactor the console watcher into utility method Cleber Rosa
@ 2019-02-02  0:56 ` Cleber Rosa
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 14/20] Boot Linux Console Test: add a test for mips + malta Cleber Rosa
                   ` (12 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

The set_console() utility function traditionally adds a device either
based on the explicitly given device type, or based on the machine type,
a known good type of device.

But, for a number of machine types, it may be impossible or
inconvenient to add the devices my 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, and there's no definition on CONSOLE_DEV_TYPES, the "-serial"
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 now being set to the bare essential entries (one entry to be
honest), for machine types that can not easily give us a working
console with "-serial".

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 scripts/qemu.py | 39 +++++++++++++++++++--------------------
 1 file changed, 19 insertions(+), 20 deletions(-)

diff --git a/scripts/qemu.py b/scripts/qemu.py
index eeaab99906..53bdc46ce2 100644
--- a/scripts/qemu.py
+++ b/scripts/qemu.py
@@ -34,11 +34,6 @@ def kvm_available(target_arch=None):
 
 #: 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',
     }
 
@@ -121,6 +116,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
@@ -240,13 +236,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):
@@ -472,30 +472,29 @@ 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, of if not given, it will use the device type set
+        on CONSOLE_DEV_TYPES if a machine type is set, and a matching
+        entry exists on CONSOLE_DEV_TYPES.
 
         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"
+        @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, if a machine type is set,
+                            and a matching entry exists on CONSOLE_DEV_TYPES.
         @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")
+        self._console_set = True
+        if device_type is None and self._machine is not None:
             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")
         self._console_device_type = device_type
 
     @property
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 14/20] Boot Linux Console Test: add a test for mips + malta
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (12 preceding siblings ...)
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 13/20] scripts/qemu.py: support adding a console with the default serial device Cleber Rosa
@ 2019-02-02  0:56 ` Cleber Rosa
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 15/20] Boot Linux Console Test: add a test for mips64el " Cleber Rosa
                   ` (11 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic, Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

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é <f4bug@amsat.org>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 .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 1b43ed4df6..a4e3328c23 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -189,7 +189,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 e2ef43e7ce..05e43360b8 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):
@@ -44,6 +47,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
@@ -62,3 +80,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)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 15/20] Boot Linux Console Test: add a test for mips64el + malta
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (13 preceding siblings ...)
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 14/20] Boot Linux Console Test: add a test for mips + malta Cleber Rosa
@ 2019-02-02  0:56 ` Cleber Rosa
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 16/20] Boot Linux Console Test: add a test for ppc64 + pseries Cleber Rosa
                   ` (10 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic, 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.

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é <f4bug@amsat.org>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 .travis.yml                            |  2 +-
 tests/acceptance/boot_linux_console.py | 32 ++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index a4e3328c23..df6a24a3b6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -189,7 +189,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 05e43360b8..cd9a4c9b7d 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -10,6 +10,7 @@
 
 import os
 import logging
+import os
 
 from avocado_qemu import Test
 from avocado.utils import process
@@ -103,3 +104,34 @@ 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)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 16/20] Boot Linux Console Test: add a test for ppc64 + pseries
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (14 preceding siblings ...)
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 15/20] Boot Linux Console Test: add a test for mips64el " Cleber Rosa
@ 2019-02-02  0:56 ` Cleber Rosa
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 17/20] Boot Linux Console Test: add a test for aarch64 + virt Cleber Rosa
                   ` (9 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

Just like the previous tests, boots a Linux kernel on a ppc64 target
using the pseries machine.

Reviewed-by: Caio Carrara <ccarrara@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 .travis.yml                            |  2 +-
 tests/acceptance/boot_linux_console.py | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index df6a24a3b6..7fa13d15db 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -189,7 +189,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,ppc64-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 cd9a4c9b7d..3b973aac26 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -135,3 +135,22 @@ class BootLinuxConsole(Test):
         self.vm.launch()
         console_pattern = 'Kernel command line: %s' % kernel_command_line
         self.wait_for_console_pattern(console_pattern)
+
+    def test_ppc64_pseries(self):
+        """
+        :avocado: tags=arch:ppc64
+        :avocado: tags=machine:pseries
+        """
+        kernel_url = ('http://mirrors.rit.edu/fedora/fedora-secondary/'
+                      'releases/29/Everything/ppc64le/os/ppc/ppc64/vmlinuz')
+        kernel_hash = '3fe04abfc852b66653b8c3c897a59a689270bc77'
+        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
+
+        self.vm.set_machine('pseries')
+        self.vm.set_console()
+        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=hvc0'
+        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)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 17/20] Boot Linux Console Test: add a test for aarch64 + virt
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (15 preceding siblings ...)
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 16/20] Boot Linux Console Test: add a test for ppc64 + pseries Cleber Rosa
@ 2019-02-02  0:56 ` Cleber Rosa
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 18/20] Boot Linux Console Test: add a test for arm " Cleber Rosa
                   ` (8 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

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).

Reviewed-by: Caio Carrara <ccarrara@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 .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 7fa13d15db..0dbd8183f6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -189,7 +189,7 @@ matrix:
 
     # Acceptance (Functional) tests
     - env:
-        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,ppc64-softmmu"
+        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,ppc64-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 3b973aac26..85502fa48a 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -154,3 +154,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_aarch64_virt(self):
+        """
+        :avocado: tags=arch:aarch64
+        :avocado: tags=machine:virt
+        """
+        kernel_url = ('https://sjc.edge.kernel.org/fedora-buffet/fedora/linux/'
+                      'releases/29/Server/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)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 18/20] Boot Linux Console Test: add a test for arm + virt
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (16 preceding siblings ...)
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 17/20] Boot Linux Console Test: add a test for aarch64 + virt Cleber Rosa
@ 2019-02-02  0:56 ` Cleber Rosa
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 19/20] Boot Linux Console Test: add a test for s390x + s390-ccw-virtio Cleber Rosa
                   ` (7 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

Just like the previous tests, boots a Linux kernel on an arm target
using the virt machine.

Reviewed-by: Caio Carrara <ccarrara@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 .travis.yml                            |  2 +-
 tests/acceptance/boot_linux_console.py | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 0dbd8183f6..0b6416ba06 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -189,7 +189,7 @@ matrix:
 
     # Acceptance (Functional) tests
     - env:
-        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,ppc64-softmmu,aarch64-softmmu"
+        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,ppc64-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 85502fa48a..4b031baf7a 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -174,3 +174,22 @@ 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://sjc.edge.kernel.org/fedora-buffet/fedora/linux/'
+                      'releases/29/Server/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)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 19/20] Boot Linux Console Test: add a test for s390x + s390-ccw-virtio
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (17 preceding siblings ...)
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 18/20] Boot Linux Console Test: add a test for arm " Cleber Rosa
@ 2019-02-02  0:56 ` Cleber Rosa
  2019-02-06 15:44   ` Cornelia Huck
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 20/20] Boot Linux Console Test: add a test for alpha + clipper Cleber Rosa
                   ` (6 subsequent siblings)
  25 siblings, 1 reply; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

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.

Reviewed-by: Caio Carrara <ccarrara@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 .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 0b6416ba06..31ff85920a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -189,7 +189,7 @@ matrix:
 
     # Acceptance (Functional) tests
     - env:
-        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,ppc64-softmmu,aarch64-softmmu,arm-softmmu"
+        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,ppc64-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 4b031baf7a..5d79099602 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -193,3 +193,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 = ('http://mirrors.rit.edu/fedora/fedora-secondary/releases'
+                      '/29/Server/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)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH v2 20/20] Boot Linux Console Test: add a test for alpha + clipper
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (18 preceding siblings ...)
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 19/20] Boot Linux Console Test: add a test for s390x + s390-ccw-virtio Cleber Rosa
@ 2019-02-02  0:56 ` Cleber Rosa
  2019-02-02 19:20 ` [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support no-reply
                   ` (5 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: Cleber Rosa @ 2019-02-02  0:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Cornelia Huck, Cleber Rosa,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic, 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.  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

Reviewed-by: Caio Carrara <ccarrara@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 .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 31ff85920a..5f477743c4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -189,7 +189,7 @@ matrix:
 
     # Acceptance (Functional) tests
     - env:
-        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,ppc64-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu"
+        - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,ppc64-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 5d79099602..1e956e540f 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -213,3 +213,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)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 10/20] Boot Linux Console Test: add common kernel command line options
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 10/20] Boot Linux Console Test: add common kernel command line options Cleber Rosa
@ 2019-02-02  1:01   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 40+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-02-02  1:01 UTC (permalink / raw)
  To: Cleber Rosa, qemu-devel
  Cc: Aleksandar Markovic, Caio Carrara, Wainer dos Santos Moschetta,
	Eduardo Habkost, Alex Bennée, Cornelia Huck,
	Aleksandar Rikalo, Aurelien Jarno, Fam Zheng, qemu-s390x,
	Stefan Markovic

On 2/2/19 1:56 AM, Cleber Rosa wrote:
> 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.

Thanks!

> 
> Signed-off-by: Cleber Rosa <crosa@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>  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 35b31162d4..cc5dcd7373 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -23,6 +23,8 @@ class BootLinuxConsole(Test):
>  
>      timeout = 60
>  
> +    KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
> +
>      def test_x86_64_pc(self):
>          """
>          :avocado: tags=arch:x86_64
> @@ -35,7 +37,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()
> 

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (19 preceding siblings ...)
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 20/20] Boot Linux Console Test: add a test for alpha + clipper Cleber Rosa
@ 2019-02-02 19:20 ` no-reply
  2019-02-02 19:20 ` no-reply
                   ` (4 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: no-reply @ 2019-02-02 19:20 UTC (permalink / raw)
  To: crosa; +Cc: fam, qemu-devel

Patchew URL: https://patchew.org/QEMU/20190202005610.24048-1-crosa@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support
Type: series
Message-id: 20190202005610.24048-1-crosa@redhat.com

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
6655fa70df Boot Linux Console Test: add a test for alpha + clipper
f6dd48f846 Boot Linux Console Test: add a test for s390x + s390-ccw-virtio
018f1969af Boot Linux Console Test: add a test for arm + virt
1b3a2357bc Boot Linux Console Test: add a test for aarch64 + virt
a72b513a01 Boot Linux Console Test: add a test for ppc64 + pseries
53b6bd6a83 Boot Linux Console Test: add a test for mips64el + malta
9e99bc7ca7 Boot Linux Console Test: add a test for mips + malta
ad537d2fcc scripts/qemu.py: support adding a console with the default serial device
a90473b9e3 Boot Linux Console Test: refactor the console watcher into utility method
31e1e8e772 Boot Linux Console Test: increase timeout
71fd9a8546 Boot Linux Console Test: add common kernel command line options
1f01854455 Boot Linux Console Test: update the x86_64 kernel
fd958acfdb Boot Linux Console Test: rename the x86_64 after the arch and machine
5353486417 Acceptance tests: look for target architecture in test tags first
0eec679cae Acceptance tests: use "arch:" tag to filter target specific tests
d8bdead7f5 Acceptance tests: introduce arch parameter and attribute
68ac450c2b Acceptance tests: fix doc reference to avocado_qemu directory
4ef4e6bab1 Acceptance tests: improve docstring on pick_default_qemu_bin()
9255bba791 Acceptance tests: show avocado test execution by default
3401845f7e scripts/qemu.py: log QEMU launch command line

=== OUTPUT BEGIN ===
1/20 Checking commit 3401845f7eb9 (scripts/qemu.py: log QEMU launch command line)
2/20 Checking commit 9255bba791a8 (Acceptance tests: show avocado test execution by default)
3/20 Checking commit 4ef4e6bab129 (Acceptance tests: improve docstring on pick_default_qemu_bin())
4/20 Checking commit 68ac450c2b81 (Acceptance tests: fix doc reference to avocado_qemu directory)
5/20 Checking commit d8bdead7f506 (Acceptance tests: introduce arch parameter and attribute)
6/20 Checking commit 0eec679cae2b (Acceptance tests: use "arch:" tag to filter target specific tests)
7/20 Checking commit 5353486417ba (Acceptance tests: look for target architecture in test tags first)
8/20 Checking commit fd958acfdb06 (Boot Linux Console Test: rename the x86_64 after the arch and machine)
9/20 Checking commit 1f018544557b (Boot Linux Console Test: update the x86_64 kernel)
10/20 Checking commit 71fd9a85460e (Boot Linux Console Test: add common kernel command line options)
11/20 Checking commit 31e1e8e772d2 (Boot Linux Console Test: increase timeout)
12/20 Checking commit a90473b9e34b (Boot Linux Console Test: refactor the console watcher into utility method)
13/20 Checking commit ad537d2fcc3d (scripts/qemu.py: support adding a console with the default serial device)
14/20 Checking commit 9e99bc7ca7b3 (Boot Linux Console Test: add a test for mips + malta)
15/20 Checking commit 53b6bd6a83fb (Boot Linux Console Test: add a test for mips64el + malta)
ERROR: line over 90 characters
#61: FILE: tests/acceptance/boot_linux_console.py:116:
+        [1] http://snapshot.debian.org/package/linux-2.6/2.6.32-48/#linux-source-2.6.32_2.6.32-48

ERROR: line over 90 characters
#62: FILE: tests/acceptance/boot_linux_console.py:117:
+        [2] https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-common-official

total: 2 errors, 0 warnings, 49 lines checked

Patch 15/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

16/20 Checking commit a72b513a0156 (Boot Linux Console Test: add a test for ppc64 + pseries)
17/20 Checking commit 1b3a2357bc57 (Boot Linux Console Test: add a test for aarch64 + virt)
WARNING: line over 80 characters
#51: FILE: tests/acceptance/boot_linux_console.py:170:
+        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyAMA0'

total: 0 errors, 1 warnings, 31 lines checked

Patch 17/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
18/20 Checking commit 018f1969af3b (Boot Linux Console Test: add a test for arm + virt)
WARNING: line over 80 characters
#48: FILE: tests/acceptance/boot_linux_console.py:190:
+        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyAMA0'

total: 0 errors, 1 warnings, 30 lines checked

Patch 18/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
19/20 Checking commit f6dd48f84608 (Boot Linux Console Test: add a test for s390x + s390-ccw-virtio)
20/20 Checking commit 6655fa70dfc9 (Boot Linux Console Test: add a test for alpha + clipper)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20190202005610.24048-1-crosa@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (20 preceding siblings ...)
  2019-02-02 19:20 ` [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support no-reply
@ 2019-02-02 19:20 ` no-reply
  2019-02-02 19:23 ` no-reply
                   ` (3 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: no-reply @ 2019-02-02 19:20 UTC (permalink / raw)
  To: crosa; +Cc: fam, qemu-devel

Patchew URL: https://patchew.org/QEMU/20190202005610.24048-1-crosa@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20190202005610.24048-1-crosa@redhat.com
Subject: [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20190202005610.24048-1-crosa@redhat.com -> patchew/20190202005610.24048-1-crosa@redhat.com
 * [new tag]         patchew/20190202011048.12343-1-jsnow@redhat.com -> patchew/20190202011048.12343-1-jsnow@redhat.com
 * [new tag]         patchew/20190202072456.6468-1-yang.zhong@intel.com -> patchew/20190202072456.6468-1-yang.zhong@intel.com
Switched to a new branch 'test'
6655fa7 Boot Linux Console Test: add a test for alpha + clipper
f6dd48f Boot Linux Console Test: add a test for s390x + s390-ccw-virtio
018f196 Boot Linux Console Test: add a test for arm + virt
1b3a235 Boot Linux Console Test: add a test for aarch64 + virt
a72b513 Boot Linux Console Test: add a test for ppc64 + pseries
53b6bd6 Boot Linux Console Test: add a test for mips64el + malta
9e99bc7 Boot Linux Console Test: add a test for mips + malta
ad537d2 scripts/qemu.py: support adding a console with the default serial device
a90473b Boot Linux Console Test: refactor the console watcher into utility method
31e1e8e Boot Linux Console Test: increase timeout
71fd9a8 Boot Linux Console Test: add common kernel command line options
1f01854 Boot Linux Console Test: update the x86_64 kernel
fd958ac Boot Linux Console Test: rename the x86_64 after the arch and machine
5353486 Acceptance tests: look for target architecture in test tags first
0eec679 Acceptance tests: use "arch:" tag to filter target specific tests
d8bdead Acceptance tests: introduce arch parameter and attribute
68ac450 Acceptance tests: fix doc reference to avocado_qemu directory
4ef4e6b Acceptance tests: improve docstring on pick_default_qemu_bin()
9255bba Acceptance tests: show avocado test execution by default
3401845 scripts/qemu.py: log QEMU launch command line

=== OUTPUT BEGIN ===
1/20 Checking commit 3401845f7eb9 (scripts/qemu.py: log QEMU launch command line)
2/20 Checking commit 9255bba791a8 (Acceptance tests: show avocado test execution by default)
3/20 Checking commit 4ef4e6bab129 (Acceptance tests: improve docstring on pick_default_qemu_bin())
4/20 Checking commit 68ac450c2b81 (Acceptance tests: fix doc reference to avocado_qemu directory)
5/20 Checking commit d8bdead7f506 (Acceptance tests: introduce arch parameter and attribute)
6/20 Checking commit 0eec679cae2b (Acceptance tests: use "arch:" tag to filter target specific tests)
7/20 Checking commit 5353486417ba (Acceptance tests: look for target architecture in test tags first)
8/20 Checking commit fd958acfdb06 (Boot Linux Console Test: rename the x86_64 after the arch and machine)
9/20 Checking commit 1f018544557b (Boot Linux Console Test: update the x86_64 kernel)
10/20 Checking commit 71fd9a85460e (Boot Linux Console Test: add common kernel command line options)
11/20 Checking commit 31e1e8e772d2 (Boot Linux Console Test: increase timeout)
12/20 Checking commit a90473b9e34b (Boot Linux Console Test: refactor the console watcher into utility method)
13/20 Checking commit ad537d2fcc3d (scripts/qemu.py: support adding a console with the default serial device)
14/20 Checking commit 9e99bc7ca7b3 (Boot Linux Console Test: add a test for mips + malta)
15/20 Checking commit 53b6bd6a83fb (Boot Linux Console Test: add a test for mips64el + malta)
ERROR: line over 90 characters
#61: FILE: tests/acceptance/boot_linux_console.py:116:
+        [1] http://snapshot.debian.org/package/linux-2.6/2.6.32-48/#linux-source-2.6.32_2.6.32-48

ERROR: line over 90 characters
#62: FILE: tests/acceptance/boot_linux_console.py:117:
+        [2] https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-common-official

total: 2 errors, 0 warnings, 49 lines checked

Patch 15/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

16/20 Checking commit a72b513a0156 (Boot Linux Console Test: add a test for ppc64 + pseries)
17/20 Checking commit 1b3a2357bc57 (Boot Linux Console Test: add a test for aarch64 + virt)
WARNING: line over 80 characters
#51: FILE: tests/acceptance/boot_linux_console.py:170:
+        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyAMA0'

total: 0 errors, 1 warnings, 31 lines checked

Patch 17/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
18/20 Checking commit 018f1969af3b (Boot Linux Console Test: add a test for arm + virt)
WARNING: line over 80 characters
#48: FILE: tests/acceptance/boot_linux_console.py:190:
+        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyAMA0'

total: 0 errors, 1 warnings, 30 lines checked

Patch 18/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
19/20 Checking commit f6dd48f84608 (Boot Linux Console Test: add a test for s390x + s390-ccw-virtio)
20/20 Checking commit 6655fa70dfc9 (Boot Linux Console Test: add a test for alpha + clipper)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20190202005610.24048-1-crosa@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (21 preceding siblings ...)
  2019-02-02 19:20 ` no-reply
@ 2019-02-02 19:23 ` no-reply
  2019-02-02 19:25 ` no-reply
                   ` (2 subsequent siblings)
  25 siblings, 0 replies; 40+ messages in thread
From: no-reply @ 2019-02-02 19:23 UTC (permalink / raw)
  To: crosa; +Cc: fam, qemu-devel

Patchew URL: https://patchew.org/QEMU/20190202005610.24048-1-crosa@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support
Message-id: 20190202005610.24048-1-crosa@redhat.com
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20190202005610.24048-1-crosa@redhat.com -> patchew/20190202005610.24048-1-crosa@redhat.com
 * [new tag]         patchew/20190202011048.12343-1-jsnow@redhat.com -> patchew/20190202011048.12343-1-jsnow@redhat.com
Submodule 'capstone' (https://git.qemu.org/git/capstone.git) registered for path 'capstone'
Submodule 'dtc' (https://git.qemu.org/git/dtc.git) registered for path 'dtc'
Submodule 'roms/QemuMacDrivers' (https://git.qemu.org/git/QemuMacDrivers.git) registered for path 'roms/QemuMacDrivers'
Submodule 'roms/SLOF' (https://git.qemu.org/git/SLOF.git) registered for path 'roms/SLOF'
Submodule 'roms/ipxe' (https://git.qemu.org/git/ipxe.git) registered for path 'roms/ipxe'
Submodule 'roms/openbios' (https://git.qemu.org/git/openbios.git) registered for path 'roms/openbios'
Submodule 'roms/openhackware' (https://git.qemu.org/git/openhackware.git) registered for path 'roms/openhackware'
Submodule 'roms/qemu-palcode' (https://git.qemu.org/git/qemu-palcode.git) registered for path 'roms/qemu-palcode'
Submodule 'roms/seabios' (https://git.qemu.org/git/seabios.git/) registered for path 'roms/seabios'
Submodule 'roms/seabios-hppa' (https://github.com/hdeller/seabios-hppa.git) registered for path 'roms/seabios-hppa'
Submodule 'roms/sgabios' (https://git.qemu.org/git/sgabios.git) registered for path 'roms/sgabios'
Submodule 'roms/skiboot' (https://git.qemu.org/git/skiboot.git) registered for path 'roms/skiboot'
Submodule 'roms/u-boot' (https://git.qemu.org/git/u-boot.git) registered for path 'roms/u-boot'
Submodule 'roms/u-boot-sam460ex' (https://git.qemu.org/git/u-boot-sam460ex.git) registered for path 'roms/u-boot-sam460ex'
Submodule 'tests/fp/berkeley-softfloat-3' (https://github.com/cota/berkeley-softfloat-3) registered for path 'tests/fp/berkeley-softfloat-3'
Submodule 'tests/fp/berkeley-testfloat-3' (https://github.com/cota/berkeley-testfloat-3) registered for path 'tests/fp/berkeley-testfloat-3'
Submodule 'ui/keycodemapdb' (https://git.qemu.org/git/keycodemapdb.git) registered for path 'ui/keycodemapdb'
Cloning into 'capstone'...
Submodule path 'capstone': checked out '22ead3e0bfdb87516656453336160e0a37b066bf'
Cloning into 'dtc'...
Submodule path 'dtc': checked out '88f18909db731a627456f26d779445f84e449536'
Cloning into 'roms/QemuMacDrivers'...
Submodule path 'roms/QemuMacDrivers': checked out 'd4e7d7ac663fcb55f1b93575445fcbca372f17a7'
Cloning into 'roms/SLOF'...
Submodule path 'roms/SLOF': checked out '9b7ab2fa020341dee8bf9df6c9cf40003e0136df'
Cloning into 'roms/ipxe'...
Submodule path 'roms/ipxe': checked out 'de4565cbe76ea9f7913a01f331be3ee901bb6e17'
Cloning into 'roms/openbios'...
Submodule path 'roms/openbios': checked out '441a84d3a642a10b948369c63f32367e8ff6395b'
Cloning into 'roms/openhackware'...
Submodule path 'roms/openhackware': checked out 'c559da7c8eec5e45ef1f67978827af6f0b9546f5'
Cloning into 'roms/qemu-palcode'...
Submodule path 'roms/qemu-palcode': checked out '51c237d7e20d05100eacadee2f61abc17e6bc097'
Cloning into 'roms/seabios'...
Submodule path 'roms/seabios': checked out 'a698c8995ffb2838296ec284fe3c4ad33dfca307'
Cloning into 'roms/seabios-hppa'...
Submodule path 'roms/seabios-hppa': checked out '1ef99a01572c2581c30e16e6fe69e9ea2ef92ce0'
Cloning into 'roms/sgabios'...
Submodule path 'roms/sgabios': checked out 'cbaee52287e5f32373181cff50a00b6c4ac9015a'
Cloning into 'roms/skiboot'...
Submodule path 'roms/skiboot': checked out 'e0ee24c27a172bcf482f6f2bc905e6211c134bcc'
Cloning into 'roms/u-boot'...
Submodule path 'roms/u-boot': checked out 'd85ca029f257b53a96da6c2fb421e78a003a9943'
Cloning into 'roms/u-boot-sam460ex'...
Submodule path 'roms/u-boot-sam460ex': checked out '60b3916f33e617a815973c5a6df77055b2e3a588'
Cloning into 'tests/fp/berkeley-softfloat-3'...
Submodule path 'tests/fp/berkeley-softfloat-3': checked out 'b64af41c3276f97f0e181920400ee056b9c88037'
Cloning into 'tests/fp/berkeley-testfloat-3'...
Submodule path 'tests/fp/berkeley-testfloat-3': checked out '5a59dcec19327396a011a17fd924aed4fec416b3'
Cloning into 'ui/keycodemapdb'...
Submodule path 'ui/keycodemapdb': checked out '6b3d716e2b6472eb7189d3220552280ef3d832ce'
Switched to a new branch 'test'
6655fa7 Boot Linux Console Test: add a test for alpha + clipper
f6dd48f Boot Linux Console Test: add a test for s390x + s390-ccw-virtio
018f196 Boot Linux Console Test: add a test for arm + virt
1b3a235 Boot Linux Console Test: add a test for aarch64 + virt
a72b513 Boot Linux Console Test: add a test for ppc64 + pseries
53b6bd6 Boot Linux Console Test: add a test for mips64el + malta
9e99bc7 Boot Linux Console Test: add a test for mips + malta
ad537d2 scripts/qemu.py: support adding a console with the default serial device
a90473b Boot Linux Console Test: refactor the console watcher into utility method
31e1e8e Boot Linux Console Test: increase timeout
71fd9a8 Boot Linux Console Test: add common kernel command line options
1f01854 Boot Linux Console Test: update the x86_64 kernel
fd958ac Boot Linux Console Test: rename the x86_64 after the arch and machine
5353486 Acceptance tests: look for target architecture in test tags first
0eec679 Acceptance tests: use "arch:" tag to filter target specific tests
d8bdead Acceptance tests: introduce arch parameter and attribute
68ac450 Acceptance tests: fix doc reference to avocado_qemu directory
4ef4e6b Acceptance tests: improve docstring on pick_default_qemu_bin()
9255bba Acceptance tests: show avocado test execution by default
3401845 scripts/qemu.py: log QEMU launch command line

=== OUTPUT BEGIN ===
1/20 Checking commit 3401845f7eb9 (scripts/qemu.py: log QEMU launch command line)
2/20 Checking commit 9255bba791a8 (Acceptance tests: show avocado test execution by default)
3/20 Checking commit 4ef4e6bab129 (Acceptance tests: improve docstring on pick_default_qemu_bin())
4/20 Checking commit 68ac450c2b81 (Acceptance tests: fix doc reference to avocado_qemu directory)
5/20 Checking commit d8bdead7f506 (Acceptance tests: introduce arch parameter and attribute)
6/20 Checking commit 0eec679cae2b (Acceptance tests: use "arch:" tag to filter target specific tests)
7/20 Checking commit 5353486417ba (Acceptance tests: look for target architecture in test tags first)
8/20 Checking commit fd958acfdb06 (Boot Linux Console Test: rename the x86_64 after the arch and machine)
9/20 Checking commit 1f018544557b (Boot Linux Console Test: update the x86_64 kernel)
10/20 Checking commit 71fd9a85460e (Boot Linux Console Test: add common kernel command line options)
11/20 Checking commit 31e1e8e772d2 (Boot Linux Console Test: increase timeout)
12/20 Checking commit a90473b9e34b (Boot Linux Console Test: refactor the console watcher into utility method)
13/20 Checking commit ad537d2fcc3d (scripts/qemu.py: support adding a console with the default serial device)
14/20 Checking commit 9e99bc7ca7b3 (Boot Linux Console Test: add a test for mips + malta)
15/20 Checking commit 53b6bd6a83fb (Boot Linux Console Test: add a test for mips64el + malta)
ERROR: line over 90 characters
#61: FILE: tests/acceptance/boot_linux_console.py:116:
+        [1] http://snapshot.debian.org/package/linux-2.6/2.6.32-48/#linux-source-2.6.32_2.6.32-48

ERROR: line over 90 characters
#62: FILE: tests/acceptance/boot_linux_console.py:117:
+        [2] https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-common-official

total: 2 errors, 0 warnings, 49 lines checked

Patch 15/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

16/20 Checking commit a72b513a0156 (Boot Linux Console Test: add a test for ppc64 + pseries)
17/20 Checking commit 1b3a2357bc57 (Boot Linux Console Test: add a test for aarch64 + virt)
WARNING: line over 80 characters
#51: FILE: tests/acceptance/boot_linux_console.py:170:
+        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyAMA0'

total: 0 errors, 1 warnings, 31 lines checked

Patch 17/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
18/20 Checking commit 018f1969af3b (Boot Linux Console Test: add a test for arm + virt)
WARNING: line over 80 characters
#48: FILE: tests/acceptance/boot_linux_console.py:190:
+        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyAMA0'

total: 0 errors, 1 warnings, 30 lines checked

Patch 18/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
19/20 Checking commit f6dd48f84608 (Boot Linux Console Test: add a test for s390x + s390-ccw-virtio)
20/20 Checking commit 6655fa70dfc9 (Boot Linux Console Test: add a test for alpha + clipper)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20190202005610.24048-1-crosa@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (22 preceding siblings ...)
  2019-02-02 19:23 ` no-reply
@ 2019-02-02 19:25 ` no-reply
  2019-02-02 19:26 ` no-reply
  2019-02-03 17:46 ` no-reply
  25 siblings, 0 replies; 40+ messages in thread
From: no-reply @ 2019-02-02 19:25 UTC (permalink / raw)
  To: crosa; +Cc: fam, qemu-devel

Patchew URL: https://patchew.org/QEMU/20190202005610.24048-1-crosa@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20190202005610.24048-1-crosa@redhat.com
Subject: [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 - [tag update]      patchew/20190202005610.24048-1-crosa@redhat.com -> patchew/20190202005610.24048-1-crosa@redhat.com
 * [new tag]         patchew/20190202144531.5772-1-n54@gmx.com -> patchew/20190202144531.5772-1-n54@gmx.com
Switched to a new branch 'test'
13c391b Boot Linux Console Test: add a test for alpha + clipper
273b9ac Boot Linux Console Test: add a test for s390x + s390-ccw-virtio
0a9b73c Boot Linux Console Test: add a test for arm + virt
e070e1d Boot Linux Console Test: add a test for aarch64 + virt
86d4a09 Boot Linux Console Test: add a test for ppc64 + pseries
d2b7457 Boot Linux Console Test: add a test for mips64el + malta
4f2bf45 Boot Linux Console Test: add a test for mips + malta
5d2bc37 scripts/qemu.py: support adding a console with the default serial device
e93021f Boot Linux Console Test: refactor the console watcher into utility method
58cb1eb Boot Linux Console Test: increase timeout
8e8235f Boot Linux Console Test: add common kernel command line options
5034fd3 Boot Linux Console Test: update the x86_64 kernel
14bbc9f Boot Linux Console Test: rename the x86_64 after the arch and machine
3787369 Acceptance tests: look for target architecture in test tags first
69d1e10 Acceptance tests: use "arch:" tag to filter target specific tests
8494959 Acceptance tests: introduce arch parameter and attribute
ae64545 Acceptance tests: fix doc reference to avocado_qemu directory
3ca6eaa Acceptance tests: improve docstring on pick_default_qemu_bin()
8960ff3 Acceptance tests: show avocado test execution by default
e154b53 scripts/qemu.py: log QEMU launch command line

=== OUTPUT BEGIN ===
1/20 Checking commit e154b53986c2 (scripts/qemu.py: log QEMU launch command line)
2/20 Checking commit 8960ff314a40 (Acceptance tests: show avocado test execution by default)
3/20 Checking commit 3ca6eaaa5580 (Acceptance tests: improve docstring on pick_default_qemu_bin())
4/20 Checking commit ae645458d956 (Acceptance tests: fix doc reference to avocado_qemu directory)
5/20 Checking commit 84949598dc7a (Acceptance tests: introduce arch parameter and attribute)
6/20 Checking commit 69d1e10ba586 (Acceptance tests: use "arch:" tag to filter target specific tests)
7/20 Checking commit 37873698dc9e (Acceptance tests: look for target architecture in test tags first)
8/20 Checking commit 14bbc9fdbca8 (Boot Linux Console Test: rename the x86_64 after the arch and machine)
9/20 Checking commit 5034fd3690c5 (Boot Linux Console Test: update the x86_64 kernel)
10/20 Checking commit 8e8235fd2f21 (Boot Linux Console Test: add common kernel command line options)
11/20 Checking commit 58cb1eb0af81 (Boot Linux Console Test: increase timeout)
12/20 Checking commit e93021fae9d0 (Boot Linux Console Test: refactor the console watcher into utility method)
13/20 Checking commit 5d2bc37cd347 (scripts/qemu.py: support adding a console with the default serial device)
14/20 Checking commit 4f2bf45f1281 (Boot Linux Console Test: add a test for mips + malta)
15/20 Checking commit d2b7457492bd (Boot Linux Console Test: add a test for mips64el + malta)
ERROR: line over 90 characters
#61: FILE: tests/acceptance/boot_linux_console.py:116:
+        [1] http://snapshot.debian.org/package/linux-2.6/2.6.32-48/#linux-source-2.6.32_2.6.32-48

ERROR: line over 90 characters
#62: FILE: tests/acceptance/boot_linux_console.py:117:
+        [2] https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-common-official

total: 2 errors, 0 warnings, 49 lines checked

Patch 15/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

16/20 Checking commit 86d4a092b14e (Boot Linux Console Test: add a test for ppc64 + pseries)
17/20 Checking commit e070e1db9f0f (Boot Linux Console Test: add a test for aarch64 + virt)
WARNING: line over 80 characters
#51: FILE: tests/acceptance/boot_linux_console.py:170:
+        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyAMA0'

total: 0 errors, 1 warnings, 31 lines checked

Patch 17/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
18/20 Checking commit 0a9b73c4cf58 (Boot Linux Console Test: add a test for arm + virt)
WARNING: line over 80 characters
#48: FILE: tests/acceptance/boot_linux_console.py:190:
+        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyAMA0'

total: 0 errors, 1 warnings, 30 lines checked

Patch 18/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
19/20 Checking commit 273b9ac35793 (Boot Linux Console Test: add a test for s390x + s390-ccw-virtio)
20/20 Checking commit 13c391bc2771 (Boot Linux Console Test: add a test for alpha + clipper)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20190202005610.24048-1-crosa@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (23 preceding siblings ...)
  2019-02-02 19:25 ` no-reply
@ 2019-02-02 19:26 ` no-reply
  2019-02-03 17:46 ` no-reply
  25 siblings, 0 replies; 40+ messages in thread
From: no-reply @ 2019-02-02 19:26 UTC (permalink / raw)
  To: crosa; +Cc: fam, qemu-devel

Patchew URL: https://patchew.org/QEMU/20190202005610.24048-1-crosa@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support
Type: series
Message-id: 20190202005610.24048-1-crosa@redhat.com

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 t [tag update]            patchew/20190202005610.24048-1-crosa@redhat.com -> patchew/20190202005610.24048-1-crosa@redhat.com
Switched to a new branch 'test'
17035afa87 Boot Linux Console Test: add a test for alpha + clipper
664f768105 Boot Linux Console Test: add a test for s390x + s390-ccw-virtio
af7932545d Boot Linux Console Test: add a test for arm + virt
afe4751b4d Boot Linux Console Test: add a test for aarch64 + virt
34684e2787 Boot Linux Console Test: add a test for ppc64 + pseries
828dece1c0 Boot Linux Console Test: add a test for mips64el + malta
eafeed88f9 Boot Linux Console Test: add a test for mips + malta
04af0c729d scripts/qemu.py: support adding a console with the default serial device
cb969cd6fe Boot Linux Console Test: refactor the console watcher into utility method
a446d2e9ba Boot Linux Console Test: increase timeout
cbedab968c Boot Linux Console Test: add common kernel command line options
14bf9a0f17 Boot Linux Console Test: update the x86_64 kernel
b41b04b466 Boot Linux Console Test: rename the x86_64 after the arch and machine
d957397957 Acceptance tests: look for target architecture in test tags first
e15cd2534a Acceptance tests: use "arch:" tag to filter target specific tests
c558ad7dc5 Acceptance tests: introduce arch parameter and attribute
981c7f300d Acceptance tests: fix doc reference to avocado_qemu directory
19b5d68909 Acceptance tests: improve docstring on pick_default_qemu_bin()
db08e24a7e Acceptance tests: show avocado test execution by default
fe7c5846dc scripts/qemu.py: log QEMU launch command line

=== OUTPUT BEGIN ===
1/20 Checking commit fe7c5846dca6 (scripts/qemu.py: log QEMU launch command line)
2/20 Checking commit db08e24a7ead (Acceptance tests: show avocado test execution by default)
3/20 Checking commit 19b5d6890978 (Acceptance tests: improve docstring on pick_default_qemu_bin())
4/20 Checking commit 981c7f300d93 (Acceptance tests: fix doc reference to avocado_qemu directory)
5/20 Checking commit c558ad7dc50a (Acceptance tests: introduce arch parameter and attribute)
6/20 Checking commit e15cd2534a41 (Acceptance tests: use "arch:" tag to filter target specific tests)
7/20 Checking commit d95739795725 (Acceptance tests: look for target architecture in test tags first)
8/20 Checking commit b41b04b4662d (Boot Linux Console Test: rename the x86_64 after the arch and machine)
9/20 Checking commit 14bf9a0f170e (Boot Linux Console Test: update the x86_64 kernel)
10/20 Checking commit cbedab968cbf (Boot Linux Console Test: add common kernel command line options)
11/20 Checking commit a446d2e9baf6 (Boot Linux Console Test: increase timeout)
12/20 Checking commit cb969cd6fe2b (Boot Linux Console Test: refactor the console watcher into utility method)
13/20 Checking commit 04af0c729dfa (scripts/qemu.py: support adding a console with the default serial device)
14/20 Checking commit eafeed88f9b4 (Boot Linux Console Test: add a test for mips + malta)
15/20 Checking commit 828dece1c0ce (Boot Linux Console Test: add a test for mips64el + malta)
ERROR: line over 90 characters
#61: FILE: tests/acceptance/boot_linux_console.py:116:
+        [1] http://snapshot.debian.org/package/linux-2.6/2.6.32-48/#linux-source-2.6.32_2.6.32-48

ERROR: line over 90 characters
#62: FILE: tests/acceptance/boot_linux_console.py:117:
+        [2] https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-common-official

total: 2 errors, 0 warnings, 49 lines checked

Patch 15/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

16/20 Checking commit 34684e2787d1 (Boot Linux Console Test: add a test for ppc64 + pseries)
17/20 Checking commit afe4751b4d91 (Boot Linux Console Test: add a test for aarch64 + virt)
WARNING: line over 80 characters
#51: FILE: tests/acceptance/boot_linux_console.py:170:
+        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyAMA0'

total: 0 errors, 1 warnings, 31 lines checked

Patch 17/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
18/20 Checking commit af7932545dc5 (Boot Linux Console Test: add a test for arm + virt)
WARNING: line over 80 characters
#48: FILE: tests/acceptance/boot_linux_console.py:190:
+        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyAMA0'

total: 0 errors, 1 warnings, 30 lines checked

Patch 18/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
19/20 Checking commit 664f768105fe (Boot Linux Console Test: add a test for s390x + s390-ccw-virtio)
20/20 Checking commit 17035afa8703 (Boot Linux Console Test: add a test for alpha + clipper)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20190202005610.24048-1-crosa@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support
  2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
                   ` (24 preceding siblings ...)
  2019-02-02 19:26 ` no-reply
@ 2019-02-03 17:46 ` no-reply
  25 siblings, 0 replies; 40+ messages in thread
From: no-reply @ 2019-02-03 17:46 UTC (permalink / raw)
  To: crosa; +Cc: fam, qemu-devel

Patchew URL: https://patchew.org/QEMU/20190202005610.24048-1-crosa@redhat.com/



Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
time make docker-test-mingw@fedora SHOW_ENV=1 J=14
=== TEST SCRIPT END ===


Configure options:
--enable-werror --target-list=x86_64-softmmu,aarch64-softmmu --prefix=/tmp/qemu-test/install --python=/usr/bin/python3 --cross-prefix=x86_64-w64-mingw32- --enable-trace-backends=simple --enable-gnutls --enable-nettle --enable-curl --enable-vnc --enable-bzip2 --enable-guest-agent --with-sdlabi=2.0
ERROR: unknown option --with-sdlabi=2.0
Try '/tmp/qemu-test/src/configure --help' for more information
# QEMU configure log Sun Feb  3 17:46:40 UTC 2019
# Configured with: '/tmp/qemu-test/src/configure' '--enable-werror' '--target-list=x86_64-softmmu,aarch64-softmmu' '--prefix=/tmp/qemu-test/install' '--python=/usr/bin/python3' '--cross-prefix=x86_64-w64-mingw32-' '--enable-trace-backends=simple' '--enable-gnutls' '--enable-nettle' '--enable-curl' '--enable-vnc' '--enable-bzip2' '--enable-guest-agent' '--with-sdlabi=2.0'
---
funcs: do_compiler do_cc compile_object check_define main
lines: 92 122 617 634 0
x86_64-w64-mingw32-gcc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -c -o config-temp/qemu-conf.o config-temp/qemu-conf.c
config-temp/qemu-conf.c:2:2: error: #error __linux__ not defined
 #error __linux__ not defined
  ^~~~~

---
funcs: do_compiler do_cc compile_object check_define main
lines: 92 122 617 686 0
x86_64-w64-mingw32-gcc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -c -o config-temp/qemu-conf.o config-temp/qemu-conf.c
config-temp/qemu-conf.c:2:2: error: #error __i386__ not defined
 #error __i386__ not defined
  ^~~~~

---
funcs: do_compiler do_cc compile_object check_define main
lines: 92 122 617 689 0
x86_64-w64-mingw32-gcc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -c -o config-temp/qemu-conf.o config-temp/qemu-conf.c
config-temp/qemu-conf.c:2:2: error: #error __ILP32__ not defined
 #error __ILP32__ not defined
  ^~~~~

---
lines: 92 128 920 0
x86_64-w64-mingw32-gcc -mthreads -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -g -liberty
/usr/lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld: cannot find -liberty
collect2: error: ld returned 1 exit status
Failed to run 'configure'
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 563, in <module>


The full log is available at
http://patchew.org/logs/20190202005610.24048-1-crosa@redhat.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 02/20] Acceptance tests: show avocado test execution by default
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 02/20] Acceptance tests: show avocado test execution by default Cleber Rosa
@ 2019-02-06 14:36   ` Cornelia Huck
  2019-02-06 17:02     ` Cleber Rosa
  0 siblings, 1 reply; 40+ messages in thread
From: Cornelia Huck @ 2019-02-06 14:36 UTC (permalink / raw)
  To: Cleber Rosa
  Cc: qemu-devel, Aleksandar Markovic, Caio Carrara,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Aleksandar Rikalo,
	Aurelien Jarno, Fam Zheng, qemu-s390x, Stefan Markovic

On Fri,  1 Feb 2019 19:55:52 -0500
Cleber Rosa <crosa@redhat.com> wrote:

> 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).

Btw: What are our expectations regarding execution time for tests?
Especially if we continue adding tests, and architecture-specific tests
are bound to be slower if run on a foreign architecture via tcg.

Would a make check-acceptance-quick command make sense? ("I only want
to verify quickly that I didn't break too much, so run the quicker
tests only, probably only for my host architecture")

> 
> 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.
> 
> Reviewed-by: Caio Carrara <ccarrara@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
>  .travis.yml            | 2 +-
>  tests/Makefile.include | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 05/20] Acceptance tests: introduce arch parameter and attribute
  2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 05/20] Acceptance tests: introduce arch parameter and attribute Cleber Rosa
@ 2019-02-06 15:40   ` Cornelia Huck
  2019-02-07 18:02     ` Cleber Rosa
  0 siblings, 1 reply; 40+ messages in thread
From: Cornelia Huck @ 2019-02-06 15:40 UTC (permalink / raw)
  To: Cleber Rosa
  Cc: qemu-devel, Aleksandar Markovic, Caio Carrara,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Aleksandar Rikalo,
	Aurelien Jarno, Fam Zheng, qemu-s390x, Stefan Markovic

On Fri,  1 Feb 2019 19:55:55 -0500
Cleber Rosa <crosa@redhat.com> wrote:

> 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

Thinking a bit more about this: These two are often, but not
necessarily, the same. For example, starting a machine with the 64 bit
variant of an architecture to run a guest with the 32 bit variant of
that architecture might be a valid case.

> 
> 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.
> 
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
>  docs/devel/testing.rst                    | 17 +++++++++++++++++
>  tests/acceptance/avocado_qemu/__init__.py | 14 +++++++++++---
>  2 files changed, 28 insertions(+), 3 deletions(-)
> 
> diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
> index 44c9b3ae74..d37c4b0e77 100644
> --- a/docs/devel/testing.rst
> +++ b/docs/devel/testing.rst
> @@ -689,6 +689,16 @@ vm
>  A QEMUMachine instance, initially configured according to the given
>  ``qemu_bin`` parameter.
>  
> +arch
> +~~~~
> +
> +The architecture that will be used on a number of different
> +scenarios.  For instance, when a QEMU binary is not explicitly given,
> +the one selected will depend on this attribute.

This is probably a bit too vague. (What are "different scenarios"?)

Does it select anything else than the architecture of the vm that will
be started?

> +
> +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
>  ~~~~~~~~
>  
> @@ -711,6 +721,13 @@ 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 be used on a number of different scenarios.

Same comment here.

> +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 d8d5b48dac..f580582602 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`).

This is more specific :)

> +    :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.vm = None
> +        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")
>          self.vm = QEMUMachine(self.qemu_bin)

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 19/20] Boot Linux Console Test: add a test for s390x + s390-ccw-virtio
  2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 19/20] Boot Linux Console Test: add a test for s390x + s390-ccw-virtio Cleber Rosa
@ 2019-02-06 15:44   ` Cornelia Huck
  0 siblings, 0 replies; 40+ messages in thread
From: Cornelia Huck @ 2019-02-06 15:44 UTC (permalink / raw)
  To: Cleber Rosa
  Cc: qemu-devel, Aleksandar Markovic, Caio Carrara,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Aleksandar Rikalo,
	Aurelien Jarno, Fam Zheng, qemu-s390x, Stefan Markovic

On Fri,  1 Feb 2019 19:56:09 -0500
Cleber Rosa <crosa@redhat.com> wrote:

> 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.
> 
> Reviewed-by: Caio Carrara <ccarrara@redhat.com>
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
>  .travis.yml                            |  2 +-
>  tests/acceptance/boot_linux_console.py | 20 ++++++++++++++++++++
>  2 files changed, 21 insertions(+), 1 deletion(-)

Reviewed-by: Cornelia Huck <cohuck@redhat.com>

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 02/20] Acceptance tests: show avocado test execution by default
  2019-02-06 14:36   ` Cornelia Huck
@ 2019-02-06 17:02     ` Cleber Rosa
  2019-02-06 17:20       ` Cornelia Huck
  0 siblings, 1 reply; 40+ messages in thread
From: Cleber Rosa @ 2019-02-06 17:02 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: qemu-devel, Aleksandar Markovic, Caio Carrara,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Aleksandar Rikalo,
	Aurelien Jarno, Fam Zheng, qemu-s390x, Stefan Markovic



On 2/6/19 9:36 AM, Cornelia Huck wrote:
> On Fri,  1 Feb 2019 19:55:52 -0500
> Cleber Rosa <crosa@redhat.com> wrote:
> 
>> 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).
> 
> Btw: What are our expectations regarding execution time for tests?
> Especially if we continue adding tests, and architecture-specific tests
> are bound to be slower if run on a foreign architecture via tcg.
> 
> Would a make check-acceptance-quick command make sense? ("I only want
> to verify quickly that I didn't break too much, so run the quicker
> tests only, probably only for my host architecture")
> 

Yes, it definitely makes sense.  Now, let me know if the following also
makes sense to you:

1) Because these tests focus on functional testing, the default
target/shortcut ("make check-acceptance") should run the complete set of
test cases (including the slow ones).

2) Requirements vary greatly from user to user, to while adding a
"check-acceptance-quick" is fine, you just mentioned one extra test
execution variation ("for my host architecture").  For those, the idea
is that:

 a) "make check-acceptance[-quick]" will adapt to the build environment
(if you only built s390x targets, that's all it's going to use)

 b) "avocado" command line interface *should* be easy enough to fulfill
other requirements, and not necessarily require a "make" target.  For
instance, if you're only interested in your host arch and one specific
machine type, a command line such as the following should do the trick:

  $ make check-venv
  $ ./tests/venv/bin/avocado run -t arch:`uname -m` -t
machine:WHAT_I_CARE_ABOUT tests/acceptance/

How does that sound?

Regards,
- Cleber.

>>
>> 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.
>>
>> Reviewed-by: Caio Carrara <ccarrara@redhat.com>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>> Signed-off-by: Cleber Rosa <crosa@redhat.com>
>> ---
>>  .travis.yml            | 2 +-
>>  tests/Makefile.include | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 02/20] Acceptance tests: show avocado test execution by default
  2019-02-06 17:02     ` Cleber Rosa
@ 2019-02-06 17:20       ` Cornelia Huck
  2019-02-06 17:36         ` Cleber Rosa
  0 siblings, 1 reply; 40+ messages in thread
From: Cornelia Huck @ 2019-02-06 17:20 UTC (permalink / raw)
  To: Cleber Rosa
  Cc: qemu-devel, Aleksandar Markovic, Caio Carrara,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Aleksandar Rikalo,
	Aurelien Jarno, Fam Zheng, qemu-s390x, Stefan Markovic

On Wed, 6 Feb 2019 12:02:55 -0500
Cleber Rosa <crosa@redhat.com> wrote:

> On 2/6/19 9:36 AM, Cornelia Huck wrote:
> > On Fri,  1 Feb 2019 19:55:52 -0500
> > Cleber Rosa <crosa@redhat.com> wrote:
> >   
> >> 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).  
> > 
> > Btw: What are our expectations regarding execution time for tests?
> > Especially if we continue adding tests, and architecture-specific tests
> > are bound to be slower if run on a foreign architecture via tcg.
> > 
> > Would a make check-acceptance-quick command make sense? ("I only want
> > to verify quickly that I didn't break too much, so run the quicker
> > tests only, probably only for my host architecture")
> >   
> 
> Yes, it definitely makes sense.  Now, let me know if the following also
> makes sense to you:
> 
> 1) Because these tests focus on functional testing, the default
> target/shortcut ("make check-acceptance") should run the complete set of
> test cases (including the slow ones).

Nod.

> 
> 2) Requirements vary greatly from user to user, to while adding a
> "check-acceptance-quick" is fine, you just mentioned one extra test
> execution variation ("for my host architecture").  For those, the idea
> is that:
> 
>  a) "make check-acceptance[-quick]" will adapt to the build environment
> (if you only built s390x targets, that's all it's going to use)

Yes. However, I usually build some extra targets (just to verify that
files that e.g. include headers I modify don't break for other
environments), but don't necessarily want to run all acceptance tests
for them (as I don't expect functional changes for them). That's
probably something I only want to do when I run the full set anyway.

> 
>  b) "avocado" command line interface *should* be easy enough to fulfill
> other requirements, and not necessarily require a "make" target.  For
> instance, if you're only interested in your host arch and one specific
> machine type, a command line such as the following should do the trick:
> 
>   $ make check-venv
>   $ ./tests/venv/bin/avocado run -t arch:`uname -m` -t
> machine:WHAT_I_CARE_ABOUT tests/acceptance/
> 
> How does that sound?

Yes, that looks quite usable (I can easily define aliases locally for
shortcuts) and solves the case I mentioned above.

So, to summarize:
- add 'make check-acceptance-quick' that excludes tests marked as 'slow'
- use the avocado command line interface to further narrow down
  architectures and machines, if wanted
?

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 02/20] Acceptance tests: show avocado test execution by default
  2019-02-06 17:20       ` Cornelia Huck
@ 2019-02-06 17:36         ` Cleber Rosa
  2019-02-07 10:25           ` Cornelia Huck
  0 siblings, 1 reply; 40+ messages in thread
From: Cleber Rosa @ 2019-02-06 17:36 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: Fam Zheng, Eduardo Habkost, Aleksandar Rikalo, Alex Bennée,
	qemu-devel, Wainer dos Santos Moschetta, Stefan Markovic,
	qemu-s390x, Aleksandar Markovic, Caio Carrara,
	Philippe Mathieu-Daudé,
	Aurelien Jarno



On 2/6/19 12:20 PM, Cornelia Huck wrote:
> On Wed, 6 Feb 2019 12:02:55 -0500
> Cleber Rosa <crosa@redhat.com> wrote:
> 
>> On 2/6/19 9:36 AM, Cornelia Huck wrote:
>>> On Fri,  1 Feb 2019 19:55:52 -0500
>>> Cleber Rosa <crosa@redhat.com> wrote:
>>>   
>>>> 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).  
>>>
>>> Btw: What are our expectations regarding execution time for tests?
>>> Especially if we continue adding tests, and architecture-specific tests
>>> are bound to be slower if run on a foreign architecture via tcg.
>>>
>>> Would a make check-acceptance-quick command make sense? ("I only want
>>> to verify quickly that I didn't break too much, so run the quicker
>>> tests only, probably only for my host architecture")
>>>   
>>
>> Yes, it definitely makes sense.  Now, let me know if the following also
>> makes sense to you:
>>
>> 1) Because these tests focus on functional testing, the default
>> target/shortcut ("make check-acceptance") should run the complete set of
>> test cases (including the slow ones).
> 
> Nod.
> 
>>
>> 2) Requirements vary greatly from user to user, to while adding a
>> "check-acceptance-quick" is fine, you just mentioned one extra test
>> execution variation ("for my host architecture").  For those, the idea
>> is that:
>>
>>  a) "make check-acceptance[-quick]" will adapt to the build environment
>> (if you only built s390x targets, that's all it's going to use)
> 
> Yes. However, I usually build some extra targets (just to verify that
> files that e.g. include headers I modify don't break for other
> environments), but don't necessarily want to run all acceptance tests
> for them (as I don't expect functional changes for them). That's
> probably something I only want to do when I run the full set anyway.
> 

Right, that's an interesting point I haven't thought of.

>>
>>  b) "avocado" command line interface *should* be easy enough to fulfill
>> other requirements, and not necessarily require a "make" target.  For
>> instance, if you're only interested in your host arch and one specific
>> machine type, a command line such as the following should do the trick:
>>
>>   $ make check-venv
>>   $ ./tests/venv/bin/avocado run -t arch:`uname -m` -t
>> machine:WHAT_I_CARE_ABOUT tests/acceptance/
>>
>> How does that sound?
> 
> Yes, that looks quite usable (I can easily define aliases locally for
> shortcuts) and solves the case I mentioned above.
> 
> So, to summarize:
> - add 'make check-acceptance-quick' that excludes tests marked as 'slow'

Yes... with one caveat: since the default is to have functional tests
that are not necessarily quick, the other approach has been used.  Tests
that are known to be quick are currently marked as such.

Anyway, this task is being tracked here:

https://trello.com/c/9HZWfKeE/79-add-a-make-check-acceptance-quick-target

> - use the avocado command line interface to further narrow down
>   architectures and machines, if wanted
> ?
> 

Yes.  Do you think this deserves a section in the docs?

Thanks!
- Cleber.

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 02/20] Acceptance tests: show avocado test execution by default
  2019-02-06 17:36         ` Cleber Rosa
@ 2019-02-07 10:25           ` Cornelia Huck
  2019-02-07 18:32             ` Cleber Rosa
  0 siblings, 1 reply; 40+ messages in thread
From: Cornelia Huck @ 2019-02-07 10:25 UTC (permalink / raw)
  To: Cleber Rosa
  Cc: Fam Zheng, Eduardo Habkost, Aleksandar Rikalo, Alex Bennée,
	qemu-devel, Wainer dos Santos Moschetta, Stefan Markovic,
	qemu-s390x, Aleksandar Markovic, Caio Carrara,
	Philippe Mathieu-Daudé,
	Aurelien Jarno

On Wed, 6 Feb 2019 12:36:23 -0500
Cleber Rosa <crosa@redhat.com> wrote:

> On 2/6/19 12:20 PM, Cornelia Huck wrote:
> > So, to summarize:
> > - add 'make check-acceptance-quick' that excludes tests marked as 'slow'  
> 
> Yes... with one caveat: since the default is to have functional tests
> that are not necessarily quick, the other approach has been used.  Tests
> that are known to be quick are currently marked as such.
> 
> Anyway, this task is being tracked here:
> 
> https://trello.com/c/9HZWfKeE/79-add-a-make-check-acceptance-quick-target

Yes, that sounds good as well.

> 
> > - use the avocado command line interface to further narrow down
> >   architectures and machines, if wanted
> > ?
> >   
> 
> Yes.  Do you think this deserves a section in the docs?

I know that I'll find myself searching the docs for that info at some
point in the future, so yes :)

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 05/20] Acceptance tests: introduce arch parameter and attribute
  2019-02-06 15:40   ` Cornelia Huck
@ 2019-02-07 18:02     ` Cleber Rosa
  2019-02-07 18:22       ` Cleber Rosa
  0 siblings, 1 reply; 40+ messages in thread
From: Cleber Rosa @ 2019-02-07 18:02 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: qemu-devel, Aleksandar Markovic, Caio Carrara,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Aleksandar Rikalo,
	Aurelien Jarno, Fam Zheng, qemu-s390x, Stefan Markovic



On 2/6/19 10:40 AM, Cornelia Huck wrote:
> On Fri,  1 Feb 2019 19:55:55 -0500
> Cleber Rosa <crosa@redhat.com> wrote:
> 
>> 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
> 
> Thinking a bit more about this: These two are often, but not
> necessarily, the same. For example, starting a machine with the 64 bit
> variant of an architecture to run a guest with the 32 bit variant of
> that architecture might be a valid case.
> 

I agree with everything you said, and that's why I imagine "arch" being
used as a safe default type of parameter.

See, the QEMU binary can be influenced by the "arch" parameter, but can
still be *defined* by the "qemu_bin" parameter.  That's the same
approach I believe can be applied to the architecture of the guest code.
 When time comes, we may add a "guest_arch" parameter of sorts.  We
don't have that use case now, but I believe we'll be covered when it comes.

>>
>> 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.
>>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> Signed-off-by: Cleber Rosa <crosa@redhat.com>
>> ---
>>  docs/devel/testing.rst                    | 17 +++++++++++++++++
>>  tests/acceptance/avocado_qemu/__init__.py | 14 +++++++++++---
>>  2 files changed, 28 insertions(+), 3 deletions(-)
>>
>> diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
>> index 44c9b3ae74..d37c4b0e77 100644
>> --- a/docs/devel/testing.rst
>> +++ b/docs/devel/testing.rst
>> @@ -689,6 +689,16 @@ vm
>>  A QEMUMachine instance, initially configured according to the given
>>  ``qemu_bin`` parameter.
>>  
>> +arch
>> +~~~~
>> +
>> +The architecture that will be used on a number of different
>> +scenarios.  For instance, when a QEMU binary is not explicitly given,
>> +the one selected will depend on this attribute.
> 
> This is probably a bit too vague. (What are "different scenarios"?)
> 

I believe it's kind of vague because I was thinking of both the
"framework level" code, and the possible uses in the tests.

At the "framework" level, it's only used for the case listed there
("when a QEMU binary is not explicitly given...").

> Does it select anything else than the architecture of the vm that will
> be started?
> 

No, it doesn't.  The idea here was that tests may choose to use the same
attribute value in their own specific ("different") scenarios.

I can certainly make this clearer.

>> +
>> +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
>>  ~~~~~~~~
>>  
>> @@ -711,6 +721,13 @@ 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 be used on a number of different scenarios.
> 
> Same comment here.
> 

ACK.

>> +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 d8d5b48dac..f580582602 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`).
> 
> This is more specific :)
> 

Yep, I'll make the other doc snippets clearer.

Thanks!
- Cleber.

>> +    :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.vm = None
>> +        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")
>>          self.vm = QEMUMachine(self.qemu_bin)
> 

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 05/20] Acceptance tests: introduce arch parameter and attribute
  2019-02-07 18:02     ` Cleber Rosa
@ 2019-02-07 18:22       ` Cleber Rosa
  2019-02-08 10:10         ` Cornelia Huck
  0 siblings, 1 reply; 40+ messages in thread
From: Cleber Rosa @ 2019-02-07 18:22 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: qemu-devel, Aleksandar Markovic, Caio Carrara,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Aleksandar Rikalo,
	Aurelien Jarno, Fam Zheng, qemu-s390x, Stefan Markovic



On 2/7/19 1:02 PM, Cleber Rosa wrote:
> 
> 
> On 2/6/19 10:40 AM, Cornelia Huck wrote:
>> On Fri,  1 Feb 2019 19:55:55 -0500
>> Cleber Rosa <crosa@redhat.com> wrote:
>>
>>> 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
>>
>> Thinking a bit more about this: These two are often, but not
>> necessarily, the same. For example, starting a machine with the 64 bit
>> variant of an architecture to run a guest with the 32 bit variant of
>> that architecture might be a valid case.
>>
> 
> I agree with everything you said, and that's why I imagine "arch" being
> used as a safe default type of parameter.
> 
> See, the QEMU binary can be influenced by the "arch" parameter, but can
> still be *defined* by the "qemu_bin" parameter.  That's the same
> approach I believe can be applied to the architecture of the guest code.
>  When time comes, we may add a "guest_arch" parameter of sorts.  We
> don't have that use case now, but I believe we'll be covered when it comes.
> 
>>>
>>> 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.
>>>
>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>> Signed-off-by: Cleber Rosa <crosa@redhat.com>
>>> ---
>>>  docs/devel/testing.rst                    | 17 +++++++++++++++++
>>>  tests/acceptance/avocado_qemu/__init__.py | 14 +++++++++++---
>>>  2 files changed, 28 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
>>> index 44c9b3ae74..d37c4b0e77 100644
>>> --- a/docs/devel/testing.rst
>>> +++ b/docs/devel/testing.rst
>>> @@ -689,6 +689,16 @@ vm
>>>  A QEMUMachine instance, initially configured according to the given
>>>  ``qemu_bin`` parameter.
>>>  
>>> +arch
>>> +~~~~
>>> +
>>> +The architecture that will be used on a number of different
>>> +scenarios.  For instance, when a QEMU binary is not explicitly given,
>>> +the one selected will depend on this attribute.
>>
>> This is probably a bit too vague. (What are "different scenarios"?)
>>
> 
> I believe it's kind of vague because I was thinking of both the
> "framework level" code, and the possible uses in the tests.
> 
> At the "framework" level, it's only used for the case listed there
> ("when a QEMU binary is not explicitly given...").
> 
>> Does it select anything else than the architecture of the vm that will
>> be started?
>>
> 
> No, it doesn't.  The idea here was that tests may choose to use the same
> attribute value in their own specific ("different") scenarios.
> 
> I can certainly make this clearer.
> 

Hi Cornelia,

How does this sound?

---

The architecture that will 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``.

---

It uses your previous point about the 64/32 bit host/guest as an
example.  Again, a test could use another parameter (not a Test class
attribute) if it wants to use code for a different arch than the host.

Thanks,
- Cleber.

>>> +
>>> +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
>>>  ~~~~~~~~
>>>  
>>> @@ -711,6 +721,13 @@ 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 be used on a number of different scenarios.
>>
>> Same comment here.
>>
> 
> ACK.
> 
>>> +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 d8d5b48dac..f580582602 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`).
>>
>> This is more specific :)
>>
> 
> Yep, I'll make the other doc snippets clearer.
> 
> Thanks!
> - Cleber.
> 
>>> +    :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.vm = None
>>> +        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")
>>>          self.vm = QEMUMachine(self.qemu_bin)
>>

-- 
Cleber Rosa
[ Sr Software Engineer - Virtualization Team - Red Hat ]
[ Avocado Test Framework - avocado-framework.github.io ]
[  7ABB 96EB 8B46 B94D 5E0F  E9BB 657E 8D33 A5F2 09F3  ]

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 02/20] Acceptance tests: show avocado test execution by default
  2019-02-07 10:25           ` Cornelia Huck
@ 2019-02-07 18:32             ` Cleber Rosa
  2019-02-08  9:54               ` Cornelia Huck
  0 siblings, 1 reply; 40+ messages in thread
From: Cleber Rosa @ 2019-02-07 18:32 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: Fam Zheng, Eduardo Habkost, Aleksandar Rikalo, Alex Bennée,
	qemu-devel, Wainer dos Santos Moschetta, Stefan Markovic,
	qemu-s390x, Aleksandar Markovic, Caio Carrara,
	Philippe Mathieu-Daudé,
	Aurelien Jarno



On 2/7/19 5:25 AM, Cornelia Huck wrote:
> On Wed, 6 Feb 2019 12:36:23 -0500
> Cleber Rosa <crosa@redhat.com> wrote:
> 
>> On 2/6/19 12:20 PM, Cornelia Huck wrote:
>>> So, to summarize:
>>> - add 'make check-acceptance-quick' that excludes tests marked as 'slow'  
>>
>> Yes... with one caveat: since the default is to have functional tests
>> that are not necessarily quick, the other approach has been used.  Tests
>> that are known to be quick are currently marked as such.
>>
>> Anyway, this task is being tracked here:
>>
>> https://trello.com/c/9HZWfKeE/79-add-a-make-check-acceptance-quick-target
> 
> Yes, that sounds good as well.
> 
>>
>>> - use the avocado command line interface to further narrow down
>>>   architectures and machines, if wanted
>>> ?
>>>   
>>
>> Yes.  Do you think this deserves a section in the docs?
> 
> I know that I'll find myself searching the docs for that info at some
> point in the future, so yes :)
> 

Sure thing, tracking it here:

https://trello.com/c/7Fxbtx6F/80-document-how-to-use-the-avocado-command-line-and-tags

Regards,
- Cleber.

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 02/20] Acceptance tests: show avocado test execution by default
  2019-02-07 18:32             ` Cleber Rosa
@ 2019-02-08  9:54               ` Cornelia Huck
  0 siblings, 0 replies; 40+ messages in thread
From: Cornelia Huck @ 2019-02-08  9:54 UTC (permalink / raw)
  To: Cleber Rosa
  Cc: Fam Zheng, Eduardo Habkost, Aleksandar Rikalo, Alex Bennée,
	qemu-devel, Wainer dos Santos Moschetta, Stefan Markovic,
	qemu-s390x, Aleksandar Markovic, Caio Carrara,
	Philippe Mathieu-Daudé,
	Aurelien Jarno

On Thu, 7 Feb 2019 13:32:54 -0500
Cleber Rosa <crosa@redhat.com> wrote:

> On 2/7/19 5:25 AM, Cornelia Huck wrote:
> > On Wed, 6 Feb 2019 12:36:23 -0500
> > Cleber Rosa <crosa@redhat.com> wrote:
> >   
> >> On 2/6/19 12:20 PM, Cornelia Huck wrote:  
> >>> So, to summarize:
> >>> - add 'make check-acceptance-quick' that excludes tests marked as 'slow'    
> >>
> >> Yes... with one caveat: since the default is to have functional tests
> >> that are not necessarily quick, the other approach has been used.  Tests
> >> that are known to be quick are currently marked as such.
> >>
> >> Anyway, this task is being tracked here:
> >>
> >> https://trello.com/c/9HZWfKeE/79-add-a-make-check-acceptance-quick-target  
> > 
> > Yes, that sounds good as well.
> >   
> >>  
> >>> - use the avocado command line interface to further narrow down
> >>>   architectures and machines, if wanted
> >>> ?
> >>>     
> >>
> >> Yes.  Do you think this deserves a section in the docs?  
> > 
> > I know that I'll find myself searching the docs for that info at some
> > point in the future, so yes :)
> >   
> 
> Sure thing, tracking it here:
> 
> https://trello.com/c/7Fxbtx6F/80-document-how-to-use-the-avocado-command-line-and-tags

Great, thanks!

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH v2 05/20] Acceptance tests: introduce arch parameter and attribute
  2019-02-07 18:22       ` Cleber Rosa
@ 2019-02-08 10:10         ` Cornelia Huck
  0 siblings, 0 replies; 40+ messages in thread
From: Cornelia Huck @ 2019-02-08 10:10 UTC (permalink / raw)
  To: Cleber Rosa
  Cc: qemu-devel, Aleksandar Markovic, Caio Carrara,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Eduardo Habkost, Alex Bennée, Aleksandar Rikalo,
	Aurelien Jarno, Fam Zheng, qemu-s390x, Stefan Markovic

On Thu, 7 Feb 2019 13:22:10 -0500
Cleber Rosa <crosa@redhat.com> wrote:

> On 2/7/19 1:02 PM, Cleber Rosa wrote:
> > 
> > 
> > On 2/6/19 10:40 AM, Cornelia Huck wrote:  
> >> On Fri,  1 Feb 2019 19:55:55 -0500
> >> Cleber Rosa <crosa@redhat.com> wrote:
> >>  
> >>> 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  
> >>
> >> Thinking a bit more about this: These two are often, but not
> >> necessarily, the same. For example, starting a machine with the 64 bit
> >> variant of an architecture to run a guest with the 32 bit variant of
> >> that architecture might be a valid case.
> >>  
> > 
> > I agree with everything you said, and that's why I imagine "arch" being
> > used as a safe default type of parameter.
> > 
> > See, the QEMU binary can be influenced by the "arch" parameter, but can
> > still be *defined* by the "qemu_bin" parameter.  That's the same
> > approach I believe can be applied to the architecture of the guest code.
> >  When time comes, we may add a "guest_arch" parameter of sorts.  We
> > don't have that use case now, but I believe we'll be covered when it comes.

Ok, makes sense.

> >   
> >>>
> >>> 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.
> >>>
> >>> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> >>> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> >>> ---
> >>>  docs/devel/testing.rst                    | 17 +++++++++++++++++
> >>>  tests/acceptance/avocado_qemu/__init__.py | 14 +++++++++++---
> >>>  2 files changed, 28 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
> >>> index 44c9b3ae74..d37c4b0e77 100644
> >>> --- a/docs/devel/testing.rst
> >>> +++ b/docs/devel/testing.rst
> >>> @@ -689,6 +689,16 @@ vm
> >>>  A QEMUMachine instance, initially configured according to the given
> >>>  ``qemu_bin`` parameter.
> >>>  
> >>> +arch
> >>> +~~~~
> >>> +
> >>> +The architecture that will be used on a number of different
> >>> +scenarios.  For instance, when a QEMU binary is not explicitly given,
> >>> +the one selected will depend on this attribute.  
> >>
> >> This is probably a bit too vague. (What are "different scenarios"?)
> >>  
> > 
> > I believe it's kind of vague because I was thinking of both the
> > "framework level" code, and the possible uses in the tests.
> > 
> > At the "framework" level, it's only used for the case listed there
> > ("when a QEMU binary is not explicitly given...").
> >   
> >> Does it select anything else than the architecture of the vm that will
> >> be started?
> >>  
> > 
> > No, it doesn't.  The idea here was that tests may choose to use the same
> > attribute value in their own specific ("different") scenarios.
> > 
> > I can certainly make this clearer.
> >   
> 
> Hi Cornelia,
> 
> How does this sound?
> 
> ---

What about adding the following as a lead-in:

"The architecture can be used on different levels of the stack, e.g. by
the framework or by the test itself."

That would probably explain what you wanted to express with "different
scenarios".

> 
> The architecture that will influence the selection of a QEMU binary
> (when one is not explicitly given).

s/that will/will/ ?

> 
> 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``.
> 
> ---
> 
> It uses your previous point about the 64/32 bit host/guest as an
> example.  Again, a test could use another parameter (not a Test class
> attribute) if it wants to use code for a different arch than the host.

Sounds good!

^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2019-02-08 10:11 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-02  0:55 [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support Cleber Rosa
2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 01/20] scripts/qemu.py: log QEMU launch command line Cleber Rosa
2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 02/20] Acceptance tests: show avocado test execution by default Cleber Rosa
2019-02-06 14:36   ` Cornelia Huck
2019-02-06 17:02     ` Cleber Rosa
2019-02-06 17:20       ` Cornelia Huck
2019-02-06 17:36         ` Cleber Rosa
2019-02-07 10:25           ` Cornelia Huck
2019-02-07 18:32             ` Cleber Rosa
2019-02-08  9:54               ` Cornelia Huck
2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 03/20] Acceptance tests: improve docstring on pick_default_qemu_bin() Cleber Rosa
2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 04/20] Acceptance tests: fix doc reference to avocado_qemu directory Cleber Rosa
2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 05/20] Acceptance tests: introduce arch parameter and attribute Cleber Rosa
2019-02-06 15:40   ` Cornelia Huck
2019-02-07 18:02     ` Cleber Rosa
2019-02-07 18:22       ` Cleber Rosa
2019-02-08 10:10         ` Cornelia Huck
2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 06/20] Acceptance tests: use "arch:" tag to filter target specific tests Cleber Rosa
2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 07/20] Acceptance tests: look for target architecture in test tags first Cleber Rosa
2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 08/20] Boot Linux Console Test: rename the x86_64 after the arch and machine Cleber Rosa
2019-02-02  0:55 ` [Qemu-devel] [PATCH v2 09/20] Boot Linux Console Test: update the x86_64 kernel Cleber Rosa
2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 10/20] Boot Linux Console Test: add common kernel command line options Cleber Rosa
2019-02-02  1:01   ` Philippe Mathieu-Daudé
2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 11/20] Boot Linux Console Test: increase timeout Cleber Rosa
2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 12/20] Boot Linux Console Test: refactor the console watcher into utility method Cleber Rosa
2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 13/20] scripts/qemu.py: support adding a console with the default serial device Cleber Rosa
2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 14/20] Boot Linux Console Test: add a test for mips + malta Cleber Rosa
2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 15/20] Boot Linux Console Test: add a test for mips64el " Cleber Rosa
2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 16/20] Boot Linux Console Test: add a test for ppc64 + pseries Cleber Rosa
2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 17/20] Boot Linux Console Test: add a test for aarch64 + virt Cleber Rosa
2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 18/20] Boot Linux Console Test: add a test for arm " Cleber Rosa
2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 19/20] Boot Linux Console Test: add a test for s390x + s390-ccw-virtio Cleber Rosa
2019-02-06 15:44   ` Cornelia Huck
2019-02-02  0:56 ` [Qemu-devel] [PATCH v2 20/20] Boot Linux Console Test: add a test for alpha + clipper Cleber Rosa
2019-02-02 19:20 ` [Qemu-devel] [PATCH v2 00/20] Acceptance Tests: target architecture support no-reply
2019-02-02 19:20 ` no-reply
2019-02-02 19:23 ` no-reply
2019-02-02 19:25 ` no-reply
2019-02-02 19:26 ` no-reply
2019-02-03 17:46 ` no-reply

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.