Skip to contentSkip to conversation

Integration testing patches for 2021-11-08

GIT PULL Applied Philippe Mathieu-Daudé 2 participants 11 messages Nov 8, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

The following changes since commit 260f9210d2ce892c5e162a45b0e5ec0036bedc79:

Merge remote-tracking branch 'remotes/marcandre.lureau/tags/sphinx-pull-request' into staging (2021-11-08 14:56:10 +0100)

are available in the Git repository at:

https://github.com/philmd/qemu.git tags/avocado-20211108

for you to fetch changes up to b94d00898a9ee708b4d4b79432c2272905a56b06:

tests/avocado: Remove p7zip binary availability check (2021-11-08 17:00:22 +0100)

----------------------------------------------------------------
Integration testing patches

- Rename tests/acceptance/ -> tests/avocado/
- Rename avocado_qemu.Test -> avocado_qemu.QemuSystemTest
- Introduce QemuUserTest class
- Add the first linux-user test, covering the bFLT loader

----------------------------------------------------------------

Philippe Mathieu-Daudé (7):
tests/avocado: Extract QemuBaseTest from Test tests/avocado: Make pick_default_qemu_bin() more generic tests/avocado: Introduce QemuUserTest base class tests/avocado: Share useful helpers from virtiofs_submounts test tests/avocado: Add bFLT loader linux-user test tests/avocado: Rename avocado_qemu.Test -> QemuSystemTest tests/avocado: Remove p7zip binary availability check

Willian Rampazzo (2):
tests/acceptance: introduce new check-avocado target tests/acceptance: rename tests acceptance to tests avocado

 docs/devel/build-system.rst                   |   2 +-
 docs/devel/ci-definitions.rst.inc             |   2 +-
 docs/devel/testing.rst                        |  57 +++---
 docs/system/arm/orangepi.rst                  |   8 +-
 python/qemu/machine/README.rst                |   2 +-
 python/qemu/qmp/README.rst                    |   2 +-
 python/qemu/utils/README.rst                  |   2 +-
 tests/acceptance/README.rst                   |  10 --
 tests/avocado/README.rst                      |  10 ++
 configure                                     |   2 +-
 .gitlab-ci.d/buildtest-template.yml           |   2 +-
 .gitlab-ci.d/buildtest.yml                    |  56 +++---
 MAINTAINERS                                   |  52 +++---
 tests/Makefile.include                        |  21 ++-
 .../avocado_qemu/__init__.py                  | 163 +++++++++++++-----
 tests/{acceptance => avocado}/boot_linux.py   |   0
 .../boot_linux_console.py                     |  11 +-
 tests/{acceptance => avocado}/boot_xen.py     |   0
 tests/{acceptance => avocado}/cpu_queries.py  |   4 +-
 .../empty_cpu_model.py                        |   4 +-
 tests/{acceptance => avocado}/hotplug_cpu.py  |   0
 tests/{acceptance => avocado}/info_usernet.py |   4 +-
 tests/{acceptance => avocado}/intel_iommu.py  |   0
 tests/{acceptance => avocado}/linux_initrd.py |   6 +-
 .../linux_ssh_mips_malta.py                   |   5 +-
 tests/avocado/load_bflt.py                    |  54 ++++++
 .../machine_arm_canona1100.py                 |   4 +-
 .../machine_arm_integratorcp.py               |   4 +-
 .../machine_arm_n8x0.py                       |   4 +-
 tests/{acceptance => avocado}/machine_avr6.py |   6 +-
 .../machine_m68k_nextcube.py                  |   4 +-
 .../machine_microblaze.py                     |   4 +-
 .../machine_mips_fuloong2e.py                 |   4 +-
 .../machine_mips_loongson3v.py                |   4 +-
 .../machine_mips_malta.py                     |   4 +-
 .../machine_rx_gdbsim.py                      |   4 +-
 .../machine_s390_ccw_virtio.py                |   4 +-
 .../machine_sparc64_sun4u.py                  |   0
 .../machine_sparc_leon3.py                    |   4 +-
 tests/{acceptance => avocado}/migration.py    |   4 +-
 tests/{acceptance => avocado}/multiprocess.py |   4 +-
 .../pc_cpu_hotplug_props.py                   |   4 +-
 tests/{acceptance => avocado}/ppc_405.py      |   4 +-
 tests/{acceptance => avocado}/ppc_bamboo.py   |   4 +-
 .../{acceptance => avocado}/ppc_mpc8544ds.py  |   4 +-
 tests/{acceptance => avocado}/ppc_prep_40p.py |   4 +-
 tests/{acceptance => avocado}/ppc_pseries.py  |   4 +-
 .../ppc_virtex_ml507.py                       |   4 +-
 .../{acceptance => avocado}/replay_kernel.py  |   0
 tests/{acceptance => avocado}/replay_linux.py |   0
 .../reverse_debugging.py                      |   0
 tests/{acceptance => avocado}/smmu.py         |   0
 tests/{acceptance => avocado}/tcg_plugins.py  |   0
 .../tesseract_utils.py                        |   0
 tests/{acceptance => avocado}/version.py      |   4 +-
 tests/{acceptance => avocado}/virtio-gpu.py   |   4 +-
 .../virtio_check_params.py                    |   4 +-
 .../{acceptance => avocado}/virtio_version.py |   4 +-
 .../virtiofs_submounts.py                     |  59 +------
 .../virtiofs_submounts.py.data/cleanup.sh     |   0
 .../guest-cleanup.sh                          |   0
 .../virtiofs_submounts.py.data/guest.sh       |   0
 .../virtiofs_submounts.py.data/host.sh        |   0
 tests/{acceptance => avocado}/vnc.py          |   4 +-
 .../x86_cpu_model_versions.py                 |   4 +-
 65 files changed, 364 insertions(+), 284 deletions(-)
 delete mode 100644 tests/acceptance/README.rst
 create mode 100644 tests/avocado/README.rst
 rename tests/{acceptance => avocado}/avocado_qemu/__init__.py (87%)
 rename tests/{acceptance => avocado}/boot_linux.py (100%)
 rename tests/{acceptance => avocado}/boot_linux_console.py (99%)
 rename tests/{acceptance => avocado}/boot_xen.py (100%)
 rename tests/{acceptance => avocado}/cpu_queries.py (91%)
 rename tests/{acceptance => avocado}/empty_cpu_model.py (88%)
 rename tests/{acceptance => avocado}/hotplug_cpu.py (100%)
 rename tests/{acceptance => avocado}/info_usernet.py (92%)
 rename tests/{acceptance => avocado}/intel_iommu.py (100%)
 rename tests/{acceptance => avocado}/linux_initrd.py (96%)
 rename tests/{acceptance => avocado}/linux_ssh_mips_malta.py (98%)
 create mode 100644 tests/avocado/load_bflt.py
 rename tests/{acceptance => avocado}/machine_arm_canona1100.py (93%)
 rename tests/{acceptance => avocado}/machine_arm_integratorcp.py (97%)
 rename tests/{acceptance => avocado}/machine_arm_n8x0.py (95%)
 rename tests/{acceptance => avocado}/machine_avr6.py (94%)
 rename tests/{acceptance => avocado}/machine_m68k_nextcube.py (97%)
 rename tests/{acceptance => avocado}/machine_microblaze.py (94%)
 rename tests/{acceptance => avocado}/machine_mips_fuloong2e.py (95%)
 rename tests/{acceptance => avocado}/machine_mips_loongson3v.py (94%)
 rename tests/{acceptance => avocado}/machine_mips_malta.py (98%)
 rename tests/{acceptance => avocado}/machine_rx_gdbsim.py (97%)
 rename tests/{acceptance => avocado}/machine_s390_ccw_virtio.py (99%)
 rename tests/{acceptance => avocado}/machine_sparc64_sun4u.py (100%)
 rename tests/{acceptance => avocado}/machine_sparc_leon3.py (94%)
 rename tests/{acceptance => avocado}/migration.py (97%)
 rename tests/{acceptance => avocado}/multiprocess.py (98%)
 rename tests/{acceptance => avocado}/pc_cpu_hotplug_props.py (93%)
 rename tests/{acceptance => avocado}/ppc_405.py (94%)
 rename tests/{acceptance => avocado}/ppc_bamboo.py (95%)
 rename tests/{acceptance => avocado}/ppc_mpc8544ds.py (93%)
 rename tests/{acceptance => avocado}/ppc_prep_40p.py (97%)
 rename tests/{acceptance => avocado}/ppc_pseries.py (94%)
 rename tests/{acceptance => avocado}/ppc_virtex_ml507.py (93%)
 rename tests/{acceptance => avocado}/replay_kernel.py (100%)
 rename tests/{acceptance => avocado}/replay_linux.py (100%)
 rename tests/{acceptance => avocado}/reverse_debugging.py (100%)
 rename tests/{acceptance => avocado}/smmu.py (100%)
 rename tests/{acceptance => avocado}/tcg_plugins.py (100%)
 rename tests/{acceptance => avocado}/tesseract_utils.py (100%)
 rename tests/{acceptance => avocado}/version.py (88%)
 rename tests/{acceptance => avocado}/virtio-gpu.py (98%)
 rename tests/{acceptance => avocado}/virtio_check_params.py (98%)
 rename tests/{acceptance => avocado}/virtio_version.py (98%)
 rename tests/{acceptance => avocado}/virtiofs_submounts.py (82%)
 rename tests/{acceptance => avocado}/virtiofs_submounts.py.data/cleanup.sh (100%)
 rename tests/{acceptance => avocado}/virtiofs_submounts.py.data/guest-cleanup.sh (100%)
 rename tests/{acceptance => avocado}/virtiofs_submounts.py.data/guest.sh (100%)
 rename tests/{acceptance => avocado}/virtiofs_submounts.py.data/host.sh (100%)
 rename tests/{acceptance => avocado}/vnc.py (96%)
 rename tests/{acceptance => avocado}/x86_cpu_model_versions.py (99%)
Signature · 1 line
2.31.1
#1 lore raw

[PULL 4/9] tests/avocado: Make pick_default_qemu_bin() more generic

From: Philippe Mathieu-Daudé <[email protected]>

Make pick_default_qemu_bin() generic to find qemu-system or qemu-user binaries.

Message-Id: <[email protected]>

---
 tests/avocado/avocado_qemu/__init__.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
tests/avocado/avocado_qemu/__init__.py +5 -5
index a495e106d03..984c554e7d6 100644
@@ -45,7 +45,7 @@ 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(arch=None):
+def pick_default_qemu_bin(bin_prefix='qemu-system-', arch=None):
     """
     Picks the path of a QEMU binary, starting either in the current working
     directory or in the source tree root directory.
@@ -64,7 +64,7 @@ def pick_default_qemu_bin(arch=None):
     # qemu binary path does not match arch for powerpc, handle it
     if 'ppc64le' in arch:
         arch = 'ppc64'
-    qemu_bin_relative_path = "./qemu-system-%s" % arch
+    qemu_bin_relative_path = os.path.join(".", bin_prefix + arch)
     if is_readable_executable_file(qemu_bin_relative_path):
         return qemu_bin_relative_path
 
@@ -179,14 +179,14 @@ def _get_unique_tag_val(self, tag_name):
             return vals.pop()
         return None
 
-    def setUp(self):
+    def setUp(self, bin_prefix):
         self.arch = self.params.get('arch',
                                     default=self._get_unique_tag_val('arch'))
 
         self.cpu = self.params.get('cpu',
                                    default=self._get_unique_tag_val('cpu'))
 
-        default_qemu_bin = pick_default_qemu_bin(arch=self.arch)
+        default_qemu_bin = pick_default_qemu_bin(bin_prefix, arch=self.arch)
         self.qemu_bin = self.params.get('qemu_bin',
                                         default=default_qemu_bin)
         if self.qemu_bin is None:
@@ -214,7 +214,7 @@ class Test(QemuBaseTest):
     def setUp(self):
         self._vms = {}
 
-        super().setUp()
+        super().setUp('qemu-system-')
 
         self.machine = self.params.get('machine',
                                        default=self._get_unique_tag_val('machine'))
Signature · 1 line
2.31.1
#2 lore raw

[PULL 2/9] tests/acceptance: rename tests acceptance to tests avocado

In reply to Philippe Mathieu-Daudé

From: Willian Rampazzo <[email protected]>

In the discussion about renaming the tests/acceptance [1], the conclusion was that the folders inside tests are related to the framework running the tests and not directly related to the type of the tests.

This changes the folder to tests/avocado and adjusts the MAKEFILE, the CI related files and the documentation.

[1] https://lists.gnu.org/archive/html/qemu-devel/2021-05/msg06553.html

Message-Id: <[email protected]>

---
 docs/devel/build-system.rst                   |  2 +-
 docs/devel/ci-definitions.rst.inc             |  2 +-
 docs/devel/testing.rst                        | 49 ++++++++--------
 docs/system/arm/orangepi.rst                  |  8 +--
 python/qemu/machine/README.rst                |  2 +-
 python/qemu/qmp/README.rst                    |  2 +-
 python/qemu/utils/README.rst                  |  2 +-
 tests/acceptance/README.rst                   | 10 ----
 tests/avocado/README.rst                      | 10 ++++
 configure                                     |  2 +-
 .gitlab-ci.d/buildtest-template.yml           |  2 +-
 .gitlab-ci.d/buildtest.yml                    | 56 +++++++++----------
 MAINTAINERS                                   | 52 ++++++++---------
 tests/Makefile.include                        |  4 +-
 .../avocado_qemu/__init__.py                  |  2 +-
 tests/{acceptance => avocado}/boot_linux.py   |  0
 .../boot_linux_console.py                     |  0
 tests/{acceptance => avocado}/boot_xen.py     |  0
 tests/{acceptance => avocado}/cpu_queries.py  |  0
 .../empty_cpu_model.py                        |  0
 tests/{acceptance => avocado}/hotplug_cpu.py  |  0
 tests/{acceptance => avocado}/info_usernet.py |  0
 tests/{acceptance => avocado}/intel_iommu.py  |  0
 tests/{acceptance => avocado}/linux_initrd.py |  2 +-
 .../linux_ssh_mips_malta.py                   |  0
 .../machine_arm_canona1100.py                 |  0
 .../machine_arm_integratorcp.py               |  0
 .../machine_arm_n8x0.py                       |  0
 tests/{acceptance => avocado}/machine_avr6.py |  2 +-
 .../machine_m68k_nextcube.py                  |  0
 .../machine_microblaze.py                     |  0
 .../machine_mips_fuloong2e.py                 |  0
 .../machine_mips_loongson3v.py                |  0
 .../machine_mips_malta.py                     |  0
 .../machine_rx_gdbsim.py                      |  0
 .../machine_s390_ccw_virtio.py                |  0
 .../machine_sparc64_sun4u.py                  |  0
 .../machine_sparc_leon3.py                    |  0
 tests/{acceptance => avocado}/migration.py    |  0
 tests/{acceptance => avocado}/multiprocess.py |  0
 .../pc_cpu_hotplug_props.py                   |  0
 tests/{acceptance => avocado}/ppc_405.py      |  0
 tests/{acceptance => avocado}/ppc_bamboo.py   |  0
 .../{acceptance => avocado}/ppc_mpc8544ds.py  |  0
 tests/{acceptance => avocado}/ppc_prep_40p.py |  0
 tests/{acceptance => avocado}/ppc_pseries.py  |  0
 .../ppc_virtex_ml507.py                       |  0
 .../{acceptance => avocado}/replay_kernel.py  |  0
 tests/{acceptance => avocado}/replay_linux.py |  0
 .../reverse_debugging.py                      |  0
 tests/{acceptance => avocado}/smmu.py         |  0
 tests/{acceptance => avocado}/tcg_plugins.py  |  0
 .../tesseract_utils.py                        |  0
 tests/{acceptance => avocado}/version.py      |  0
 tests/{acceptance => avocado}/virtio-gpu.py   |  0
 .../virtio_check_params.py                    |  0
 .../{acceptance => avocado}/virtio_version.py |  0
 .../virtiofs_submounts.py                     |  0
 .../virtiofs_submounts.py.data/cleanup.sh     |  0
 .../guest-cleanup.sh                          |  0
 .../virtiofs_submounts.py.data/guest.sh       |  0
 .../virtiofs_submounts.py.data/host.sh        |  0
 tests/{acceptance => avocado}/vnc.py          |  0
 .../x86_cpu_model_versions.py                 |  0
 64 files changed, 104 insertions(+), 105 deletions(-)
 delete mode 100644 tests/acceptance/README.rst
 create mode 100644 tests/avocado/README.rst
 rename tests/{acceptance => avocado}/avocado_qemu/__init__.py (99%)
 rename tests/{acceptance => avocado}/boot_linux.py (100%)
 rename tests/{acceptance => avocado}/boot_linux_console.py (100%)
 rename tests/{acceptance => avocado}/boot_xen.py (100%)
 rename tests/{acceptance => avocado}/cpu_queries.py (100%)
 rename tests/{acceptance => avocado}/empty_cpu_model.py (100%)
 rename tests/{acceptance => avocado}/hotplug_cpu.py (100%)
 rename tests/{acceptance => avocado}/info_usernet.py (100%)
 rename tests/{acceptance => avocado}/intel_iommu.py (100%)
 rename tests/{acceptance => avocado}/linux_initrd.py (99%)
 rename tests/{acceptance => avocado}/linux_ssh_mips_malta.py (100%)
 rename tests/{acceptance => avocado}/machine_arm_canona1100.py (100%)
 rename tests/{acceptance => avocado}/machine_arm_integratorcp.py (100%)
 rename tests/{acceptance => avocado}/machine_arm_n8x0.py (100%)
 rename tests/{acceptance => avocado}/machine_avr6.py (98%)
 rename tests/{acceptance => avocado}/machine_m68k_nextcube.py (100%)
 rename tests/{acceptance => avocado}/machine_microblaze.py (100%)
 rename tests/{acceptance => avocado}/machine_mips_fuloong2e.py (100%)
 rename tests/{acceptance => avocado}/machine_mips_loongson3v.py (100%)
 rename tests/{acceptance => avocado}/machine_mips_malta.py (100%)
 rename tests/{acceptance => avocado}/machine_rx_gdbsim.py (100%)
 rename tests/{acceptance => avocado}/machine_s390_ccw_virtio.py (100%)
 rename tests/{acceptance => avocado}/machine_sparc64_sun4u.py (100%)
 rename tests/{acceptance => avocado}/machine_sparc_leon3.py (100%)
 rename tests/{acceptance => avocado}/migration.py (100%)
 rename tests/{acceptance => avocado}/multiprocess.py (100%)
 rename tests/{acceptance => avocado}/pc_cpu_hotplug_props.py (100%)
 rename tests/{acceptance => avocado}/ppc_405.py (100%)
 rename tests/{acceptance => avocado}/ppc_bamboo.py (100%)
 rename tests/{acceptance => avocado}/ppc_mpc8544ds.py (100%)
 rename tests/{acceptance => avocado}/ppc_prep_40p.py (100%)
 rename tests/{acceptance => avocado}/ppc_pseries.py (100%)
 rename tests/{acceptance => avocado}/ppc_virtex_ml507.py (100%)
 rename tests/{acceptance => avocado}/replay_kernel.py (100%)
 rename tests/{acceptance => avocado}/replay_linux.py (100%)
 rename tests/{acceptance => avocado}/reverse_debugging.py (100%)
 rename tests/{acceptance => avocado}/smmu.py (100%)
 rename tests/{acceptance => avocado}/tcg_plugins.py (100%)
 rename tests/{acceptance => avocado}/tesseract_utils.py (100%)
 rename tests/{acceptance => avocado}/version.py (100%)
 rename tests/{acceptance => avocado}/virtio-gpu.py (100%)
 rename tests/{acceptance => avocado}/virtio_check_params.py (100%)
 rename tests/{acceptance => avocado}/virtio_version.py (100%)
 rename tests/{acceptance => avocado}/virtiofs_submounts.py (100%)
 rename tests/{acceptance => avocado}/virtiofs_submounts.py.data/cleanup.sh (100%)
 rename tests/{acceptance => avocado}/virtiofs_submounts.py.data/guest-cleanup.sh (100%)
 rename tests/{acceptance => avocado}/virtiofs_submounts.py.data/guest.sh (100%)
 rename tests/{acceptance => avocado}/virtiofs_submounts.py.data/host.sh (100%)
 rename tests/{acceptance => avocado}/vnc.py (100%)
 rename tests/{acceptance => avocado}/x86_cpu_model_versions.py (100%)
docs/devel/build-system.rst +1 -1
index ae536ef75db..aca1f5a273f 100644
@@ -416,7 +416,7 @@ number of dynamically created files listed later.
 
 ``tests/Makefile.include``
   Rules for external test harnesses. These include the TCG tests,
-  ``qemu-iotests`` and the Avocado-based acceptance tests.
+  ``qemu-iotests`` and the Avocado-based integration tests.
 
 ``tests/docker/Makefile.include``
   Rules for Docker tests. Like tests/Makefile, this file is included
docs/devel/ci-definitions.rst.inc +1 -1
index 32e22ff4687..6d5c6fd9f20 100644
@@ -59,7 +59,7 @@ to system testing [5]_. Note that, in some cases, system testing may require
 interaction with third-party software, like operating system images, databases,
 networks, and so on.
 
-On QEMU, system testing is represented by the 'check-acceptance' target from
+On QEMU, system testing is represented by the 'check-avocado' target from
 'make'.
 
 Flaky tests
docs/devel/testing.rst +24 -25

145 lines not on this page · raw message

docs/system/arm/orangepi.rst +4 -4
index 6f23907fb69..c55694dd91b 100644
@@ -250,14 +250,14 @@ and set the following environment variables before booting:
 Optionally you may save the environment variables to SD card with 'saveenv'.
 To continue booting simply give the 'boot' command and NetBSD boots.
 
-Orange Pi PC acceptance tests
-"""""""""""""""""""""""""""""
+Orange Pi PC integration tests
+""""""""""""""""""""""""""""""
 
-The Orange Pi PC machine has several acceptance tests included.
+The Orange Pi PC machine has several integration tests included.
 To run the whole set of tests, build QEMU from source and simply
 provide the following command:
 
 .. code-block:: bash
 
   $ AVOCADO_ALLOW_LARGE_STORAGE=yes avocado --show=app,console run \
-     -t machine:orangepi-pc tests/acceptance/boot_linux_console.py
+     -t machine:orangepi-pc tests/avocado/boot_linux_console.py
python/qemu/machine/README.rst +1 -1
index ac2b4fffb42..8de2c3d7722 100644
@@ -2,7 +2,7 @@ qemu.machine package
 ====================
 
 This package provides core utilities used for testing and debugging
-QEMU. It is used by the iotests, vm tests, acceptance tests, and several
+QEMU. It is used by the iotests, vm tests, avocado tests, and several
 other utilities in the ./scripts directory. It is not a fully-fledged
 SDK and it is subject to change at any time.
 
python/qemu/qmp/README.rst +1 -1
index c21951491cf..5bfb82535f8 100644
@@ -3,7 +3,7 @@ qemu.qmp package
 
 This package provides a library used for connecting to and communicating
 with QMP servers. It is used extensively by iotests, vm tests,
-acceptance tests, and other utilities in the ./scripts directory. It is
+avocado tests, and other utilities in the ./scripts directory. It is
 not a fully-fledged SDK and is subject to change at any time.
 
 See the documentation in ``__init__.py`` for more information.
python/qemu/utils/README.rst +1 -1
index 975fbf4d7de..d5f2da14540 100644
@@ -2,6 +2,6 @@ qemu.utils package
 ==================
 
 This package provides miscellaneous utilities used for testing and
-debugging QEMU. It is used primarily by the vm and acceptance tests.
+debugging QEMU. It is used primarily by the vm and avocado tests.
 
 See the documentation in ``__init__.py`` for more information.
tests/acceptance/README.rst deleted +0 -10
deleted file mode 100644
index 89260faed6b..00000000000
@@ -1,10 +0,0 @@
-============================================
-Acceptance tests using the Avocado Framework
-============================================
-
-This directory contains 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.
-
-For more information, please refer to ``docs/devel/testing.rst``,
-section "Acceptance tests using the Avocado Framework".
tests/avocado/README.rst new file +10 -0
new file mode 100644
index 00000000000..94488371bbe
@@ -0,0 +1,10 @@
+=============================================
+Integration tests using the Avocado Framework
+=============================================
+
+This directory contains integration tests. They're usually higher
+level, and may interact with external resources and with various
+guest operating systems.
+
+For more information, please refer to ``docs/devel/testing.rst``,
+section "Integration tests using the Avocado Framework".
configure +1 -1
index 33682cb9716..19d5e97b278 100755
@@ -3832,7 +3832,7 @@ LINKS="$LINKS pc-bios/s390-ccw/Makefile"
 LINKS="$LINKS roms/seabios/Makefile"
 LINKS="$LINKS pc-bios/qemu-icon.bmp"
 LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit
-LINKS="$LINKS tests/acceptance tests/data"
+LINKS="$LINKS tests/avocado tests/data"
 LINKS="$LINKS tests/qemu-iotests/check"
 LINKS="$LINKS python"
 LINKS="$LINKS contrib/plugins/Makefile "
.gitlab-ci.d/buildtest-template.yml +1 -1
index fcbcc4e627a..2c7980a4f6a 100644
@@ -37,7 +37,7 @@
     # Avoid recompiling by hiding ninja with NINJA=":"
     - make NINJA=":" $MAKE_CHECK_ARGS
 
-.acceptance_test_job_template:
+.avocado_test_job_template:
   extends: .native_test_job_template
   cache:
     key: "${CI_JOB_NAME}-cache"
.gitlab-ci.d/buildtest.yml +28 -28

161 lines not on this page · raw message

MAINTAINERS +26 -26

190 lines not on this page · raw message

tests/Makefile.include +2 -2
index 8e8ee584933..4c564cf7899 100644
@@ -89,7 +89,7 @@ TESTS_VENV_DIR=$(BUILD_DIR)/tests/venv
 TESTS_VENV_REQ=$(SRC_PATH)/tests/requirements.txt
 TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
 ifndef AVOCADO_TESTS
-	AVOCADO_TESTS=tests/acceptance
+	AVOCADO_TESTS=tests/avocado
 endif
 # Controls the output generated by Avocado when running tests.
 # Any number of command separated loggers are accepted.  For more
@@ -140,7 +140,7 @@ check-avocado: check-venv $(TESTS_RESULTS_DIR) get-vm-images
 			--filter-by-tags-include-empty-key) \
             $(AVOCADO_CMDLINE_TAGS) \
             $(if $(GITLAB_CI),,--failfast) $(AVOCADO_TESTS), \
-            "AVOCADO", "tests/acceptance")
+            "AVOCADO", "tests/avocado")
 
 check-acceptance-deprecated-warning:
 	@echo
tests/avocado/avocado_qemu/__init__.py renamed from tests/acceptance/avocado_qemu/__init__.py +1 -1
similarity index 99%
rename from tests/acceptance/avocado_qemu/__init__.py
rename to tests/avocado/avocado_qemu/__init__.py
index 1841053e2c1..cd21b59e040 100644
@@ -27,7 +27,7 @@
 BUILD_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
 
 if os.path.islink(os.path.dirname(os.path.dirname(__file__))):
-    # The link to the acceptance tests dir in the source code directory
+    # The link to the avocado tests dir in the source code directory
     lnk = os.path.dirname(os.path.dirname(__file__))
     #: The QEMU root source directory
     SOURCE_DIR = os.path.dirname(os.path.dirname(os.readlink(lnk)))
tests/avocado/boot_linux.py renamed from tests/acceptance/boot_linux.py +0 -0
similarity index 100%
rename from tests/acceptance/boot_linux.py
rename to tests/avocado/boot_linux.py
tests/avocado/boot_linux_console.py renamed from tests/acceptance/boot_linux_console.py +0 -0
similarity index 100%
rename from tests/acceptance/boot_linux_console.py
rename to tests/avocado/boot_linux_console.py
tests/avocado/boot_xen.py renamed from tests/acceptance/boot_xen.py +0 -0
similarity index 100%
rename from tests/acceptance/boot_xen.py
rename to tests/avocado/boot_xen.py
tests/avocado/cpu_queries.py renamed from tests/acceptance/cpu_queries.py +0 -0
similarity index 100%
rename from tests/acceptance/cpu_queries.py
rename to tests/avocado/cpu_queries.py
tests/avocado/empty_cpu_model.py renamed from tests/acceptance/empty_cpu_model.py +0 -0
similarity index 100%
rename from tests/acceptance/empty_cpu_model.py
rename to tests/avocado/empty_cpu_model.py
tests/avocado/hotplug_cpu.py renamed from tests/acceptance/hotplug_cpu.py +0 -0
similarity index 100%
rename from tests/acceptance/hotplug_cpu.py
rename to tests/avocado/hotplug_cpu.py
tests/avocado/info_usernet.py renamed from tests/acceptance/info_usernet.py +0 -0
similarity index 100%
rename from tests/acceptance/info_usernet.py
rename to tests/avocado/info_usernet.py
tests/avocado/intel_iommu.py renamed from tests/acceptance/intel_iommu.py +0 -0
similarity index 100%
rename from tests/acceptance/intel_iommu.py
rename to tests/avocado/intel_iommu.py
tests/avocado/linux_initrd.py renamed from tests/acceptance/linux_initrd.py +1 -1
similarity index 99%
rename from tests/acceptance/linux_initrd.py
rename to tests/avocado/linux_initrd.py
index a249e2f14a2..9b4880cd8c2 100644
@@ -1,4 +1,4 @@
-# Linux initrd acceptance test.
+# Linux initrd integration test.
 #
 # Copyright (c) 2018 Red Hat, Inc.
 #
tests/avocado/linux_ssh_mips_malta.py renamed from tests/acceptance/linux_ssh_mips_malta.py +0 -0
similarity index 100%
rename from tests/acceptance/linux_ssh_mips_malta.py
rename to tests/avocado/linux_ssh_mips_malta.py
tests/avocado/machine_arm_canona1100.py renamed from tests/acceptance/machine_arm_canona1100.py +0 -0
similarity index 100%
rename from tests/acceptance/machine_arm_canona1100.py
rename to tests/avocado/machine_arm_canona1100.py
tests/avocado/machine_arm_integratorcp.py renamed from tests/acceptance/machine_arm_integratorcp.py +0 -0
similarity index 100%
rename from tests/acceptance/machine_arm_integratorcp.py
rename to tests/avocado/machine_arm_integratorcp.py
tests/avocado/machine_arm_n8x0.py renamed from tests/acceptance/machine_arm_n8x0.py +0 -0
similarity index 100%
rename from tests/acceptance/machine_arm_n8x0.py
rename to tests/avocado/machine_arm_n8x0.py
tests/avocado/machine_avr6.py renamed from tests/acceptance/machine_avr6.py +1 -1
similarity index 98%
rename from tests/acceptance/machine_avr6.py
rename to tests/avocado/machine_avr6.py
index 6baf4e9c7f3..6bab31342aa 100644
@@ -1,5 +1,5 @@
 #
-# QEMU AVR acceptance tests
+# QEMU AVR integration tests
 #
 # Copyright (c) 2019-2020 Michael Rolnik <[email protected]>
 #
tests/avocado/machine_m68k_nextcube.py renamed from tests/acceptance/machine_m68k_nextcube.py +0 -0
similarity index 100%
rename from tests/acceptance/machine_m68k_nextcube.py
rename to tests/avocado/machine_m68k_nextcube.py
tests/avocado/machine_microblaze.py renamed from tests/acceptance/machine_microblaze.py +0 -0
similarity index 100%
rename from tests/acceptance/machine_microblaze.py
rename to tests/avocado/machine_microblaze.py
tests/avocado/machine_mips_fuloong2e.py renamed from tests/acceptance/machine_mips_fuloong2e.py +0 -0
similarity index 100%
rename from tests/acceptance/machine_mips_fuloong2e.py
rename to tests/avocado/machine_mips_fuloong2e.py
tests/avocado/machine_mips_loongson3v.py renamed from tests/acceptance/machine_mips_loongson3v.py +0 -0
similarity index 100%
rename from tests/acceptance/machine_mips_loongson3v.py
rename to tests/avocado/machine_mips_loongson3v.py
tests/avocado/machine_mips_malta.py renamed from tests/acceptance/machine_mips_malta.py +0 -0
similarity index 100%
rename from tests/acceptance/machine_mips_malta.py
rename to tests/avocado/machine_mips_malta.py
tests/avocado/machine_rx_gdbsim.py renamed from tests/acceptance/machine_rx_gdbsim.py +0 -0
similarity index 100%
rename from tests/acceptance/machine_rx_gdbsim.py
rename to tests/avocado/machine_rx_gdbsim.py
tests/avocado/machine_s390_ccw_virtio.py renamed from tests/acceptance/machine_s390_ccw_virtio.py +0 -0
similarity index 100%
rename from tests/acceptance/machine_s390_ccw_virtio.py
rename to tests/avocado/machine_s390_ccw_virtio.py
tests/avocado/machine_sparc64_sun4u.py renamed from tests/acceptance/machine_sparc64_sun4u.py +0 -0
similarity index 100%
rename from tests/acceptance/machine_sparc64_sun4u.py
rename to tests/avocado/machine_sparc64_sun4u.py
tests/avocado/machine_sparc_leon3.py renamed from tests/acceptance/machine_sparc_leon3.py +0 -0
similarity index 100%
rename from tests/acceptance/machine_sparc_leon3.py
rename to tests/avocado/machine_sparc_leon3.py
tests/avocado/migration.py renamed from tests/acceptance/migration.py +0 -0
similarity index 100%
rename from tests/acceptance/migration.py
rename to tests/avocado/migration.py
tests/avocado/multiprocess.py renamed from tests/acceptance/multiprocess.py +0 -0
similarity index 100%
rename from tests/acceptance/multiprocess.py
rename to tests/avocado/multiprocess.py
tests/avocado/pc_cpu_hotplug_props.py renamed from tests/acceptance/pc_cpu_hotplug_props.py +0 -0
similarity index 100%
rename from tests/acceptance/pc_cpu_hotplug_props.py
rename to tests/avocado/pc_cpu_hotplug_props.py
tests/avocado/ppc_405.py renamed from tests/acceptance/ppc_405.py +0 -0
similarity index 100%
rename from tests/acceptance/ppc_405.py
rename to tests/avocado/ppc_405.py
tests/avocado/ppc_bamboo.py renamed from tests/acceptance/ppc_bamboo.py +0 -0
similarity index 100%
rename from tests/acceptance/ppc_bamboo.py
rename to tests/avocado/ppc_bamboo.py
tests/avocado/ppc_mpc8544ds.py renamed from tests/acceptance/ppc_mpc8544ds.py +0 -0
similarity index 100%
rename from tests/acceptance/ppc_mpc8544ds.py
rename to tests/avocado/ppc_mpc8544ds.py
tests/avocado/ppc_prep_40p.py renamed from tests/acceptance/ppc_prep_40p.py +0 -0
similarity index 100%
rename from tests/acceptance/ppc_prep_40p.py
rename to tests/avocado/ppc_prep_40p.py
tests/avocado/ppc_pseries.py renamed from tests/acceptance/ppc_pseries.py +0 -0
similarity index 100%
rename from tests/acceptance/ppc_pseries.py
rename to tests/avocado/ppc_pseries.py
tests/avocado/ppc_virtex_ml507.py renamed from tests/acceptance/ppc_virtex_ml507.py +0 -0
similarity index 100%
rename from tests/acceptance/ppc_virtex_ml507.py
rename to tests/avocado/ppc_virtex_ml507.py
tests/avocado/replay_kernel.py renamed from tests/acceptance/replay_kernel.py +0 -0
similarity index 100%
rename from tests/acceptance/replay_kernel.py
rename to tests/avocado/replay_kernel.py
tests/avocado/replay_linux.py renamed from tests/acceptance/replay_linux.py +0 -0
similarity index 100%
rename from tests/acceptance/replay_linux.py
rename to tests/avocado/replay_linux.py
tests/avocado/reverse_debugging.py renamed from tests/acceptance/reverse_debugging.py +0 -0
similarity index 100%
rename from tests/acceptance/reverse_debugging.py
rename to tests/avocado/reverse_debugging.py
tests/avocado/smmu.py renamed from tests/acceptance/smmu.py +0 -0
similarity index 100%
rename from tests/acceptance/smmu.py
rename to tests/avocado/smmu.py
tests/avocado/tcg_plugins.py renamed from tests/acceptance/tcg_plugins.py +0 -0
similarity index 100%
rename from tests/acceptance/tcg_plugins.py
rename to tests/avocado/tcg_plugins.py
tests/avocado/tesseract_utils.py renamed from tests/acceptance/tesseract_utils.py +0 -0
similarity index 100%
rename from tests/acceptance/tesseract_utils.py
rename to tests/avocado/tesseract_utils.py
tests/avocado/version.py renamed from tests/acceptance/version.py +0 -0
similarity index 100%
rename from tests/acceptance/version.py
rename to tests/avocado/version.py
tests/avocado/virtio-gpu.py renamed from tests/acceptance/virtio-gpu.py +0 -0
similarity index 100%
rename from tests/acceptance/virtio-gpu.py
rename to tests/avocado/virtio-gpu.py
tests/avocado/virtio_check_params.py renamed from tests/acceptance/virtio_check_params.py +0 -0
similarity index 100%
rename from tests/acceptance/virtio_check_params.py
rename to tests/avocado/virtio_check_params.py
tests/avocado/virtio_version.py renamed from tests/acceptance/virtio_version.py +0 -0
similarity index 100%
rename from tests/acceptance/virtio_version.py
rename to tests/avocado/virtio_version.py
tests/avocado/virtiofs_submounts.py renamed from tests/acceptance/virtiofs_submounts.py +0 -0
similarity index 100%
rename from tests/acceptance/virtiofs_submounts.py
rename to tests/avocado/virtiofs_submounts.py
tests/avocado/virtiofs_submounts.py.data/cleanup.sh renamed from tests/acceptance/virtiofs_submounts.py.data/cleanup.sh +0 -0
similarity index 100%
rename from tests/acceptance/virtiofs_submounts.py.data/cleanup.sh
rename to tests/avocado/virtiofs_submounts.py.data/cleanup.sh
tests/avocado/virtiofs_submounts.py.data/guest-cleanup.sh renamed from tests/acceptance/virtiofs_submounts.py.data/guest-cleanup.sh +0 -0
similarity index 100%
rename from tests/acceptance/virtiofs_submounts.py.data/guest-cleanup.sh
rename to tests/avocado/virtiofs_submounts.py.data/guest-cleanup.sh
tests/avocado/virtiofs_submounts.py.data/guest.sh renamed from tests/acceptance/virtiofs_submounts.py.data/guest.sh +0 -0
similarity index 100%
rename from tests/acceptance/virtiofs_submounts.py.data/guest.sh
rename to tests/avocado/virtiofs_submounts.py.data/guest.sh
tests/avocado/virtiofs_submounts.py.data/host.sh renamed from tests/acceptance/virtiofs_submounts.py.data/host.sh +0 -0
similarity index 100%
rename from tests/acceptance/virtiofs_submounts.py.data/host.sh
rename to tests/avocado/virtiofs_submounts.py.data/host.sh
tests/avocado/vnc.py renamed from tests/acceptance/vnc.py +0 -0
similarity index 100%
rename from tests/acceptance/vnc.py
rename to tests/avocado/vnc.py
tests/avocado/x86_cpu_model_versions.py renamed from tests/acceptance/x86_cpu_model_versions.py +0 -0
similarity index 100%
rename from tests/acceptance/x86_cpu_model_versions.py
rename to tests/avocado/x86_cpu_model_versions.py
Signature · 1 line
2.31.1
#3 lore raw

[PULL 1/9] tests/acceptance: introduce new check-avocado target

In reply to Philippe Mathieu-Daudé

From: Willian Rampazzo <[email protected]>

This introduces a new make target, check-avocado, and adds a deprecation message about the check-acceptance target. This is a preparation for renaming the tests/acceptance folder to tests/avocado.

The plan is to remove the call to the check-avocado target one or two months after the release and leave the warning to force people to move to the new check-avocado target.

Later, the check-acceptance target can be removed. The intent is to avoid a direct impact during the current soft freeze.

Message-Id: <[email protected]>

---
 tests/Makefile.include | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
tests/Makefile.include +12 -5
index 8434a33fe68..8e8ee584933 100644
@@ -16,7 +16,7 @@ ifneq ($(filter $(all-check-targets), check-softfloat),)
 	@echo " $(MAKE) check-tcg            Run TCG tests"
 	@echo " $(MAKE) check-softfloat      Run FPU emulation tests"
 endif
-	@echo " $(MAKE) check-acceptance     Run acceptance (functional) tests for currently configured targets"
+	@echo " $(MAKE) check-avocado        Run avocado (integration) tests for currently configured targets"
 	@echo
 	@echo " $(MAKE) check-report.tap     Generates an aggregated TAP test report"
 	@echo " $(MAKE) check-venv           Creates a Python venv for tests"
@@ -24,7 +24,7 @@ endif
 	@echo
 	@echo "The following are useful for CI builds"
 	@echo " $(MAKE) check-build          Build most test binaris"
-	@echo " $(MAKE) get-vm-images        Downloads all images used by acceptance tests, according to configured targets (~350 MB each, 1.5 GB max)"
+	@echo " $(MAKE) get-vm-images        Downloads all images used by avocado tests, according to configured targets (~350 MB each, 1.5 GB max)"
 	@echo
 	@echo
 	@echo "The variable SPEED can be set to control the gtester speed setting."
@@ -83,7 +83,7 @@ clean-tcg: $(CLEAN_TCG_TARGET_RULES)
 
 # Python venv for running tests
 
-.PHONY: check-venv check-acceptance
+.PHONY: check-venv check-avocado check-acceptance check-acceptance-deprecated-warning
 
 TESTS_VENV_DIR=$(BUILD_DIR)/tests/venv
 TESTS_VENV_REQ=$(SRC_PATH)/tests/requirements.txt
@@ -127,12 +127,12 @@ get-vm-image-fedora-31-%: check-venv
 	$(call quiet-command, \
              $(TESTS_VENV_DIR)/bin/python -m avocado vmimage get \
              --distro=fedora --distro-version=31 --arch=$*, \
-	"AVOCADO", "Downloading acceptance tests VM image for $*")
+	"AVOCADO", "Downloading avocado tests VM image for $*")
 
 # download all vm images, according to defined targets
 get-vm-images: check-venv $(patsubst %,get-vm-image-fedora-31-%, $(FEDORA_31_DOWNLOAD))
 
-check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images
+check-avocado: check-venv $(TESTS_RESULTS_DIR) get-vm-images
 	$(call quiet-command, \
             $(TESTS_VENV_DIR)/bin/python -m avocado \
             --show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
@@ -142,6 +142,13 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images
             $(if $(GITLAB_CI),,--failfast) $(AVOCADO_TESTS), \
             "AVOCADO", "tests/acceptance")
 
+check-acceptance-deprecated-warning:
+	@echo
+	@echo "Note '$(MAKE) check-acceptance' is deprecated, use '$(MAKE) check-avocado' instead."
+	@echo
+
+check-acceptance: check-acceptance-deprecated-warning | check-avocado
+
 # Consolidated targets
 
 .PHONY: check-block check check-clean get-vm-images
Signature · 1 line
2.31.1
#4 lore raw

[PULL 5/9] tests/avocado: Introduce QemuUserTest base class

In reply to Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <[email protected]>

Similarly to the 'System' Test base class with methods for testing system emulation, the QemuUserTest class contains methods useful to test user-mode emulation.

Message-Id: <[email protected]>

---
 tests/avocado/avocado_qemu/__init__.py | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
tests/avocado/avocado_qemu/__init__.py +18 -1
index 984c554e7d6..e46b3ecb89e 100644
@@ -17,7 +17,7 @@
 import uuid
 
 import avocado
-from avocado.utils import cloudinit, datadrainer, network, ssh, vmimage
+from avocado.utils import cloudinit, datadrainer, network, process, ssh, vmimage
 from avocado.utils.path import find_command
 
 #: The QEMU build root directory.  It may also be the source directory
@@ -295,6 +295,23 @@ def tearDown(self):
         super().tearDown()
 
 
+class QemuUserTest(QemuBaseTest):
+    """Facilitates user-mode emulation tests."""
+
+    def setUp(self):
+        self._ldpath = []
+        super().setUp('qemu-')
+
+    def add_ldpath(self, ldpath):
+        self._ldpath.append(os.path.abspath(ldpath))
+
+    def run(self, bin_path, args=[]):
+        qemu_args = " ".join(["-L %s" % ldpath for ldpath in self._ldpath])
+        bin_args = " ".join(args)
+        return process.run("%s %s %s %s" % (self.qemu_bin, qemu_args,
+                                            bin_path, bin_args))
+
+
 class LinuxSSHMixIn:
     """Contains utility methods for interacting with a guest via SSH."""
 
Signature · 1 line
2.31.1
#5 lore raw

[PULL 6/9] tests/avocado: Share useful helpers from virtiofs_submounts test

In reply to Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <[email protected]>

Move the useful has_cmd()/has_cmds() helpers from the virtiofs test to the avocado_qemu public class.

Message-Id: <[email protected]>

---
 tests/avocado/avocado_qemu/__init__.py | 57 +++++++++++++++++++++++++
 tests/avocado/virtiofs_submounts.py    | 59 +-------------------------
 2 files changed, 59 insertions(+), 57 deletions(-)
tests/avocado/avocado_qemu/__init__.py +57 -0
index e46b3ecb89e..1efc22dabfa 100644
@@ -11,6 +11,7 @@
 import logging
 import os
 import shutil
+import subprocess
 import sys
 import tempfile
 import time
@@ -41,6 +42,62 @@
                         tcg_available)
 
 
+def has_cmd(name, args=None):
+    """
+    This function is for use in a @avocado.skipUnless decorator, e.g.:
+
+        @skipUnless(*has_cmd('sudo -n', ('sudo', '-n', 'true')))
+        def test_something_that_needs_sudo(self):
+            ...
+    """
+
+    if args is None:
+        args = ('which', name)
+
+    try:
+        _, stderr, exitcode = run_cmd(args)
+    except Exception as e:
+        exitcode = -1
+        stderr = str(e)
+
+    if exitcode != 0:
+        cmd_line = ' '.join(args)
+        err = f'{name} required, but "{cmd_line}" failed: {stderr.strip()}'
+        return (False, err)
+    else:
+        return (True, '')
+
+def has_cmds(*cmds):
+    """
+    This function is for use in a @avocado.skipUnless decorator and
+    allows checking for the availability of multiple commands, e.g.:
+
+        @skipUnless(*has_cmds(('cmd1', ('cmd1', '--some-parameter')),
+                              'cmd2', 'cmd3'))
+        def test_something_that_needs_cmd1_and_cmd2(self):
+            ...
+    """
+
+    for cmd in cmds:
+        if isinstance(cmd, str):
+            cmd = (cmd,)
+
+        ok, errstr = has_cmd(*cmd)
+        if not ok:
+            return (False, errstr)
+
+    return (True, '')
+
+def run_cmd(args):
+    subp = subprocess.Popen(args,
+                            stdout=subprocess.PIPE,
+                            stderr=subprocess.PIPE,
+                            universal_newlines=True)
+    stdout, stderr = subp.communicate()
+    ret = subp.returncode
+
+    return (stdout, stderr, ret)
+
 def is_readable_executable_file(path):
     return os.path.isfile(path) and os.access(path, os.R_OK | os.X_OK)
 
tests/avocado/virtiofs_submounts.py +2 -57

69 lines not on this page · raw message

Signature · 1 line
2.31.1
#6 lore raw

[PULL 7/9] tests/avocado: Add bFLT loader linux-user test

In reply to Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <[email protected]>

Add a very quick test that runs a busybox binary in bFLT format:

  $ AVOCADO_ALLOW_UNTRUSTED_CODE=1 \
    avocado --show=app run -t linux_user tests/avocado/load_bflt.py
  JOB ID     : db94d5960ce564c50904d666a7e259148c27e88f
  JOB LOG    : ~/avocado/job-results/job-2019-06-25T10.52-db94d59/job.log
   (1/1) tests/avocado/load_bflt.py:LoadBFLT.test_stm32: PASS (0.15 s)
  RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
  JOB TIME   : 0.54 s

Message-Id: <[email protected]>

---
 tests/avocado/load_bflt.py | 54 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 tests/avocado/load_bflt.py
tests/avocado/load_bflt.py new file +54 -0
new file mode 100644
index 00000000000..bb50cec1ee8
@@ -0,0 +1,54 @@
+# Test the bFLT loader format
+#
+# Copyright (C) 2019 Philippe Mathieu-Daudé <[email protected]>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import os
+import bz2
+import subprocess
+
+from avocado import skipUnless
+from avocado_qemu import QemuUserTest
+from avocado_qemu import has_cmd
+
+
+class LoadBFLT(QemuUserTest):
+
+    def extract_cpio(self, cpio_path):
+        """
+        Extracts a cpio archive into the test workdir
+
+        :param cpio_path: path to the cpio archive
+        """
+        cwd = os.getcwd()
+        os.chdir(self.workdir)
+        with bz2.open(cpio_path, 'rb') as archive_cpio:
+            subprocess.run(['cpio', '-i'], input=archive_cpio.read(),
+                           stderr=subprocess.DEVNULL)
+        os.chdir(cwd)
+
+    @skipUnless(*has_cmd('cpio'))
+    @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
+    def test_stm32(self):
+        """
+        :avocado: tags=arch:arm
+        :avocado: tags=linux_user
+        :avocado: tags=quick
+        """
+        # See https://elinux.org/STM32#User_Space
+        rootfs_url = ('https://elinux.org/images/5/51/'
+                      'Stm32_mini_rootfs.cpio.bz2')
+        rootfs_hash = '9f065e6ba40cce7411ba757f924f30fcc57951e6'
+        rootfs_path_bz2 = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash)
+        busybox_path = os.path.join(self.workdir, "/bin/busybox")
+
+        self.extract_cpio(rootfs_path_bz2)
+
+        res = self.run(busybox_path)
+        ver = 'BusyBox v1.24.0.git (2015-02-03 22:17:13 CET) multi-call binary.'
+        self.assertIn(ver, res.stdout_text)
+
+        res = self.run(busybox_path, ['uname', '-a'])
+        unm = 'armv7l GNU/Linux'
+        self.assertIn(unm, res.stdout_text)
Signature · 1 line
2.31.1
#7 lore raw

[PULL 3/9] tests/avocado: Extract QemuBaseTest from Test

In reply to Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <[email protected]>

The Avocado Test::fetch_asset() is handy to download artifacts before running tests. The current class is named Test but only tests system emulation. As we want to test user emulation, refactor the common code as QemuBaseTest.

Message-Id: <[email protected]>

---
 tests/avocado/avocado_qemu/__init__.py | 72 +++++++++++++++-----------
 1 file changed, 41 insertions(+), 31 deletions(-)
tests/avocado/avocado_qemu/__init__.py +41 -31
index cd21b59e040..a495e106d03 100644
@@ -169,7 +169,7 @@ def exec_command_and_wait_for_pattern(test, command,
     """
     _console_interaction(test, success_message, failure_message, command + '\r')
 
-class Test(avocado.Test):
+class QemuBaseTest(avocado.Test):
     def _get_unique_tag_val(self, tag_name):
         """
         Gets a tag value, if unique for a key
@@ -179,6 +179,46 @@ def _get_unique_tag_val(self, tag_name):
             return vals.pop()
         return None
 
+    def setUp(self):
+        self.arch = self.params.get('arch',
+                                    default=self._get_unique_tag_val('arch'))
+
+        self.cpu = self.params.get('cpu',
+                                   default=self._get_unique_tag_val('cpu'))
+
+        default_qemu_bin = pick_default_qemu_bin(arch=self.arch)
+        self.qemu_bin = self.params.get('qemu_bin',
+                                        default=default_qemu_bin)
+        if self.qemu_bin is None:
+            self.cancel("No QEMU binary defined or found in the build tree")
+
+    def fetch_asset(self, name,
+                    asset_hash=None, algorithm=None,
+                    locations=None, expire=None,
+                    find_only=False, cancel_on_missing=True):
+        return super().fetch_asset(name,
+                        asset_hash=asset_hash,
+                        algorithm=algorithm,
+                        locations=locations,
+                        expire=expire,
+                        find_only=find_only,
+                        cancel_on_missing=cancel_on_missing)
+
+
+class Test(QemuBaseTest):
+    """Facilitates system emulation tests.
+
+    TODO: Rename this class as `QemuSystemTest`.
+    """
+
+    def setUp(self):
+        self._vms = {}
+
+        super().setUp()
+
+        self.machine = self.params.get('machine',
+                                       default=self._get_unique_tag_val('machine'))
+
     def require_accelerator(self, accelerator):
         """
         Requires an accelerator to be available for the test to continue
@@ -201,24 +241,6 @@ def require_accelerator(self, accelerator):
             self.cancel("%s accelerator does not seem to be "
                         "available" % accelerator)
 
-    def setUp(self):
-        self._vms = {}
-
-        self.arch = self.params.get('arch',
-                                    default=self._get_unique_tag_val('arch'))
-
-        self.cpu = self.params.get('cpu',
-                                   default=self._get_unique_tag_val('cpu'))
-
-        self.machine = self.params.get('machine',
-                                       default=self._get_unique_tag_val('machine'))
-
-        default_qemu_bin = pick_default_qemu_bin(arch=self.arch)
-        self.qemu_bin = self.params.get('qemu_bin',
-                                        default=default_qemu_bin)
-        if self.qemu_bin is None:
-            self.cancel("No QEMU binary defined or found in the build tree")
-
     def _new_vm(self, name, *args):
         self._sd = tempfile.TemporaryDirectory(prefix="avo_qemu_sock_")
         vm = QEMUMachine(self.qemu_bin, base_temp_dir=self.workdir,
@@ -272,18 +294,6 @@ def tearDown(self):
         self._sd = None
         super().tearDown()
 
-    def fetch_asset(self, name,
-                    asset_hash=None, algorithm=None,
-                    locations=None, expire=None,
-                    find_only=False, cancel_on_missing=True):
-        return super().fetch_asset(name,
-                        asset_hash=asset_hash,
-                        algorithm=algorithm,
-                        locations=locations,
-                        expire=expire,
-                        find_only=find_only,
-                        cancel_on_missing=cancel_on_missing)
-
 
 class LinuxSSHMixIn:
     """Contains utility methods for interacting with a guest via SSH."""
Signature · 1 line
2.31.1
#8 lore raw

[PULL 8/9] tests/avocado: Rename avocado_qemu.Test -> QemuSystemTest

In reply to Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <[email protected]>

To run user-mode emulation tests, we introduced the avocado_qemu.QemuUserTest which inherits from avocado_qemu.QemuBaseTest. System-mode emulation tests are based on the avocado_qemu.Test class, which also inherits avocado_qemu.QemuBaseTest. To avoid confusion, rename it as avocado_qemu.QemuSystemTest.

Message-Id: <[email protected]>

---
 docs/devel/testing.rst                    |  8 ++++----
 tests/avocado/avocado_qemu/__init__.py    | 21 +++++++++------------
 tests/avocado/boot_linux_console.py       |  4 ++--
 tests/avocado/cpu_queries.py              |  4 ++--
 tests/avocado/empty_cpu_model.py          |  4 ++--
 tests/avocado/info_usernet.py             |  4 ++--
 tests/avocado/linux_initrd.py             |  4 ++--
 tests/avocado/linux_ssh_mips_malta.py     |  5 +++--
 tests/avocado/machine_arm_canona1100.py   |  4 ++--
 tests/avocado/machine_arm_integratorcp.py |  4 ++--
 tests/avocado/machine_arm_n8x0.py         |  4 ++--
 tests/avocado/machine_avr6.py             |  4 ++--
 tests/avocado/machine_m68k_nextcube.py    |  4 ++--
 tests/avocado/machine_microblaze.py       |  4 ++--
 tests/avocado/machine_mips_fuloong2e.py   |  4 ++--
 tests/avocado/machine_mips_loongson3v.py  |  4 ++--
 tests/avocado/machine_mips_malta.py       |  4 ++--
 tests/avocado/machine_rx_gdbsim.py        |  4 ++--
 tests/avocado/machine_s390_ccw_virtio.py  |  4 ++--
 tests/avocado/machine_sparc_leon3.py      |  4 ++--
 tests/avocado/migration.py                |  4 ++--
 tests/avocado/multiprocess.py             |  4 ++--
 tests/avocado/pc_cpu_hotplug_props.py     |  4 ++--
 tests/avocado/ppc_405.py                  |  4 ++--
 tests/avocado/ppc_bamboo.py               |  4 ++--
 tests/avocado/ppc_mpc8544ds.py            |  4 ++--
 tests/avocado/ppc_prep_40p.py             |  4 ++--
 tests/avocado/ppc_pseries.py              |  4 ++--
 tests/avocado/ppc_virtex_ml507.py         |  4 ++--
 tests/avocado/version.py                  |  4 ++--
 tests/avocado/virtio-gpu.py               |  4 ++--
 tests/avocado/virtio_check_params.py      |  4 ++--
 tests/avocado/virtio_version.py           |  4 ++--
 tests/avocado/vnc.py                      |  4 ++--
 tests/avocado/x86_cpu_model_versions.py   |  4 ++--
 35 files changed, 80 insertions(+), 82 deletions(-)
docs/devel/testing.rst +4 -4
index dc5dbd057db..60c59023e58 100644
@@ -811,10 +811,10 @@ class.  Here's a simple usage example:
 
 .. code::
 
-  from avocado_qemu import Test
+  from avocado_qemu import QemuSystemTest
 
 
-  class Version(Test):
+  class Version(QemuSystemTest):
       """
       :avocado: tags=quick
       """
@@ -859,10 +859,10 @@ and hypothetical example follows:
 
 .. code::
 
-  from avocado_qemu import Test
+  from avocado_qemu import QemuSystemTest
 
 
-  class MultipleMachines(Test):
+  class MultipleMachines(QemuSystemTest):
       def test_multiple_machines(self):
           first_machine = self.get_vm()
           second_machine = self.get_vm()
tests/avocado/avocado_qemu/__init__.py +9 -12
index 1efc22dabfa..75063c0c301 100644
@@ -176,7 +176,7 @@ def interrupt_interactive_console_until_pattern(test, success_message,
 
     :param test: an Avocado test containing a VM that will have its console
                  read and probed for a success or failure message
-    :type test: :class:`avocado_qemu.Test`
+    :type test: :class:`avocado_qemu.QemuSystemTest`
     :param success_message: if this message appears, test succeeds
     :param failure_message: if this message appears, test fails
     :param interrupt_string: a string to send to the console before trying
@@ -192,7 +192,7 @@ def wait_for_console_pattern(test, success_message, failure_message=None,
 
     :param test: an Avocado test containing a VM that will have its console
                  read and probed for a success or failure message
-    :type test: :class:`avocado_qemu.Test`
+    :type test: :class:`avocado_qemu.QemuSystemTest`
     :param success_message: if this message appears, test succeeds
     :param failure_message: if this message appears, test fails
     """
@@ -204,7 +204,7 @@ def exec_command(test, command):
     the content.
 
     :param test: an Avocado test containing a VM.
-    :type test: :class:`avocado_qemu.Test`
+    :type test: :class:`avocado_qemu.QemuSystemTest`
     :param command: the command to send
     :type command: str
     """
@@ -219,7 +219,7 @@ def exec_command_and_wait_for_pattern(test, command,
 
     :param test: an Avocado test containing a VM that will have its console
                  read and probed for a success or failure message
-    :type test: :class:`avocado_qemu.Test`
+    :type test: :class:`avocado_qemu.QemuSystemTest`
     :param command: the command to send
     :param success_message: if this message appears, test succeeds
     :param failure_message: if this message appears, test fails
@@ -262,11 +262,8 @@ def fetch_asset(self, name,
                         cancel_on_missing=cancel_on_missing)
 
 
-class Test(QemuBaseTest):
-    """Facilitates system emulation tests.
-
-    TODO: Rename this class as `QemuSystemTest`.
-    """
+class QemuSystemTest(QemuBaseTest):
+    """Facilitates system emulation tests."""
 
     def setUp(self):
         self._vms = {}
@@ -508,11 +505,11 @@ def default_kernel_params(self):
         return self._info.get('kernel_params', None)
 
 
-class LinuxTest(LinuxSSHMixIn, Test):
+class LinuxTest(LinuxSSHMixIn, QemuSystemTest):
     """Facilitates having a cloud-image Linux based available.
 
-    For tests that indend to interact with guests, this is a better choice
-    to start with than the more vanilla `Test` class.
+    For tests that indent to interact with guests, this is a better choice
+    to start with than the more vanilla `QemuSystemTest` class.
     """
 
     timeout = 900
tests/avocado/boot_linux_console.py +2 -2
index 06fc967f6c4..4ed01ed7893 100644
@@ -15,7 +15,7 @@
 
 from avocado import skip
 from avocado import skipUnless
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import exec_command
 from avocado_qemu import exec_command_and_wait_for_pattern
 from avocado_qemu import interrupt_interactive_console_until_pattern
@@ -46,7 +46,7 @@ def image_pow2ceil_expand(path):
             with open(path, 'ab+') as fd:
                 fd.truncate(size_aligned)
 
-class LinuxKernelTest(Test):
+class LinuxKernelTest(QemuSystemTest):
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
 
     def wait_for_console_pattern(self, success_message, vm=None):
tests/avocado/cpu_queries.py +2 -2
index cc9e380cc7f..cf69f69b116 100644
@@ -8,9 +8,9 @@
 # This work is licensed under the terms of the GNU GPL, version 2 or
 # later.  See the COPYING file in the top-level directory.
 
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 
-class QueryCPUModelExpansion(Test):
+class QueryCPUModelExpansion(QemuSystemTest):
     """
     Run query-cpu-model-expansion for each CPU model, and validate results
     """
tests/avocado/empty_cpu_model.py +2 -2
index a1e59e45e4e..22f504418d2 100644
@@ -7,9 +7,9 @@
 #
 # This work is licensed under the terms of the GNU GPL, version 2 or
 # later.  See the COPYING file in the top-level directory.
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 
-class EmptyCPUModel(Test):
+class EmptyCPUModel(QemuSystemTest):
     def test(self):
         self.vm.add_args('-S', '-display', 'none', '-machine', 'none', '-cpu', '')
         self.vm.set_qmp_monitor(enabled=False)
tests/avocado/info_usernet.py +2 -2
index 9c1fd903a0b..dc01f74150c 100644
@@ -8,12 +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.
 
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 
 from qemu.utils import get_info_usernet_hostfwd_port
 
 
-class InfoUsernet(Test):
+class InfoUsernet(QemuSystemTest):
 
     def test_hostfwd(self):
         self.vm.add_args('-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22')
tests/avocado/linux_initrd.py +2 -2
index 9b4880cd8c2..ba02e5a563d 100644
@@ -12,11 +12,11 @@
 import logging
 import tempfile
 
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado import skipIf
 
 
-class LinuxInitrd(Test):
+class LinuxInitrd(QemuSystemTest):
     """
     Checks QEMU evaluates correctly the initrd file passed as -initrd option.
 
tests/avocado/linux_ssh_mips_malta.py +3 -2
index 4de19474188..c0f0be5adee 100644
@@ -12,7 +12,8 @@
 import time
 
 from avocado import skipUnless
-from avocado_qemu import Test, LinuxSSHMixIn
+from avocado_qemu import LinuxSSHMixIn
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import wait_for_console_pattern
 from avocado.utils import process
 from avocado.utils import archive
@@ -21,7 +22,7 @@
 
 @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout')
 @skipUnless(ssh.SSH_CLIENT_BINARY, 'No SSH client available')
-class LinuxSSH(Test, LinuxSSHMixIn):
+class LinuxSSH(QemuSystemTest, LinuxSSHMixIn):
 
     timeout = 150 # Not for 'configure --enable-debug --enable-debug-tcg'
 
tests/avocado/machine_arm_canona1100.py +2 -2
index 0e5c43dbcf8..182a0b05134 100644
@@ -8,11 +8,11 @@
 # This work is licensed under the terms of the GNU GPL, version 2 or
 # later.  See the COPYING file in the top-level directory.
 
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import wait_for_console_pattern
 from avocado.utils import archive
 
-class CanonA1100Machine(Test):
+class CanonA1100Machine(QemuSystemTest):
     """Boots the barebox firmware and checks that the console is operational"""
 
     timeout = 90
tests/avocado/machine_arm_integratorcp.py +2 -2
index 49c8ebff78b..1ffe1073ef8 100644
@@ -12,7 +12,7 @@
 import logging
 
 from avocado import skipUnless
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import wait_for_console_pattern
 
 
@@ -29,7 +29,7 @@
     CV2_AVAILABLE = False
 
 
-class IntegratorMachine(Test):
+class IntegratorMachine(QemuSystemTest):
 
     timeout = 90
 
tests/avocado/machine_arm_n8x0.py +2 -2
index e5741f2d8d1..12e9a6803ba 100644
@@ -11,10 +11,10 @@
 import os
 
 from avocado import skipUnless
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import wait_for_console_pattern
 
-class N8x0Machine(Test):
+class N8x0Machine(QemuSystemTest):
     """Boots the Linux kernel and checks that the console is operational"""
 
     timeout = 90
tests/avocado/machine_avr6.py +2 -2
index 6bab31342aa..5485db79c68 100644
@@ -19,9 +19,9 @@
 
 import time
 
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 
-class AVR6Machine(Test):
+class AVR6Machine(QemuSystemTest):
     timeout = 5
 
     def test_freertos(self):
tests/avocado/machine_m68k_nextcube.py +2 -2
index 09e2745cc52..6790e7d9cd1 100644
@@ -8,7 +8,7 @@
 import os
 import time
 
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado import skipUnless
 
 from tesseract_utils import tesseract_available, tesseract_ocr
@@ -20,7 +20,7 @@
     PIL_AVAILABLE = False
 
 
-class NextCubeMachine(Test):
+class NextCubeMachine(QemuSystemTest):
     """
     :avocado: tags=arch:m68k
     :avocado: tags=machine:next-cube
tests/avocado/machine_microblaze.py +2 -2
index 7f6d18495d8..4928920f960 100644
@@ -5,11 +5,11 @@
 # This work is licensed under the terms of the GNU GPL, version 2 or
 # later. See the COPYING file in the top-level directory.
 
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import wait_for_console_pattern
 from avocado.utils import archive
 
-class MicroblazeMachine(Test):
+class MicroblazeMachine(QemuSystemTest):
 
     timeout = 90
 
tests/avocado/machine_mips_fuloong2e.py +2 -2
index 0ac285e2af1..89291f47b24 100644
@@ -10,10 +10,10 @@
 import os
 
 from avocado import skipUnless
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import wait_for_console_pattern
 
-class MipsFuloong2e(Test):
+class MipsFuloong2e(QemuSystemTest):
 
     timeout = 60
 
tests/avocado/machine_mips_loongson3v.py +2 -2
index 85b131a40f0..5194cf18c9c 100644
@@ -11,10 +11,10 @@
 import time
 
 from avocado import skipUnless
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import wait_for_console_pattern
 
-class MipsLoongson3v(Test):
+class MipsLoongson3v(QemuSystemTest):
     timeout = 60
 
     @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
tests/avocado/machine_mips_malta.py +2 -2
index b67d8cb141c..f1895d59f35 100644
@@ -12,7 +12,7 @@
 import logging
 
 from avocado import skipUnless
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import wait_for_console_pattern
 from avocado.utils import archive
 from avocado import skipIf
@@ -33,7 +33,7 @@
 
 @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
 @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
-class MaltaMachineFramebuffer(Test):
+class MaltaMachineFramebuffer(QemuSystemTest):
 
     timeout = 30
 
tests/avocado/machine_rx_gdbsim.py +2 -2
index 32b737b6d85..6cd8704b016 100644
@@ -11,13 +11,13 @@
 import os
 
 from avocado import skipIf
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import exec_command_and_wait_for_pattern
 from avocado_qemu import wait_for_console_pattern
 from avocado.utils import archive
 
 
-class RxGdbSimMachine(Test):
+class RxGdbSimMachine(QemuSystemTest):
 
     timeout = 30
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
tests/avocado/machine_s390_ccw_virtio.py +2 -2
index 4028c99afce..bd03d7160b4 100644
@@ -13,12 +13,12 @@
 import tempfile
 
 from avocado import skipIf
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import exec_command_and_wait_for_pattern
 from avocado_qemu import wait_for_console_pattern
 from avocado.utils import archive
 
-class S390CCWVirtioMachine(Test):
+class S390CCWVirtioMachine(QemuSystemTest):
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
 
     timeout = 120
tests/avocado/machine_sparc_leon3.py +2 -2
index 2405cd7a0d7..e61b223185a 100644
@@ -5,12 +5,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.
 
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import wait_for_console_pattern
 from avocado import skip
 
 
-class Leon3Machine(Test):
+class Leon3Machine(QemuSystemTest):
 
     timeout = 60
 
tests/avocado/migration.py +2 -2
index 792639cb693..584d6ef53f5 100644
@@ -11,7 +11,7 @@
 
 
 import tempfile
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado import skipUnless
 
 from avocado.utils import network
@@ -19,7 +19,7 @@
 from avocado.utils.path import find_command
 
 
-class Migration(Test):
+class Migration(QemuSystemTest):
     """
     :avocado: tags=migration
     """
tests/avocado/multiprocess.py +2 -2
index 96627f022a8..80a3b8f442b 100644
@@ -7,12 +7,12 @@
 import os
 import socket
 
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import wait_for_console_pattern
 from avocado_qemu import exec_command
 from avocado_qemu import exec_command_and_wait_for_pattern
 
-class Multiprocess(Test):
+class Multiprocess(QemuSystemTest):
     """
     :avocado: tags=multiprocess
     """
tests/avocado/pc_cpu_hotplug_props.py +2 -2
index 2e86d5017a5..52b878188ed 100644
@@ -20,9 +20,9 @@
 # License along with this library; if not, see <http://www.gnu.org/licenses/>.
 #
 
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 
-class OmittedCPUProps(Test):
+class OmittedCPUProps(QemuSystemTest):
     """
     :avocado: tags=arch:x86_64
     :avocado: tags=cpu:qemu64
tests/avocado/ppc_405.py +2 -2
index c534d5d32f2..a47f89b9346 100644
@@ -6,11 +6,11 @@
 # later.  See the COPYING file in the top-level directory.
 
 from avocado.utils import archive
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import wait_for_console_pattern
 from avocado_qemu import exec_command_and_wait_for_pattern
 
-class Ppc405Machine(Test):
+class Ppc405Machine(QemuSystemTest):
 
     timeout = 90
 
tests/avocado/ppc_bamboo.py +2 -2
index dd33bf66f32..40629e34789 100644
@@ -6,11 +6,11 @@
 # later.  See the COPYING file in the top-level directory.
 
 from avocado.utils import archive
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import wait_for_console_pattern
 from avocado_qemu import exec_command_and_wait_for_pattern
 
-class BambooMachine(Test):
+class BambooMachine(QemuSystemTest):
 
     timeout = 90
 
tests/avocado/ppc_mpc8544ds.py +2 -2
index ce840600c1c..886f967b15a 100644
@@ -6,10 +6,10 @@
 # later.  See the COPYING file in the top-level directory.
 
 from avocado.utils import archive
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import wait_for_console_pattern
 
-class Mpc8544dsMachine(Test):
+class Mpc8544dsMachine(QemuSystemTest):
 
     timeout = 90
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
tests/avocado/ppc_prep_40p.py +2 -2
index 5e61e686bd0..4bd956584d6 100644
@@ -8,11 +8,11 @@
 import os
 
 from avocado import skipUnless
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import wait_for_console_pattern
 
 
-class IbmPrep40pMachine(Test):
+class IbmPrep40pMachine(QemuSystemTest):
 
     timeout = 60
 
tests/avocado/ppc_pseries.py +2 -2
index f14a884ee16..d8b04dc3ead 100644
@@ -6,10 +6,10 @@
 # later.  See the COPYING file in the top-level directory.
 
 from avocado.utils import archive
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import wait_for_console_pattern
 
-class pseriesMachine(Test):
+class pseriesMachine(QemuSystemTest):
 
     timeout = 90
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
tests/avocado/ppc_virtex_ml507.py +2 -2
index 27f7bf2d492..a6912ee5793 100644
@@ -6,10 +6,10 @@
 # later.  See the COPYING file in the top-level directory.
 
 from avocado.utils import archive
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import wait_for_console_pattern
 
-class VirtexMl507Machine(Test):
+class VirtexMl507Machine(QemuSystemTest):
 
     timeout = 90
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
tests/avocado/version.py +2 -2
index 79b923d4fc0..ded7f039c1b 100644
@@ -9,10 +9,10 @@
 # later.  See the COPYING file in the top-level directory.
 
 
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 
 
-class Version(Test):
+class Version(QemuSystemTest):
     """
     :avocado: tags=quick
     """
tests/avocado/virtio-gpu.py +2 -2
index 4acc1e6d5fd..2a249a3a2c1 100644
@@ -4,8 +4,8 @@
 # later.  See the COPYING file in the top-level directory.
 
 
-from avocado_qemu import Test
 from avocado_qemu import BUILD_DIR
+from avocado_qemu import QemuSystemTest
 from avocado_qemu import wait_for_console_pattern
 from avocado_qemu import exec_command_and_wait_for_pattern
 from avocado_qemu import is_readable_executable_file
@@ -27,7 +27,7 @@ def pick_default_vug_bin():
         return bld_dir_path
 
 
-class VirtioGPUx86(Test):
+class VirtioGPUx86(QemuSystemTest):
     """
     :avocado: tags=virtio-gpu
     :avocado: tags=arch:x86_64
tests/avocado/virtio_check_params.py +2 -2
index 87e6c839d14..e869690473a 100644
@@ -24,7 +24,7 @@
 
 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
 from qemu.machine import QEMUMachine
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 from avocado import skip
 
 #list of machine types and virtqueue properties to test
@@ -41,7 +41,7 @@
                                     'driver=null-co,id=drive0,if=none']}
 
 
-class VirtioMaxSegSettingsCheck(Test):
+class VirtioMaxSegSettingsCheck(QemuSystemTest):
     @staticmethod
     def make_pattern(props):
         pattern_items = ['{0} = \w+'.format(prop) for prop in props]
tests/avocado/virtio_version.py +2 -2
index 33593c29dd0..208910bb844 100644
@@ -13,7 +13,7 @@
 
 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
 from qemu.machine import QEMUMachine
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 
 # Virtio Device IDs:
 VIRTIO_NET = 1
@@ -55,7 +55,7 @@ def get_pci_interfaces(vm, devtype):
     interfaces = ('pci-express-device', 'conventional-pci-device')
     return [i for i in interfaces if devtype_implements(vm, devtype, i)]
 
-class VirtioVersionCheck(Test):
+class VirtioVersionCheck(QemuSystemTest):
     """
     Check if virtio-version-specific device types result in the
     same device tree created by `disable-modern` and
tests/avocado/vnc.py +2 -2
index f301fbb4f56..096432988fb 100644
@@ -8,10 +8,10 @@
 # This work is licensed under the terms of the GNU GPL, version 2 or
 # later.  See the COPYING file in the top-level directory.
 
-from avocado_qemu import Test
+from avocado_qemu import QemuSystemTest
 
 
-class Vnc(Test):
+class Vnc(QemuSystemTest):
     """
     :avocado: tags=vnc,quick
     """
tests/avocado/x86_cpu_model_versions.py +2 -2
index 0e9feda62d4..a6edf74c1cc 100644
@@ -24,7 +24,7 @@
 import avocado_qemu
 import re
 
-class X86CPUModelAliases(avocado_qemu.Test):
+class X86CPUModelAliases(avocado_qemu.QemuSystemTest):
     """
     Validation of PC CPU model versions and CPU model aliases
 
@@ -239,7 +239,7 @@ def test_none_alias(self):
         self.validate_aliases(cpus)
 
 
-class CascadelakeArchCapabilities(avocado_qemu.Test):
+class CascadelakeArchCapabilities(avocado_qemu.QemuSystemTest):
     """
     Validation of Cascadelake arch-capabilities
 
Signature · 1 line
2.31.1
#9 lore raw

[PULL 9/9] tests/avocado: Remove p7zip binary availability check

In reply to Philippe Mathieu-Daudé

The single use of the 7z binary has been removed in commit a30e114f3 ("tests/acceptance: remove Armbian 19.11.3 test for orangepi-pc"), we don't need to check for this binary availability anymore.

Message-Id: <[email protected]>

---
 tests/avocado/boot_linux_console.py | 7 -------
 1 file changed, 7 deletions(-)
tests/avocado/boot_linux_console.py +0 -7
index 4ed01ed7893..9c618d4809f 100644
@@ -22,13 +22,6 @@
 from avocado_qemu import wait_for_console_pattern
 from avocado.utils import process
 from avocado.utils import archive
-from avocado.utils.path import find_command, CmdNotFoundError
-
-P7ZIP_AVAILABLE = True
-try:
-    find_command('7z')
-except CmdNotFoundError:
-    P7ZIP_AVAILABLE = False
 
 """
 Round up to next power of 2
Signature · 1 line
2.31.1
#10 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 146 lines · Philippe Mathieu-Daudé

The following changes since commit 260f9210d2ce892c5e162a45b0e5ec0036bedc79:

   Merge remote-tracking branch 'remotes/marcandre.lureau/tags/sphinx-pull-request' into staging (2021-11-08 14:56:10 +0100)

are available in the Git repository at:

   https://github.com/philmd/qemu.git tags/avocado-20211108

for you to fetch changes up to b94d00898a9ee708b4d4b79432c2272905a56b06:

   tests/avocado: Remove p7zip binary availability check (2021-11-08 17:00:22 +0100)

----------------------------------------------------------------
Integration testing patches

- Rename tests/acceptance/ -> tests/avocado/
- Rename avocado_qemu.Test -> avocado_qemu.QemuSystemTest
- Introduce QemuUserTest class
- Add the first linux-user test, covering the bFLT loader

----------------------------------------------------------------

Philippe Mathieu-Daudé (7):
tests/avocado: Extract QemuBaseTest from Test tests/avocado: Make pick_default_qemu_bin() more generic tests/avocado: Introduce QemuUserTest base class tests/avocado: Share useful helpers from virtiofs_submounts test tests/avocado: Add bFLT loader linux-user test tests/avocado: Rename avocado_qemu.Test -> QemuSystemTest tests/avocado: Remove p7zip binary availability check

Willian Rampazzo (2):
tests/acceptance: introduce new check-avocado target tests/acceptance: rename tests acceptance to tests avocado

  docs/devel/build-system.rst                   |   2 +-
  docs/devel/ci-definitions.rst.inc             |   2 +-
  docs/devel/testing.rst                        |  57 +++---
  docs/system/arm/orangepi.rst                  |   8 +-
  python/qemu/machine/README.rst                |   2 +-
  python/qemu/qmp/README.rst                    |   2 +-
  python/qemu/utils/README.rst                  |   2 +-
  tests/acceptance/README.rst                   |  10 --
  tests/avocado/README.rst                      |  10 ++
  configure                                     |   2 +-
  .gitlab-ci.d/buildtest-template.yml           |   2 +-
  .gitlab-ci.d/buildtest.yml                    |  56 +++---
  MAINTAINERS                                   |  52 +++---
  tests/Makefile.include                        |  21 ++-
  .../avocado_qemu/__init__.py                  | 163 +++++++++++++-----
  tests/{acceptance => avocado}/boot_linux.py   |   0
  .../boot_linux_console.py                     |  11 +-
  tests/{acceptance => avocado}/boot_xen.py     |   0
  tests/{acceptance => avocado}/cpu_queries.py  |   4 +-
  .../empty_cpu_model.py                        |   4 +-
  tests/{acceptance => avocado}/hotplug_cpu.py  |   0
  tests/{acceptance => avocado}/info_usernet.py |   4 +-
  tests/{acceptance => avocado}/intel_iommu.py  |   0
  tests/{acceptance => avocado}/linux_initrd.py |   6 +-
  .../linux_ssh_mips_malta.py                   |   5 +-
  tests/avocado/load_bflt.py                    |  54 ++++++
  .../machine_arm_canona1100.py                 |   4 +-
  .../machine_arm_integratorcp.py               |   4 +-
  .../machine_arm_n8x0.py                       |   4 +-
  tests/{acceptance => avocado}/machine_avr6.py |   6 +-
  .../machine_m68k_nextcube.py                  |   4 +-
  .../machine_microblaze.py                     |   4 +-
  .../machine_mips_fuloong2e.py                 |   4 +-
  .../machine_mips_loongson3v.py                |   4 +-
  .../machine_mips_malta.py                     |   4 +-
  .../machine_rx_gdbsim.py                      |   4 +-
  .../machine_s390_ccw_virtio.py                |   4 +-
  .../machine_sparc64_sun4u.py                  |   0
  .../machine_sparc_leon3.py                    |   4 +-
  tests/{acceptance => avocado}/migration.py    |   4 +-
  tests/{acceptance => avocado}/multiprocess.py |   4 +-
  .../pc_cpu_hotplug_props.py                   |   4 +-
  tests/{acceptance => avocado}/ppc_405.py      |   4 +-
  tests/{acceptance => avocado}/ppc_bamboo.py   |   4 +-
  .../{acceptance => avocado}/ppc_mpc8544ds.py  |   4 +-
  tests/{acceptance => avocado}/ppc_prep_40p.py |   4 +-
  tests/{acceptance => avocado}/ppc_pseries.py  |   4 +-
  .../ppc_virtex_ml507.py                       |   4 +-
  .../{acceptance => avocado}/replay_kernel.py  |   0
  tests/{acceptance => avocado}/replay_linux.py |   0
  .../reverse_debugging.py                      |   0
  tests/{acceptance => avocado}/smmu.py         |   0
  tests/{acceptance => avocado}/tcg_plugins.py  |   0
  .../tesseract_utils.py                        |   0
  tests/{acceptance => avocado}/version.py      |   4 +-
  tests/{acceptance => avocado}/virtio-gpu.py   |   4 +-
  .../virtio_check_params.py                    |   4 +-
  .../{acceptance => avocado}/virtio_version.py |   4 +-
  .../virtiofs_submounts.py                     |  59 +------
  .../virtiofs_submounts.py.data/cleanup.sh     |   0
  .../guest-cleanup.sh                          |   0
  .../virtiofs_submounts.py.data/guest.sh       |   0
  .../virtiofs_submounts.py.data/host.sh        |   0
  tests/{acceptance => avocado}/vnc.py          |   4 +-
  .../x86_cpu_model_versions.py                 |   4 +-
  65 files changed, 364 insertions(+), 284 deletions(-)

delete mode 100644 tests/acceptance/README.rst
create mode 100644 tests/avocado/README.rst
rename tests/{acceptance => avocado}/avocado_qemu/__init__.py (87%) rename tests/{acceptance => avocado}/boot_linux.py (100%) rename tests/{acceptance => avocado}/boot_linux_console.py (99%) rename tests/{acceptance => avocado}/boot_xen.py (100%) rename tests/{acceptance => avocado}/cpu_queries.py (91%) rename tests/{acceptance => avocado}/empty_cpu_model.py (88%) rename tests/{acceptance => avocado}/hotplug_cpu.py (100%) rename tests/{acceptance => avocado}/info_usernet.py (92%) rename tests/{acceptance => avocado}/intel_iommu.py (100%) rename tests/{acceptance => avocado}/linux_initrd.py (96%) rename tests/{acceptance => avocado}/linux_ssh_mips_malta.py (98%) create mode 100644 tests/avocado/load_bflt.py
rename tests/{acceptance => avocado}/machine_arm_canona1100.py (93%) rename tests/{acceptance => avocado}/machine_arm_integratorcp.py (97%) rename tests/{acceptance => avocado}/machine_arm_n8x0.py (95%) rename tests/{acceptance => avocado}/machine_avr6.py (94%) rename tests/{acceptance => avocado}/machine_m68k_nextcube.py (97%) rename tests/{acceptance => avocado}/machine_microblaze.py (94%) rename tests/{acceptance => avocado}/machine_mips_fuloong2e.py (95%) rename tests/{acceptance => avocado}/machine_mips_loongson3v.py (94%) rename tests/{acceptance => avocado}/machine_mips_malta.py (98%) rename tests/{acceptance => avocado}/machine_rx_gdbsim.py (97%) rename tests/{acceptance => avocado}/machine_s390_ccw_virtio.py (99%) rename tests/{acceptance => avocado}/machine_sparc64_sun4u.py (100%) rename tests/{acceptance => avocado}/machine_sparc_leon3.py (94%) rename tests/{acceptance => avocado}/migration.py (97%) rename tests/{acceptance => avocado}/multiprocess.py (98%) rename tests/{acceptance => avocado}/pc_cpu_hotplug_props.py (93%) rename tests/{acceptance => avocado}/ppc_405.py (94%) rename tests/{acceptance => avocado}/ppc_bamboo.py (95%) rename tests/{acceptance => avocado}/ppc_mpc8544ds.py (93%) rename tests/{acceptance => avocado}/ppc_prep_40p.py (97%) rename tests/{acceptance => avocado}/ppc_pseries.py (94%) rename tests/{acceptance => avocado}/ppc_virtex_ml507.py (93%) rename tests/{acceptance => avocado}/replay_kernel.py (100%) rename tests/{acceptance => avocado}/replay_linux.py (100%) rename tests/{acceptance => avocado}/reverse_debugging.py (100%) rename tests/{acceptance => avocado}/smmu.py (100%)
rename tests/{acceptance => avocado}/tcg_plugins.py (100%) rename tests/{acceptance => avocado}/tesseract_utils.py (100%) rename tests/{acceptance => avocado}/version.py (88%) rename tests/{acceptance => avocado}/virtio-gpu.py (98%) rename tests/{acceptance => avocado}/virtio_check_params.py (98%)

Quoted 8 lines

rename tests/{acceptance => avocado}/virtio_version.py (98%)
rename tests/{acceptance => avocado}/virtiofs_submounts.py (82%)
rename tests/{acceptance => avocado}/virtiofs_submounts.py.data/cleanup.sh (100%) rename tests/{acceptance => avocado}/virtiofs_submounts.py.data/guest-cleanup.sh (100%) rename tests/{acceptance => avocado}/virtiofs_submounts.py.data/guest.sh (100%) rename tests/{acceptance => avocado}/virtiofs_submounts.py.data/host.sh (100%) rename tests/{acceptance => avocado}/vnc.py (96%)
rename tests/{acceptance => avocado}/x86_cpu_model_versions.py (99%)

Applied, thanks.

r~