Testing tweaks (build, docs, bumps)
- expose cross compiler info in meson pretty print - bump Fedora to 33 - "graceful" handling of missing virgl config - updates to the container documentation - move CODING_STYLE.rst into developer manual -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAmA2M5MACgkQ+9DbCVqe KkT3FAf/VqJMFin2ON8GxD/0OvaPhX2zOMrPzzUioMcHZKTW2AFytY0y4JPp7bcg rCqbHHa2escODQk0p1Wf5VvNYSjC9Q2PA0tmGXIZPYt+8Xf2N5l9Ub3woDBO6uKD cEY590wWzrcLoaSEyTcqEUKFD5Ce9PO/WAf/dlZgYr3Mo1flX17wBNvrMi4iQrld mLajqx3x4vonnda4nrAiz7fD/CLwE/50+21+0xN2vY3YA7EjRp8UfkUBIwe+Fubn iu0FmGgHn7coNSHSD8sfYKHeuo/fMJl6jKiWJdFC7343WdAQtsnYF7Uhml+T6X7i cm8yHCaBnbpHEw0x7kTsxfP/1ixYVw== =hyyV -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-updates-240221-1' into staging Testing tweaks (build, docs, bumps) - expose cross compiler info in meson pretty print - bump Fedora to 33 - "graceful" handling of missing virgl config - updates to the container documentation - move CODING_STYLE.rst into developer manual # gpg: Signature made Wed 24 Feb 2021 11:08:03 GMT # gpg: using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44 # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full] # Primary key fingerprint: 6685 AE99 E751 67BC AFC8 DF35 FBD0 DB09 5A9E 2A44 * remotes/stsquad/tags/pull-testing-updates-240221-1: docs: move CODING_STYLE into the developer documentation docs/devel: add forward reference to check-tcg docs/devel: update the container based tests docs/devel: expand on use of containers to build tests tests/acceptance: allow a "graceful" failing for virtio-gpu test docker: Bump Fedora images to release 33 meson.build: expose TCG cross compiler information in summary Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
cbcf09872a
|
@ -66,7 +66,9 @@ When submitting patches, one common approach is to use 'git
|
||||||
format-patch' and/or 'git send-email' to format & send the mail to the
|
format-patch' and/or 'git send-email' to format & send the mail to the
|
||||||
qemu-devel@nongnu.org mailing list. All patches submitted must contain
|
qemu-devel@nongnu.org mailing list. All patches submitted must contain
|
||||||
a 'Signed-off-by' line from the author. Patches should follow the
|
a 'Signed-off-by' line from the author. Patches should follow the
|
||||||
guidelines set out in the CODING_STYLE.rst file.
|
guidelines set out in the `style section
|
||||||
|
<https://www.qemu.org/docs/master/devel/style.html>` of
|
||||||
|
the Developers Guide.
|
||||||
|
|
||||||
Additional information on submitting patches can be found online via
|
Additional information on submitting patches can be found online via
|
||||||
the QEMU website
|
the QEMU website
|
||||||
|
|
|
@ -14,6 +14,7 @@ Contents:
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
|
|
||||||
build-system
|
build-system
|
||||||
|
style
|
||||||
kconfig
|
kconfig
|
||||||
testing
|
testing
|
||||||
fuzzing
|
fuzzing
|
||||||
|
|
|
@ -641,7 +641,7 @@ trace-events style
|
||||||
|
|
||||||
In trace-events files, use a '0x' prefix to specify hex numbers, as in:
|
In trace-events files, use a '0x' prefix to specify hex numbers, as in:
|
||||||
|
|
||||||
.. code-block::
|
.. code-block:: c
|
||||||
|
|
||||||
some_trace(unsigned x, uint64_t y) "x 0x%x y 0x" PRIx64
|
some_trace(unsigned x, uint64_t y) "x 0x%x y 0x" PRIx64
|
||||||
|
|
||||||
|
@ -649,14 +649,14 @@ An exception is made for groups of numbers that are hexadecimal by
|
||||||
convention and separated by the symbols '.', '/', ':', or ' ' (such as
|
convention and separated by the symbols '.', '/', ':', or ' ' (such as
|
||||||
PCI bus id):
|
PCI bus id):
|
||||||
|
|
||||||
.. code-block::
|
.. code-block:: c
|
||||||
|
|
||||||
another_trace(int cssid, int ssid, int dev_num) "bus id: %x.%x.%04x"
|
another_trace(int cssid, int ssid, int dev_num) "bus id: %x.%x.%04x"
|
||||||
|
|
||||||
However, you can use '0x' for such groups if you want. Anyway, be sure that
|
However, you can use '0x' for such groups if you want. Anyway, be sure that
|
||||||
it is obvious that numbers are in hex, ex.:
|
it is obvious that numbers are in hex, ex.:
|
||||||
|
|
||||||
.. code-block::
|
.. code-block:: c
|
||||||
|
|
||||||
data_dump(uint8_t c1, uint8_t c2, uint8_t c3) "bytes (in hex): %02x %02x %02x"
|
data_dump(uint8_t c1, uint8_t c2, uint8_t c3) "bytes (in hex): %02x %02x %02x"
|
||||||
|
|
|
@ -272,21 +272,28 @@ Note that the following group names have a special meaning:
|
||||||
|
|
||||||
- disabled: Tests in this group are disabled and ignored by check.
|
- disabled: Tests in this group are disabled and ignored by check.
|
||||||
|
|
||||||
.. _docker-ref:
|
.. _container-ref:
|
||||||
|
|
||||||
Docker based tests
|
Container based tests
|
||||||
==================
|
=====================
|
||||||
|
|
||||||
Introduction
|
Introduction
|
||||||
------------
|
------------
|
||||||
|
|
||||||
The Docker testing framework in QEMU utilizes public Docker images to build and
|
The container testing framework in QEMU utilizes public images to
|
||||||
test QEMU in predefined and widely accessible Linux environments. This makes
|
build and test QEMU in predefined and widely accessible Linux
|
||||||
it possible to expand the test coverage across distros, toolchain flavors and
|
environments. This makes it possible to expand the test coverage
|
||||||
library versions.
|
across distros, toolchain flavors and library versions. The support
|
||||||
|
was originally written for Docker although we also support Podman as
|
||||||
|
an alternative container runtime. Although the many of the target
|
||||||
|
names and scripts are prefixed with "docker" the system will
|
||||||
|
automatically run on whichever is configured.
|
||||||
|
|
||||||
Prerequisites
|
The container images are also used to augment the generation of tests
|
||||||
-------------
|
for testing TCG. See :ref:`checktcg-ref` for more details.
|
||||||
|
|
||||||
|
Docker Prerequisites
|
||||||
|
--------------------
|
||||||
|
|
||||||
Install "docker" with the system package manager and start the Docker service
|
Install "docker" with the system package manager and start the Docker service
|
||||||
on your development machine, then make sure you have the privilege to run
|
on your development machine, then make sure you have the privilege to run
|
||||||
|
@ -316,26 +323,53 @@ Note that any one of above configurations makes it possible for the user to
|
||||||
exploit the whole host with Docker bind mounting or other privileged
|
exploit the whole host with Docker bind mounting or other privileged
|
||||||
operations. So only do it on development machines.
|
operations. So only do it on development machines.
|
||||||
|
|
||||||
Quickstart
|
Podman Prerequisites
|
||||||
----------
|
--------------------
|
||||||
|
|
||||||
From source tree, type ``make docker`` to see the help. Testing can be started
|
Install "podman" with the system package manager.
|
||||||
without configuring or building QEMU (``configure`` and ``make`` are done in
|
|
||||||
the container, with parameters defined by the make target):
|
|
||||||
|
|
||||||
.. code::
|
.. code::
|
||||||
|
|
||||||
make docker-test-build@min-glib
|
$ sudo dnf install podman
|
||||||
|
$ podman ps
|
||||||
|
|
||||||
This will create a container instance using the ``min-glib`` image (the image
|
The last command should print an empty table, to verify the system is ready.
|
||||||
|
|
||||||
|
Quickstart
|
||||||
|
----------
|
||||||
|
|
||||||
|
From source tree, type ``make docker-help`` to see the help. Testing
|
||||||
|
can be started without configuring or building QEMU (``configure`` and
|
||||||
|
``make`` are done in the container, with parameters defined by the
|
||||||
|
make target):
|
||||||
|
|
||||||
|
.. code::
|
||||||
|
|
||||||
|
make docker-test-build@centos8
|
||||||
|
|
||||||
|
This will create a container instance using the ``centos8`` image (the image
|
||||||
is downloaded and initialized automatically), in which the ``test-build`` job
|
is downloaded and initialized automatically), in which the ``test-build`` job
|
||||||
is executed.
|
is executed.
|
||||||
|
|
||||||
|
Registry
|
||||||
|
--------
|
||||||
|
|
||||||
|
The QEMU project has a container registry hosted by GitLab at
|
||||||
|
``registry.gitlab.com/qemu-project/qemu`` which will automatically be
|
||||||
|
used to pull in pre-built layers. This avoids unnecessary strain on
|
||||||
|
the distro archives created by multiple developers running the same
|
||||||
|
container build steps over and over again. This can be overridden
|
||||||
|
locally by using the ``NOCACHE`` build option:
|
||||||
|
|
||||||
|
.. code::
|
||||||
|
|
||||||
|
make docker-image-debian10 NOCACHE=1
|
||||||
|
|
||||||
Images
|
Images
|
||||||
------
|
------
|
||||||
|
|
||||||
Along with many other images, the ``min-glib`` image is defined in a Dockerfile
|
Along with many other images, the ``centos8`` image is defined in a Dockerfile
|
||||||
in ``tests/docker/dockerfiles/``, called ``min-glib.docker``. ``make docker``
|
in ``tests/docker/dockerfiles/``, called ``centos8.docker``. ``make docker-help``
|
||||||
command will list all the available images.
|
command will list all the available images.
|
||||||
|
|
||||||
To add a new image, simply create a new ``.docker`` file under the
|
To add a new image, simply create a new ``.docker`` file under the
|
||||||
|
@ -355,7 +389,7 @@ QEMU. Docker tests are the executables under ``tests/docker`` named
|
||||||
library, ``tests/docker/common.rc``, which provides helpers to find the QEMU
|
library, ``tests/docker/common.rc``, which provides helpers to find the QEMU
|
||||||
source and build it.
|
source and build it.
|
||||||
|
|
||||||
The full list of tests is printed in the ``make docker`` help.
|
The full list of tests is printed in the ``make docker-help`` help.
|
||||||
|
|
||||||
Debugging a Docker test failure
|
Debugging a Docker test failure
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
@ -980,6 +1014,8 @@ And remove any package you want with::
|
||||||
If you've used ``make check-acceptance``, the Python virtual environment where
|
If you've used ``make check-acceptance``, the Python virtual environment where
|
||||||
Avocado is installed will be cleaned up as part of ``make check-clean``.
|
Avocado is installed will be cleaned up as part of ``make check-clean``.
|
||||||
|
|
||||||
|
.. _checktcg-ref:
|
||||||
|
|
||||||
Testing with "make check-tcg"
|
Testing with "make check-tcg"
|
||||||
=============================
|
=============================
|
||||||
|
|
||||||
|
@ -1001,10 +1037,17 @@ for the architecture in question, for example::
|
||||||
There is also a ``--cross-cc-flags-ARCH`` flag in case additional
|
There is also a ``--cross-cc-flags-ARCH`` flag in case additional
|
||||||
compiler flags are needed to build for a given target.
|
compiler flags are needed to build for a given target.
|
||||||
|
|
||||||
If you have the ability to run containers as the user you can also
|
If you have the ability to run containers as the user the build system
|
||||||
take advantage of the build systems "Docker" support. It will then use
|
will automatically use them where no system compiler is available. For
|
||||||
containers to build any test case for an enabled guest where there is
|
architectures where we also support building QEMU we will generally
|
||||||
no system compiler available. See :ref:`docker-ref` for details.
|
use the same container to build tests. However there are a number of
|
||||||
|
additional containers defined that have a minimal cross-build
|
||||||
|
environment that is only suitable for building test cases. Sometimes
|
||||||
|
we may use a bleeding edge distribution for compiler features needed
|
||||||
|
for test cases that aren't yet in the LTS distros we support for QEMU
|
||||||
|
itself.
|
||||||
|
|
||||||
|
See :ref:`container-ref` for more details.
|
||||||
|
|
||||||
Running subset of tests
|
Running subset of tests
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
18
meson.build
18
meson.build
|
@ -2509,6 +2509,24 @@ endif
|
||||||
summary_info += {'strip binaries': get_option('strip')}
|
summary_info += {'strip binaries': get_option('strip')}
|
||||||
summary_info += {'sparse': sparse.found() ? sparse.full_path() : false}
|
summary_info += {'sparse': sparse.found() ? sparse.full_path() : false}
|
||||||
summary_info += {'mingw32 support': targetos == 'windows'}
|
summary_info += {'mingw32 support': targetos == 'windows'}
|
||||||
|
|
||||||
|
# snarf the cross-compilation information for tests
|
||||||
|
foreach target: target_dirs
|
||||||
|
tcg_mak = meson.current_build_dir() / 'tests/tcg' / 'config-' + target + '.mak'
|
||||||
|
if fs.exists(tcg_mak)
|
||||||
|
config_cross_tcg = keyval.load(tcg_mak)
|
||||||
|
target = config_cross_tcg['TARGET_NAME']
|
||||||
|
compiler = ''
|
||||||
|
if 'DOCKER_CROSS_CC_GUEST' in config_cross_tcg
|
||||||
|
summary_info += {target + ' tests': config_cross_tcg['DOCKER_CROSS_CC_GUEST'] +
|
||||||
|
' via ' + config_cross_tcg['DOCKER_IMAGE']}
|
||||||
|
elif 'CROSS_CC_GUEST' in config_cross_tcg
|
||||||
|
summary_info += {target + ' tests'
|
||||||
|
: config_cross_tcg['CROSS_CC_GUEST'] }
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
|
|
||||||
summary(summary_info, bool_yn: true, section: 'Compilation')
|
summary(summary_info, bool_yn: true, section: 'Compilation')
|
||||||
|
|
||||||
# Targets and accelerators
|
# Targets and accelerators
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
#
|
#
|
||||||
# Fix multiline comments to match CODING_STYLE
|
# Fix multiline comments to match docs/devel/style.rst
|
||||||
#
|
#
|
||||||
# Copyright (C) 2018 Red Hat, Inc.
|
# Copyright (C) 2018 Red Hat, Inc.
|
||||||
#
|
#
|
||||||
|
|
|
@ -85,7 +85,12 @@ class VirtioGPUx86(Test):
|
||||||
"-append",
|
"-append",
|
||||||
kernel_command_line,
|
kernel_command_line,
|
||||||
)
|
)
|
||||||
self.vm.launch()
|
try:
|
||||||
|
self.vm.launch()
|
||||||
|
except:
|
||||||
|
# TODO: probably fails because we are missing the VirGL features
|
||||||
|
self.cancel("VirGL not enabled?")
|
||||||
|
|
||||||
self.wait_for_console_pattern("as init process")
|
self.wait_for_console_pattern("as init process")
|
||||||
exec_command_and_wait_for_pattern(
|
exec_command_and_wait_for_pattern(
|
||||||
self, "/usr/sbin/modprobe virtio_gpu", ""
|
self, "/usr/sbin/modprobe virtio_gpu", ""
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Cross compiler for cris system tests
|
# Cross compiler for cris system tests
|
||||||
#
|
#
|
||||||
|
|
||||||
FROM fedora:30
|
FROM fedora:33
|
||||||
ENV PACKAGES gcc-cris-linux-gnu
|
ENV PACKAGES gcc-cris-linux-gnu
|
||||||
RUN dnf install -y $PACKAGES
|
RUN dnf install -y $PACKAGES
|
||||||
RUN rpm -q $PACKAGES | sort > /packages.txt
|
RUN rpm -q $PACKAGES | sort > /packages.txt
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM fedora:31
|
FROM fedora:33
|
||||||
ENV PACKAGES \
|
ENV PACKAGES \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
diffutils \
|
diffutils \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM fedora:32
|
FROM fedora:33
|
||||||
|
|
||||||
# Please keep this list sorted alphabetically
|
# Please keep this list sorted alphabetically
|
||||||
ENV PACKAGES \
|
ENV PACKAGES \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM fedora:32
|
FROM fedora:33
|
||||||
|
|
||||||
# Please keep this list sorted alphabetically
|
# Please keep this list sorted alphabetically
|
||||||
ENV PACKAGES \
|
ENV PACKAGES \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM fedora:32
|
FROM fedora:33
|
||||||
|
|
||||||
# Please keep this list sorted alphabetically
|
# Please keep this list sorted alphabetically
|
||||||
ENV PACKAGES \
|
ENV PACKAGES \
|
||||||
|
|
|
@ -263,11 +263,3 @@ for target in $target_list; do
|
||||||
echo "DOCKER_CROSS_CC_GUEST=$container_cross_cc" >> $config_target_mak
|
echo "DOCKER_CROSS_CC_GUEST=$container_cross_cc" >> $config_target_mak
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# report container support state
|
|
||||||
echo "cross containers $container"
|
|
||||||
|
|
||||||
if test -n "$enabled_cross_compilers"; then
|
|
||||||
echo
|
|
||||||
echo "NOTE: guest cross-compilers enabled:$enabled_cross_compilers"
|
|
||||||
fi
|
|
||||||
|
|
Loading…
Reference in New Issue