Commit graph

65 commits

Author SHA1 Message Date
Florian Schüller
f0d39d986f test/cases/oci: improve CI output
Avoid error message where this is no error.
2025-06-06 14:34:04 +02:00
Achilleas Koutsou
eda67e2cc6 test: disable verification step for vsphere builds
The vsphere verification is failing consistently with the following
error message from govc:

  A component of the virtual machine is not accessible on the host.

Disabling it until we have time to look into it further.
2025-04-16 10:46:13 +02:00
Tomáš Hozza
930658d605 Test/api.sh/vsphere: configure cloud-init via VM's extraConfig
We used to provide the cloud-init user-data and meta-data to the VM as
key/value in the VM's extraConfig as guestinfo keys. This replaces bunch
of code that used to create an ISO, upload it to VSphere and attach it
to the VM.

We recently started to observe issues when uploading the ISO to our
testing VSphere instance in CI. This commit aims to circumvent this
issue by using a different and simpler way to provide the cloud-init
data to the VM.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-03-31 12:33:48 +02:00
Sanne Raymaekers
d08cedf73b test/cases/api: add modules 2025-03-20 14:07:52 +01:00
Tom Koscielniak
9b850de9f1 tests/CI: Re-enable the vmware tests on RHEL 10
Re-enable the vmware tests on RHEL 10 and use vcenter 8 instead of 6. This fixes the issues caused by outdated CPUs in old cluster by migrating to a new one with new hosts as well.
2025-02-25 16:29:20 +01:00
Achilleas Koutsou
083d84f70c test: update all calls to image-info
Call the script without a path since it's now in the PATH.

Drop the SELinux labelling workaround (chcon) from filesystem.sh and
image_tests.sh.  The packaged tool is already labelled correctly.

Install osbuild-tools instead of osbuild-composer-tests in
regression-old-worker-new-composer.sh to get osbuild-image-info.
2025-01-31 08:22:29 +01:00
Lukas Zapletal
d531f62488 blueprint: add cacert customization 2025-01-10 10:26:54 +01:00
Sanne Raymaekers
1372be3f6e test/cases/api/azure: actually verify the HyperV Generation 2024-11-29 10:37:24 +01:00
Sanne Raymaekers
3a6a8813a5 test/cases/api/azure: use v2 HyperV generation 2024-11-21 11:22:20 +01:00
Jakub Rusz
ec4aff7e58 test/cases: Use openscap customization on RHEL-10 2024-09-25 08:30:45 +02:00
Achilleas Koutsou
b0c0e84142 test: replace openscap with compliance in rhsm facts
See https://github.com/osbuild/images/pull/914
2024-09-17 23:33:44 +02:00
Jakub Rusz
f58193dbeb test/cases: implement retry for ssh connection in api test
Fixing this by implementing a retry for the whole ssh connection
attempt.
2024-09-16 12:41:05 +02:00
Sanne Raymaekers
a6b87b58f2 test/api: check openscap facts when appropriate 2024-09-06 11:39:35 +02:00
Tomáš Hozza
d7e59e6eec Worker: move GCE image guest OS features to upload target options
Previously, the worker was determining the GCE image guest OS Features
on its own, based on the OS name. This caused problems, in case the
osbuild-composer was of a newer version than the worker.

Example:
osbuild-composer contained support for c10s GCE image type and its
implementation also contained the proper guest OS Features list for it.
However, when the worker got the osbuild job, it built it and tried to
fetch the guest OS Features for the distro. Since its implementation was
too old, it didn't contain the code that added the actual support for
c10s GCE images and got no guest OS features list (which is the default
for unsupported distros). The image was successfully uploaded and
shared, but it does not boot in GCP, because it does not know that it
should use UEFI to boot it.

This behavior could be considered a bug. The worker should be dumb. It
should not be making decisions about the image features, but instead it
should take them from the upload target options. And composer should be
the authoritative source of truth for this. Because otherwise, we
basically have two components that need to be updated in sync to add
support for GCE images on a new distro.

Move the GCE image guest OS features to the GCP upload target options.
The worker will just take what is specified there and use it when
importing the image to GCP. As a compatibility layer for the case when
the composer would be older than the worker (unlikely, but still),
worker will try to determine the image guest OS features in case the
list in the upload target options is empty.

Extend the GCP functional tests to check that the imported image has at
least some guest OS features set.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-08-29 17:37:48 +02:00
Tomáš Hozza
82ff759ee1 Test: test GCE image type on el10 / c10s
Enable testing of GCE image type on el10 / c10s. The el10 / c10s image
type temporarily uses cloud-init, because there are no GCP guest tools
for el10 / c10s yet and el9 version can't be installed. This implies
that we need to set the SSH key in the instance metadata and use SSH
directly.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-08-23 13:10:53 +02:00
Tomáš Hozza
768537dba3 Add support for RHSM customizations
Add support for RHSM customizations, which currently allow various
aspects of RHSM. Specifically enabling / disabling DNF plugins shipped
by subscription-manager package and setting a subset of options in the
rhsm.conf.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-08-13 15:52:44 +02:00
Tomáš Hozza
26dd54a4d7 Add support for RPM customizations
Add support for RPM customizations, which currently allow to import RPM
GPG key from a file installed in the image. This is e.g. done for the
Azure RHUI image type.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-08-13 15:52:44 +02:00
Jakub Rusz
ce9b75ac87 tests/api: Remove openscap profile for el-10
Currently there are no openscap profiles for el-10.
2024-08-12 08:39:05 +03:00
Alexander Todorov
dd82900f53 Replace GOVC_DATACENTER with GOVMOMI_DATACENTER ENV var
both are defined in CI, but the GOVC_ prefix doesn't match anything
else. Additionally this value is slightly different for vCenter8 and may
lead to failures if not unified.
2024-08-12 08:39:05 +03:00
Achilleas Koutsou
a55bf9a177 test: update path to tailoring file in api tests
See https://github.com/osbuild/images/pull/752
and 7bd70d828e
2024-07-04 19:01:07 +02:00
Simon Steinbeiss
bdc973d085 test/api.sh: Drop distro aliases and dot-notation
This reverts commit 2fe5e01d4d with the
exception of the changes in tools/provision.sh.
This functionality is covered by unit tests in osbuild/images:
aaa53adc3c/pkg/distrofactory/distrofactory_test.go (L9)
2024-03-06 13:28:30 +01:00
Achilleas Koutsou
76a699653a test: add iot-bootable-container to api tests
The image type supports uploading to both s3 and container registries.
Right now we only care about getting it in Koji, so let's just add it to
the s3 upload section.

The container registry test also embeds containers in the image, which
the iot-bootable-container doesn't support (yet).
2024-02-02 10:34:41 +01:00
Tomáš Hozza
1fa72f262e test/api.sh/vsphere: specify the resource pool for image import
Specify the resource pool when importing the VMDK to the VCenter.
This should prevent the following error:

govc: default resource pool resolves to multiple instances, please specify

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-01-26 11:32:34 +01:00
Tomáš Hozza
2fe5e01d4d Test/api.sh: test distro aliases and names without dot-notation
Extend the `api.sh` to allow testing compose requests with distro name
which does not use dot-notation (specifically when the dot is removed
from the distro name as it used to be in the past). In addition to that,
allow also testing the distro alias using distro name without the minor
version in compose requests.

Enable these two new test variants in the CI.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-01-26 11:32:34 +01:00
Ondrej Ezr
d5483ccfb0 test: Add nginx to the image request 2023-12-20 09:02:06 +01:00
Achilleas Koutsou
d3921dcc31 test: use upload_targets for edge in api s3.sh
When making the upload request for edge commit image types, use the new
upload_targets array to define the aws.s3 upload options.
Leave other upload target definitions as is for now to test the old
options.
2023-11-17 16:48:16 +01:00
Sanne Raymaekers
0a255df1ca cloudapi/v2: add all existing customizations to openapi spec 2023-10-11 17:29:56 +02:00
Sanne Raymaekers
1e7e1308ab test/cases/api: don't print command traces
Causes some secrets to be dumped into the logs.
2023-09-19 22:57:06 +02:00
Sanne Raymaekers
522a54188a test/api: add oci test 2023-09-19 22:57:06 +02:00
Gianluca Zuccarelli
0311ef449d test/cases: OpenSCAP cloudapi tests
Run a basic check to see that the tailoring file has been created when
adding tailoring rules to the OpenSCAP config. Since the OpenSCAP scan
requires more memory and breaks some of the API tests, a full scan is
not run in the cloudapi tests.
2023-09-18 20:46:49 +02:00
Sanne Raymaekers
1b04a78120 test/cases/api: add check for subscription-manager facts 2023-08-07 20:47:20 +02:00
Jakub Rusz
86d11d9b67 tests/vsphere: report only ipv4 address 2023-05-30 16:45:30 +02:00
Tomáš Hozza
4afc5f58d0 test/api.sh/aws: verify AMI boot mode
Extend the Cloud API AWS test case to verify the uploaded AMI boot mode.
For informational purposes, also log the boot mode of the instance
created using the AMI by the test case.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-05-19 13:24:39 +02:00
Gianluca Zuccarelli
1c25d2792c tests/api: custom repository tests
- remove `custom-repos.sh` integratoin test
- add custom repositories check to `api` tests for supported
  images
- verify custom repositores are added to /etc/yum.repos.d
- verify gpg key is saved to /etc/pki/rpm-gpg (for inline keys)
2023-04-26 14:16:16 +01:00
Sanne Raymaekers
861e1473d9 test/vmware: boot VMs with EFI and use SCSI as a disk controller
Since we use streamOptimized images everywhere, we no longer need to use
IDE and boot with bios. Let's test a more realistic scenario.
2023-03-15 10:37:21 +01:00
Tomáš Hozza
c528948b71 Test/API: use directories and files customization for supported images
Use directories and files customization in the compose request for image
types that support this customization (only ostree installer and raw
image do not support it).

Extend the instance verification to check for the custom directories and
files.

Extend the ostree commit verification to check for the custom
directories and files.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-02-22 12:17:36 +01:00
Tomáš Hozza
d1325aaf45 Test/API/GCP: don't set gcloud format to JSON by default
Previously, the `--format=json` was always set in the `$GCP_CMD`. This
was working OK in general, but it is creating issues when using
`$GCP_CMD compute ssh` to execute commands on the provisioned VM. In
such case, an extra `[]` is added to the output, which then causes
various checks to fail, since the captured stdout is different than
expected.

Instead remove the `--format=json` by default from `$GCP_CMD` and use it
explicitly only in cases when `jq` is used to parse the command's
output. In all other cases, it should be OK to not set the output format
to JSON and it is very much desirable to do so when SSH-ing to the VM.

Also by default pass the `--quiet` option to `gcloud` when using it from
the container. This was previously done only when using the tool
installed on the system.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-02-22 12:17:36 +01:00
Tomáš Hozza
5a0d286d6b test/api: don't provide Resource Group Location when testing Azure
Let's default to not providing the Resource Group Location when testing
Cloud API with Azure and leave it up to the implementation to determine
the correct location to use.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2022-10-27 19:33:43 +02:00
Tomáš Hozza
809107cd45 cloudapi: make Bucket optional in GCPUploadOptions
GCP Bucket to use can be now configured in the worker configuration.
Make the `Bucket` optional in the Cloud API when uploading image to GCP.

Adjust the Cloud API test case to configure GCP Bucket on the worker and
not provide it in the API request.
2022-10-11 13:23:18 +02:00
Achilleas Koutsou
632f371a08 test: add iot-commit to api tests by name 2022-09-20 18:29:28 +02:00
Sanne Raymaekers
bfd90cf191 test/api/aws: Fix cloned image cleanup
The ami id of the cloned image is stored in `AMI_ID_2`.

Also tag the cloned image with `gitlab-ci-test`
2022-09-20 11:11:19 +02:00
Ondřej Budai
d78f1e6229 cloudapi: add option to upload S3 artifacts publicly
A small test is added to cover this new option. Also, a check for AWS region
in the URL was removed. The public URL doesn't actually contain it and it's
imho useless - S3 buckets are always tied to a certain region.

The elaborate grep command parsing a path from a URI was switched to being
a small python script. The python script can actually handle an URI without
a query (which was always present in the pre-signed URI, but it's not in the
ordinary one)

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-09-19 22:56:36 +02:00
Tomáš Hozza
ff82dec37f test/api/common: add cleanupVSphere() and use it where appropriate
Clean up VSphere in all S3 test case implementations, which were
previously not cleaning up after themselves.
2022-09-19 10:37:32 +02:00
Tomáš Hozza
f1bf5b32f9 test/api/common: move all VSphere code from s3.sh to vsphere.sh 2022-09-19 10:37:32 +02:00
Tomáš Hozza
7e2d112783 test/api: add checkEnvVSphere() to common/vsphere.sh
Add a common function to check for all environment variables needed to
test VSphere image. Call the function from all S3 implementations of
`checkEnv()` if testing the VSphere image type.
2022-09-19 10:37:32 +02:00
Tomáš Hozza
9e9aec5b53 test/api: move govc installation to common/vsphere.sh
Move the installation of the VSphere client out of the
`api/common/aws.sh` `installClient()` function into a dedicated
`installClientVSphere()` function in `api/common/vsphere.sh`.

Rename the `installClient()` in `api/common/aws.sh` to
`installAWSClient()`. Introduce `installClient()` in both,
`api/aws.sh` and `api/aws.s3.sh`, which calls `installAWSClient()`.

Call `installClientVSphere()` conditionally when testing VMDK image type
in `api/aws.s3.sh` and `api/generic.s3.sh`.
2022-09-19 10:37:32 +02:00
Tomáš Hozza
9981a05190 test/cases/api/common/s3.sh: delete duplicate functions
All of the deleted functions were defined in the same file twice.
2022-09-19 10:37:32 +02:00
Tomáš Hozza
9285b7c9fe test/cases/api/aws.s3.sh: delete duplicate functions
The `verifyEdgeCommit()` and `verifyDisk()` functions are already
defined in the `test/cases/api/common/s3.sh` file sourced by
`test/cases/api/aws.s3.sh`.
2022-09-19 10:37:32 +02:00
Tomáš Hozza
ce8cc11739 test/cases/api/common/s3.sh: fix indentation 2022-09-19 10:37:32 +02:00
Achilleas Koutsou
bf83bbea38 test: move greenprint and redprint functions to shared_lib.sh
Since we're sharing functions between test scripts, move greenprint(),
the most rewritten function in the history of the project, to
shared_lib.sh and source it everywhere.
2022-09-13 16:06:19 +01:00