Commit graph

908 commits

Author SHA1 Message Date
Tomas Hozza
0875c3491f distro/rhel9: disable GPG check for Google repos in gce* images
Having the GPG check enabled for Google repos in `gce*` images will make
DNF try to import the relevant keys when upgrading, downgrading or
installing any packages from the repo. However due to Google still using
SHA-1 for GPG keys used to sign their RPMs, importing it will make any
transaction that includes such RPM to fail.

Disabling the GPG check will ensure that DNF won't attempt to import
Google GPG keys.

Related to https://issuetracker.google.com/issues/223626963
2022-08-17 11:59:39 +02:00
Tomas Hozza
55e78e195f distro/rhel9: do not define Google Cloud SDK repo in gce* images
The repo is not needed any more, because the Google Cloud SDK is not
installed in the images by default. If anyone wants to install the SDK,
they can add the appropriate repo definition.
2022-08-17 11:59:39 +02:00
Tomas Hozza
debd6d4342 distro/rhel8: do not define Google Cloud SDK repo in gce* images
The repo is not needed any more, because the Google Cloud SDK is not
installed in the images by default. If anyone wants to install the SDK,
they can add the appropriate repo definition.
2022-08-17 11:59:39 +02:00
Tomas Hozza
5f48aaa212 distro/rhel9: don't install google-cloud-sdk in any gce* images
The Google SDK ships pre-compiled binaries. It is undesirable to install
it by default in `gce` and `gce-rhui` in its current shape. Also not
installing it does not anyhow affect the RHEL integration as the guest
OS in GCP.
2022-08-17 11:59:39 +02:00
Tomas Hozza
cf92c1f23a distro/rhel8: don't install google-cloud-sdk in any gce* images
The Google SDK ships pre-compiled binaries. It is undesirable to install
it by default in `gce` and `gce-rhui` in its current shape. Also not
installing it does not anyhow affect the RHEL integration as the guest
OS in GCP.
2022-08-17 11:59:39 +02:00
Xiaofeng Wang
53d4d7f284 test: Improvements for container embedding Edge test 2022-08-12 10:18:29 +03:00
Juan Abia
6e771c97fc test/cases: update cloud-image-val in aws.sh
update CIV to latests realease: v0.2.2
2022-08-11 18:17:28 +02:00
Alexander Todorov
8ae8ba9fae tests: Add comment to make it more obvious what's happening 2022-08-11 13:12:55 +02:00
Alexander Todorov
d3dde77a6f tests: Make Satellite regression tests to use the SUT 2022-08-10 16:33:34 +03:00
Alexander Todorov
860b122f2c tests: Remove useless JSON file overrides
See comment
https://github.com/osbuild/osbuild-composer/pull/2881/files#r940065803

for explanation why
2022-08-10 16:33:34 +03:00
Christian Kellner
b562d144ca distro/*: allow /boot to be customized
Since the LVM support was added to all distros, our disk
related code is adaptive, i.e. we will set the correct BLS
and grub2 prefix if there a `boot` partiton is present in
the layout after all customizations happen, which includes
LVMification.
One thing that was not yet fully working was layouts that
do not yet have a `/boot` partition but allow LVMification.
In that case `NewPartitionTable` and if `/boot` was the
first (or only) customization, would LVMify the partition
which in turn would create the `/boot` partition; but after
`newPT.ensureLVM()` the call to `newPT.createFilesystem`
with `/boot` would try to create another `/boot` mountpoint.
In order to deal with this situation correctly we are now
using a two phase approach: 1) enlarge existing mountpoints
and collect new ones. 2) if there are new ones and LMVify
was allowed, switch to LVM layout. Do a second pass and now
create or enlarge existing partitions, handling `/boot` in
the process.
2022-08-08 18:05:05 +02:00
Jakub Rusz
13e287733a tests/ostree-ng: use /var/tmp/ as TMPDIR for mkkiso
Fedora is using 'tmpfs' as /tmp and that is based on the size of RAM.
That is not enough in case of medium Openstack machines. Changin to use
/var/tmp which is backed by a drive resolves this.
2022-08-08 11:32:03 +02:00
Jakub Rusz
738e6877e0 tests/ostree-rebase: split to uefi and bios
This test used to spawn two VMs at the same time which requires more
memory than the Openstack ci medium runner can provide. We want to be
using only medium runners so this change is necesasry to allow that.
2022-08-08 11:32:03 +02:00
Tomas Hozza
2d13050ba8 test/oscap.sh: provision SUT for the on-premise scenario
The PR#2695 [1] was not rebased on top of PR#2853 [2]. As a result, the
`oscap.sh` test case is provisioning the SUT in a wrong way, which makes
it fail all the time.

Provision the SUT in the test case for the on-premise scenario, since it
uses Weldr API to interact with osbuild-composer.

[1] https://github.com/osbuild/osbuild-composer/pull/2695
[2] https://github.com/osbuild/osbuild-composer/pull/2853
2022-08-05 16:15:24 +02:00
Tomas Hozza
24c52c8d69 osbuild-mock-openid-provider: support client_credentials grant type
Extend the implementation of mock openid server to take the `grant_type`
into consideration for the `/token` endpoint.

In addition to the previously supported `refresh_topen`, the
implementation now supports also `client_credentials`.

This is necessary to make it possible to use the mock server in
the `koji-osbuild` CI, because the builder plugin uses
`client_credentials` to get access token.

The implementation behaves in the following way:
 - For `refresh_token` grant type, it takes the `refresh_token` value
   from the request and adds it to the `rh-org-id` field in the custom
   claim, which is part of the returned token.
 - For `client_credentials` grant type, it takes the `client_secret`
   value from the request and adds it to the `rh-org-id` field in the
   custom claim, which is part of the returned token.

Requests without the supported `grant_type` set are rejected.

Modify affected test cases to specify `grant_type` when fetching a new
access token.
2022-08-05 16:15:24 +02:00
Gianluca Zuccarelli
53c56de88c test: add oscap tests
Add integration tests for oscap customizations.
This tests only the most basic case of oscap remediation.
Mountpoints and additional packages are not added since
this varies between distros and OpenSCAP profiles
i.e. additional blueprints customizations would need
to be specified for each oscap profile to ensure
best results.
2022-08-04 18:19:06 +02:00
Christian Kellner
7767f16e31 test/api: embed containers into the edge container
To check embedding containers via the cloud API works, embed a
known test container from our gitlab CI and check that it is
indeed embedded in the image by pulling the commit and poking
into the container storage.
2022-08-04 14:37:12 +02:00
Tomas Hozza
45850639a0 provision.sh: don't start local worker and Weldr with TLS auth
Do not start local worker (mask the unit) and Weldr API socket when
provisioning the SUT with TLS client cert authentication method. This
method is used only in the Service scenario, therefore starting these
units / sockets was not reflecting the intended deployment.

Modify `api.sh` to not rely on local worker.

Modify `base_tests.sh` to provision SUT with TLS for
`osbuild-auth-tests`, while provisioning SUT with no authentication
method for the rest of test cases.
2022-08-04 11:55:43 +02:00
Tomas Hozza
a4b0efb278 provision.sh: add none authentication method for on-premise scenario
`tools/provision.sh` is provisioning SUT always in the same way for
both, the Service scenario and the on-premise scenario. While this is
not causing any issues, it does not realistically represent how we
expect osbuild-composer and worker to be used in these scenarios.

The script currently supports the following authentication options:
- `none`
  - Intended for the on-premise scenario with Weldr API.
  - NO certificates are generated.
  - NO osbuild-composer configuration file is created.
  - NO osbuild-worker configuration file is created. This means that no
    cloud provider credentials are configured directly in the worker.
  - Only the local worker is started and used.
  - Only the Weldr API socker is started.
  - Appropriate repository definitions are copied to
    `/etc/osbuild-composer/repositories/`.
- `jwt`
  - Intended for the Service scenario with Cloud API.
  - Should be the only method supported in the Service scenario in the
    future.
  - Certificates are generated and copied to `/etc/osbuild-composer`.
  - osbuild-composer configuration file is created and configured for
    JWT authentication.
  - osbuild-worker configuration file is created, configured for JWT
    authentication and with appropriate cloud provider credentials.
  - Local worker unit is masked. Only the remote worker is used (the
    socket is started and one remote-worker instance is created).
  - Only the Cloud API socket is started (Weldr API socket is stopped).
  - NO repository definitions are copied to
    `/etc/osbuild-composer/repositories/`.
- `tls`
  - Intended for the Service scenario with Cloud API.
  - Should eventually go away.
  - Certificates are generated and copied to `/etc/osbuild-composer`.
  - osbuild-composer configuration file is created and configured for
    TLS client cert authentication.
  - osbuild-worker configuration file is created, configured for TLS
    authentication and with appropriate cloud provider credentials.
  - Services and sockets are started as they used to be originally:
    - Both local and remote worker sockets are started.
    - Both Weldr and Cloud API sockets are started.
    - Only the local worker unit will be started automatically.
  - NO repository definitions are copied to
    `/etc/osbuild-composer/repositories/`.
2022-08-04 11:55:43 +02:00
Tomas Hozza
7c73861c22 test/koji.sh: use JWT authentication method
Modify the `koji.sh` test case and `tools/koji-compose.py` to use JWT
authentication method. This better mimics the production deployment.
2022-08-04 11:55:43 +02:00
Tomas Hozza
0891b6b3d7 test/koji.sh: don't copy keytab to /etc/osbuild-composer
There is no need to copy the client kerberos keytab to the
`/etc/osbuild-composer` directory. Composer does not need nor use this
file at all.
2022-08-04 11:55:43 +02:00
Tomas Hozza
4b96a79935 test: add functions variant usable with JWT without providing ORG ID
Common integration tests should not need to care about specific ORG ID
configured in the worker, but they should be able to get access token
and check compose status without providing a specific ORG ID. The only
integration test that should care about ORG ID is the
`multi-tenancy.sh`.

Modify the `access_token` and `compose_status` functions to hide the
existence of ORG ID from the user and instead read it from the worker's
configuration, specifically `/etc/osbuild-worker/token`.

The original implementations of the functions mentioned above are now
available under `access_token_with_org_id` and
`compose_status_with_org_id` names.

Modify the `multi-tenancy.sh` to use the new function names.
2022-08-04 11:55:43 +02:00
Tomas Hozza
765d218b6f test: extract common JTW code from the multi-tenancy.sh test
Move some code related to using JWT tokens from the `multi-tenancy.sh`
test case to `test/cases/api/common/common.sh`, `tools/provision.sh`
and `tools/run-mock-auth-servers.sh`. Move the composer and worker
configuration from the test to new testing configuration files.

The `tools/provision.sh` now accepts an optional argument specifying the
authentication method to use with the provisioned composer and workers.
Valid values are `tls` and `jwt`. If no argument is specified, the `tls`
option is used and the script defaults to its previous behavior.
2022-08-04 11:55:43 +02:00
Tomas Hozza
036303694c test: suffix the currently used test configurations with -tls
This is a preparation to support a different authentication method in
`provision.sh`, specifically JWT.
2022-08-04 11:55:43 +02:00
Alexander Todorov
d176df2ca5 Update test/cases/ostree-ng.sh
Co-authored-by: Jakub Rusz <55534579+jrusz@users.noreply.github.com>
2022-08-04 10:37:16 +02:00
Alexander Todorov
ab510764c2 tests: Apply work around only on RHEL/CentOS 2022-08-04 10:37:16 +02:00
Alexander Todorov
a14b76ef61 tests: Workaround for mkksiso options coming from newer lorax RPM 2022-08-04 10:37:16 +02:00
Xiaofeng Wang
0fe36359ae test: Remove BIOS installation test because edge-installer supports
UEFI only

Due to Edge security reason, edge-simplified-installer and
edge-installer support UEFI only
2022-08-02 09:22:24 +02:00
Ygal Blum
ca32d7b729 cloudapi: Make container name and tag optional
If the user does not pass a name, use the distribution as a name
A provided tag is used only if name is provided. It
The tag's default is a generated using UUID to avoid collisions
2022-08-01 21:50:03 +01:00
Ygal Blum
1847a6ae05 tests/api: add container related test
Add a new cloud API test that will build an edge-container,
upload it to the gitlab CI registry, fetch it from there,
run it and compare that the OSTree commit contained in it
is indeed the one we expect.

Co-Developed-By: Christian Kellner <christian@kellner.me>
2022-08-01 21:50:03 +01:00
Jakub Rusz
e0d092538d distro/rhel8+9: exclude qemu-guest-agent package in ec2 and gce images
Related RHBZ#2075815
2022-08-01 13:16:05 +02:00
Jakub Rusz
3b4ace9987 distro/rhel90: exclude dracut-config-rescue package in ec2 images
Related RHBZ#2064087
2022-08-01 13:16:05 +02:00
Christian Kellner
e3de1d03c0 distro/rhel7: blacklist skx_edac,intel_cstate kernel modules on azure
This was done in RHEL 8, 9 but RHEL 7 was not yet merged so this was
missed there. See e.g. 5c1530ee53
2022-07-28 17:00:11 +01:00
Achilleas Koutsou
234e16f35e test/diff-manifests: fix error handling
The change made in 7f563a6db1 would
require the shell option `-e` to not be set, so that we could capture
the exit code after the command fails.
Fix the error handling by putting the commands that we want to handle in
the test part of an `if` clause.

In addition, error messages are now printed in red.
2022-07-28 10:12:17 +02:00
Achilleas Koutsou
dc95382ba3 rhel90: add kernel modules for iso
These modules are on the official RHEL 9.0 ISO.  Adding them for feature
parity.
2022-07-28 10:12:17 +02:00
Achilleas Koutsou
02bb7a0b4f rhel90: add dracut modules for iso
The nvdimm module is required for booting the image via UEFI HTTP.

The rest are added for feature parity with the official RHEL 9.0 ISO.

Fixes rhbz#2030730
2022-07-28 10:12:17 +02:00
Achilleas Koutsou
93592dabc1 test: regenerate manifests 2022-07-27 18:29:59 +02:00
Achilleas Koutsou
2b6faea320 Remove image info from all test manifests
We never generated it for the newest distro versions and we don't test
it on any of the old ones.

It's better this way.
2022-07-27 10:01:16 +02:00
Jakub Rusz
74bf3aa3df test/diff-manifests: checkout repo to $head on exit
During the diff-manifests.sh test the source repository checkout is
changed to generate manifests from current main branch for comparion. We
want to checkout back to $head after the script is done or in case of
any unexpected exit.
2022-07-26 17:08:32 +02:00
Jakub Rusz
cf562dbb57 CI: drop /tmp/artifacts upload to Gitlab
Contents of this folder are uploaded to S3 with shutzbot/upload_artifacts.sh
Also fixing epel installation in the mentioned script.
2022-07-26 17:08:32 +02:00
Xiaofeng Wang
c71ae8f455 test: Update tests to support embeded container image feature
Container image can only be embeded on commit Use fedora image
instead of ubi8 and only run embeded image checking on  RHEL
8.7, 9.1, CS8 and CS9.
2022-07-26 17:07:31 +02:00
Achilleas Koutsou
f3c166c3fd CI: fix artifact collection for diff-manifests 2022-07-25 21:23:02 +02:00
Achilleas Koutsou
46b127c898 diff-manifests: never use main explicitly
The base branch name is read from the pull request metadata.  Let's use
it everywhere and never assume `main`.
2022-07-25 21:23:02 +02:00
Achilleas Koutsou
b5c47dbe8a test/diff-manifests: warn if generation fails on merge-base
If the manifest generation fails on the merge-base with main (the target
branch of the PR), add a note to the review comment.
2022-07-25 21:23:02 +02:00
Achilleas Koutsou
404d1130bd test/diff-manifests: add link to job artifacts in review comment 2022-07-25 21:23:02 +02:00
Achilleas Koutsou
4c7fc8fd4d test/diff-manifests: fail test if manifest generation fails on PR
Fail the test if manifest generation fails on the PR HEAD, but don't
fail if the generation on main fails.
This can happen if something breaks in main (the generator, a
repository, an image definition, etc) and the PR is meant to fix it.
2022-07-25 21:23:02 +02:00
Achilleas Koutsou
7f563a6db1 test/diff-manifests: minor change in error handling 2022-07-25 21:23:02 +02:00
Achilleas Koutsou
68227ed18b test/diff-manifests: print gen-manifests output
Don't silence the output.  It should be much less noisy now that the
progress isn't printed on a timer but only when something changes.
2022-07-25 21:23:02 +02:00
Tomas Hozza
abc3d31222 test/repos: add AWS and Azure RHUI repos for 86/87/90/91
This is needed in order to be able to test Koji composes with cloud
upload and RHUI images.
2022-07-22 11:39:49 +01:00
Tomas Hozza
88403dec75 koji.sh: support testing of upload to the cloud
Extend the `koji.sh` test case to allow also testing the upload to
cloud, in addition to the testing that it supports currently (building
of multiple images in one Koji compose request).

The script now reuses some common functions used by the `api.sh` test
case. Once the Koji compose succeeds, the script verifies that the image
is present in the appropriate cloud environment using a CLI tool. No
additional testing of the image is done, it is not booted.
2022-07-22 11:39:49 +01:00