Commit graph

412 commits

Author SHA1 Message Date
Achilleas Koutsou
ceb64b43fe test: disable full image building in generation.sh
The purpose of the test is to check that the dnf-json socket can be
started automatically when running the test case generator while the
service or socket isn't enabled/started.

dnf-json will still be used to depsolve the packages and create the
manifest even if the image is not built.
2022-04-29 08:55:36 +02:00
Alexander Todorov
1e520719cb Don't run unsupported tests on 8.6 and 9.0
https://coreos.slack.com/archives/C0235DZB0DT/p1650536467098679?thread_ts=1650512166.141439&cid=C0235DZB0DT
2022-04-22 15:45:02 +02:00
Tomas Hozza
ee285e5e8a Weldr: support GCP upload target
Add support for importing the GCE image into GCP using Weldr API. The
credentials to be used can be specified in the upload settings and will
be then used by the worker to authenticate with GCP.

The GCP target credentials are passed to Weldr API as base64 encoded
content of the GCP credentials JSON file. The reason is that the JSON
file contains many values and its format could change in the future.
This way, the Weldr API does not rely on the credentials file content
format in any way.

Add a new test case for the GCP upload via Weldr and run it in CI.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
29174bfbef test/api.sh: take advantage of GCP guest tools to SSH to the VM
Modify the Cloud API test case for GCP to use `gcloud` and GCP guest
tools installed in the image to connect to the VM instance over SSH.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Tomas Hozza
ea3e6f072e test/api.sh: filter repos by image type
Filter the list of repositories passed in compose request based on the
`image_type_tags` object member. This is the same approach used by the
Weldr API. If the `image_type_tags` does not exist, the repo is added to
the list. If the `image_type_tags` exists, the repo is added to the list
only if the image type name is in the tags array.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Ygal Blum
b5dcb40b05 Generic S3 test - retry creating the alias in case the service is not yet up 2022-04-12 09:39:21 +02:00
Alexander Todorov
4c97fae0e9 Properly skip Fedora distros
Co-authored-by: Jakub Rusz <55534579+jrusz@users.noreply.github.com>
2022-04-11 15:27:15 +02:00
Alexander Todorov
8556a844e8 Add tests for blueprints without explicit definition for /
- currently disabled on Fedora until PR #2461 lands

Related: RHBZ#2049500
2022-04-11 15:27:15 +02:00
Ygal Blum
bee14bf392 OSBuild - add support for generic S3 services
jobimpl-osbuild
---------------
Add GenericS3Creds to struct
Add method to create AWS with Endpoint for Generic S3 (with its own credentials file)
Move uploading to S3 and result handling to a separate method (along with the special VMDK handling)
adjust the AWS S3 case to the new method
Implement a new case for uploading to a generic S3 service

awscloud
--------
Add wrapper methods for endpoint support
Set the endpoint to the AWS session
Set s3ForcePathStyle to true if endpoint was set

Target
------
Define a new target type for the GenericS3Target and Options
Handle unmarshaling of the target options and result for the Generic S3

Weldr
-----
Add support for only uploading to AWS S3
Define new structures for AWS S3 and Generic S3 (based on AWS S3)
Handle unmarshaling of the providers settings' upload settings

main
----
Add a section in the main config for the Generic S3 service for credentials
If provided pass the credentials file name to the osbuild job implementation

Upload Utility
--------------
Add upload-generic-s3 utility

Makefile
------
Do not fail if the bin directory already exists

Tests
-----
Add test cases for both AWS and a generic S3 server
Add a generic s3_test.sh file for both test cases and add it to the tests RPM spec
Adjust the libvirt test case script to support already created images
GitLabCI - Extend the libvirt test case to include the two new tests
2022-04-07 15:01:01 +02:00
Tomas Hozza
e30fa53c50 CI: rotate the used RHSM activation key 2022-04-07 11:44:52 +02:00
Jakub Rusz
a999b7b04c test/ostree-ng: remove user customization from upgrade BP
A user does not need to be specified in upgrade blueprint in order for
it to be present after the upgrade. Related rhbz#2060575
2022-04-06 16:34:31 +02:00
Xiaofeng Wang
62ab822695 test: Enable CS9 test for ostree-rebase and ostree 2022-04-06 08:59:37 +02:00
Jakub Rusz
e1bb8ab47c tests/ci: split regression tests
Regression test suite has grown considerably and is taking too long to
run with a single wrapper. Splitting them into individual standalone
tests instead and making them run in parallel.
2022-04-04 12:18:53 +02:00
Tomas Hozza
72019740c2 Cloud API: upload stream-optimized VMDK to S3
The VMDK image must be in stream-optimized format in order to be
imported to VSphere. osbuild-composer does not produce VMDK by default
as stream-optimized. Instead, it is converted on the fly when the image
build job has been submitted via Weldr API.

Since we are aiming mainly for the VSphere use case with the VMDK image
in the service, the image should be ready for importing to VSphere.

Implement a temporary workaround for the Cloud API and AWS S3 target to
upload stream-optimized VMDK image.

Adjust the `api.sh` test case to not convert the VMDK image downloaded
form S3, before importing it to VSphere.
2022-04-02 08:47:02 +01:00
Tomas Hozza
5acaaabc1d test/api.sh: do not print to stdout when dumping the DB
Ensure that the content of the database is not printed to the console
when dumped at the end of the test case. The output is still preserved
as a CI run artifact.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-02 08:47:02 +01:00
Tomas Hozza
7a44d00cec test/api.sh: cleanup the DB container
Kill and remove the DB container as part of the test case cleanup.
Without this change, running the test case more than once fails.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-02 08:47:02 +01:00
Tomas Hozza
27c260daaf test/api.sh: verify VMDK images from S3 in VSphere
Extend the `api.sh` test to verify the VMDK images uploaded to S3 in
VSphere by booting them and configuring using cloud-init.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-02 08:47:02 +01:00
Xiaofeng Wang
21b6e95136 test: Clean up and improve ostree-simplified-installer.sh
Remove comment out code
Use three different IP address for different test scenarios
Move /boot/device-credentials file checking into playbook
Some shell script improvements
2022-03-29 08:09:37 +02:00
Jakub Rusz
55a3556e9f test/ostree-simplified-installer: destroy VM fixup
There was another virt-install added recently and it was missed in
1d51c0764936902c681283a3489845ef660fef5e
2022-03-29 08:01:08 +02:00
Xiaofeng Wang
15a135fcbb test: Remove RHEL 8.4 test and not used configurations
CI will not run RHEL 8.4 test any more, remove it.
2022-03-28 14:08:57 +02:00
Xiaofeng Wang
75a3426515 test: Add a new user in installer bp and test new user created 2022-03-28 14:08:57 +02:00
Achilleas Koutsou
14aa3b9f54 test: save installer test manifest and build log
Same as with ostree tests.
2022-03-28 14:08:57 +02:00
Jakub Rusz
b639a44899 tests/ostree-simplified-installer: destroy VM when installation is stuck
This test get stuck randomly on centos-stream-8 and is making the CI
unreliable. Adding hard wait limit and destroying the VM afterwards
helps the test get unstuck and continue as expected. See
https://github.com/osbuild/osbuild-composer/issues/2413 for details.
2022-03-25 16:00:39 +01:00
Ondřej Budai
80af9cac98 cloudapi: enable edge-commit on Fedora
We have to do a small hack to enable edge-commit on Fedora because its name
is different. We can also change this in the image definition but I want to
iterate quickly on the Fedora Integration MVP and don't want to run in
any conflicts with
https://github.com/osbuild/osbuild-composer/pull/2461

This commit also enables a test for Fedora IoT built through the API.

While enabling the test, I also simplified our decision logic for SSH_USER
and DISTRO.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-03-25 13:23:32 +01:00
yih
cd0f762e58 add fdo sshkey and rootcert test 2022-03-24 18:23:39 +01:00
Tomas Hozza
d11a2f3bc7 api.sh: encrypt the DB dump artifact 2022-03-23 09:45:09 +01:00
Jakub Rusz
15c2044b3c tests/upgrade: update gpg key
We need to use a new gpg key after the SHA-1 deprecation. Also don't
fail immediately on compose failure to be able to retrieve logs from the
test VM.
2022-03-22 10:54:30 +01:00
Sanne Raymaekers
2023f7731d worker: Support client_credentials grant type in client
This will allow us to use the service accounts which work against
identity.api.openshift.com. These are much easier to manage, especially
with the new multi-tenancy, as there's a single page to create/expire
them across an account.

They also have the added benefit of not expiring automatically when
they're not used like offline tokens, and immediate expiration when
desired.
2022-03-21 09:43:43 +01:00
Tomas Hozza
e5595667bc test/api.sh: move the DB dump to the cleanup() function
Previously, the DB was not dumped in case the compose failed. Ensure
that the DB is dumped before the script exits in any case.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-03-16 09:03:47 +00:00
Tomas Hozza
e8a347d1e8 test/api.sh: do not use /tmp, but $WORKDIR
Do not create files directly in `/tmp`, but use `$WORKDIR`, which is a
temporary directory for transient files, which gets cleaned up when the
test case finishes. Without this change, running `api.sh` twice fails
the second time.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-03-16 09:03:47 +00:00
Juan Abia
4c5de045ff test: add test purpose
Most test scripts don't have any documentation regarding it's purpose,
although it can be guessed by the code. There's value in adding this
small comment.

[skip-ci]
2022-03-09 22:46:25 +01:00
Jakub Rusz
05be7c4096 test/image-tests: temporarily skip azure_rhui image testing
This manifest is intended only for internal use and is currently failing
in nightly pipelines. This will be moved to a different test script in
the future, see COMPOSER-1397.
2022-03-08 13:19:34 +01:00
Ondřej Budai
2d16aeb467 tests: add an E2E test for multi-tenancy
See the comment. It's imho still very important to have this test
but its powers are limited.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-03-08 12:07:00 +01:00
Ondřej Budai
299264f178 test/koji: install podman-plugins everywhere
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-03-08 12:07:00 +01:00
Ondřej Budai
cfb756b9ba api/{cloud,worker}: used channel name based on JWT claims for new jobs
This commit implements multi-tenancy. A tenant is defined based on a value
from JWT claims. The key of this value must be specified in the configuration
file. This allows us to pick different values when using multiple SSOs.

Let me explain more in depth how this works:

Cloud API gets a new compose request. Firstly, it extracts a tenant name from
JWT claims. The considered claims are configured as an array in
cloud_api.jwt.tenant_provider_fields in composer's config file. The channel
name for all jobs belonging to this compose is created by `"org-" + tenant`.

Why is the channel prefixed by "org-"? To give us options in the future. I can
imagine the request having a channel override. This basically means that
multiple tenants can share a channel. A real use-case for this is multiple
Fedora projects sharing one pool of workers.

Why this commit adds a whole new cloud_api section to the config? Because the
current config is a mess and we should stop adding new stuff into the koji
section. As the Koji API is basically deprecated, we will need to remove it
soon nevertheless.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-03-08 12:07:00 +01:00
Jakub Rusz
ae07093404 tests/image-tests: filter out cases with ostree URL
These tests depend on external dependencies which are difficult to setup
during image-test like http ostree repository. See
https://github.com/osbuild/osbuild-composer/pull/2389#issuecomment-1060338127
for more details.
2022-03-08 09:23:05 +01:00
Xiaofeng Wang
e147e41879 test: Fix COMPOSE_URL issue and add set-env-variables.sh 2022-03-08 09:23:05 +01:00
Jakub Rusz
485fc68a98 tests/upgrade: add user choice for vdo devices check
This is a user choice that has to be picked before the upgrade or it
acts as an inhibitor.
2022-03-08 09:23:05 +01:00
Antonio Murdaca
c79f51942b test/cases/simpl installer: bump to use fdo 0.4.0
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2022-03-03 16:27:57 +01:00
Alexander Todorov
cf8f05b57c tests: Better implementation for ab30694
Don't remove the pre-existing mount-points from the blueprint b/c we
still need to assert on those.

Add `/tmp` and `/var/tmp` to exercise the case where mountpoints have
matching suffixes.
2022-02-26 17:53:09 +00:00
Alexander Todorov
1459531148 Revert "tests: check mountpoints with matching suffixes"
This reverts commit ab306943d4.
2022-02-26 17:53:09 +00:00
Ondřej Budai
d8d161480e rhel86/90: change isolevel of image-installer to 3
So it can contain payload bigger than 4GiB.

Related: rhbz#2056451
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-02-24 17:56:22 +00:00
Antonio Murdaca
6a127ae1a7 ostree-simplified-installer: pin fdo-containers commit and fix selinux
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2022-02-24 17:07:34 +01:00
yih
8d5490e209 test: add test case for fdo
Add a new test case that tests secure device onboarding for the
Edge simplified installer.
2022-02-24 17:07:34 +01:00
Gianluca Zuccarelli
ab306943d4 tests: check mountpoints with matching suffixes
Filesystem mountpoints with matching suffixes, i.e.
`/tmp` and `/var/tmp` was causing image builds to
fail. Since this was fixed with #2141 the integration
tests have been updated to check for this.
2022-02-24 11:00:35 +01:00
Sanne Raymaekers
b05723a37e templates/composer: Verify against mass sso and rh sso 2022-02-24 09:48:12 +01:00
Xiaofeng Wang
05cbbf0cc5 test: Skip rollback test only on UEFI VM of ostree-rebase.sh 2022-02-23 11:08:24 +01:00
Xiaofeng Wang
45ee6c297f test: Remove ANSIBLE_STDOUT_CALLBACK=yaml in ostree-rebase.sh 2022-02-23 11:08:24 +01:00
Xiaofeng Wang
bc9d1431bc test: Add OSTree rebase test for OSTree parent ref support
To run ostree-rebase.sh, like RHEL 8.6 and RHEL 9, the CS8 VM
needs "large" flavor for more CPU and memory resource.
2022-02-23 11:08:24 +01:00
Achilleas Koutsou
be382ecef8 test/ostree: update ostree compose request to match new requirements
Specifying a parent commit ID without a URL isn't allowed now.  The
upgrade commit is built without a parent.  The OS upgrade should still
work without it.
Getting the ID of the first commit is not necessary now.
2022-02-23 11:08:24 +01:00