tools: Add script to generate all test cases in VMs
Add the `generate-all-test-cases` tool, which generates all defined image test cases based on provided "distro x arch x image-type" combination matrix and CLI arguments. Test cases are generated by running the `generate-test-cases` tool inside an architecture-specific VM. The tool requires a qcow2 image to be provided for each requested architecture. These images are used to create ephemeral VMs used for test case generation. There appears to be an issue with entropy on all VMs for other architecture than the host's one. It makes the generation of the first test case usually fail due to the `go get` command failing with a "TLS handshake timeout" error. There is a workaround to retry the generation of a test case a maximum of 3 times in this case. In the usual case, the test case generation passes on the second try. All subsequent test case generations should complete successfully on the first try. Add the `distro-arch-imagetype-map.json` file as the default source of the "distro x arch x image-type" combination matrix for generating test cases. Its content is based on the current content of the `test/data/manifests` directory. Update `test/README.md` to mention the `generate-all-test-cases` tool. Add a note, that `generate-test-cases` must be run on a host with the same architecture, as the intended test case's. Known issues: - The tool does not work with RHEL images because of missing "9p" filesystem support. Signed-off-by: Tomas Hozza <thozza@redhat.com>
This commit is contained in:
parent
8ebcca23ae
commit
55825042f7
5 changed files with 1045 additions and 0 deletions
9
tools/deploy/gen-test-data/files/run/provision-scripts/deploy.sh
Executable file
9
tools/deploy/gen-test-data/files/run/provision-scripts/deploy.sh
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
dnf -y install osbuild \
|
||||
osbuild-selinux \
|
||||
osbuild-ostree \
|
||||
osbuild-composer \
|
||||
golang
|
||||
20
tools/deploy/gen-test-data/user-data.yml
Normal file
20
tools/deploy/gen-test-data/user-data.yml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#cloud-config
|
||||
yum_repos:
|
||||
# Fetch osbuild packages from a repository served on the host.
|
||||
#
|
||||
# In qemu user networking, 10.0.2.2 always points to the host:
|
||||
# https://wiki.qemu.org/Documentation/Networking#User_Networking_.28SLIRP.29
|
||||
osbuild:
|
||||
name: osbuild
|
||||
baseurl: "http://10.0.2.2:8000"
|
||||
enabled: true
|
||||
gpgcheck: false
|
||||
skip_if_unavailable: true
|
||||
user: admin
|
||||
password: foobar
|
||||
ssh_pwauth: True
|
||||
chpasswd:
|
||||
expire: False
|
||||
sudo: 'ALL=(ALL) NOPASSWD:ALL'
|
||||
runcmd:
|
||||
- /run/provision-scripts/deploy.sh
|
||||
Loading…
Add table
Add a link
Reference in a new issue