Commit graph

3120 commits

Author SHA1 Message Date
Gianluca Zuccarelli
3fa8ab8cbc stages/autotailor: fix stage schema
There was a small mistake in the schema since either one of
`new_profile` or `tailored_profile_id` is required. This commit fixes
this and updates the tests to check for this case.
2024-07-25 11:56:07 +02:00
Tomáš Hozza
5bf252a2c1 Test/manifests: start testing on el10.0-nightly
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-07-24 12:24:43 +02:00
Tomáš Hozza
1c086fd328 Test/manifests: start testing on c10s
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-07-24 12:24:43 +02:00
Roberto Majadas
ac7379488c mpp: Allow container-storage image resolution
This commit allows to the user to define the "container-transport"
variable when they are defining a container image to be resolved by the
osbuild-mpp tool. When the user defines the "container-storage" as
"container-transport" osbuild-mpp will look for the image in the local
container-storage.

Signed-off-by: Roberto Majadas <rmajadas@redhat.com>
2024-07-23 16:01:33 +02:00
Tomáš Hozza
df83c62920 Mockbuild: workaround a SELinux policy issue on c10s.
SELinux policy forbids systemd-machined from creating a varlink socket,
which it does since v256. This makes it fail to start. Subsequently,
mock fails to build the RPM, because it uses systemd-nspawn as an
isolation and it fails to register the machine with systemd-machined.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-07-19 09:27:30 +02:00
Tomáš Hozza
dcc08d8bd4 CI: build RPMs for RHEL-10.0-nightly
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-07-19 09:27:30 +02:00
Tomáš Hozza
71c01da734 Schutzfile: add el10.0 repo snapshots
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-07-19 09:27:30 +02:00
Tomáš Hozza
3959de8a19 mockbuild.sh: temporarily base missing el10 mock template on el9
There is no RHEL-10 mock template yet. Let's base it on RHEL-9 template
with a few tweaks.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-07-19 09:27:30 +02:00
Gianluca Zuccarelli
cca6668b42 test/oscap.autotailor: json profile id shadowing 2024-07-17 13:14:48 +02:00
Gianluca Zuccarelli
a87b1ba852 test/oscap: autotailor json schema validation
Add basic schema validation unit test for the JSON autotailor options.
2024-07-17 13:14:48 +02:00
Gianluca Zuccarelli
92bb161501 stages/oscap.autotailor: make profile id required
According to `autotailor(8)` arguments passed in via the cli take
precedence over the JSON tailoring file contents.

Make the `new_profile` a required field for the json tailoring too and
pass it as an option to the `autotailor` command. This approach has some
trade-offs. It allows us to maintain the explicitness of the manifest
that is consumed by `osbuild`. The downside is that it will override the
profile id that is set by the user in the JSON tailoring file.
2024-07-17 13:14:48 +02:00
Gianluca Zuccarelli
2a28acbc85 stages/oscap.autotailor: rename new_profile
Rename the `new_profile` option to `tailoring_profile_id` for clarity.
This also ensures that the change is backwards compatible by falling
back to the `new_profile` option if that was set instead of the
`tailoring_profile` id option.
2024-07-17 13:14:48 +02:00
Michael Vogt
16667ef260 sources(curl): error if curl exists 0 but there are downloads left
As part of the investigation of the CI failure in
https://github.com/osbuild/osbuild-composer/pull/4247
we noticed that curl can return a return_code of `0` even
when it did not downloaded all the urls in a `--config` provided
file. This seems to be curl version dependent, I had a hard
time writing a test-case with the real curl (8.6.0) that
reproduces this so I went with mocking it. We definietly saw
this failure with the centos 9 version (7.76).

Our current code is buggy and assumes that the exit status
of curl is always non-zero if any download fails but that is
only the case when `--fail-early` is used.

The extra paranoia will not hurt even when relying on the
exit code of curl is fixed.
2024-07-17 11:39:35 +02:00
schutzbot
2b2fec85b2 Post release version bump
[skip ci]
2024-07-17 08:16:09 +00:00
Alexander Todorov
33fda9ba50 Update centos-stream-10 repo snapshots to 20240701 2024-07-16 11:30:13 +02:00
Alexander Todorov
207648549c There is no EPEL for EL10 yet so use a custom repository 2024-07-16 11:30:13 +02:00
Alexander Todorov
60d4f56b54 Use CentOS-Stream-10-20240703.2 runner images 2024-07-16 11:30:13 +02:00
Alexander Todorov
3bbf05243c Start building RPMs on CentOS Stream 10 for testing
Related: COMPOSER-2226
2024-07-16 11:30:13 +02:00
Tomáš Hozza
143677f5d9 Tests: force checkout manifest-db
Manifest tests on Fedora 39 sometimes fail, because checking out the
specific manifest-db commit fails with:

"error: The following untracked working tree files would be
overwritten by checkout"

Use --force when checking out the ref, which will hopefully solve any
error like this.

[1] https://gitlab.com/redhat/services/products/image-builder/ci/osbuild/-/jobs/7317097983

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-07-15 11:06:10 +02:00
Gianluca Zuccarelli
24c26e7787 stages/oscap.remediation: small import adjustment
This is a small adjustment to how the `osbuild.util.mnt.mount` fuction
is imported. While adding unit tests, the tests failed when trying to
patch the function, this commit fixes the issue.
2024-07-11 12:26:13 +02:00
Gianluca Zuccarelli
a1beb4d295 stages/oscap.remediation: setup env helper
Add a small helper function to setup the mountpoints and symlink for the
stage. This will help in making the stage easier to test.
2024-07-11 12:26:13 +02:00
Michael Vogt
9bef57d5a6 sources(curl): disable curl --parallel by default
Disable `curl --parallel` by default until the failure in
https://github.com/osbuild/osbuild-composer/pull/4247

is fully understood. It can be enabled via the environment:
```
OSBUILD_SOURCES_CURL_USE_PARALLEL=1
```
in the osbuild-composer test.
2024-07-08 18:00:59 +02:00
Michael Vogt
4697a3fb84 sources: do not use %{json} when generating curl output
We cannot use `curl --write-out %{json}` because older curl
(7.76 from RHEL9/Centos9) will write `{"http_connect":000}`
which python cannot parse.
2024-07-04 11:53:40 +02:00
Michael Vogt
018c15aae8 sources: run all tests for curl with both old and new curl
To ensure there are no regressions with the old curl make
sure to run all tests that fetch_all() with both old and
new curl.
2024-07-04 11:53:40 +02:00
Michael Vogt
0d3a153c78 sources: add new _fetch_all_new_curl() helper
When using a modern curl we can download download multiple urls
in parallel which avoids connection setup overhead and is generally
more efficient. Use when it's detected.

TODO: ensure both old and new curl are tested automatically via
the testsuite.
2024-07-04 11:53:40 +02:00
Michael Vogt
974c8adff9 source: add helper to detect if curl parallel download is available
Modern curl (7.68+) has a --parallel option that will download
multiple sources in parallel. This commit adds detection for this
feature as it is only available after RHEL 8.

In addition we need some more feature to properly support --parallel,
i.e. `--write-out` with json and exitcode options. This bumps the
requirements to 7.75+ which is still fine, centos9/RHEL9 have
7.76.
2024-07-04 11:53:40 +02:00
Michael Vogt
d20713d7af curl: add gen_curl_download_config() and use in download
Instead of passing the url and options on the commandline this
commit moves it into a config file. This is not useful just yet
but it will be once we download multiple urls per curl instance.
2024-07-04 11:53:40 +02:00
Nikita Dubrovskii
cb978d3c72 stages: add stage for creating dm-verity partitions
Co-authored-by: Michael Vogt <michael.vogt@gmail.com>
2024-07-03 16:54:32 +02:00
schutzbot
8507b32a87 Post release version bump
[skip ci]
2024-07-03 08:16:19 +00:00
Sanne Raymaekers
2e5a9335c9 sources/curl: use --user-agent option to set the user-agent
Setting the user-agent using `--header` is broken in combination with
`--location`, `--proxy`, and an https endpoint which redirects. The
user-agent sent to the proxy changes after the client is redirected,
tripping up proxies.

For more information see https://issues.redhat.com/browse/RHEL-45364
2024-07-02 16:15:56 +02:00
Tomáš Hozza
8db6b8985a schutzbot/mockbuild.sh: let mock bootstrap chroot
Don't instruct mock to not bootstrap the chroot. This is making builds
to fail on F40 due to DNF5. The error message suggests to bootstrap
chroot.

Example:
https://gitlab.com/redhat/services/products/image-builder/ci/osbuild/-/jobs/7239614060#L1363

Note that e.g. osbuild-composer does not specify the
--no-bootstrap-chroot option either.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-07-02 09:46:45 +02:00
Tomáš Hozza
4c806cbe34 Schutzfile: update Fedora repo overrides
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-07-02 09:46:45 +02:00
Tomáš Hozza
cdb6c6711a Schutzfile: remove repo overrides for GA RHEL 9.4 and 8.10
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-07-02 09:46:45 +02:00
Tomáš Hozza
897a5ed065 Gitlab CI: update RHEL runners
Update RHEL runners to the same versions that correspond to the actual
state of which release is currently GA and which is in development
(nightly). Specifically, run jobs only on:

 - RHEL-8.10 GA
 - RHEL-9.4 GA
 - RHEL-9.5 nightly

 This is the same set of RHEL workers, as used by 'manifest-db'

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-07-02 09:46:45 +02:00
Tomáš Hozza
ae33fe4e65 Schutzbot: update terraform ref
Update to the latest 'main' HEAD, so that all the latest RHEL GA runners
are available.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-07-02 09:46:45 +02:00
Tomáš Hozza
79ab1c2784 Schutzfile: update manifest-db ref
Update manifest-db ref to the latest one. This should solve the problem
with GCP el8 repos being gone in the old manifests.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-07-02 09:46:45 +02:00
Michael Vogt
f7d56b3d7e tests: update l2hash for the fc40 move
Similar to what was explained in 2e6d49fbe this commit updates
the l2hash in test_assemblers to the new values from fc40 images.

Sadly it is hard to derive them from first principles (see the
other commit) and given that this is legacy code it is probably
fine this way.
2024-07-02 09:46:45 +02:00
Tomáš Hozza
d15ce4bb11 Test/assemblers: update manifest to use Fedora 40
Fedora 38 is EOL and unfortunately so are our F38 snapshots. Lets
update the manifest to F40.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-07-02 09:46:45 +02:00
Paweł Poławski
92e5e43794 CI: Add testing based on Centos containers
In the release loop upstream changes are merged to Centos every two
weeks. This creates a delay in error detection when new tests
being added upstream.

Running tests in Centos based containers on top of the upstream code
more frequently should speed up error detection.
2024-06-24 20:25:04 +02:00
Alexander Todorov
0b62ec08ad Update snapshots for rhel-9.5 to make them in sync with osbuild-composer
Related: COMPOSER-2227
2024-06-24 16:27:03 +02:00
schutzbot
477a164492 Post release version bump
[skip ci]
2024-06-19 08:15:53 +00:00
Florian Schüller
41f528eeb2 osbuild/monitor.py: improve naming of progress 2024-06-18 16:00:55 +02:00
Tomáš Hozza
86cd09b121 Packit: build RPMs in COPR for c10s and c9s on all arches
Newly add building of RPMs for c10s on all supported arches.
Extend the c9s config to build RPMs for all supported arches.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-06-17 11:43:40 +02:00
Gianluca Zuccarelli
faaa0bf508 tools/tree-diff: use null for timestamped files
The `tree-diff` tool is used by the `gen-stage-diff` tool to generate
the stage `diff.json` files. A few of these stages have timestamped
files that need to be edited after the tool is run to replace the
`sha256` content hash with `null` so the stage diff tests ignore these
files.

This commit updates the `tree-diff` tool to check through a list of the
files that contain timestamps and to use the `null` value rather than
the `sha256` content hash so the stage tests don't fail.
2024-06-06 15:41:49 +01:00
Gianluca Zuccarelli
8b67b02dfa test/cases: fix users stage
Since the `/etc/shadow` file contains a timestamp we need to add a
`null` value rather than a `sha256` hash to tell the diff tool to ignore
these fields. The issue is that the timestamp will always be different
meaning the tests will pass for a day, but then fail after that.
2024-06-06 14:48:32 +01:00
schutzbot
49b86f0b5a Post release version bump
[skip ci]
2024-06-05 08:15:18 +00:00
Tomáš Hozza
ab711cb630 Schutzfile: update manifest-db ref
The new ref does not contain F39 manifests, which can't be built.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-06-04 19:39:39 +02:00
Tomáš Hozza
1d0952002b Test/stages/users: fix diff.json
I'm not sure what happened, but the test case started failing on the
diff on 'main'. I didn't change anything related to this test case in my
PR. The previous changes adjusted the vars, specifically the Fedora
snapshot date used to generate the manifests, but the test passed on
it.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-06-04 19:39:39 +02:00
Tomáš Hozza
c06fda60b6 Test/stages: update udev.rules test case to not use F34
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-06-04 19:39:39 +02:00
Tomáš Hozza
7aff6c9d3c Drop testing on F37 and F38, which are EOL
F37 and F38 are EOL and repositories are no longer working. Drop
building and testing on F37 and F38.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-06-04 19:39:39 +02:00