Commit graph

15 commits

Author SHA1 Message Date
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
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
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
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
Tomas Hozza
250810614e koji-compose.py: use provided arch instead of hard-coding it 2022-07-22 11:39:49 +01:00
Tomas Hozza
9c13f267dc koji-compose.py: print only compose ID to STDOUT
Modify the `tools/koji-compose.py` script to print all log messages to
STDERR and to print only the Koji compose ID to STDOUT. This way, the
caller of the script can easily get the ID of the compose created by the
script and use it later.
2022-07-22 11:39:49 +01:00
Ondřej Budai
0adbce3606 test/koji: remove the old code for testing koji API
Koji API is no more, let's drop the test and rename koji-compose-v2.py to
koji-compose.py.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-07-19 16:00:52 +02: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
Tom Gundersen
9adae8a3a7 kojiapi: support multi-build composes
This removes the restriction of only having a single build per compose
and uses the new job types to schedule the broken-appart build.

A small change in behavior is introduced: the koji build ID is not
known when the call to `compose` returns, so it is always set to
`0`. In the future we should remove this from the API, and instead
rely on the status call to return this information, when it is
known.

The status route will be updated in follow-up commits to reflect the
changes introduced here.
2020-11-11 18:16:42 +01:00
Lars Karlitski
e47b44329e kojiapi: expose logs on the API
Add an API route that returns logs for a specific compose.

For now, this contains the result of the job, in JSON. The idea is to
put more and more of this information into structured APIs. This is a
first step to make logs available at all.

Amend koji-compose.py to check that the route exist and contains as many
"image_logs" as images that were requested (currently always 1).

Based on a patch by Chloe Kaubisch <chloe.kaubisch@gmail.com>.
2020-11-10 16:23:49 +01:00
Ondřej Budai
6962c4d8e6 tools/koji-compose: use the central test repositories
We have several repository definitions across the tests which is quite messy.
This commit switches the Koji test to use the "central" repository configs defined in test/data/repositories/
2020-11-10 09:38:25 +01:00
Tom Gundersen
25abccf66d tree-wide: drop f31 support
We no longer release into F31, and the right specfile was anyway not
being tested.

This allows us to remove a workaround that updates the VMs during
deploy, and other fedora-31 specific hacks.
2020-10-21 09:04:13 +02:00
Ondřej Budai
bb3e450e83 tests/koji: use gpg key when building Fedora
This change allows to test both builds with a gpg key and without one.
2020-10-13 08:10:22 +02:00
Tom Gundersen
001c7f682a test/integration: move koji-compose.py into tools
This is not an integration test in itself, but a helper tool.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-10-06 13:08:26 +02:00
Renamed from test/integration/koji-compose.py (Browse further)