Commit graph

4803 commits

Author SHA1 Message Date
schutzbot
8982ab2018 Post release version bump
[skip ci]
2022-08-24 08:26:57 +00:00
Brian C. Lane
8a67406873 api_test: Use badpackage1 request for FetchError request
This returns the FetchError response setup in mocks/dnfjson for the
search command.
2022-08-23 22:47:46 +01:00
Brian C. Lane
3c0fa94c69 mock-dnf-json: Add support for search command
The search response from mocks/dnfjson is a map of responses indexed by the
comma-separated list of packages and globs being requested. Add support
for this.
2022-08-23 22:47:46 +01:00
Brian C. Lane
760be50069 mocks/dnfjson: Add mock support for the search command
The search command is more complicated than depsolve and dump. It needs
to return results based on the requested package names and globs.

Add a number of mock responses for the new search command, including
search results, all packages, and error responses that are triggered by
using special package names: nonexistingpkg, badpackage1, baddepsolve.
2022-08-23 22:47:46 +01:00
Brian C. Lane
60986380c4 weldr: Use the SearchMetadata function for globs
Instead of fetching all available packages from dnf-json and then
searching the results this uses SearchMetadata when a package name or
glob is passed to the API. It only uses FetchMetadata when fetching
the full list of packages.

This also fixes a bug where the error response to a projects/info
request used the id of 'ModulesError'. It now uses 'ProjectsError'.
2022-08-23 22:47:46 +01:00
Brian C. Lane
a751dfe71c dnfjson: Add the search support to the Solver
Pass the list of package names or globs to dnf-json and return the
results.
2022-08-23 22:47:46 +01:00
Brian C. Lane
2c3cb56cb3 dnf-json: Add search command
Use the DNF query API
(https://dnf.readthedocs.io/en/latest/api_queries.html) to quickly
return results matching a glob pattern. Multiple package glob results
are combined into a single response.

This adds a search dict to the arguments. 'packages' is a list of package
names or globs to search for.
An optional 'latest' boolean will return only the latest NEVRA instead
of all matching builds in the metadata.

eg.

    "search": {
        "latest": false,
        "packages": ["tmux", "vim*", "*ssh*"]
    },
2022-08-23 22:47:46 +01:00
Gianluca Zuccarelli
c264ce53cd distro: add oscap packages to image
Since the oscap remediation stage in osbuild runs
the oscap package in `chroot`, it is necessary to
install the `openscap-scanner` package to the image
itself rather than the build root.
2022-08-23 18:06:15 +02:00
Jakub Rusz
de6b8e8f5b Update terraform SHA with more aarch64 runner options
This commit adds the option to also provision c6g.large machines in
addition to c7g.large machines in AWS.
2022-08-23 15:31:47 +03:00
Jakub Rusz
e9a1e66cbe distro/rhel-9: remove nvmf dracut module from image-installer
The module is not present in official RHEL-9.1 ISO image and it is
causing boot issues when used with newer content. HTTP boot is
not affected by this change and works as expected.
2022-08-22 10:11:48 +02:00
Alexander Todorov
65ef1b2e78 Don't special case nightly repository names for Satellite regression tests
this is no longer needed b/c the nightly CI jobs are now using the same
json definitions as the regular CI jobs, just changing baseurl. See
previous commit.
2022-08-18 14:00:16 +03:00
Alexander Todorov
f451e0291a Modify repositories/rhel-xy.json file before testing nightly compose
Fixes #1318

- uses a wildcard match for sed in order to replace only lines which
  match and keep the rest intact
2022-08-18 14:00:16 +03:00
Alexander Todorov
e902e1f410 Revert "provision.sh: don't do any verification"
This reverts commit faf911cd21.
2022-08-18 14:00:16 +03:00
Tomas Hozza
0875c3491f distro/rhel9: disable GPG check for Google repos in gce* images
Having the GPG check enabled for Google repos in `gce*` images will make
DNF try to import the relevant keys when upgrading, downgrading or
installing any packages from the repo. However due to Google still using
SHA-1 for GPG keys used to sign their RPMs, importing it will make any
transaction that includes such RPM to fail.

Disabling the GPG check will ensure that DNF won't attempt to import
Google GPG keys.

Related to https://issuetracker.google.com/issues/223626963
2022-08-17 11:59:39 +02:00
Tomas Hozza
55e78e195f distro/rhel9: do not define Google Cloud SDK repo in gce* images
The repo is not needed any more, because the Google Cloud SDK is not
installed in the images by default. If anyone wants to install the SDK,
they can add the appropriate repo definition.
2022-08-17 11:59:39 +02:00
Tomas Hozza
debd6d4342 distro/rhel8: do not define Google Cloud SDK repo in gce* images
The repo is not needed any more, because the Google Cloud SDK is not
installed in the images by default. If anyone wants to install the SDK,
they can add the appropriate repo definition.
2022-08-17 11:59:39 +02:00
Tomas Hozza
5f48aaa212 distro/rhel9: don't install google-cloud-sdk in any gce* images
The Google SDK ships pre-compiled binaries. It is undesirable to install
it by default in `gce` and `gce-rhui` in its current shape. Also not
installing it does not anyhow affect the RHEL integration as the guest
OS in GCP.
2022-08-17 11:59:39 +02:00
Tomas Hozza
cf92c1f23a distro/rhel8: don't install google-cloud-sdk in any gce* images
The Google SDK ships pre-compiled binaries. It is undesirable to install
it by default in `gce` and `gce-rhui` in its current shape. Also not
installing it does not anyhow affect the RHEL integration as the guest
OS in GCP.
2022-08-17 11:59:39 +02:00
Tomas Hozza
735c6ec9c3 generate-all-test-cases: make output default to test/data/manifests 2022-08-17 11:59:39 +02:00
Tomas Hozza
a2c46bdf3a distro: rename rhel90 -> rhel9
Make the package and directory naming consistent with RHEL-7 and RHEL-8.
2022-08-17 11:59:39 +02:00
Alexander Todorov
239e8ccbc0 ci: Update runner to RHEL 9.1 to enable test in nightly pipeline 2022-08-16 18:26:28 +03:00
Xiaofeng Wang
53d4d7f284 test: Improvements for container embedding Edge test 2022-08-12 10:18:29 +03:00
Juan Abia
6e771c97fc test/cases: update cloud-image-val in aws.sh
update CIV to latests realease: v0.2.2
2022-08-11 18:17:28 +02:00
Alexander Todorov
8ae8ba9fae tests: Add comment to make it more obvious what's happening 2022-08-11 13:12:55 +02:00
Alexander Todorov
d3dde77a6f tests: Make Satellite regression tests to use the SUT 2022-08-10 16:33:34 +03:00
Alexander Todorov
860b122f2c tests: Remove useless JSON file overrides
See comment
https://github.com/osbuild/osbuild-composer/pull/2881/files#r940065803

for explanation why
2022-08-10 16:33:34 +03:00
schutzbot
df22e8b686 Post release version bump
[skip ci]
2022-08-10 08:26:51 +00:00
Christian Kellner
dd0be9e439 disk/partition_table: extract customization application into method
Extract the application into a utility method on `PartitionTable`.
In order for it to be usable for the first and second pass it does
take a `create` argument that controlls whether new partitons will
be created or return.
2022-08-08 18:05:05 +02:00
Christian Kellner
b562d144ca distro/*: allow /boot to be customized
Since the LVM support was added to all distros, our disk
related code is adaptive, i.e. we will set the correct BLS
and grub2 prefix if there a `boot` partiton is present in
the layout after all customizations happen, which includes
LVMification.
One thing that was not yet fully working was layouts that
do not yet have a `/boot` partition but allow LVMification.
In that case `NewPartitionTable` and if `/boot` was the
first (or only) customization, would LVMify the partition
which in turn would create the `/boot` partition; but after
`newPT.ensureLVM()` the call to `newPT.createFilesystem`
with `/boot` would try to create another `/boot` mountpoint.
In order to deal with this situation correctly we are now
using a two phase approach: 1) enlarge existing mountpoints
and collect new ones. 2) if there are new ones and LMVify
was allowed, switch to LVM layout. Do a second pass and now
create or enlarge existing partitions, handling `/boot` in
the process.
2022-08-08 18:05:05 +02:00
Christian Kellner
3c3f1b4969 disk: rename MountpointAllowList -> MountpointPolicies
Now that the mountpoint allow is is actually a trie of path
policies we should rename it to better refelct its contents.
2022-08-08 18:05:05 +02:00
Christian Kellner
de52e024a0 disk: use path policy for mount point checking
Replace the simple allow list of paths with the more sophisticated
path policies. It enables us to e.g. allow one path but not any
sub-path. This will be useful for `/boot` where we want to allow
its customization but not any sub-path because that might actually
break booting.
2022-08-08 18:05:05 +02:00
Christian Kellner
9523694879 disk: new path policies struct and methods
Build a new path policy struct, ased on the new path trie struct.
It is designed to be able to store policies for paths. A Check
method can then be used to look up the policy for a given path
based on the defined policies.
2022-08-08 18:05:05 +02:00
Christian Kellner
00555722b2 disk: add generic path trie implementation
Add a simple implementation of a path trie structure that can be
used to look up assoicated data for any given path. The constructor
will build the trie from a dict of paths to associated data. Later
modification is currently not support. Add tests for it creation
and lookup.
2022-08-08 18:05:05 +02:00
Christian Kellner
1ca2efe6cf distro/*: move mount point allow list to disk
All distributions have exactly the same list of allowed mountpoint
customization points. Therefore move it to `disk` and share it
between all distros.
2022-08-08 18:05:05 +02:00
Christian Kellner
2b03a839f0 disk: move mount point checking to central location
Instead of all distribution implementing their own mount point
checking code, we de-duplicate it and move it to `disk`.
2022-08-08 18:05:05 +02:00
Jakub Rusz
13e287733a tests/ostree-ng: use /var/tmp/ as TMPDIR for mkkiso
Fedora is using 'tmpfs' as /tmp and that is based on the size of RAM.
That is not enough in case of medium Openstack machines. Changin to use
/var/tmp which is backed by a drive resolves this.
2022-08-08 11:32:03 +02:00
Jakub Rusz
738e6877e0 tests/ostree-rebase: split to uefi and bios
This test used to spawn two VMs at the same time which requires more
memory than the Openstack ci medium runner can provide. We want to be
using only medium runners so this change is necesasry to allow that.
2022-08-08 11:32:03 +02:00
Jakub Rusz
490a872bfc CI: add 1 retry
There are several reasons a CI job can fail, mostly infra issue,
openstack issue, other random issues which are not test failures and so
restarting once in case of failure should reduce the ammount of time
people are investigating these test unrelated failures. Also add
interruptibble:true to init to make it actually work for the rest of the
jobs.
2022-08-08 11:32:03 +02:00
Jakub Rusz
53458ed400 CI: use only medium runners on Openstack
The execution time seems to be 10% longer at worst and this will allow
us to safely increase the number of concurent Openstack jobs by 75 %
(from 40 to 70)
2022-08-08 11:32:03 +02:00
Tomas Hozza
2d13050ba8 test/oscap.sh: provision SUT for the on-premise scenario
The PR#2695 [1] was not rebased on top of PR#2853 [2]. As a result, the
`oscap.sh` test case is provisioning the SUT in a wrong way, which makes
it fail all the time.

Provision the SUT in the test case for the on-premise scenario, since it
uses Weldr API to interact with osbuild-composer.

[1] https://github.com/osbuild/osbuild-composer/pull/2695
[2] https://github.com/osbuild/osbuild-composer/pull/2853
2022-08-05 16:15:24 +02:00
Tomas Hozza
24c52c8d69 osbuild-mock-openid-provider: support client_credentials grant type
Extend the implementation of mock openid server to take the `grant_type`
into consideration for the `/token` endpoint.

In addition to the previously supported `refresh_topen`, the
implementation now supports also `client_credentials`.

This is necessary to make it possible to use the mock server in
the `koji-osbuild` CI, because the builder plugin uses
`client_credentials` to get access token.

The implementation behaves in the following way:
 - For `refresh_token` grant type, it takes the `refresh_token` value
   from the request and adds it to the `rh-org-id` field in the custom
   claim, which is part of the returned token.
 - For `client_credentials` grant type, it takes the `client_secret`
   value from the request and adds it to the `rh-org-id` field in the
   custom claim, which is part of the returned token.

Requests without the supported `grant_type` set are rejected.

Modify affected test cases to specify `grant_type` when fetching a new
access token.
2022-08-05 16:15:24 +02:00
Gianluca Zuccarelli
6ed9e48d87 ci: add OpenSCAP tests 2022-08-04 18:19:06 +02:00
Gianluca Zuccarelli
53c56de88c test: add oscap tests
Add integration tests for oscap customizations.
This tests only the most basic case of oscap remediation.
Mountpoints and additional packages are not added since
this varies between distros and OpenSCAP profiles
i.e. additional blueprints customizations would need
to be specified for each oscap profile to ensure
best results.
2022-08-04 18:19:06 +02:00
Gianluca Zuccarelli
ab250a28a1 distro: add oscap packages to build root
Conditionally add the required packages to the build
root in order to run the OpenSCAP remediation at build
time.
2022-08-04 18:19:06 +02:00
Gianluca Zuccarelli
95046d5fee pipelines: add oscap config for os pipeline
Add config options for oscap in the build pipeline
and add a new stage if the config is not nil.
2022-08-04 18:19:06 +02:00
Gianluca Zuccarelli
86af5ca9d8 distro: oscap customization validation
Add basic validation to ensure that the oscap
customizations are valid and required fields
have been provided. The validation also ensures
that the manifest generation errors out if
oscap customization has been enabled for older
or unsupported distros.
2022-08-04 18:19:06 +02:00
Gianluca Zuccarelli
0cb28f3a8f oscap: add oscap package
Add a package with the constants of the
valid oscap profiles. Add a function to
validate the available profiles against
an allow map of supported profiles. The
allowed function checks for both exact
matches and shorthand versions of the
oscap profiles.
2022-08-04 18:19:06 +02:00
Gianluca Zuccarelli
512cbd6089 osbuild: new stage oscap remediation 2022-08-04 18:19:06 +02:00
Gianluca Zuccarelli
0ef6789cd9 blueprint/customizations: oscap config
Add the required configuration options needed
to run the oscap first boot remediation.
2022-08-04 18:19:06 +02:00
Christian Kellner
7767f16e31 test/api: embed containers into the edge container
To check embedding containers via the cloud API works, embed a
known test container from our gitlab CI and check that it is
indeed embedded in the image by pulling the commit and poking
into the container storage.
2022-08-04 14:37:12 +02:00