From patchwork Tue Mar 12 17:18:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1055614 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44Jj3d611kz9sBb for ; Wed, 13 Mar 2019 04:42:37 +1100 (AEDT) Received: from localhost ([127.0.0.1]:56608 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3lQB-0001TC-61 for incoming@patchwork.ozlabs.org; Tue, 12 Mar 2019 13:42:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3l2w-0005uq-Tz for qemu-devel@nongnu.org; Tue, 12 Mar 2019 13:18:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3l2v-0006Zx-1J for qemu-devel@nongnu.org; Tue, 12 Mar 2019 13:18:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55050) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h3l2u-0006ZA-NJ; Tue, 12 Mar 2019 13:18:32 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B369A30A20CA; Tue, 12 Mar 2019 17:18:31 +0000 (UTC) Received: from dhcp-17-165.bos.redhat.com (dhcp-17-165.bos.redhat.com [10.18.17.165]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B68296014E; Tue, 12 Mar 2019 17:18:25 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Date: Tue, 12 Mar 2019 13:18:04 -0400 Message-Id: <20190312171824.5134-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 12 Mar 2019 17:18:32 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v5 00/20] Acceptance Tests: target architecture support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Eduardo Habkost , Stefan Markovic , =?utf-8?q?Alex_Benn=C3=A9e?= , Cornelia Huck , Markus Armbruster , Wainer dos Santos Moschetta , Aleksandar Rikalo , qemu-s390x@nongnu.org, Aleksandar Markovic , Cleber Rosa , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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. --- Changes from v4: ================ * On "scripts/qemu.py: support adding a console with the default serial device" - Improved commit message (s/the "-serial"/the "-serial" option/) and ( (s/as it is/as is/) (Cornelia) * On "Boot Linux Console Test: update the x86_64 kernel": - Use the standard Fedora download URI for the kernel image (Daniel) * On "Boot Linux Console Test: add a test for ppc64 + pseries" - Use the standard Fedora download URI for the kernel image (Daniel) * On "Boot Linux Console Test: add a test for aarch64 + virt" - Use the standard Fedora download URI for the kernel image (Daniel) * on "Boot Linux Console Test: add a test for arm + virt" - Use the standard Fedora download URI for the kernel image (Daniel) * New commit "Boot Linux Console Test for ppc64 + pseries: use power8 CPU model" - To cope with changes introduced by da874d90a Changes from v3: ================ * On "Acceptance tests: introduce arch parameter and attribute": - Fixed a typo (s/will will/will/) (Cornelia) - Added a comma to the pick_default_qemu_bin() docstring for easier reading (Cornelia) * On "Acceptance tests: use "arch:" tag to filter target specific tests": - Adjust the commit message to the fact that more tests use the "x86_64" tag (Cornelia) - Fixed a typo (s/class, class/class/) (Cornelia) - Dropped the bump in avocado-framework version, given that commit 9531d26c106 did that for other reasons (Cornelia) * On "Boot Linux Console Test: update the x86_64 kernel" - Changed the commit message to be self contained and not use the commit title (Phillipe) * On "scripts/qemu.py: support adding a console with the default serial device": - Changed the wording on the commit message (Cornelia) - Fixed a typo (s/my/by/) (Cornelia) - Dropped the CONSOLE_DEV_TYPES dict and the logic to use, as all targets and machine types tested now work with "-serial" (Cornelia) * On "Boot Linux Console Test: add a test for mips64el + malta": - Dropped duplicate "import os" line (Phillipe) * Dropped "scripts/qemu.py: log QEMU launch command line", already on master Changes from v2: ================ * On "Acceptance tests: introduce arch parameter and attribute": - Made the documentation on the "arch" attribute and parameter clearer as to what the framework does with them, and what tests may use them for (Cornelia). * On "Acceptance tests: use "arch:" tag to filter target specific tests": - Bumped avocado-framework to the latest release (68.0, instead of 67.0 on v2). * On "Boot Linux Console Test: add a test for mips64el + malta": - Broke down kernel source/doc URLs lines on docstring to make patchew happy about number of columns in line * On "Boot Linux Console Test: add a test for aarch64 + virt" - Broke down "kernel_command_line" assignment line to make patchew happy about number of columns in line * On "Boot Linux Console Test: add a test for arm + virt" - Broke down "kernel_command_line" assignment line to make patchew happy about number of columns in line Open issues during v2: ====================== * 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 * 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 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_v5 - Remote: https://github.com/clebergnu/qemu - Branch: sent/target_arch_v5 Travis CI: - Build: https://travis-ci.org/clebergnu/qemu/builds/505337647 Cleber Rosa (19): 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 for ppc64 + pseries: use power8 CPU model 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 | 35 +++- python/qemu/__init__.py | 48 ++--- tests/Makefile.include | 5 +- tests/acceptance/avocado_qemu/__init__.py | 23 ++- tests/acceptance/boot_linux_console.py | 231 ++++++++++++++++++++-- tests/acceptance/linux_initrd.py | 2 +- tests/acceptance/virtio_version.py | 2 +- 8 files changed, 289 insertions(+), 61 deletions(-)