Commit graph

23 commits

Author SHA1 Message Date
Tomas Hozza
008dfcc5b5 generate-test-cases: drop --with-customizations option
Generating image test case with all possible blueprint customizations is
supported only for `qcow2` image type. Generating `qcow2` images with
customizations was not a lot of fun. One had to use a special CLI option
for this case.

To streamline the generation of image test cases, drop the
`--with-customizations` option from the `generate-test-cases` script and
move the functionality to `format-request-map.json` by defining a new
`qcow2-customize` test case. This is very similar to what `*edge-rt`
test case already uses. This mean that when the test case for `qcow2`
image type is being generated, actually two test cases will be
generated. The filesystem customizations since RHEL-8.5 are handled
through distro-specific `overrides`.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-23 09:20:47 +02:00
Tomas Hozza
6502f527fd format-request-map.json: remove redundant overrides
Some of the `overrides` specified in `format-request-map.json` were
redundant, because the same blueprint customizations were already
specified in the image compose-request. Thus these values had no
additional values.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-23 09:20:47 +02:00
Tomas Hozza
2d2d9fe7f9 generate-test-cases: check supported_arches from format-request-map.json
Some image type test cases require additional repositories, which are
not available for all architectures. However, when an image type test
case is specified in the `format-request-map.json`, it is generated on any
architecture.

This behavior is creating issues when generating `*edge-commit` image
type test cases. This is because the `format-request-map.json` contains one
additional definition for `*edge-commit-rt`, which includes `kernel-rt`
package. However repositories with this package are available only for
x86_64. Therefore, when generating image test cases for `*edge-commit`,
the `generate-test-cases` script always generates two test cases,
but the generation of `*edge-commit-rt` always fails on non-x86_64
architectures.

Add a new optional member to the image type test case object in
`format-request-map.json`, called `supported_arches`. Its value is a
list of strings, specifying the supported architectures of the image
type test case. In case the member is not specified, the image test
case is supported on any architecture.

Extend the `generate-test-cases` script to skip image type test case
generation in case the case has the `supported_arches` specified and the
requested architecture is not in the list.

Fix #1478

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-21 14:41:38 +02:00
Achilleas Koutsou
ab264abd76 distro/rhel85: tar-installer -> image-installer
Renamed tar-installer to image-installer.
This is a more appropriate name:
- It disassociates the image type from the "tar" image type. The two
  should not be perceived to be connected.
- It's more descriptive. The format of the payload (tar) isn't relevant
  to the purpose of the image type.
2021-08-11 01:31:47 +02:00
Achilleas Koutsou
7d08535232 test/data: Add tar-installer test manifest
Added to format-request-map and generated manifest.
No image-info since ISOs aren't supported by the tool. The manifest is
useful only for detecting changes in the image type definition.
2021-08-05 16:13:46 +02:00
Tomas Hozza
c97420e879 rhel85: add definitions of RHEL ec2 and ec2-ha images
Add new image type definitions `ec2` and `ec2-ha` representing the
official RHEL ec2 image types.

Add a `xzArchivePipeline()`, which returns a pipeline producing a XZ
archive from a file produced by a different pipeline.

Add rpmrepo snapshots for `rhui` and `ha` repositories used to generate
image test cases. `rhui` is used by the `ec2` image and it is available
on x86_64 and aarch64 architectures. `ha` is used by the `ec2-ha` image
and it is available only for x86_64.

The new image type definitions are currently not used by any
API test case.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-08-02 19:05:09 +02:00
Achilleas Koutsou
4651b8ba22 tools: add 8.5 edge types to format request map
For test case generation. These are the new names used by the 8.5 edge
image types.
2021-06-29 17:26:43 +01:00
Achilleas Koutsou
f317b0a3d9 test/data: test cases for rhel-edge-container 2021-03-17 18:12:17 +00:00
Tom Gundersen
167fdc44bc test/data/manifests: avoid duplicate booting
We have integration tests that boot most of the image types, let
the image tests focus on the actual content of the images, shaving
off considerable CI time.

The only missing one is OpenStack (which should be ported over) and
tar (which we need to define the integration test for).

Signed-off-by: Tom Gundersen <teg@jklm.no>
2021-03-08 13:22:26 +01:00
Achilleas Koutsou
8438078c50 tools: test cases for alt kernel selection
Two new test cases added to format-request-map and test cases are
generated.

1. kernel-rt for RHEL images:
Requires new package repositories for RHEL 8.3 and 8.4.
Creates an OSTree commit with the `kernel-rt` as a customization.

2. kernel-debug for Fedora images:
kernel-rt isn't included in the official fedora repositories.  Using
kernel-debug at least tests the feature with the fedora-iot-commit type.
2021-02-16 13:51:26 +00:00
Tomas Hozza
89df6ab328 image-tests: remove 'subscription' customization, update repos, regenerate
Remove 'subscription' customization from 'format-request-map.json',
because it currently has no effect on image test cases. The reason is
that this customization of image is possible only via Cloud API in
composer and setting imageOptions. However image test cases currently
support image customization only via Blueprint customizations.

Update repo links in 'repos.json' to the latest rpmrepo snapshots.

Regenerate all image test cases affected by updates to 'repos.json'
and 'format-request-map.json'. This includes all `rhel-8` and `rhel-84`
image test cases.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-01 23:20:01 +00:00
Ondřej Budai
8bbe2b9c0e test/image: regenerate the test cases
This commit does several things:

1) Changes the Fedora 33 repos in the test case generator from development
   to release ones.

2) Fixes format-request-map.json so we can generate fedora-iot-commit
   "images".

3) Regenerates all the cases.
2020-11-11 09:52:28 +01:00
sanne raymaekers
9404b0640a test: Regenerate the rhel-8 cases to add subscriptions 2020-09-22 11:38:28 +02:00
Alexander Todorov
0469be7a22 tests: Change boot typo to openstack. Refs #876
this will cause the images to be uploaded and booted in our
OpenStack cluster.
2020-08-07 19:58:37 +02:00
Major Hayden
0f32f35756 📦 Use raw image format for AWS
Although the vhdx format is smaller than raw, AWS often has some issues
booting instances from an imported vhdx snapshot. The raw format seems
to boot consistently at AWS.

Fixes #754.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-02 13:11:11 -05:00
Tom Gundersen
654eb9d280 tools/test-case-generator: add iot and edge test-case generation 2020-06-11 20:44:17 +02:00
Tom Gundersen
ab276bdb77 tools/test-case-generator: add more options
Allow individual test-cases or sub-sets of test-cases to be generated
more easily.

We allow explicit skipping of image-info generation (and hence the
osbuild run), and also individual image types to be specified.

Also drop distros and image types that are no longer supported.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-06-10 19:25:54 +02:00
Ondřej Budai
e235fdedb3 tests/image: boot the vhd images on Azure
Previously, vhd images were tested using QEMU. This commit changes that to
boot them in the actual Azure infrastructure.

Azure VMs have quite a lot of dependencies - a network interface, a virtual
network, a network security group, a public ip address and a disk. Azure CLI
and Azure Portal handle the creation of all these resources internally.
However, when using the API, the caller is responsible to create all these
resources before creating an actual VM.

To handle the creation of all the resources in the right order, a deployment
is used. A deployment is a set of resources defined in a JSON document.
It can optionally take parameters to customize each deployment. After the
deployment is finished, the VM is up and ready to be tested using SSH.

Sadly, the deployments are a bit hard to clean-up. One would expect that
deleting a deployment removes all the deployed resources. However, it doesn't
work this way and therefore it's needed to clean up all resources "manually".
For this reason, our deployment sets a unique tag on all the resources created
by the deployment. After this test is finished, the API is queried for all
the resources with the tag and then, they're deleted in the right order.
2020-04-27 20:34:20 +02:00
Ondřej Budai
83a3a8d821 change the format of the ami image type to vhdx
Prior this commit the ami image type produced raw.xz images. This was bad for
two reasons:

- The upload was broken because AWS doesn't support tar.xz format
- XZ compression is terribly slow

This commit changes the format to vhdx, which is supported by AWS and also
quite quick. See https://github.com/osbuild/osbuild-composer/issues/257
why vhdx was chosen.

Fixes #257
2020-04-24 15:27:39 +02:00
Ondřej Budai
7dd09443cf tests/image/ami: test ami images on AWS
Prior this commit the ami images were tested locally using qemu. This does
not reflect at all how they're used in practice. This commit introduces
the support for running them in the actual AWS. Yay!

The structure of code reflects that we want to switch to osbuild-composer
to build the images soon.
2020-04-06 16:38:28 +02:00
Tom Gundersen
7825132ae2 test/cases: include repository information
This means that the unit tests no longer need to load the
repositories from the git repo, and in a follow-up, osbuild-composer
won't need to either.

By splitting the repositories used for testing from the system
repositories available through the weldr API we are able to extend
the system repositories without affecting the reproducibility of
the tests.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-03-29 16:08:36 +02:00
Tom Gundersen
a949843f1e test/cases: rename output-format to image-type
Bring this in line with our naming convention.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-03-29 16:08:36 +02:00
Jacob Kozol
afa4975a15 tools: add script to generate multiple test cases
This script generates json test cases for each supported output format.
It requires an architecure, distro, osbuild store, and output directory
as input. There is also a json object which maps from output format to a
test case request which includes the compose request and boot type.
The script uses these test case requests to call the generate-test-case
script and then outputs the resulting json test cases to files in the
specified output directory.
2020-03-20 13:55:36 +01:00