@@ -272,21 +272,28 @@ Note that the following group names have a special meaning:
272
272
273
273
- disabled: Tests in this group are disabled and ignored by check.
274
274
275
- .. _ docker -ref :
275
+ .. _ container -ref :
276
276
277
- Docker based tests
278
- ==================
277
+ Container based tests
278
+ =====================
279
279
280
280
Introduction
281
281
------------
282
282
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.
287
291
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
+ --------------------
290
297
291
298
Install "docker" with the system package manager and start the Docker service
292
299
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
316
323
exploit the whole host with Docker bind mounting or other privileged
317
324
operations. So only do it on development machines.
318
325
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
+
319
338
Quickstart
320
339
----------
321
340
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):
325
345
326
346
.. code ::
327
347
328
- make docker-test-build@min-glib
348
+ make docker-test-build@centos8
329
349
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
331
351
is downloaded and initialized automatically), in which the ``test-build `` job
332
352
is executed.
333
353
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
+
334
368
Images
335
369
------
336
370
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 ``
339
373
command will list all the available images.
340
374
341
375
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
355
389
library, ``tests/docker/common.rc ``, which provides helpers to find the QEMU
356
390
source and build it.
357
391
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.
359
393
360
394
Debugging a Docker test failure
361
395
-------------------------------
@@ -980,6 +1014,8 @@ And remove any package you want with::
980
1014
If you've used ``make check-acceptance ``, the Python virtual environment where
981
1015
Avocado is installed will be cleaned up as part of ``make check-clean ``.
982
1016
1017
+ .. _checktcg-ref :
1018
+
983
1019
Testing with "make check-tcg"
984
1020
=============================
985
1021
@@ -1001,10 +1037,17 @@ for the architecture in question, for example::
1001
1037
There is also a ``--cross-cc-flags-ARCH `` flag in case additional
1002
1038
compiler flags are needed to build for a given target.
1003
1039
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.
1008
1051
1009
1052
Running subset of tests
1010
1053
-----------------------
0 commit comments