Debian Codegraph @

doc/source/example_use_cases/integration_testing.rst

raw
1 Building Build Tests
2 ====================
3
4 {kiwi} provides a collection of integration test images for
5 different architectures and distributions. The test descriptions
6 cover a number of appliance features that can be built with {kiwi}.
7 The test descriptions are stored in a directory structure of the
8 following layout: `build-tests/ARCH/DISTRIBUTION/test-image-NAME`.
9 To build integration test image(s), the script `build-tests.sh`
10 exists.
11
12 The implementation of `build-tests.sh` calls kiwi's `boxbuild`
13 command, by default in container mode, which allows calling the script on
14 any host system that allows you to run container instances
15 via `podman`. The `--vm` option of `build-tests.sh` runs the build in a
16 virtual machine instead.
17
18 .. warning:: **Architectures**
19
20 Cross-architecture image building is possible and also supported
21 via boxbuild, but the performance impact is big, even in containers
22 using qemu-binfmt, and even bigger in full qemu arch emulation.
23 This would slow down building the integration tests a lot, and
24 therefore, `build-tests.sh` requires the host architecture to
25 match the image target architecture.
26
27 Prior to calling `build-tests.sh`, the following requirements must be met:
28
29 ``Tools``
30
31 Install the packages providing the following tools:
32
33 * tree
34 * git
35 * xmllint
36 * podman
37 * pip
38
39 ``Source Checkout``
40
41 Check out the kiwi git repo, which provides the test descriptions
42 as well as the `build-tests.sh` script.
43
44 .. code:: bash
45
46 $ git clone https://github.com/OSInside/kiwi.git
47
48 ``kiwi``
49
50 Install {kiwi}. It provides the boxbuild command used by
51 `build-tests.sh`. If there are no {kiwi} packages for your host,
52 install {kiwi} from pip:
53
54 .. code:: bash
55
56 $ pip install --upgrade kiwi
57
58 .. warning::
59
60 Make sure to be able to execute `kiwi-ng`. When installed from
61 pip as a user, `kiwi-ng` is placed in `~/.local/bin`. Update your
62 path via `export PATH=~/.local/bin:$PATH` if needed.
63
64 Building a specific integration test can be done as follows:
65
66 .. code:: bash
67
68 $ cd kiwi
69 $ ./build-tests.sh \
70 --test-dir build-tests/x86/tumbleweed/ \
71 --test-name test-image-disk
72
73 Building all integration tests for a specific arch and distribution
74 can be done as follows:
75
76 .. code:: bash
77
78 $ cd kiwi
79 $ ./build-tests.sh \
80 --test-dir build-tests/x86/tumbleweed/
81
82 .. note::
83
84 Building all integration tests can take some time and depends
85 on the number of tests provided as well as on the build power
86 of the host system. In general, the tests can also run in
87 parallel or be distributed to multiple hosts.