Commit graph

449 commits

Author SHA1 Message Date
Ondřej Budai
0359647a82 go.mod: update to Go 1.18
Fedora 35 support was dropped, so we can update to a newer Go.

Stable RHEL 8 and 9 and Fedora 36 ships Go 1.18, so let's switch to it.

"//go:build" directives are now apparently enforced by go fmt, so that's why
there were added.

Also, all the github actions were adjusted to use Go 1.18.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-01-09 14:03:18 +01:00
Ondřej Budai
4bafe1ead9 remove Fedora 35 support
Fedora 35 is going EOL on Tue 2022-12-13. At the time of writing this commit
message, that's the next day. As we do releases on Wednesdays, the next
release will never find its way to F35 and thus, there's no point in keeping
support for it.

Let's delete everything that relates to Fedora 35. If there's something that
cannot be deleted (e.g. CI containers based on F35), let's upgrade it to F37.

TestCrossArchDepsolve now uses CentOS Stream 8 because RHEL 8.4 cannot read
F37 repository metadata. This is a similar issue to
https://bugzilla.redhat.com/show_bug.cgi?id=2004853 . Basically, newer
repositories can be only read by libmodulemd >= 2.11.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-01-06 11:34:50 +01:00
Ondřej Budai
1f782900f0 tools/koji-composer: add encoding to open()
Newer versions of pylint complain about a missing encoding in the open()
function.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-01-06 11:34:50 +01:00
Achilleas Koutsou
a9842d5e9c test-case-generators: enable azure aarch64 manifest generation
Add the rhui-azure rpmrepo snapshots to aarch64 repositories.
The repos are labelled as x86_64 but they're actually 'noarch' and we
name them x86_64 when creating the snapshots.

Co-Authored-By: Christian Kellner <christian@kellner.me>
2022-12-16 15:40:09 +01:00
Sanne Raymaekers
07a8f3d5ea test: adapt to shellcheck v0.9.0 2022-12-13 13:55:53 +01:00
Sanne Raymaekers
369f237d89 gen-manifests: add ostree rhsm option 2022-12-12 13:42:52 +01:00
Achilleas Koutsou
c2fe05950c tools: update test case repos for CS9 2022-12-11 12:37:37 +00:00
Achilleas Koutsou
b9098c64c4 test: add valid parent commit ID to test manifests
The previous value for parent was not a valid commit ID.  In a regular
compose request, the parent ref is resolved before being added as a
source in the manifest.  However, when building test manifests, since
the values aren't real, we don't resolve the ostree refs, meaning that
the test manifests weren't valid — they failed validity checks if run in
osbuild.

Replaced the fake parent ref with a fake parent commit ID
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff".
The manifests still aren't buildable, since they don't point to a valid
ostree repository or commit, but now they're at least valid (in the
technical sense).
2022-12-11 12:37:37 +00:00
Ondřej Budai
fd72a6d16e run-koji-container.sh: drop the duplicate vhd.xz format
When the test upload a vhd.xz image to koji, it returns `koji.GenericError:
multiple matches for file extension: vhd.xz`. It seems like the default
schema is not valid for vhd.xz images because it contains two archive types
for them which koji cannot handle. I reported this issue as

https://pagure.io/koji/issue/3605

This commit works around that by removing one of the archive types, so koji
isn't confused by two same records.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-12-01 20:59:30 +01:00
Achilleas Koutsou
9ae3d03f88 tools: add package to image-installer manifest request
Add podman to the image installer's packages when generating test
manifests.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
c5f6aca53b format-request-map: iot-commit with container
Add manifests for container embedding in iot-commits for Fedora.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
04a7cd36c7 format-request-map: new manifests for container embedding
Add manifests for container embedding in edge-commits and qcow2s.
Limit qcow2 container embedding to RHEL 9.1 for now since it's not
supported on Fedora or RHEL 8 yet.
2022-11-28 17:20:49 +01:00
Xiaofeng Wang
920431a679 test: Disable secure boot for CS9 on libvirt_test.sh 2022-11-25 03:47:30 +01:00
Xiaofeng Wang
422e70c8ce test: Update nightly compose URL to updates URL
Since RHEL 9.1 and 8.7 released, the nightly compose URL moved to
update URL, like /rhel-8/nightly/updates/RHEL-8/latest-RHEL-8.7.0/
2022-11-25 03:47:30 +01:00
Achilleas Koutsou
6f37df7777 tools/define-compose-url: fix RHEL 9.1 compose URL
RHEL 9.1 currently doesn't have a 'latest' compose.  Use most recent
date-stamped build.
2022-11-21 09:45:26 +01:00
Brian C. Lane
12c7f12d16 tools: Add new azure-sap-rhui image type
It needs to be listed in format-request-map.json, and the repo snapshots
required to depsolve the packages need to be added to repos.json

NOTE: The snapshots are from https://github.com/osbuild/rpmrepo/
2022-11-18 16:53:22 +01:00
Ondřej Budai
422281698a packer: add a workaround for broken podman from 9.1
Podman doesn't work when installed from 9.1 repositories on 9.0 image.

I found that upgrading the whole system helps. Sadly, that requires removing
python-unversioned-command for some reason.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-11-16 22:31:43 +01:00
Paul Whalen
560905108c fedora/package_sets: Update sil-scheherazade-new-fonts
F37 no longer ships sil-scheherazade-fonts, but
sil-scheherazade-new-fonts instead. Let's change this. The repos for
test manifests must have been updated in order to get the new package.

Co-authored-by: Ondřej Budai <ondrej@budai.cz>
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-11-14 12:01:47 +01:00
Tomáš Hozza
754a9b59b3 tools/provision.sh: copy RHEL repo overrides using wildcard
Don't list specific RHEL repos which should be copied over to the repo
overrides directory, but instead copy all of them, similar to how it's
done for Fedora and CentOS Stream. This is less error prone when support
for a new RHEL release is added to composer.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2022-11-09 20:25:01 +01:00
Brian C. Lane
d73171fdde Use go install instead of deprecated go get
In go 1.18 'go install' needs to be used to install an executable. See
https://go.dev/doc/go-get-install-deprecation and
https://go.dev/doc/manage-install
2022-11-09 12:08:43 +01:00
Tomáš Hozza
a001da966a distro: add support for RHEL-9.2
Add relevant repo definitions and generate image test manifests.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2022-10-31 08:07:09 +01:00
Tomáš Hozza
fc95dac86a distro: add support for RHEL-8.8
Add relevant repo definitions and generate image test manifests.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2022-10-31 08:07:09 +01:00
Tomáš Hozza
10432d6103 tools: update repos used to generate 8.7 and 9.1 image manifests
Also drop repos for RHEL-9.0 Beta, which are not used any more.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2022-10-19 17:07:36 +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
Diaa Sami
420097ae63 tools/appsre: remove leftover code from before 2022-10-04 16:26:08 +02:00
Diaa Sami
98eda72499 templates/packer: update amazon plugin 2022-09-27 10:47:32 +02:00
Diaa Sami
06fbd926ae app-sre: Update AMIs to rhel-9.0 2022-09-27 10:47:32 +02:00
Achilleas Koutsou
cdfd305e0f test: update format request map and test manifests 2022-09-20 18:29:28 +02:00
Tomas Hozza
117f5a48f9 format-request-map.json: fix azure-rhui definition
There was a missing `overrides` property in the `azure-rhui` request
definition, which resulted in:

```
$ ./tools/test-case-generators/generate-test-cases --distro rhel-90
--arch x86_64 --image-types azure-rhui --store /dev/null --output
/home/thozza/devel/osbuild-composer/test/data/manifests
--keep-image-info
Traceback (most recent call last):
  File "/home/thozza/devel/osbuild-composer/./tools/test-case-generators/generate-test-cases", line 176, in <module>
    main(args.distro, args.arch, args.image_types, args.keep_image_info, args.store, args.output)
  File "/home/thozza/devel/osbuild-composer/./tools/test-case-generators/generate-test-cases", line 153, in main
    if distro in test_case_request["overrides"]:
KeyError: 'overrides'
```
2022-09-15 08:50:33 +02:00
Alexander Todorov
3d6256a89d Specify additional package in blueprint for tests
Related RHBZ#2065734
2022-09-13 18:56:00 +02:00
Achilleas Koutsou
6dafa36fc7 image-info: remove base loop device before analysing partitions
Instead of keeping the loop device of the base image and then opening
each partition as a loop device, remove the original loop device of the
base image and then create a loop device for each partition from the
file itself using the partition offsets.

The open_image() function is renamed to convert_image() and now only
handles converting qcow2 files to raw files if necessary.
The loop_open() context is done in analyse_image() instead, so that the
base loop device can be closed without removing the converted image.

This fixes the following issue with LVM partitions:
When the same lvm partition UUID is on two devices (e.g., /dev/loop0p4
and /dev/loop1), the 'vgchange -ay' command fails with the following
error:

  Cannot activate LVs in VG rootvg while PVs appear on duplicate
  devices.

This happens when we open the LVM partition as a separate loop device,
which we do for all partitions that we want to inspect.

NB: It's possible to restrict the vgchange command to a specific device
with --devices, but this isn't available in older versions of lvm2 (it
was introduced in 2.03.11).
2022-09-13 16:06:19 +01:00
Achilleas Koutsou
fb4309acf4 test: add repos and test manifests for Fedora 38 2022-09-13 16:06:19 +01:00
Achilleas Koutsou
eb731e031d test: generate new manifests
Add new image type to format request map and generate manifests.
2022-09-13 16:06:19 +01:00
Ondřej Budai
e2a298723e ci: enable fedora 37 tests
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-09-13 16:06:19 +01:00
Diaa Sami
6df494f810 tools/appsre: disable packer parallel builds 2022-09-09 12:08:29 +02:00
Diaa Sami
a22b0c229a appsre-ansible: subscribe before upgrading packages 2022-09-05 12:08:57 +02:00
Diaa Sami
ec0a1944b4 appsre-ansible: support aarch64
make ansible playbooks arch-agnostic
extract embedded bash script into separate file with parameters
update packer template to support aarch64
Convert parts of bash script to python code that can start multi-arch instances to build RPMS
2022-09-05 12:08:57 +02:00
Alexander Todorov
f451e0291a Modify repositories/rhel-xy.json file before testing nightly compose
Fixes #1318

- uses a wildcard match for sed in order to replace only lines which
  match and keep the rest intact
2022-08-18 14:00:16 +03:00
Alexander Todorov
e902e1f410 Revert "provision.sh: don't do any verification"
This reverts commit faf911cd21.
2022-08-18 14:00:16 +03:00
Tomas Hozza
735c6ec9c3 generate-all-test-cases: make output default to test/data/manifests 2022-08-17 11:59:39 +02: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
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
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
31b1a383f0 tools/koji-compose.py: test with pylint and fix found issues
Check `tools/koji-compose.py` using pylint as part of GitHub actions.
Fix all issues that were found by pylint.
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
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
faf911cd21 provision.sh: don't do any verification
The provision tools was calling to the Weldr API using a CLI client to do
a basic verification of the provisioned software. This is however not
practical nor needed. Eventually, we may want to not enable the Weldr
API socket when testing scenarios related to the Service, to make it
more realistic. Another reason to not do it is that test cases which are
using this script to provision the software are doing the actual
verification, so this just duplicates it.
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
Tomas Hozza
067e58857a koji-compose.py: support Koji composes with upload to cloud
Extend the `tools/koji-compose.py.sh` script to allow also testing the
upload to cloud, in addition to the testing that it supports currently.

If only the `DISTRO` and `ARCH` arguments are passed to the script, it
submits a new Koji compose with two image requests, as it always did.

If a `CLOUD_TARGET` and `IMAGE_TYPE` arguments are provided in addition
to `DISTRO` and `ARCH`, then the script submits a new Koji compose with
a single image request, which has the upload options set to make the
image be uploaded to cloud.

Supported cloud targets are:
 - `aws`
 - `azure`
 - `gcp`

The image types are those that are accepted by the Cloud API. The script
does not check at all if the provided combination of the cloud target
and image type is valid and submits anything that it gets to composer.
2022-07-22 11:39:49 +01:00