Commit graph

151 commits

Author SHA1 Message Date
Lars Karlitski
48ee71b9af mockbuild: use mock to build source rpm
Running `make srpm` on the host can have different results from building
the SRPM in mock.

Stop using the Makefile altogether for this, which is meant for
developer convenience only. The interface is clear: a tarball generated
from `git archive` and defining the `commit` variable. Less stuff to
install on the host, too.
2020-11-17 08:56:17 +00:00
Tom Gundersen
8a5b4bbfc0 schutzbot/team-ssh-keys: add another key for myself
Got another machine, grant it access.
2020-11-15 14:25:50 +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
f3b56cc305 master → main 2020-11-13 14:09:01 +01:00
Lars Karlitski
ae17b5aa3c mockbuild: move installing dependencies down
These don't need to run when we're not building anything.
2020-11-12 09:41:36 +01:00
Lars Karlitski
ca3360c6d1 mockbuild: don't build repository when it already exists
This avoids doing unnecessary work and speeds up restarting tests.
2020-11-12 09:41:36 +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
Lars Karlitski
888e7ea910 mockbuild: don't use short commit ids
The length of these is not predictable. It depends on the shortest
unique prefix in the repository and git configuration.

Just use the full one, which also makes it easier to copy the id from
`git log` or GitHub.
2020-11-11 15:35:56 +01:00
Lars Karlitski
420ba53797 mockbuild: change repository path
Change the repository path on S3 to a more predictable one. We really
only need the name of the project (static osbuild-composer for this
repository), the name of the distro (use the same as osbuild-composer's
API for consistency) and the commit SHA.

In particular, drop the PR number / branch name. Also don't remove the
dots from version numbers. All places we're using them in (paths and
URLs) support dots.

For example, osbuild composer commit xxxxxxx for fedora-33 on x86_64
will result in this URL:

    osbuild-composer/fedora-33/x86_64/xxxxxxx
2020-11-11 15:35:56 +01:00
Lars Karlitski
acae39c905 mockbuild: move path logic into separate variable 2020-11-11 15:35:56 +01:00
Lars Karlitski
d57238869a mockbuild: remove unused variable 2020-11-11 15:35:56 +01:00
Lars Karlitski
0f3ea935ac mockbuild: remove unused logs
These logs are not preserved, just remove them.
2020-11-11 15:35:56 +01:00
Lars Karlitski
3d1d42b341 mockbuild: remove the "latest" repo
This is not used anywhere and something we want to discourage: these
repos are meant for testing, and one ought to know what one tests
against.
2020-11-11 15:35:56 +01:00
Lars Karlitski
c7b712742d mockbuild: rename POST_MERGE_SHA
Jenkins has been configured to use the latest commit on a pull request
(instead of merging to master) for a long time now. Rename the variable
to reflect that.
2020-11-11 15:35:56 +01:00
Ondřej Budai
a07783ce43 schutzbot: enable F33 testing
osbuild-composer now has support, let's fire up more VMs! Currently, F33 beta
is used in both AWS and PSI.
2020-11-11 09:52:28 +01:00
Martin Sehnoutka
1b4db3377b base_tests.sh: make the test self-contained
We claim to have self-contained test cases, but the base_tests.sh script
still requires the WORKSPACE environment variable to be set outside of
the script, which is what Jenkins does.

This patch replaces WORKSPACE with a temporary directory and modifies
Jenkinsfile to use it when collecting logs.
2020-11-10 10:44:13 +00:00
Ondřej Budai
543f1f4cce schutzbot: drop RHEL 8.3 stages
RHEL 8.3 is already GA therefore we don't need to test it anymore!
2020-11-06 00:26:04 +01:00
Ondřej Budai
cbb8640266 schutzbot: move the ostree test to RHEL 8
RHEL 8.3 is GA so we can run the ostree test here. This is a first step
to remove the RHEL 8.3 testing pipeline.

8.3 GA also ships a different version of composer-cli, therefore a slight
adjustment was needed.
2020-11-06 00:26:04 +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
Ondřej Budai
0e7a1dd407 tests: remove stray F31 occurrences
osbuild-composer doesn't support F31 anymore, this commit rips out the last
pieces.
2020-10-21 18:09:53 +01: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
3c7f61c322 test: restructure dir layout
Attempt to clarify the structure of our tests. Each test case is now
encapsulated in a script in `test/cases`. Each of these scripts should
be runnable on a pristine machine and be independent of each other. It
is up to the test-orchestractor to decide if they should be run
consequtively instance, or in parallel on separate instances. Each
script can execute several tests and call whatever helper binaries
is desired. However, each case should be assumed to always run as one.
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
Tom Gundersen
1d7df26775 schutzbot: move test scripts into the test package
`run_{base,image}_tests.sh` are osbuild-composer-specific, and should
live in the `-test` subpackage, rather than as part of the testing
infratructure.

This is not a functional change.
2020-10-21 09:04:13 +02:00
Alexander Todorov
12b8ec2f58 tests: Fail if python36 is installed. Closes #794 2020-10-19 11:21:39 +03:00
Ondřej Budai
0e511a43c4 schutzbot: remove rhel nightly pipeline
Jenkins doesn't support two pipelines in one file. We had two and it caused
an exception in Jenkins marking all builds as failed even though all stages
passed successfully.

As this pipeline isn't used for anything right now (see #976), it's safe to
delete it.

Fixes #1032
2020-10-19 09:49:50 +02:00
Lars Karlitski
0aef7ff5d5 test/cmd: add api.sh
Add an additional integration test, which builds a fedora-32 image via
the newly moved composer API.

This adds a new certificate for clients to authenticate, with
CN=client.osbuild.org.

Also stop allowing certificates with `CN=worker.osbuild.org` in the
`osbuild-composer.toml` used in tests and amend `osbuild-auth-tests` to
use `CN=client.osbuild.org` for accessing the koji API.

Heavily based on an earlier version of this test in `test/cmd/aws.sh` by
Sanne Raymaekers.
2020-10-16 09:37:04 +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
Lars Karlitski
835b556db7 distribution: deprecate osbuild-composer-koji.socket
Instead, call it osbuild-composer-api.socket, but provide a symlink for
backwards compatibility. Change `schutzbot/provision.sh` to only enable
osbuild-composer-api.socket.

In the future, this new socket is the only API socket, which provides
both the "cloud" API and the one for koji.

This means that the koji API is always enabled.
2020-10-16 09:37:04 +02:00
Martin Sehnoutka
6badebef4f schutzbot/run_cloud_cleaner: pass BRANCH_NAME instead of CHANGE_ID
CHANGE_ID is unset in master branch. Use BRANCH_NAME instead.
2020-10-14 16:58:58 +02:00
Ondřej Budai
7a2f72281e schutzbot: enable F33 mockbuild
Let's start slowly. This commit enables F33 mockbuilding in Schutzbot.
Actual testing will be enabled in a follow-up.
2020-10-14 16:44:26 +02:00
Ondřej Budai
1a69a8919b schutzbot: use s3cmd from repositories
s3cmd from pip doesn't work with Python 3.9. Fortunately, s3cmd in Fedora has
a downstream patch to fix it.

See rhbz#1884607 and https://github.com/s3tools/s3cmd/pull/1137
2020-10-14 16:44:26 +02:00
Martin Sehnoutka
6b137d0ac5 cloud-cleaner: introduce script to wipe all CI artifacts
In case the job fails completely, resources might leak. This patch
together with the one introducing predictable names for CI artifacts
will make sure we wipe all resources after each CI run.
2020-10-13 14:41:32 +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
122ab25476 test: depend on rpms rather than installing them explicitly
The -test subpackage should depend on all that it needs, and we should
never need to install anything explicitly from the test scripts.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-10-07 11:49:05 +02: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
dae0f86b35 schutzbot/repositories: use RHEL8.3 nightly rather than snapshot
Our snapshots are currently broken, so until they are fixed revert back
to using an internal RHEL nightly. We choose a slightly older one,
in the hope that it is not going to be deleted anytime soon.

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
Tom Gundersen
9d18c3bfa2 tests: rename composer-cli tests
These had the generic name osbulid-tests, rename the binary to more
closely describe what is under test: weldr API as composed by
composer-cli.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-10-06 13:08:26 +02:00
Alexander Todorov
2adf8e660f tests: Use aws-credentials-osbuild-image-test in CI 2020-09-30 21:58:14 +02:00
Alexander Todorov
b48bff75bf tests: Fail if there were no tests executed. Fix #1002 2020-09-30 21:58:14 +02:00
Ondřej Budai
e9b8b7e01f tests/image: fix sudo invocation
We need sudo arguments as a separate ones.
2020-09-30 21:58:14 +02:00
Ondřej Budai
ad969cdda7 tests/image: fix the selector
Using wildcard in quotes doesn't trigger shell expansion, therefore this
commit moves the wildcard out of the quotes
2020-09-30 21:58:14 +02:00
Alexander Todorov
fd311fedfd tests: Start osbuild-composer-koji.socket only if installed 2020-09-29 09:00:44 +02:00