Commit graph

1551 commits

Author SHA1 Message Date
Lars Karlitski
b3c7548697 weldr: rename C{Waiting,Running,Finished,Failed}
Use full word to make clear what is meant.
2020-11-09 14:17:19 +01:00
Lars Karlitski
bcd57a77e2 weldr: move common.ComposeState to weldr
ComposeState is only used by the weldr API.

Drop the JSON marshaller and unmarshaller, because ComposeState is not
used in an JSON-exported field anymore.
2020-11-09 14:17:19 +01:00
Lars Karlitski
669b612d96 worker: remove State from JobStatus
This state is specific to weldr. Previous commits removed it from the
other APIs, because they use different values.

Move the conversion into the weldr API.
2020-11-09 14:17:19 +01:00
Lars Karlitski
7441012e62 kojiapi: don't rely on common.State
This is similar to the previous commit, which did this change in
package cloudapi.

Use constants instead of string literals for compose status, and derive
the status from worker.JobStatus directly, instead of via common.State.
2020-11-09 14:17:19 +01:00
Lars Karlitski
31f4d9efe8 cloudapi: return statuses as specified in openapi spec
Don't use common.State anymore, because it has different values from
what's defined in openapi.yml. It makes sense to have these strings
defined in the same package as the spec — ideally, the code generator
would make them for us.

While at it, add a "running" status.

Fix the api.sh test to use these new statuses. Thanks to Ondřej Budai
for an additional fix there.
2020-11-09 14:17:19 +01:00
Lars Karlitski
f8c640c7ef cloudapi: rename composeId → jobId
It's the id from the job.
2020-11-09 14:17:19 +01:00
Ondřej Budai
1f87958681 test: don't install epel in test cases
We don't install any packages in test cases anymore, therefore we don't need
to install EPEL there.

A slightly different explanation:
osbuild-composer-tests depends on packages from EPEL on RHEL. Therefore, you
cannot run the test cases without EPEL installed. Therefore, there's no
point in installing EPEL there.
2020-11-09 12:49:50 +01:00
Ondřej Budai
3753a3b2d0 koji/test: use our quay mirror of the postgres container
docker.io has recently introduced a rate limiting on container pulls causing
the koji test to fail quite often.

To fix this issue, I created our own postgress mirror[1]. This commit switches
the Koji test to use it. Note that this change bumps the postgres version from
12 to 13.

[1]: 7db3c6802e
2020-11-09 11:10:07 +01:00
Ondřej Budai
1da61a4338 23
Release osbuild-composer version 23.
2020-11-06 00:26:04 +01: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
Ondřej Budai
3d9c5692f5 spec: make tests require openssl
Fedora 33 doesn't ship openssl by default now so we need to require it
explicitly.
2020-11-05 13:48:48 +01:00
Ondřej Budai
19271a542b test/auth: rework the test to use the new openssl setup
Previous commits introduces a new way to generate all X.509 certificates
needed for testing. This commit reuses the same method for auth tests.

This has two benefits:

1) The new code generates certificates with Subject Alternative Name which
   means we can use it on systems with Go 1.15 (Fedora 33, RHEL 8.4).

2) The new code generates much saner certificates.
2020-11-05 13:48:48 +01:00
Ondřej Budai
90aabfa8c8 test/auth: extract certificate code
Not a functional change, just cleaning up
2020-11-05 13:48:48 +01:00
Ondřej Budai
3583399f4e test/koji: use the same X.509 generation logic as for other purposes
There's no reason to have 2 CAs and 2 places where we generate certificates,
this commit merges them together.
2020-11-05 13:48:48 +01:00
Ondřej Budai
765f599753 test: generate certificates on fly instead of shipping them in the test RPM
The certificate generation is based on work by Lars Karlitski in our osbuild
CA. The server and client certs now contains Subject Alternative Name making
Python's request module and Go 1.15 happy (they deprecated certificates
without SAN).

Several reasons why we want to switch to the certificate generation:

1) The pre-generated certificates are not documented. If someone wants
   to inspect them, he must know the right openssl incantation. This way,
   you are able to see what's inside the certificates in a plain text.

2) The pre-generated certificates are going to expire at one point and
   someone will be surprised.

3) Shipping private keys in RPMs is iffy. I know, it's just for testing but
   still...

4) Auth tests are generating their own certificates. To achieve consistency,
   we have two options:

   a) Ship also all certificates for auth tests. That's extra 8 ones or
      something like that.

   b) Generate all certificates on fly. This commit does that.

5) The setup introduced by this commit is very similar to the one in our CA
   making the test environment very similar to what's running in production.

tl;dr: I think this is a good step forward.
2020-11-05 13:48:48 +01:00
Ondřej Budai
073f9dc79a test/koji: move the koji test to schutzbot
The Koji test in Github actions was always a bit quick and dirty solution.
I think it's much nicer solution to run it on Schutzbot.

Therefore, this commit moves the koji_test.go to a new osbuild-koji-tests
executable. This new test isn't run in the base test suite as one would
anticipate but inside the koji.sh test. This is needed because
osbuild-koji-tests requires a running koji instance. This might change
in the future but I think it works for now.
2020-11-02 19:59:28 +01:00
Ondřej Budai
2dc0ecec73 koji: mark the osbuild version CGImport metadata as TODO
So we don't forget. Also, the version is changed to 0 so it's clear that
it is just a placeholder because osbuild 0 was never released.
2020-10-27 19:01:30 +00:00
Ondřej Budai
353a65356c koji: add signature to the CGImport metadata components
As suggested by Brew maintainers Tomáš Kopeček and Lubomír Sedlář.
2020-10-27 19:01:30 +00:00
Ondřej Budai
83746c5f13 osbuild/rpm: add sigpgp and siggpg keys to the metadata
This was introduced in osbuild 23, so we also need to bump the dependency
in the spec file and also the submodule.

The test is also modified and a typo in its name is fixed.
2020-10-27 19:01:30 +00:00
Ondřej Budai
befeef34a5 koji: use nvra as the filename for images
We have the same thing for AWS. The AWS target also specifies under what name
should be the image available in EC2.

As requested by Brew maintainers Tomáš Kopeček and Lubomír Sedlář.
2020-10-27 19:01:30 +00:00
Ondřej Budai
b2ed59c385 koji: use none container arch in CGImport metadata
osbuild runs directly on the host, there's no intermediate container,
therefore we should set the container type to none.

As suggested by Brew maintainers Tomáš Kopeček and Lubomír Sedlář.
2020-10-27 19:01:30 +00:00
Ondřej Budai
a0832d22e0 koji: use the host arch as the buildroot and image arch in CGImport metadata
As suggested by brew maintainers Tomáš Kopeček and Lubomír Sedlář.
2020-10-27 19:01:30 +00:00
Ondřej Budai
c64d46416e koji: use the host name from /etc/redhat-release in CGImport metadata
As suggested by Brew maintainers Tomáš Kopeček and Lubomír Sedlář.
2020-10-27 19:01:30 +00:00
Ondřej Budai
3480fe3093 koji: use typeinfo in CGImport metadata instead of the legacy format
From Koji Content Generator Metadata[1]:

"maven, win, or image: Legacy build type names which appear at this level
instead of inside typeinfo."

=> see, it's legacy

"typeinfo: A map whose entries are the names of the build types used for
this build, which are free form maps containing type-specific information
for this build."

=> struct{} is used for typeinfo.image because the docs says it should contain
"a free form map", null apparently isn't an option.

[1]: https://docs.pagure.org/koji/content_generator_metadata/

As suggested by the Brew maintainers Tomáš Kopeček and Lubomír Sedlář.
2020-10-27 19:01:30 +00:00
Xiaofeng Wang
f28e860e69 test: Add greenboot testing 2020-10-27 13:19:13 +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
Ondřej Budai
b91a63c0ad koji: fix converting rpm stage metadata to koji components
This commit adds a missing pointer and a test to verify that the conversion
is indeed fixed.
2020-10-21 11:40:01 +02:00
Ondřej Budai
a2e84bc0ac koji: fix a typo in json tag
According to the content generator metadata documentation[1], the field should
be named components.

[1]: https://docs.pagure.org/koji/content_generator_metadata/
2020-10-21 11:40:01 +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
8fd93c0d7c test/ca: drop left-over file
This was meant to have moved to `test/data/ca`.
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
Lars Karlitski
fbc93f7f87 Add DEPLOYING.md
Document how to spin up virtual machine deployments using the
tools/deploy-* scripts.
2020-10-20 15:43:30 +02:00
Lars Karlitski
c2ed3fc1b3 tools: add deploy-openstack
Similar to deploy-qemu, but deploys into an OpenStack cluster. It uses
the same logic for user-data.
2020-10-20 15:43:30 +02:00
Lars Karlitski
34e61491b0 HACKING.md: improve link 2020-10-20 15:43:30 +02:00
Ondřej Budai
b800860a30 spec: remove executable bit from certificates
Trust me, it's not very useful.
2020-10-20 13:46:48 +02:00
Ondřej Budai
baea7ac7ee docs/HACKING: add a note about how to grow the image
Yesterday, I spent more hours than I would like to admit debugging tests that
was failing because the Fedora cloud base image has only 4 GB disk space.

This commit adds a note for the future me.
2020-10-20 11:07:48 +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
Ondřej Budai
df464b0edf 22
Release osbuild-composer version 22.
2020-10-16 15:51:26 +02:00
Ondřej Budai
f43cc695ae spec: remove the old spec file
We decided to stop releasing into Fedora 31 therefore we don't need the old
spec file anyway.
2020-10-16 15:51:26 +02:00
Lars Karlitski
0f70edb48e osbuild-auth-tests: print output from openssl
This helps debugging certificate errors, because it prints
configuration on success and what went wrong on errors.
2020-10-16 09:37:04 +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