Commit graph

296 commits

Author SHA1 Message Date
Jozef Mikovic
dc31fb3f21 repositories: use snapshots for rhel90 repos 2021-03-26 14:05:20 +00:00
Jozef Mikovic
165ecafeb2 test: use DISTRO_CODE to select tests case
Using DISTRO_CODE simplifies test case selection and allows to test
different distro than the one test is running on.
This is used to run tests for RHEL 9.0 on F33 or RHEL 8.4
2021-03-26 14:05:20 +00:00
Jozef Mikovic
a9e8ea2a21 distro/rhel90: add RHEL9 support
osbuild-composer can now build rhel 9.0 images.
Added support is limited to qcow2 image type.
2021-03-26 14:05:20 +00:00
Tomas Hozza
4a47ad36af Cloud API: fix image_status.status value for running compose
Previously, the Cloud API endpoint `/v1/compose/{id}` return value's
`image_status.status` for a running worker job was "running", which didn't
comply with the Cloud API specification. Equivalents allowed by the API
specification are "building", "uploading" or "registering".

As a result, the Image Builder API also does not comply in this regard
to its specification, because it currently just copies the status value
string returned by osbuild-composer.

Define the `image_status.status` as a reusable type in the Cloud API
specification. This forces openapi to generate an explicit type for it,
which can be then explicitly used in the code, instead of plain strings.

Return "building", instead of "running"  for running compose.

Modify api integration test to check for all valid `image_status.status`
values for a compose.

Add News entry explaining this change.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-03-26 11:59:07 +01:00
Aleksandar Todorov
aa21b57daf tests: install awscli from EPEL. Fix #1037 2021-03-19 11:21:50 +01:00
Achilleas Koutsou
7066b02bf7 ostree-ng.sh: use non-default ostree ref
Run tests with user-specified ostree ref.
The ref needs to be specified in the container build as well (without a
URL) to be used for the commit that will be served to the installer.

The same variable/ref is also used to retrieve the $UPGRADE_HASH for the
final OS test.
2021-03-18 20:06:25 +00:00
Achilleas Koutsou
65ca29badb test/repositories/rhel-84: change to rh dev snapshots
For the new features, we need a very recent release of Anaconda.
2021-03-17 18:12:17 +00:00
Xiaofeng Wang
20af9a7258 test: Remove user SSH key work around
It's been fixed already by commit 1b0e9e3
2021-03-17 18:12:17 +00:00
Xiaofeng Wang
4844f4bc7a test: Fix ssh public key issue
The public key should be osbuild-composer CI's key, not my local
test one
2021-03-17 18:12:17 +00:00
Tom Gundersen
955585072d ostree-ng.sh: set VERSION-ID and ID variables
We only support one combination for now, but let's stay compatible with the old tests.

This fixes the places where these variables are still used.
2021-03-17 18:12:17 +00:00
Xiaofeng Wang
5445acb0cc test: Update ostree-ng to support container and installer tests
The ostree-ng will only be run on RHEL 8.4 because
rhel-edge-container and rhel-edge-installer image type are
supported by RHEL 8.4 only
2021-03-17 18:12:17 +00:00
Xiaofeng Wang
e4419ed752 test: Update ostree-ng.sh to work with rhel-edge-container test
rhel-edge-container is only supported by RHEL 8.4, so the test is
for RHEL 8.4 only
2021-03-17 18:12:17 +00:00
Achilleas Koutsou
f317b0a3d9 test/data: test cases for rhel-edge-container 2021-03-17 18:12:17 +00:00
Tomas Hozza
aa1d038b59 cloud-cleaner: clean up image and vm after GCP integration test
Extend internal GCP library to allow deleting Compute Node image and
instance. In addition provide function to load service account
credentials file content from the environment.

Change names used for GCP image and instance in `api.sh` integration
test to make them predictable. This is important, so that cloud-cleaner
can identify potentially left over resources and clean them up. Use the
same approach for generating predictable, but run-specific, test ID as
in GenerateCIArtifactName() from internal/test/helpers.go. Use SHA224
to generate a hash from the string, because it can contain characters
not allowed by GCP for resource name (specifically "_" e.g. in "x86_64").
SHA-224 was picked because it generates short enough output and it is
future proof for use in RHEL (unlike MD5 or SHA-1).

Refactor cloud-cleaner to clean up GCP resources and also to run cleanup
for each cloud in a separate goroutine.

Modify run_cloud_cleaner.sh to be able to run in environment in which
AZURE_CREDS is not defined.

Always run cloud-cleaner after integration tests for rhel8, rhel84 and
cs8, which test GCP.

Define DISTRO_CODE for each integration testing stage in Jenkinsfile.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-03-15 16:48:40 +00:00
Aleksandar Todorov
d7e21e2299 tests: Update documentation 2021-03-15 14:20:25 +02:00
Ondřej Budai
60e12212c5 test cases: regenerate qcow2 for rhel-84 and centos-8
So they contain the net-tools change.
2021-03-14 15:03:58 +00:00
Aleksandar Todorov
661b2a0be0 Schutzbot: Allow overriding internal RHEL URL
by defining the COMPOSE_URL environment variable! This will allow
testing more flavors of internal releases.

The rest is renaming files and variables to reflect the fact that
we're running tests against internal trees, not only nightlies.
2021-03-12 20:38:06 +02:00
Aleksandar Todorov
fc2d2894d4 tests: add manifest file for CentOS 8 aarch64 AMI 2021-03-12 11:59:21 +00:00
Aleksandar Todorov
6c546fa257 Schutzbot: Start building & testing on aarch64 for RHEL/CentOS
For now we're testing only on released streams in AWS because
we don't have aarch64 support in PSI.
2021-03-12 11:59:21 +00:00
Tom Gundersen
4805eeedf8 test/data/manifests: drop .rpmmd.checksums
These are no longer used.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2021-03-10 11:52:05 +00:00
Christian Kellner
ee08790504 test: regenerate -cusomize manifests
Use `generate-test-cases` to generate the qcow2 image types with
customization for fedora 32, 33 and CentOS 8 and RHEL 8 and 8.4.
The previous commit changed the customization blueprint but the
changes to the resulting manifest and test data was done by hand.
2021-03-09 21:45:27 +00:00
Christian Kellner
8da813ecd2 rhel84: use en_US.UTF-8 as default for LANG
Use en_US.UTF-8 as default for LANG, which is what previously was
used and is also needed to properly work on non-us/latin setups[1].

In the customization tests, use a different value than the default
one to check that the customization does in fact work.

[1] http://git.app.eng.bos.redhat.com/git/spin-kickstarts.git/tree/rhel8/rhel-8.2-kvm-x86_64.ks#n4

Co-authored-by: Achilleas Koutsou <achilleas@koutsou.net>
2021-03-09 21:45:27 +00:00
Tom Gundersen
130218778f test/repositories/rhel-84: update to the most recent snashot
In particular, make sure the -rt repositories and match the
base ones.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2021-03-09 21:39:46 +00:00
Xiaofeng Wang
0350768d73 test: Add 'kernel-rt' and kernel customization test
Since kernel upgrading from 'default' to 'rt kernel' has SSH
connection issue, 'install' kernel and 'upgrade' kernel must
have 'kernel-rt' included.
https://github.com/osbuild/osbuild-composer/issues/1222

Only RHEL 8.4 repo has 'rt kernel' repo, 'rt kernel' test will be
RHEL 8.4 only
2021-03-09 21:39:46 +00:00
Chloe Kaubisch
500533116a cloudapi: single uploadrequest
Change imageRequest to accept a single uploadRequest instead of
an array of uploadRequests.
2021-03-09 16:42:33 +01: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
Tom Gundersen
59d2f505cc test/data/manifests: add trailing newline
Mostly to avoid future noisy diffs.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2021-03-08 13:22:26 +01:00
Achilleas Koutsou
83d87a953d test/data: regenerate existing test cases (x86_64)
A few recent changes in image type definitions haven't been reflected in
the test cases yet.  This also acts as a check to make sure that the
changes in composer don't affect the old behaviour.

Causes for (some) changes:
- Kernel modules added to package lists:
  Prior to PR #1175 image types defined the kernel package in their
  package list.  Some only included `kernel-core` and not the `kernel`
  metapackage.  Now images default to having the `kernel` metapackage
  included which also adds `kernel-modules` and `alsa-sof-firmware`.
- New package source for rt kernel.
2021-03-08 13:22:26 +01:00
Ondřej Budai
fa9fc890c9 test: add integration test for the azure upload
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-03-06 15:40:48 +00:00
Xiaofeng Wang
3ed3f2ed95 test: Update dmesg test to work with only one failed log 2021-03-06 13:00:05 +00:00
Tomas Hozza
319400c280 cloudapi: implement GCP target results and include UploadOptions
Return GCP-specific target results form the worker, similar as it is
done for AWS.

Extend Cloud API to allow GCP-specific upload Options.

Modify Cloud API to return UploadOptions as part of the UploadStatus.

Modify Cloud API integration test to check returned upload Options and
upload Type.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-03-04 15:44:04 +01:00
Tomas Hozza
10ec97c2d1 tests: boot imported image as part of GCP cloudapi test
Extend the Cloud API integration test for GCP to also create a Compute
Node instance using the image, boot it and ssh to it. This brings the
GCP integration testing on par with AWS testing.

Use VHD image type for GCP integration testing, because it by default
contains `cloud-init` installed, unlike the VMDK image.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-03-02 10:18:08 +01:00
Tomas Hozza
bd33243012 test/README: Extend the section about integration testing
Split the integration testing section into two parts. One for testing of
Weldr API and another one for Cloud API. Cloud API integration testing
part has two sections, one for testing integration with AWS and another
one for GCP.

Fix path to osbuild-composer-cli-tests tool.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-25 18:44:21 +00:00
Tomas Hozza
080b64c12c cloudapi: Don't return upload type in UploadStatus for now
Upload target type is currently not returned form the worker, but
hardcoded in the cloudapi code to always return "aws". This make testing
of the cloudapi for other cloud providers quite complicated.

Since extending the target status information returned from the
worker is currently in progress, work around the situation for now
by returning an empty string as the upload type.

This will allows other types of upload targets to be tested as part of
cloudapi test case.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-25 18:44:21 +00:00
Tomas Hozza
31d4d4648f test: Test GCP upload as part of cloudapi test case
Refactor test/cases/api.sh to incorporate testing of cloudapi with
multiple cloud providers as the target. Since all variables in Bash are
by default global, don't declare them as empty in advance. The only
place where underclared variables can be potentially expanded are the
cleanup functions. Ensure that there are no unbound variables expanded
inside cleanup functions. Rename all AWS-specific variables to
contain "AWS_" prefix to make their purpose explicit.

Modify provision.sh to append the GCP credentials file path to the
worker configuration.

Add GCP api.sh test case to integration tests in Jenkins and run it only
if the appropriate GCP credentials environment variable is defined. Run
the GCP test case for RHEL images.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-25 18:44:21 +00:00
Tomas Hozza
02ad5a3199 test: Fix installation of osbuild-worker.toml in provision.sh
The tools/provision.sh script is sourced by all test cases and it sets
up the system and software for running test cases. As part of the setup,
it copied over the whole content of test/data/composer/ to
/etc/osbuild-composer. However the source directory contains not only
osbuild-composer's configuration, but also configuration for the worker.
The worker however expects its configuration in /etc/osbuild-worker.

The fact that provision.sh does not copy the worker configuration to the
correct directory didn't affect the CI, because the only test case that
relied on it is koji.sh, which copies the worker configuration
explicitly.

Move osbuild-worker test configuration to a separate 'test/data/worker/'
subdirectory. Also install the osbuild-worker test configuration to its
own subdirectory in the "-test" RPM.

Move the copying of worker configuration to the correct destination
directory from koji.sh to provision.sh, so that all test cases can rely
on the system being set up properly. Do not use wildcard for copying
osbuild-{composer,worker} configuration files, but explicitly copy each
file to its respective destination directory.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-25 18:44:21 +00:00
Ondřej Budai
f2243151be test: remove podman-plugins workaround for RHEL/CentOS
https://bugzilla.redhat.com/show_bug.cgi?id=1877865 is now fixed and
podman-plugins is now shipped in stable RHEL. One less hack in our codebase!

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-02-25 12:14:56 +01:00
Aleksandar Todorov
fbbdd2aa26 tests: Use full repo name to ubi8-minimal to workaround bug
/etc/containers/registries.conf.d/rhel-shortnames.conf shipped in
containers-common-1:1.2.2-1.module+el8.4.0+10073+30e5ea69 has a wrong
shortname for ubi8-minimal:

"ubi8-minimal" = "registry.access.redhat.com/repository/ubi8-minimal"

resulting in `name unknown: Repo not found` when trying to pull the image
via its short name.

Related: rhbz#1931785
2021-02-23 12:11:30 +01:00
Tom Gundersen
9d477e339b test/manifets: update test cases
Signed-off-by: Tom Gundersen <teg@jklm.no>
2021-02-20 20:01:15 +01:00
Tom Gundersen
e77483f007 test/ostree: add a second ostree test to test new features
We are gaining new ostree features that overlap to a great deal
with the current ones. We still need to keep the current features
for backwards compatibility, so add another test run that does the
same but using new API.

For now this simply uses the `url` parameter rather than `parent`
to build update commits. Further changes will be made in follow-up
commits.

Use `curl` rather than `composer-cli` as we have a chicken-and-egg
problem where we can't land this feature without tests, but
`composer-cli` can't add support for it without having it first in
`composer`.
2021-02-20 14:53:49 +01:00
Antonio Murdaca
21319520e5 internal/distro/rhel8: un-exclude subman from edge
We aim at shrinking our deps eventually but we need subman for the time
being. This patch basically un-exclude subman which was introduced by
https://github.com/osbuild/osbuild-composer/pull/893

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2021-02-18 13:08:32 +01:00
Jozef Mikovic
5a9d2fe8b1 test: Add integration test for VMWare upload 2021-02-16 19:06:01 +00: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
Ondřej Budai
8760de26de test/api.sh: set the username for centos-8
This is a merge race condition. Sanne added a new variable, I added a new distro.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-02-15 09:30:37 +00:00
sanne
9861215ebe test: Let the composer-api testcase also boot the image in aws 2021-02-14 16:09:04 +00:00
Ondřej Budai
5eb402415d distro/rhel84: add centos 8 stream support
The image definition is shared with the latest RHEL 8.y one (8.4 currently).
I expect that we the introduction of 8.5 support, we point the centos 8
distro at it.

The test repositories and manifests use the official CentOS composes. From
what I can tell, they are persistent. This is not guaranteed though, so we
might need to switch to RPMRepo at some point.

The "classic" CentOS 8 should also be buildable but due to the chicken and egg
issue (this commit will get into Centos "8.4" but Centos "8.4" isn't a thing
yet), we cannot test it and therefore it might be broken.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-02-14 16:08:08 +00:00
Tomas Hozza
220c77e37f image-tests: Add RHEL-8.4 test cases for all architectures
Add RHEL-8.4 image test case manifests for all architectures. The set of
image types per architecture is based on what is currently available for
RHEL-8.3.

The image test case for RHEL-8.4 tar image on s390x is not added yet
because of Issue #1220.

Fixes #1167

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-12 18:53:18 +01:00
sanne
31eb215699 test: Fix the compose request in the api test case
Customizations should be alongside image_requests, not inside of it.
2021-02-12 18:46:02 +01:00
Martin Sehnoutka
f98e231f64 cloudapi: extend the API spec with /version and /openapi.json
These endpoints are useful for clients while exploring the API. They are
also required for deploying the service into clouddot.
2021-02-12 14:25:19 +01:00
Alexander Todorov
fb8493b4df tests: Document how to manually replay nightly Pipeline 2021-02-12 14:22:04 +01:00