Commit graph

14 commits

Author SHA1 Message Date
Tomas Hozza
afd0db50c2 containers: fix globing of RPMs with two-digit version
`?` matches only a single character, which does not work with the
version on `main` being "10".
2022-09-01 18:47:45 +02:00
Ondřej Budai
e2010fed21 spec: set the default release to 1
The release number in the RPMland canonically starts at 1, not at 0. I think
it technically doesn't cause any harm but let's stick to what all other packages
do.
2022-05-04 18:17:59 +02:00
Ondřej Budai
039fc6b618 test/builder: drop misleading quotes from config
configparser treats quotes literally:

client_id = "koji"

translates to the following python string:

'"koji"'

This doesn't matter in the test because the oauth mock from osbuild-composer
actually ignores the credentials and return the token in every case.

But if you want to take this config as an example, you will probably put the
credentials automatically inside the quotes which will not work because a real
oauth server will refuse the client ID surrounded by quotes.

Note that .conf works different than .toml:

TOML requires to have strings in quotes. Yeah, consistency. 🤷
2022-03-23 17:53:30 +01:00
Christian Kellner
c1a887a9a9 test: switch to using oauth/sso
Switch the authentication method that the koji builder plugin
uses from mTLS to SSO. Since we are using the mock openid
server from the `osbuild-composer-tests` package. Make this
package a dependency of `koji-osbuild-tests`.
2022-02-02 13:33:21 +01:00
Alexander Todorov
e778771f2b Remove rhel.repo to avoid dnf being confused
when building the containers the initial `dnf upgrade` will download
content from the latest nightly trees which turns the container into a
Beta system and subsequent `dnf isntall` gets confused!
2021-07-29 11:19:33 +02:00
Christian Kellner
c282b9b1f0 test: replace docker.io with fedora's registry
In order to avoid running into docker.io's new download limit,
use the container directly from registry.fedoraproject.org.
2020-11-22 23:53:38 +01:00
Christian Kellner
8705c0aa68 test/container: ensure koji plugin paths exist
When using the local plugin, ensure the destination plugin path
exists before copying, otherwise it will fail.
2020-11-19 11:22:54 +00:00
Christian Kellner
c826db38e7 test: match container version to host
Instead of just using the "latest" container everywhere, which will
change every time a new release is made, add a build argument to
specify the version and then match that version to the host in all
the build scripts. This will make it possible to use the tests for
gating, and ensure that we test the plugins on the OS version that
is targeted.
2020-11-19 11:22:54 +00:00
Christian Kellner
d60dd9f362 test: make hub container self contained
Instead of building on the existing quay.io/osbuild/koji:v1, and
then replacing a lot of it (entry point), move the packages and
the dnf.conf change over from the former base and then directly
depend on Fedora. This gives us more control, especially over
what Fedora version is being used.
2020-11-19 11:22:54 +00:00
Lars Karlitski
16f762c2ed test: move to koji-osbuild-tests package
This is similar to how other osbuild packages are testing: everything
that's needed for testing is included in the tests package or a
dependency of it. The test runner then runs every executable in
/usr/libexec/tests/<packagename>. This gives a simple test API to
projects depending on this package (notably osbuild-composer).

The local development workflow described in HACKING.md is meant to
continue to work. To ensure this, all relevant scripts gained a
TEST_DATA variable, which defaults to `./test`, but is set from $1 to
the installed path from integration.sh.
2020-11-19 09:28:28 +01:00
Christian Kellner
630d09f6c4 ci: generate koji certs with SAN in make-certs.sh
Generate the certificate to be used for koji in make-certs.sh by
the same CA that also generates the composer and client certs.
Create a single certificate that uses the SubjectAltName (SAN)
extension to cover two domains: localhost, org.osbuild.koji.koji,
which previously was done via two separate certificates; this is
the legacy usage which stopped working with go 1.15 (see previous
commit). As a consequence the apache config is modified to use
only one virtual host with a ServerAlias directive.
2020-11-12 13:13:55 +01:00
Christian Kellner
6f439dc34f ci: rework ssl cert generation (SAN usage)
Rework the generation of certificates, in order to make use of
the SubjectAltName (SAN) extension, that is required for modern
usage of TLS (see RFC 2818, or [1]) and now enforced by default
for go version 1.15[2] (Fedora 33). For this a different config
file is used, originally written by Lars, and assign SANs to
the server and client certificates. Additionally, the correct
extensions are used for each of those, so that their usage is
limited to the server or client use case. The client certificate
is renamed from "worker" to "client".
The lifetime of the certificates is increased, as a side effect of
the new config file.

[1] https://github.com/urllib3/urllib3/issues/497
[2] https://golang.org/doc/go1.15#commonname

Co-authored-by: Lars Karlitski <lars@karlitski.net>
2020-11-12 13:13:55 +01:00
Christian Kellner
a37fe00b05 container: fix spelling in hub/kojiweb.conf
Found by codespell.
2020-11-03 11:31:29 +01:00
Christian Kellner
aa8513c20d test: move container/ into test/
Move the container directory, containing the container definitions
for all the test containers, to test/, where all the other test-
related files are located (with the exception of `Schutzbot`).
Use `test/build-container.sh` to build the container, instead of
replicating that in `test-integration.sh`.
2020-09-29 21:40:25 +01:00