From patchwork Tue May 29 19:37:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 922339 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=2001:4830:134:3::11; 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 [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40wPKK0dSBz9s08 for ; Wed, 30 May 2018 05:43:17 +1000 (AEST) Received: from localhost ([::1]:34676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNkWY-0004Om-Ls for incoming@patchwork.ozlabs.org; Tue, 29 May 2018 15:43:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNkRP-0000aV-EN for qemu-devel@nongnu.org; Tue, 29 May 2018 15:37:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNkRM-0006OK-AT for qemu-devel@nongnu.org; Tue, 29 May 2018 15:37:55 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58490 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fNkRM-0006OC-4R for qemu-devel@nongnu.org; Tue, 29 May 2018 15:37:52 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A8849738E0; Tue, 29 May 2018 19:37:51 +0000 (UTC) Received: from dhcp-17-32.bos.redhat.com (dhcp-17-32.bos.redhat.com [10.18.17.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6312A63F48; Tue, 29 May 2018 19:37:46 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Date: Tue, 29 May 2018 15:37:25 -0400 Message-Id: <20180529193730.9204-1-crosa@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 29 May 2018 19:37:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 29 May 2018 19:37:51 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'crosa@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 0/5] Acceptance/functional tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amador Pahim , Fam Zheng , Eduardo Habkost , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" TL;DR ===== Another version, with a minimalist approach, to the acceptance tests infrastructure for QEMU, based on the Avocado Testing Framework. Background ========== The previous version, still considered an RFC, was sent to the list by Eduardo[1] was based on the work held in Amador's branch[2]. After reviewing in under a different light, including the experiences done and reported by Philippe[3], it was clear to me that a different approach would be better. Differences from previous versions ================================== The main difference is that this series include only the minimal changes deemed necessary to have a starting point. I like to think that it's better connected to the QEMU community and project needs, and will hopefully allow for a more organic growth. Since this version has less features than the previous versions, provided it's accepted, these are the next probable development tasks: * Provide a simple variants mechanism to allow the same tests to be run under different targets, machine models and devices (present on the previous versions as a "YAML to Mux" file with architecture definitions) * Implement QEMUMachine migration support (present on the previous version in the "avocado_qemu.test._VM" class) * Implement Guest OS image selection and download (mostly an Avocado feature, paired with a parameter convention and cloud-init support code) * Implement interactive support for Guest OS sessions (present on the previous versions, supported by the aexpect Python module) * Move the Python modules that are used on tests to a more proper "module" organization. This should allow for a proper place to hold tests for the Python modules themselves. Even though this version shares very little (if any) code with the previous versions, the following is a list of noteworthy changes: * Tests directory is now "tests/acceptance" (was "tests/avocado") * Base test class is now "avocado_qemu.Test" (was "avocado_qemu.test.QemuTest") * Base test class is now hosted in "avocado_qemu/__init__.py" (was "avocado_qemu/test.py") * Direct use of "qemu.QEMUMachine", that is, the avocado_qemu.test._VM class is gone * avocado_qemu.Test won't search for QEMU binaries on $PATH. To use QEMU binary on a custom system location it's necessary to use the "qemu_bin" parameter * Example test in README.rst is distributed as a real test ("test_version.py") * A new "Linux boot console" test, loosely modeled after Phillipe's use case Changes ======= From v2 ------- * Renamed acceptance test files, dropping "test_" prefix. * Dropped "scripts/test_qemu.py" until we have a proper Python module location on which to put their own tests. From v1 ------- * Moved documentation to docs/devel/testing.rst * Changed code markers from "::" to ".. code::" in the documentation for consistency * Added copyright notices * Removed useless "qemu_bin=None" attribution on avocado_qemu.Test.setUp() * Removed reference about setting arguments, instead of appending them, on "Acceptance tests: add quick VNC tests" commit message * Fixed typo (s/inteligence/intelligence/) on "scripts/qemu.py: introduce set_console() method" commit message * Removed useless "return" in add_args() Commit summary ============== Cleber Rosa (5): Add functional/acceptance tests infrastructure scripts/qemu.py: allow adding to the list of extra arguments Acceptance tests: add quick VNC tests scripts/qemu.py: introduce set_console() method Acceptance tests: add Linux kernel boot and console checking test docs/devel/testing.rst | 153 +++++++++++++++++++++++++++++ scripts/qemu.py | 103 ++++++++++++++++++- tests/acceptance/README.rst | 10 ++ tests/acceptance/avocado_qemu/__init__.py | 54 ++++++++++ tests/acceptance/boot_linux_console.py | 47 +++++++++ tests/acceptance/version.py | 24 +++++ tests/acceptance/vnc.py | 60 +++++++++++ 7 files changed, 450 insertions(+), 1 deletion(-) create mode 100644 tests/acceptance/README.rst create mode 100644 tests/acceptance/avocado_qemu/__init__.py create mode 100644 tests/acceptance/boot_linux_console.py create mode 100644 tests/acceptance/version.py create mode 100644 tests/acceptance/vnc.py --- [1] https://lists.gnu.org/archive/html/qemu-devel/2018-04/msg03443.html [2] https://github.com/apahim/qemu/commits/avocado_qemu [3] https://lists.gnu.org/archive/html/qemu-devel/2018-04/msg03076.html