Commit graph

80 commits

Author SHA1 Message Date
David Rheinsberg
21c7b7463c containers: add containerized osbuild-composer
Add a Dockerfile that creates a container based on Fedora with
osbuild-composer deployed. Create a suitable entrypoint that runs
osbuild-composer in the container and creates the required sockets
without systemd.

To test this, build the container via:

    docker build ./containers/osbuild-composer

Then create your certificates in /etc/osbuild-composer/. Then run
composer with something like:

    docker run --rm -v /etc/osbuild-composer:/etc/osbuild-composer <id>

(Where <id> is the container ID returned by `docker build`.)
2020-12-17 12:46:59 +01:00
Ondřej Budai
cbc9082fac tests: move the libvirt test logic out of Jenkinsfile
All tests in /usr/libexec/tests/osbuild-composer should be able to run without
any arguments. This was not a case of libvirt.sh - it required two arguments
set by some Jenkinsfile logic.

This commit moves test/cases/libvirt.sh to tools/libvirt_test.sh and extracts
the logic controlling the test case from Jenkinsfile to test/cases/libvirt.sh.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-12-02 08:44:33 +01:00
Ondřej Budai
8963613e91 tests: rename qemu test to libvirt test
This test case doesn't use qemu directly, libvirt is more appropriate name.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-12-02 08:44:33 +01:00
Ondřej Budai
648fcb395b schutzbot: enable mockbuild & subset of tests on F33 aarch64
This commit enables:

- mockbuild for F33 aarch64
- base tests for F33 aarch64
- ami image test for F33 aarch64

This is mostly a MVP - enabling more tests would require more work than I have
a capacity for right now. Still, it gives us at least some coverage for
alt-arches. Most importantly, base tests build qcow2 and image tests build ami
so we have at least some trust that image building for aarch64 works.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-12-01 08:27:44 +01:00
Ondřej Budai
953dd0f344 schutzbot: add cloud cleaner to F33 image tests
It was missed by a rebase probably.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-12-01 08:27:44 +01:00
Lars Karlitski
dcbf490189 schutzbot: add required env variable to 8.4 integration test
22c9f6a introduced a new environment variable to api.sh,
AWS_API_TEST_SHARE_ACCOUNT, but only set it in the RHEL 8 tests.

Seems like the corresponding branch was not rebased to a version which
already had those 8.4 tests:

    https://github.com/osbuild/osbuild-composer/pull/1098
2020-11-26 23:51:28 +01:00
Sanne Raymaekers
22c9f6af61 cloudapi: Share an ec2 snapshot/ami with an account 2020-11-26 13:08:18 +00: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
Jacob Kozol
4e70a291b1 test: add UEFI boot qcow 2 tests
x86_64 and aarch64 rhel 8.4 images support hybrid boot. qcow2 images are
now tested with both BIOS and UEFI boot. The Jenkinsfile now specifies
which boot type is supported when calling run_tests. For the qemu tests,
this boot type can be passed as an option so the test can boot using
UEFI.

In order to boot using uefi from a rhel machine, we must pass the --boot
uefi flag as well as tell libvirt where the variable store template is.
Since we are not testing secureboot, we must pass
nvram_template=/usr/share/edk2/ovmf/OVMF_VARS.fd to the --boot flag.
This is the location of our non-secureboot varstore template.
2020-11-19 10:36:49 +01:00
Jacob Kozol
7b40a3b38e schutzbot: add rhel 8.4 tests to jenkins pipeline
rhel 8.4 tests are added. The configs are based off of those used for
rhel 8.3. The Schutzbot Mockbuild, Base, Image, Integration, and OSTree
tests are added for 8.4. Repo overrides are added for the rhel 8.4 tests
so that the tests use rpmrepo snapshots.

The mockbuild uses the jenkins rhel84-nightly-repo credential to
override the rhel mock template's repos with rhel 8.4 nightly repos.
These repos are stored in a credential because they are internal links.

The image tests and koji tests need a special distro selector since the
rhel-8 test cases are only for rhel 8 versions less than 8.4. The rhel
8.4 tests are named with the rhel-84 pattern whereas the other rhel 8
versions have the rhel-8 pattern.

Also, instead of having only rhel-8 and rhel-8-beta repo configs for the
tests, we now have a specific repo config for each rhel release we test.
The repo is also now pulled from an rpmrepo snapshot. For whichever
distro is being tested, the approriate repo config will be copied to
/etc/osbuild-composer/repositories as rhel-8 and rhel-8-beta since this
is the naming osbuild-composer looks for. For testing purposes, the
rhel-8 and rhel-8-beta repo should be the same since eventually all rhel
releases will go from beta to not beta. The fedora repo overrides are
already done in tools/provision.sh so the rhel override is set there as
well. Currently, only rhel 8.4 requires an override.
2020-11-19 10:36:49 +01:00
Lars Karlitski
f3b56cc305 master → main 2020-11-13 14:09:01 +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
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
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
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
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
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
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
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
Alexander Todorov
2adf8e660f tests: Use aws-credentials-osbuild-image-test in CI 2020-09-30 21:58:14 +02:00
Ondřej Budai
8ccbde8591 schutzbot: run EL integration tests in PSI
We need RH internal repos which are not available in AWS.
2020-09-16 00:15:02 +01:00
Tom Gundersen
9666be2891 schutzbot: add koji integration tests
This sets up containers running koji and supporting infrastructure, and
calls the osbuild-composer-koji API to build and image and push it into
our testing instance.

koji-compose.py and various fixes by Christian Kellner.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-09-16 00:15:02 +01:00
Martin Sehnoutka
509964bede image-tests: don't use random names for CI artifacts
When using random names for artifacts like AWS snapshots, or Azure
images, it becomes hard to clean them up in case of CI failure. See this
issue for more details:
https://github.com/osbuild/osbuild-composer/issues/942

This PR introduces predictable names so that we can easily determine
which artifact belongs to which PR and therefore we can decide to wipe
all resources that are not needed any more.
2020-09-15 14:30:51 +02:00
Alexander Todorov
951e5e66b6 Shutzbot: add pipeline for RHEL nightly builds. Refs #912
Notes:
ATM will not run any actual tests b/c we want to make sure the
pipeline configuration is correct.

run_tests() will call the deploy.sh script and then do nothing
b/c of the "dummy-" prefix which doesn't match any actual tests!
2020-09-04 09:56:25 -05:00
Xiaofeng Wang
c1b0d348d6 test: Add ostree image installation and upgrade test and add a
new parallel stage for ostree test
2020-09-03 22:51:39 +01:00
Major Hayden
d5ddcbc921 ⛈ Use AWS more often for testing
Now that we've reduced how much of our PSI quota we are using so the
OpenStack boot tests will work, we need to use AWS for jobs more often.
This should allow test runs to complete a little sooner by freeing up
PSI resources for the jobs that are only able to run there.

Signed-off-by: Major Hayden <major@redhat.com>
2020-08-28 13:31:52 +02:00
Tom Gundersen
496f921eff schutzbot: don't boot-test vmdk images in libvirt
The vmdk images are meant to be imported into VMWare vCenter, not to be
booted directly.

Our image-info tests verifies that this work, they should be converted
into integration tests similar to the aws.sh script in the future.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-08-23 14:45:27 +02:00
Alexander Todorov
dcee05d8b6 Read vCenter credentials for Schutzbot & document them 2020-08-20 21:59:54 +02:00
Alexander Todorov
b136332c7f Provide OpenStack environment for image tests
in the same way this is done for Azure we read the OS credentials
and provide them as ENV variables for the test

Note: uses `psi-openstack-creds` and not `psi-openstack-clouds-yaml`
which is a yaml file.
2020-08-07 19:58:37 +02:00
Major Hayden
093117559e 🦘 Skip checkout on prepare
Checking out the code from git during the prepare step is a waste of
time and disk space since we don't need the git repository cloned there.

Signed-off-by: Major Hayden <major@redhat.com>
2020-08-02 11:17:11 +01:00
Major Hayden
fe1777102e 🏠 Keep RHEL 8 image tests internal only
The image tests for RHEL 8 still download packages from a server that is
only available inside the Red Hat network. 😢

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-30 18:15:17 +02:00
Major Hayden
484bb9a182 🐣 Use RHEL 8.3 beta content from CDN
Remove the nightly repos from the RHEL 8.3 jobs and replace them with
CDN registration for beta content.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-29 13:25:29 -05:00
Major Hayden
248db2be0e 🔐 Add OpenStack credentials for image tests
We want to deliver images directly to OpenStack during the CI tests.
Ensure the credentials are available during those tests and move them to
the proper location to be read by OpenStack tools and SDKs.

This helps with #876.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-22 20:02:12 +03:00
Major Hayden
5d902260b0 Fix post-build telegram notification
Jenkins needs to know which node to use to send the telegram
notification.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-20 10:00:41 -05:00
Major Hayden
460369b32b 💣 Notify via telegram on master CI failure
We've come a long way and we need to triage failures that occur during
CI for the master branch. This will help us find problems with CI as
well as find other issues that could show up in a customer environment.

Also, let's send a happy notification when everything goes well. 💚

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-17 13:57:30 -05:00
Major Hayden
842b665659
Improve emoji selections 2020-07-17 11:46:12 -05:00
Major Hayden
20fd6521fb 🏇🏻 Speed up pipeline with parallelism (again)
Now that we're going about multi-arch testing in a different way, we can
restore some of the old parallelism that we used to have in the pipeline
so it will finish faster.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-17 11:43:54 -05:00
Major Hayden
60aafdaaab 📤 Temporarily disable aarch64 tests
The aarch64 tests are fairly unstable right now and they need work on
out of space issues (#870) and test cases (#861).

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-17 09:24:12 -05:00
Ondřej Budai
693b4f0823 schutzbot: make image tests upload vhds to Azure
Support for uploading was already in, it's just needed to pass the right
environment variables.
2020-07-16 14:00:15 +02:00
Major Hayden
dd65cdbe03 🖼 Add image tests for aarch64
Test image builds on aarch64 for Fedora 31/32 and RHEL 8 CDN.

More work towards finishing #834.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-15 09:46:06 +02:00
Major Hayden
f2775a39b4 🤦🏻‍♂️ Fix errors from pipeline restructuring
During the last PR that restructured the pipeline, some copy/paste
errors happened and RHEL8.3 lost some tests. Also, some of the log
directories for x86/aarch64 tests overlapped.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-15 09:46:06 +02:00
Major Hayden
45c159e7f8 🦾 Add aarch64 base tests; restructure stages
Add base aarch64 tests for Fedora 31/32 and RHEL 8 CDN.

Also restructure the pipeline so that a slow distro or slow architecture
won't hold up the faster-moving tests.

This helps a bit more with #834.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-14 14:25:40 +01:00
Major Hayden
b01bd49241 🤷🏻‍♂️ Allow tests to run on AWS and PSI
In #842, we verified that our tests run on AWS properly and we should
now let Jenkins decide where to run the tests since they work in both
places.

Remove the hardcoded AWS label and allow tests to run where they please.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-13 15:23:03 -05:00
Major Hayden
785bdbae30 Allow base/integration tests to run in PSI + AWS
Make it easier to handle PSI outages or those times when PSI is
overloaded with jobs by allowing base and integration tests to
run on PSI OpenStack and AWS.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-13 11:19:07 -05:00
Major Hayden
d8d1db50cd 🔨 Add aarch64 mock builds
Build osbuild/osbuild-composer packages on AWS using aarch64 instances.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-09 12:02:43 -05:00