Building Build Tests

KIWI NG provides a collection of integration test images for different architectures and distributions. The test descriptions cover a number of appliance features that can be built with KIWI NG. The test descriptions are stored in a directory structure of the following layout: build-tests/ARCH/DISTRIBUTION/test-image-NAME. To build integration test image(s), the script build-tests.sh exists.

The implementation of build-tests.sh calls kiwi’s boxbuild command, by default in container mode, which allows calling the script on any host system that allows you to run container instances via podman. The --vm option of build-tests.sh runs the build in a virtual machine instead.

Warning

Architectures

Cross-architecture image building is possible and also supported via boxbuild, but the performance impact is big, even in containers using qemu-binfmt, and even bigger in full qemu arch emulation. This would slow down building the integration tests a lot, and therefore, build-tests.sh requires the host architecture to match the image target architecture.

Prior to calling build-tests.sh, the following requirements must be met:

Tools

Install the packages providing the following tools:

  • tree

  • git

  • xmllint

  • podman

  • pip

Source Checkout

Check out the kiwi git repo, which provides the test descriptions as well as the build-tests.sh script.

$ git clone https://github.com/OSInside/kiwi.git

kiwi

Install KIWI NG. It provides the boxbuild command used by build-tests.sh. If there are no KIWI NG packages for your host, install KIWI NG from pip:

$ pip install --upgrade kiwi

Warning

Make sure to be able to execute kiwi-ng. When installed from pip as a user, kiwi-ng is placed in local/bin. Update your path via export PATH=~/.local/bin:$PATH if needed.

Building a specific integration test can be done as follows:

$ cd kiwi
$ ./build-tests.sh \
      --test-dir build-tests/x86/tumbleweed/ \
      --test-name test-image-disk

Building all integration tests for a specific arch and distribution can be done as follows:

$ cd kiwi
$ ./build-tests.sh \
      --test-dir build-tests/x86/tumbleweed/

Note

Building all integration tests can take some time and depends on the number of tests provided as well as on the build power of the host system. In general, the tests can also run in parallel or be distributed to multiple hosts.