qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cleber Rosa <crosa@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, "Eduardo Habkost" <ehabkost@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Fam Zheng" <famz@redhat.com>, "Amador Pahim" <amador@pahim.org>
Subject: Re: [Qemu-devel] [PATCH v3 1/5] Add functional/acceptance tests infrastructure
Date: Wed, 30 May 2018 14:15:07 -0400	[thread overview]
Message-ID: <76cb5c01-fab1-c846-58ad-b05bf8d59ef9@redhat.com> (raw)
In-Reply-To: <20180530125421.GJ14623@stefanha-x1.localdomain>



On 05/30/2018 08:54 AM, Stefan Hajnoczi wrote:
> On Tue, May 29, 2018 at 03:37:26PM -0400, Cleber Rosa wrote:
>> diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
>> index 0ca1a2d4b5..5e090c87fb 100644
>> --- a/docs/devel/testing.rst
>> +++ b/docs/devel/testing.rst
>> @@ -484,3 +484,156 @@ supported. To start the fuzzer, run
>>  
>>  Alternatively, some command different from "qemu-img info" can be tested, by
>>  changing the ``-c`` option.
>> +
>> +Acceptance tests using the Avocado Framework
>> +============================================
>> +
>> +The ``tests/acceptance`` directory hosts functional tests, also known
>> +as acceptance level tests.  They're usually higher level, and may
>> +interact with external resources and with various guest operating
>> +systems.
> 
> Can you give more concrete examples of what acceptance tests do?  This
> will make it easier for readers to understand where Avocado fits in.
> 
> Things that come to mind: checking the behavior of QMP commands and
> guest OS commands.
> 

Sure.  How about:

---

Tests based on ``avocado_qemu.Test`` can easily:

 * Customize the command line arguments given to the convenience
   ``self.vm`` attribute (a QEMUMachine instance)

 * Interact with the QEMU monitor, send QMP commands and check
   their results

 * Interact with the guest OS, using the convenience console device
   (which may be useful to assert the effectiveness and correctness of
   command line arguments or QMP commands)

 * Interact with external data files that accompany the test itself
   (see ``avocado.Test.get_data()``)

 * Donwload (and cache) remote data files such as firmware and kernel
   images

 * Have access to a library of guest OS images (by means of the
   ``avocado.utils.vmimage`` library)

 * Make use of various other test related utilities available at the
   test class itself and at the utility library:

   -
http://avocado-framework.readthedocs.io/en/latest/api/test/avocado.html#avocado.Test
   -
http://avocado-framework.readthedocs.io/en/latest/api/utils/avocado.utils.html


---

>> +To run all tests in the current directory, tagged in a particular way,
>> +run:
>> +
>> +.. code::
>> +
>> +  avocado run -t <TAG> .
> 
> What is TAG?  I guess this identifies a subset of tests to run?
> 

I'm trying to avoid too many references to the Avocado documentation, so
this could become:

---

Tests may be classified according to a convention by using docstring
directives such as ``:avocado: tags=TAG1,TAG2``.  To run all tests
in the current directory, tagged as "quick", run:

.. code::

  avocado run -t quick .

---

>> +QEMUMachine
>> +~~~~~~~~~~~
>> +
>> +The QEMUMachine API should be somewhat familiar to QEMU hackers.  It's
>> +used in the Python iotests, device-crash-test and other Python scripts.
> 
> This is not useful to someone who isn't a QEMU hacker :).
> 

True... so I would ask, why are they wandering around here? :D

Now, seriously, I'll add a bit of extra info here on v4.

> Please explain that QEMUMachine is a class for controlling a QEMU
> instance, including command-line arguments and monitor commands/events.
> 

Sure thing.

- Cleber.

  reply	other threads:[~2018-05-30 18:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29 19:37 [Qemu-devel] [PATCH v3 0/5] Acceptance/functional tests Cleber Rosa
2018-05-29 19:37 ` [Qemu-devel] [PATCH v3 1/5] Add functional/acceptance tests infrastructure Cleber Rosa
2018-05-30 12:54   ` Stefan Hajnoczi
2018-05-30 18:15     ` Cleber Rosa [this message]
2018-05-29 19:37 ` [Qemu-devel] [PATCH v3 2/5] scripts/qemu.py: allow adding to the list of extra arguments Cleber Rosa
2018-05-30 12:54   ` Stefan Hajnoczi
2018-05-29 19:37 ` [Qemu-devel] [PATCH v3 3/5] Acceptance tests: add quick VNC tests Cleber Rosa
2018-05-30 12:57   ` Stefan Hajnoczi
2018-05-30 13:04     ` Fam Zheng
2018-05-30 16:29     ` Eduardo Habkost
2018-05-30 18:00       ` Cleber Rosa
2018-05-30 20:00         ` Eduardo Habkost
2018-05-30 21:03           ` Cleber Rosa
2018-05-30 21:31             ` Eduardo Habkost
2018-05-30 22:28               ` Cleber Rosa
2018-05-30 12:57   ` Stefan Hajnoczi
2018-05-29 19:37 ` [Qemu-devel] [PATCH v3 4/5] scripts/qemu.py: introduce set_console() method Cleber Rosa
2018-05-30 19:17   ` Stefan Hajnoczi
2018-05-29 19:37 ` [Qemu-devel] [PATCH v3 5/5] Acceptance tests: add Linux kernel boot and console checking test Cleber Rosa
2018-05-30 19:20   ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=76cb5c01-fab1-c846-58ad-b05bf8d59ef9@redhat.com \
    --to=crosa@redhat.com \
    --cc=amador@pahim.org \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=famz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).