Skip to content

Commit cbcf098

Browse files
committed
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) <[email protected]>" [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 <[email protected]>
2 parents 51db2d7 + 93a1100 commit cbcf098

File tree

13 files changed

+101
-40
lines changed

13 files changed

+101
-40
lines changed

README.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ When submitting patches, one common approach is to use 'git
6666
format-patch' and/or 'git send-email' to format & send the mail to the
6767
[email protected] mailing list. All patches submitted must contain
6868
a 'Signed-off-by' line from the author. Patches should follow the
69-
guidelines set out in the CODING_STYLE.rst file.
69+
guidelines set out in the `style section
70+
<https://www.qemu.org/docs/master/devel/style.html>` of
71+
the Developers Guide.
7072

7173
Additional information on submitting patches can be found online via
7274
the QEMU website

docs/devel/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Contents:
1414
:maxdepth: 2
1515

1616
build-system
17+
style
1718
kconfig
1819
testing
1920
fuzzing

CODING_STYLE.rst renamed to docs/devel/style.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -641,22 +641,22 @@ trace-events style
641641

642642
In trace-events files, use a '0x' prefix to specify hex numbers, as in:
643643

644-
.. code-block::
644+
.. code-block:: c
645645
646646
some_trace(unsigned x, uint64_t y) "x 0x%x y 0x" PRIx64
647647
648648
An exception is made for groups of numbers that are hexadecimal by
649649
convention and separated by the symbols '.', '/', ':', or ' ' (such as
650650
PCI bus id):
651651

652-
.. code-block::
652+
.. code-block:: c
653653
654654
another_trace(int cssid, int ssid, int dev_num) "bus id: %x.%x.%04x"
655655
656656
However, you can use '0x' for such groups if you want. Anyway, be sure that
657657
it is obvious that numbers are in hex, ex.:
658658

659-
.. code-block::
659+
.. code-block:: c
660660
661661
data_dump(uint8_t c1, uint8_t c2, uint8_t c3) "bytes (in hex): %02x %02x %02x"
662662

docs/devel/testing.rst

Lines changed: 64 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -272,21 +272,28 @@ Note that the following group names have a special meaning:
272272

273273
- disabled: Tests in this group are disabled and ignored by check.
274274

275-
.. _docker-ref:
275+
.. _container-ref:
276276

277-
Docker based tests
278-
==================
277+
Container based tests
278+
=====================
279279

280280
Introduction
281281
------------
282282

283-
The Docker testing framework in QEMU utilizes public Docker images to build and
284-
test QEMU in predefined and widely accessible Linux environments. This makes
285-
it possible to expand the test coverage across distros, toolchain flavors and
286-
library versions.
283+
The container testing framework in QEMU utilizes public images to
284+
build and test QEMU in predefined and widely accessible Linux
285+
environments. This makes it possible to expand the test coverage
286+
across distros, toolchain flavors and library versions. The support
287+
was originally written for Docker although we also support Podman as
288+
an alternative container runtime. Although the many of the target
289+
names and scripts are prefixed with "docker" the system will
290+
automatically run on whichever is configured.
287291

288-
Prerequisites
289-
-------------
292+
The container images are also used to augment the generation of tests
293+
for testing TCG. See :ref:`checktcg-ref` for more details.
294+
295+
Docker Prerequisites
296+
--------------------
290297

291298
Install "docker" with the system package manager and start the Docker service
292299
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
316323
exploit the whole host with Docker bind mounting or other privileged
317324
operations. So only do it on development machines.
318325

326+
Podman Prerequisites
327+
--------------------
328+
329+
Install "podman" with the system package manager.
330+
331+
.. code::
332+
333+
$ sudo dnf install podman
334+
$ podman ps
335+
336+
The last command should print an empty table, to verify the system is ready.
337+
319338
Quickstart
320339
----------
321340

322-
From source tree, type ``make docker`` to see the help. Testing can be started
323-
without configuring or building QEMU (``configure`` and ``make`` are done in
324-
the container, with parameters defined by the make target):
341+
From source tree, type ``make docker-help`` to see the help. Testing
342+
can be started without configuring or building QEMU (``configure`` and
343+
``make`` are done in the container, with parameters defined by the
344+
make target):
325345

326346
.. code::
327347
328-
make docker-test-build@min-glib
348+
make docker-test-build@centos8
329349
330-
This will create a container instance using the ``min-glib`` image (the image
350+
This will create a container instance using the ``centos8`` image (the image
331351
is downloaded and initialized automatically), in which the ``test-build`` job
332352
is executed.
333353

354+
Registry
355+
--------
356+
357+
The QEMU project has a container registry hosted by GitLab at
358+
``registry.gitlab.com/qemu-project/qemu`` which will automatically be
359+
used to pull in pre-built layers. This avoids unnecessary strain on
360+
the distro archives created by multiple developers running the same
361+
container build steps over and over again. This can be overridden
362+
locally by using the ``NOCACHE`` build option:
363+
364+
.. code::
365+
366+
make docker-image-debian10 NOCACHE=1
367+
334368
Images
335369
------
336370

337-
Along with many other images, the ``min-glib`` image is defined in a Dockerfile
338-
in ``tests/docker/dockerfiles/``, called ``min-glib.docker``. ``make docker``
371+
Along with many other images, the ``centos8`` image is defined in a Dockerfile
372+
in ``tests/docker/dockerfiles/``, called ``centos8.docker``. ``make docker-help``
339373
command will list all the available images.
340374

341375
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
355389
library, ``tests/docker/common.rc``, which provides helpers to find the QEMU
356390
source and build it.
357391

358-
The full list of tests is printed in the ``make docker`` help.
392+
The full list of tests is printed in the ``make docker-help`` help.
359393

360394
Debugging a Docker test failure
361395
-------------------------------
@@ -980,6 +1014,8 @@ And remove any package you want with::
9801014
If you've used ``make check-acceptance``, the Python virtual environment where
9811015
Avocado is installed will be cleaned up as part of ``make check-clean``.
9821016

1017+
.. _checktcg-ref:
1018+
9831019
Testing with "make check-tcg"
9841020
=============================
9851021

@@ -1001,10 +1037,17 @@ for the architecture in question, for example::
10011037
There is also a ``--cross-cc-flags-ARCH`` flag in case additional
10021038
compiler flags are needed to build for a given target.
10031039

1004-
If you have the ability to run containers as the user you can also
1005-
take advantage of the build systems "Docker" support. It will then use
1006-
containers to build any test case for an enabled guest where there is
1007-
no system compiler available. See :ref:`docker-ref` for details.
1040+
If you have the ability to run containers as the user the build system
1041+
will automatically use them where no system compiler is available. For
1042+
architectures where we also support building QEMU we will generally
1043+
use the same container to build tests. However there are a number of
1044+
additional containers defined that have a minimal cross-build
1045+
environment that is only suitable for building test cases. Sometimes
1046+
we may use a bleeding edge distribution for compiler features needed
1047+
for test cases that aren't yet in the LTS distros we support for QEMU
1048+
itself.
1049+
1050+
See :ref:`container-ref` for more details.
10081051

10091052
Running subset of tests
10101053
-----------------------

meson.build

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,6 +2509,24 @@ endif
25092509
summary_info += {'strip binaries': get_option('strip')}
25102510
summary_info += {'sparse': sparse.found() ? sparse.full_path() : false}
25112511
summary_info += {'mingw32 support': targetos == 'windows'}
2512+
2513+
# snarf the cross-compilation information for tests
2514+
foreach target: target_dirs
2515+
tcg_mak = meson.current_build_dir() / 'tests/tcg' / 'config-' + target + '.mak'
2516+
if fs.exists(tcg_mak)
2517+
config_cross_tcg = keyval.load(tcg_mak)
2518+
target = config_cross_tcg['TARGET_NAME']
2519+
compiler = ''
2520+
if 'DOCKER_CROSS_CC_GUEST' in config_cross_tcg
2521+
summary_info += {target + ' tests': config_cross_tcg['DOCKER_CROSS_CC_GUEST'] +
2522+
' via ' + config_cross_tcg['DOCKER_IMAGE']}
2523+
elif 'CROSS_CC_GUEST' in config_cross_tcg
2524+
summary_info += {target + ' tests'
2525+
: config_cross_tcg['CROSS_CC_GUEST'] }
2526+
endif
2527+
endif
2528+
endforeach
2529+
25122530
summary(summary_info, bool_yn: true, section: 'Compilation')
25132531

25142532
# Targets and accelerators

scripts/fix-multiline-comments.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
#
3-
# Fix multiline comments to match CODING_STYLE
3+
# Fix multiline comments to match docs/devel/style.rst
44
#
55
# Copyright (C) 2018 Red Hat, Inc.
66
#

tests/acceptance/virtio-gpu.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@ def test_virtio_vga_virgl(self):
8585
"-append",
8686
kernel_command_line,
8787
)
88-
self.vm.launch()
88+
try:
89+
self.vm.launch()
90+
except:
91+
# TODO: probably fails because we are missing the VirGL features
92+
self.cancel("VirGL not enabled?")
93+
8994
self.wait_for_console_pattern("as init process")
9095
exec_command_and_wait_for_pattern(
9196
self, "/usr/sbin/modprobe virtio_gpu", ""

tests/docker/dockerfiles/fedora-cris-cross.docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Cross compiler for cris system tests
33
#
44

5-
FROM fedora:30
5+
FROM fedora:33
66
ENV PACKAGES gcc-cris-linux-gnu
77
RUN dnf install -y $PACKAGES
88
RUN rpm -q $PACKAGES | sort > /packages.txt

tests/docker/dockerfiles/fedora-i386-cross.docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM fedora:31
1+
FROM fedora:33
22
ENV PACKAGES \
33
bzip2 \
44
diffutils \

tests/docker/dockerfiles/fedora-win32-cross.docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM fedora:32
1+
FROM fedora:33
22

33
# Please keep this list sorted alphabetically
44
ENV PACKAGES \

0 commit comments

Comments
 (0)