Commit graph

69 commits

Author SHA1 Message Date
Tomáš Hozza
987da06136 deploy.sh: set network_backend to netavark in containers.conf
Add a workaround for the issue that podman falls back to the 'cni'
network backend when finding any container images in the local storage
when executed for the first time. Since we started embedding container
images in our CI runner images, this resulted in failures, because the
OS is missing some required CNI plugins. Until we somehow fix this in
osbuild, we explicitly set the network backend to 'netavark'.

This is relevant only for RHEL-9 / c9s, because Fedora since F40 and
el10 support only `netavark` backend.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-04-01 08:40:13 +02:00
Achilleas Koutsou
58d16f662f deploy: install osbuild-tools for osbuild-image-info 2025-01-31 08:22:29 +01:00
Alexander Todorov
28a6346d87 ci: Use sudo before localectl
should help resolve:

+ localectl set-locale LANG=en_US.UTF-8
Failed to issue method call: Interactive authentication required.
2023-01-10 00:28:23 +01:00
Jakub Rusz
9c3e9ff616 ci: add team ssh keys in before_script
Add the keys in before_script to make also rpbuild runners accessible as
the deploy.sh script is not being ran there.
2022-04-12 13:13:50 +02:00
Ondřej Budai
99aad294dd deploy: work around a podman bug in CS8
See the comment.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-03-21 16:45:49 +01:00
Jakub Rusz
8331af3ffd ci/nightly: report composer NVR in slack
Storing composer NVR in a file after it's installed and reporting on
Slack. Also reducing duplications of artifacts in .gitlab-ci.yml
2022-02-17 11:14:31 +01:00
Alexander Todorov
b31f61649a ci: Overwrite REPO_PATH based on the value of $NIGHTLY
Override only for osbuild-composer, not other projects

will produce different repositories/rpms for the same commit when
executed from a PR and from the scheduled pipelines. We need the
distinction b/c osbuild-composer-tests RPMs end up slightly different in
these two cases. For more info see:
https://github.com/osbuild/osbuild-composer/pull/2093#pullrequestreview-854328838
https://github.com/osbuild/osbuild-composer/pull/2093#issuecomment-1014469915
2022-02-04 23:43:43 +01:00
Alexander Todorov
8a46796cf7 ci: Don't account for SCHUTZ_OSBUILD variable
if you want to use a custom osbuild.rpm you can supply that in REPO_URL,
no?

Note: this removal of .repo files breaks building the -tests RPM from
source in downstream branches/nightlies b/c the repo is defined in
osbuild-composer.repo
2022-02-04 23:43:43 +01:00
Alexander Todorov
63bca237cf ci: Check that installed osbuild-composer RPM matches SUT 2022-02-04 23:43:43 +01:00
Jakub Rusz
14b7e92eaa tests/ci: split nightly testing based on RHEL major version
Using just the major version from the $VERSION_ID and defining new CI
variable $RHEL_MAJOR.
2021-11-16 10:46:50 +01:00
Achilleas Koutsou
aea77ed3de test: timestamp messages in test scripts
The commonly used 'greenprint' function now adds a date + timestamp to
each message for debugging and tracking the duration of segments of each
scripts.
2021-10-24 16:13:53 +01:00
Ondřej Budai
3991827f68 ci: add workaround for missing redhat.repo in EC2
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-09-24 17:03:53 +02:00
Ondřej Budai
4c5d1ae45a test: move env variables into set-env-variables helper
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-09-24 17:03:53 +02:00
Ondřej Budai
c25e58bc9d ci: assume subscribed machines
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-09-24 17:03:53 +02:00
Ondřej Budai
7c328f7fbc schutzbot: disable /tmp as tmpfs on RHEL 9
This should fix the randomly failing test. See the comment for more
information.

Fixes #1718

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-09-02 19:35:08 +02:00
Jakub Rusz
ad41022f4a tests/ci: set locale in deploy.sh
This hides warnings that are seen whenever dnf is called and also it is
no longer possible to initialize postresql database without it which is
used in base tests now.
2021-08-25 19:16:04 +02:00
Juan Abia
ee0af8b901 retry subscribing to RHN 2021-08-25 13:12:08 +02:00
Juan Abia
1e52484688 remove all rhn subscriptions before registering a new one 2021-08-24 11:53:08 +02:00
Jakub Rusz
810248fc52 ci: minor fixes for nightly testing
Updating rules for Installer and Regression testing and fixing failures
if certain variables are not set.
2021-08-20 13:21:45 +02:00
Achilleas Koutsou
c27ca818ae schutzbot/deploy.sh: dependency bug workaround 2021-07-24 15:54:00 +02:00
Ondřej Budai
3ec917062f ci: upload rpms built in RHEL 8 CDN buildroot into rhel-8-cdn directory
Let's explain how RPMs for RHEL are built:

We use a subscribed RHEL 8.x machine and mock build these on it. Mock
initializes its own buildroot based on the latest RHEL 8 CDN content, see[1].
This means that the minor version of the buildroot is independent of the minor
version of the host.

However, we currently upload RPMs to a directory whose name consists also of
the minor version of the host. Our hosts are currently running RHEL 8.3 so
the RPMs are uploaded into rhel-8.3 directory despite them being built in the
RHEL 8.4 buildroot (RHEL 8 CDN buildroot specifically). This means that
we cannot guarantee that they are installable on RHEL 8.3 which is weird.

This commit adds a special case for hosts that run on subscribed RHEL and
thus build RPMs in a buildroot constructed from RHEL CDN. These RPMs are
now uploaded into rhel-8-cdn directory. This change more accurately reflects
the way we build our RPMs and removes some confusion.

Also, we need to bump osbuild commit so we have a version that already has
the rhel-8-cdn change in it.

[1]: https://github.com/rpm-software-management/mock/blob/main/mock-core-configs/etc/mock/templates/rhel-8.tpl#L37

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-07-21 20:02:03 +02:00
Ondřej Budai
419ac4c769 ci: remove EXTRA_REPO_PATH_SEGMENT
EXTRA_REPO_PATH_SEGMENT was needed when both Jenkins and Gitlab CI
were running in parallel (so they don't override their artifacts).

Jenkins is now decommissioned so we can drop the variable.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-29 13:58:58 +02:00
Jakub Rusz
b6c579cbe3 tests: Enable use of custom osbuild-composer repo
This enables the user to specify custom REPO_URL for use during
internal RHEL build testing as ENV in scheduled pipelines.
It also gives the option to use osbuild build specified in
Schutzfile or from the nightly build repository.
2021-06-25 15:10:40 +03:00
Jakub Rusz
905c297bc7 tests: enable nightly test execution in gitlab CI
This adds several stages to the gitlab-ci.yaml file which are
triggered by a schedule specified in Gitlab->CI/CD->Schedules
2021-06-25 15:10:40 +03:00
Alexander Todorov
968e7b210f CI: Store .repo file as artifacts. Fixes #1458
Note: only store them for the Base jobs b/c these files are produced
by deploy.sh and will be the same across jobs in the same pipeline.
2021-06-15 11:43:42 +03:00
Ondřej Budai
8f91e236f8 ci/deploy: add fallback variable for GitLab
GitLab CI doesn't use GIT_COMMIT, therefore it's needed to have a fallback
to CI_COMMIT_SHA.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-04-14 09:18:06 +02:00
Ondřej Budai
d28c41b844 test: subscribe only RHEL instances
GitLab CI passes secrets to all jobs. Thus, we need to make sure that
only RHEL is being subscribed.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-04-14 09:18:06 +02:00
Ondřej Budai
5fd2ad2337 mockbuild: allow inserting an extra path segment
GitLab CI builds its own rpms and thus it must be use a different path.
This commit modifies mockbuild.sh and deploy.sh to be able to add an
extra path segment into the path so GitLab can use a different path.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-04-14 09:18:06 +02:00
Aleksandar Todorov
661b2a0be0 Schutzbot: Allow overriding internal RHEL URL
by defining the COMPOSE_URL environment variable! This will allow
testing more flavors of internal releases.

The rest is renaming files and variables to reflect the fact that
we're running tests against internal trees, not only nightlies.
2021-03-12 20:38:06 +02:00
Aleksandar Todorov
4787fce3b7 Unstash rhel8nightly repo & json files
- even if they don't exist sometimes but ignore the errors
- make the nightly repository with a higher priority
- override rhel-8*.json files so that newly built images will
  also consume the nightly content
2021-02-12 14:22:04 +01:00
Ondřej Budai
d423007482 tests: move the epel dependencies to provisioning
koji and ansible are not in RHEL repositories. Depending on them breaks RHEL
gating (see OSCI-1541): It tries to build a custom image with -tests package
in it but in the build environment there's no EPEL.

This commit makes the RPM independent from EPEL. However, we still need koji
and ansible, so the provision script now enables EPEL and installs the packages
from there. This is not nice but we have to live with that until OSCI-1541 is
solved.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-12-18 09:04:38 +01:00
Ondřej Budai
a1b730d536 tests: pre-install EPEL for koji-osbuild rev dep test on RHEL
koji-osbuild-tests depends on koji which is not available in RHEL. As we need
to get rid of EPEL from deploy.sh (see the following commit), we need a
mechanism to preinstall EPEL before koji-osbuild-tests is installed. This
commit introduces pre_install_packages to Schutzfile - a simple way to
install packages before ${PROJECT}-tests is installed.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-12-18 09:04:38 +01:00
Lars Karlitski
bbaffa33c9 Schutzfile: add koji-osbuild as dependant
Generalize deploy.sh to allow setting up reverse dependency tests. Those
need the same setup for osbuild and osbuild-composer (i.e., the ones
under test), and in addition need the -tests package of the dependant
project.

Add test runs for koji-osbuild for all operating systems in Jenkinsfile.

Use a commit in koji-osbuild for which a repository was pushed to s3 in
the right format.
2020-11-23 14:40:25 +01:00
Lars Karlitski
7ce44b6b72 schutzbot/deploy.sh: pull setup_repo into function
heredocs make control flow hard to read. Pull writing the repo file into
its own function and use it for setting up osbuild and osbuild-composer
repos.
2020-11-23 14:40:25 +01:00
Tom Gundersen
64432c706a schutzbot/mockbuild: test against osbuild in target release by default
To make sure we test against what we will release with, use osbuild from
the target distro rather than rebuilding it.

The only exception is in RHEL8.3, where we are not rebasing any longer,
but expect users who use new osbulid-composer from upstream to use it
with new osbuild from upstream too. In this case, use the RPM from
osbuild upstream, for now pinned to the same version as was in the
submodule.

This introduces a new configuration file: Schutzfile, which is meant
to contain the full test-matrix. For now it only points to the upstream
osbuild commit to add to the distro we are testing against (only relevant
for 8.3).

The submodule is now unused and is therefore removed. The produced repos
now only contain osbuild-composer, osbuild is never built as part of
osbuild-composer CI.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-11-15 14:25:50 +01:00
Lars Karlitski
4bd891be9e schutzbot: don't copy dnf repo file between stages
Now that the repository URLs are predictable, don't use Jenkins' stash
feature to pass the repo file between stages.

Instead, simply create the repo file where it is needed, in deploy.sh.
2020-11-12 09:41:36 +01:00
Tom Gundersen
ff70b269fb schutzbot: move repository snapshot definitions to the -test package
The test package should be self-contained and contain all the configuration
necessary for a known-good test run (minus secrets). This moves repo
overrides from the test orchestration into the test package.

We want all the external sources (including boot isos and repositories) to
be pinned by their content hash, and never use anything that is not strictly
defined. This moves us in the right direction, but we still have some tests
to update to use these shipped repos rather than official mirrors.

One remaining challenge is that we must make sure all our test runners have
access to the RHEL snapshots, which is not currently the case for the runners
in EC2, but a solution is in the works.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-10-23 11:33:04 +02:00
Tom Gundersen
931bd8be57 test: provision test machine from tests
Don't rely on the deployment script to install the right config or to start the
services.

This further disentangles the tests from schutzbot.
2020-10-21 09:04:13 +02:00
Tom Gundersen
d7247e2878 schutzbot/deploy: drop journald work-around
The bug this is meant to fix is not referenced atdn not explained in
comments/commit. Drop it in an effort to find out if it still applies.
2020-10-21 09:04:13 +02:00
Tom Gundersen
5fd1d3c4a2 schutzbot/deploy: re-enable weak deps
Don't differ from defaults just for the sake of speed. We still keep
the fastestmirror option enabled as that does not affect the resulting
install.
2020-10-21 09:04:13 +02:00
Tom Gundersen
1a1ecbeadb schutzbot/deploy: re-enable modular repos
We don't want to differ from standard installs unless we have to. We
prefer tests that are closer to standard installs over faster tests.
2020-10-21 09:04:13 +02: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
Lars Karlitski
8161f2fa04 schutzbot: add repositories to be used by tests
Base these on https://osbuild.org/rpmrepo.

Install those repository files when deploying in schutzbot and include
them in tools/deploy/test for local testing.

Also remove copying overrides from deploy.sh, because it copied the
wrong files. We probably want to add this back properly in the future.
2020-10-16 09:37:04 +02:00
Ondřej Budai
6a1b9f17ce test: enable epel on RHEL
I broke master by merging #1021 - ansible and koji are not in the official
RHEL repositories so we need to enable epel on RHEL to be able to get them.
2020-10-07 17:17:43 +01:00
Tom Gundersen
9e56ac9a8b schutzbot: split provision out from deploy
Deployment is specific to CI, but the provision script is needed to be
run to execute tests locally too.

This should be called from each test, rather than from deploy. For now
this change is a noop.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-10-06 13:08:26 +02:00
Tom Gundersen
805ae59151 tests: ship all tests in the -tests sub-package
No tests should be run directly from git, but should rather be installed
onto the test system using rpm and run from there. This moves towards
unifying our two types of test cases.

The new structure of is now:

`test/cmd`:   the executors, one for each test-case. This is installed
              into `/usr/libexec/test/osbuild-composer`.
`test/data`:  data and config used by the tests. This is installed into
              `/usr/share/tests/osbuild-composer`.
`schutzbot`:  configuration of the actual test run. In particular, this
              is where the distros and repositories to test against are
              configured.

This is very much still work-in-progress, and is only the first step
towards simplifying schutzbot. Apart from moving files around, this
should be a noop.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-10-06 13:08:26 +02:00
Tom Gundersen
e835c34678 test/integration: move composer configuration into composer
This is not an integration test, but configuration.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-10-06 13:08:26 +02:00
Tom Gundersen
272332e5e8 test: rename image-tests to integration
We already have something called image-tests, so this naming was
confusing. This is a collection of generic integration tests, so name
them accordingly.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-10-06 13:08:26 +02:00
Tom Gundersen
c7d993d537 scutzbot: deploy pre-generated SSL certs for testing 2020-10-06 13:08:26 +02:00
Alexander Todorov
fd311fedfd tests: Start osbuild-composer-koji.socket only if installed 2020-09-29 09:00:44 +02:00