Commit graph

2109 commits

Author SHA1 Message Date
Ondřej Budai
86baf4879a tools/deploy-qemu: use sys.exit instead of exit
exit is just a helper for the interactive shell, see:

https://stackoverflow.com/questions/6501121/difference-between-exit-and-sys-exit-in-python
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-22 14:45:54 +02:00
Ondřej Budai
99d1d4e5d0 tools/deploy-qemu: use default temp dir location
Previously, the temporary directory was created in the script dir. It just
imo created unnecessary and confusing files in my git checkout. Let's just
use the default temporary directory because we don't really have special
needs for it.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-22 14:45:54 +02:00
Alexander Todorov
1eb51b7bab Test Azure images on HyperV Gen1 and Gen2
Related: rhbz#1896264
2021-06-22 13:44:19 +03:00
Aleksandar Todorov
24f297859c Azure: deploy to V2 Hyper-V generation
Related: rhbz#1896264
2021-06-22 13:44:19 +03:00
Tomas Hozza
e6c3d78ec4 image tests: ignore 'selinux/context-mismatch' in image-info report on RHEL-8
Add a new CLI option to `osbuild-image-tests` called
`-skip-selinux-ctx-check` to workaround the limitation of `setfiles` on
RHEL-8 [1]. If the option is passed to the binary, then the
'selinux/context-mismatch' part is removed from the "expected" and
"actual" image-info report, before these two reports are compared.

Modify `image_tests.sh` to run `osbuild-image-tests` with
`-skip-selinux-ctx-check` when run on RHEL-8.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1973754

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-06-22 13:25:59 +03:00
Tomas Hozza
bce603586e image-info: changes related to reading SELinux labels unknown to host
When `image-info` inspects ostree images, the `/usr/etc` is bind-mounted
to `/etc`. This results in conflicting SELinux policy specification for
these files and makes the outcome dependent on the `setfiles` build.
All the files in `/etc` have mismatch in the expected vs. actual SELinux
context.

Exclude `/etc` from the check of SELinux ctx mismatches in case the
analysed tree is from an ostree-based image.

Sort the list returned `read_selinux_ctx_mismatch()` based on the item's
`filename` key, to make the result consistent across runs.

`image-info` can not read SELinux labels from the images, which are not
known to the host. This makes the report content depend on the host
environment. As a temporary workaround, relabel the image-info script with
osbuild_exec_t label to allow it to read unknown SELinux labels.

Modify documentation in `test/README.md` to explain the issue with
`image-info` and unknown SELinux labels.

Modify the `generate-all-test-cases` to relabel `image-info` before
generating test cases.

Modify the `image_tests.sh` to relabel `image-info` before running image
test cases.

Add 'tar' image for 'rhel-8' on 's390x' back to the matrix of generated
test cases, as it was removed by mistake. Regenerate the image test
case. Remove 'tar' image from 'rhel-84' on 's390x' from the matrix of
generated test cases, as it is not supported.

Regenerate all affected image test cases.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-06-22 13:25:59 +03:00
sanne
95cd5b782e distribution: The composer-api listens on 9196
The openshift service is listening on 443, but composer is running on
9196.
2021-06-21 17:31:15 +02:00
Alexander Todorov
9b9f86967e Remove Fedora32 from CI matrix - already EOL 2021-06-21 16:15:53 +03:00
Tomas Hozza
0f3c25824d Image test cases: remove Fedora 32 (EOL)
Remove Fedora 32 image test case manifests, because the release
is already EOL. Remove Fedora 32 definitions from
`distro-arch-imagetype-map.json`. Remove Fedora 32 repositories
from `tools/test-case-generators/repos.json`.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-06-21 16:15:53 +03:00
Colin Walters
a6ccde879b rpm_ostree_stage: Minor fixes to comments
Just a drive by commit while I was reading the code.
2021-06-21 12:11:09 +02:00
Achilleas Koutsou
deb28fd139 GitLab CI: Separate API test script test matrix
Splitting the api.sh test into its own matrix. The addition of the new
target, aws.s3, made the existing integration test matrix grow beyond
the GitLab parallel job limit (50).
2021-06-18 14:02:09 +01:00
Achilleas Koutsou
8f778af653 test: add API test for S3 upload target
Run on RHEL only.
2021-06-18 14:02:09 +01:00
Achilleas Koutsou
b825738939 docs/news: add news item for change 2021-06-18 14:02:09 +01:00
Achilleas Koutsou
1a3447ed38 kojiapi: include image type exports in Koji job args
Koji image request handling now reads the exports defined by each image
type. All APIs now support reading the exports defined by each image
type. The worker still falls back to "assembler" in case the call comes
from an older version of composer.
2021-06-18 14:02:09 +01:00
Achilleas Koutsou
14a74cf173 ostree: add test for VerifyRef() 2021-06-18 14:02:09 +01:00
Achilleas Koutsou
5556137daf Append filename to S3 object upload 2021-06-18 14:02:09 +01:00
Achilleas Koutsou
e5b28c0bb3 New upload target: AWS S3
Uploads an artifact to an S£ bucket and returns a presigned URL to allow
the user to download the file.

Although it uses a lot of common code with the AWS AMI upload target,
it's treated as a completely separate target.
2021-06-18 14:02:09 +01:00
Achilleas Koutsou
14aea30bcd osbuild-worker: add export path to all upload calls
Exports are defined in all cases now.
2021-06-18 14:02:09 +01:00
Achilleas Koutsou
49a8d98c28 Move ResolveRef test to new package 2021-06-18 14:02:09 +01:00
Achilleas Koutsou
b2f5e1cd72 cloudapi: support ostree options
Move OSTree option handling outside of the weldr API to make it usable
by other packages. New subpackage at internal/ostree.

Add support for ostree options ("Ref" and "URL") in the Cloud API.
Validate OSTree options and resolve the parent reference the same way as
in the Weldr API.

Unlike the Weldr API, the Cloud API doesn't support specifying the
Parent reference directly.

The exports list is included in the job information on the queue.
2021-06-18 14:02:09 +01:00
Achilleas Koutsou
d701d237d0 Fix cache path creation in worker Dockerfile 2021-06-18 14:02:09 +01:00
sanne
cad7f7ff63 worker: Add test for the worker oauth2 auth 2021-06-17 10:08:35 +02:00
Ondřej Budai
0a304f659d worker/client: pass arch explicitly
The API client guessed the arch, let's pass it explicitly so a caller
can specify it.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-17 10:08:35 +02:00
sanne
8fa822c02e worker: Return basepath depending on route 2021-06-17 10:08:35 +02:00
sanne
0ea31c39d5 worker: Add identity filter and client oauth support 2021-06-17 10:08:35 +02:00
Alexander Todorov
968e7b210f CI: Store .repo file as artifacts. Fixes #1458
Note: only store them for the Base jobs b/c these files are produced
by deploy.sh and will be the same across jobs in the same pipeline.
2021-06-15 11:43:42 +03:00
Alexander Todorov
68219bd92a CI: Don't run cloud_cleaner in rpmbuild stage. Fixes #1457 2021-06-15 11:43:42 +03:00
Martin Sehnoutka
1fffb57a4c deploy-qemu: rewrite in python
The discussion about Bash syntax have reached the threshold where it is
necessary to rewrite the script in Python to make everyone's life
easier.
2021-06-15 09:53:53 +02:00
Ondřej Budai
b5c65b687a 30
Release osbuild-composer 30.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-10 14:59:08 +02:00
Ondřej Budai
602b97b2a8 schutzfile: remove osbuild pins for Fedora
osbuild 28 already landed in both Fedora 32 and Fedora 33

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-10 14:59:08 +02:00
Ondřej Budai
dd3099f03d ci: run centos stream 8 integration test on openstack
AWS doesn't have real KVM and it seems that booting Centos Stream image using
TCG stopped working (TCG was actually never supported on EL). Let's switch
to using OpenStack that has KVM support.

Also, I bumped the terraform repository because the older version didn't have
centos stream on OpenStack.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-10 11:39:05 +02:00
Ondřej Budai
bc1a7dc30c tests: fix journalctl killing once again
3a8c6c8a introduced a new logic for killing journalctl. Unfortunately, it
doesn't work properly. In ostree tests, multiple journalctls are spawned
but there can be only one trap active at a time. This caused all but the last
journalctls to hang indefinitely. Unfortunately, hanging background processes
is something that causes the GitLab CI to hang indefinitely as well.

This commit modifies the logic a bit: The trap is still set. However, there's
also an explicit kill of journalctl after the compose is finished. After the
process is successfully killed, the trap is removed.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-10 07:40:36 +02:00
Tomas Hozza
244cb35eca image-info: fix read_partition() call
One occurrance of read_partition() call have not been modified as part of
previous commit [1], which is a bug.

[1] 598c2b6939

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-06-09 18:23:00 +02:00
Tomas Hozza
a2d4ba715f Extend information gathered by image-info tool
This is a preparation for defining EC2 images for RHEL-8.5.0. These
extensions to image-info tool represent modifications done to the
official EC2 images currently produced as RHEL release. It is important
to be able to analyse these aspects of images, before we define them in
osbuild-composer, to ensure that the resulting images will be consistent
with the current state.

- Read non-empty lines from /etc/hosts file and add them to the report.
- Read content of /etc/machine-id and add it to the report.
- Read uncommented key/values from /etc/systemd/logind.conf and add them
  to the report.
- Read all ifcfg-* files from /etc/sysconfig/network-scripts/ and add
  their values to the report.
- Read content of /etc/locale.conf and add it to the report.
- Read SELinux configuration from /etc/selinux/config and add it to the
  report.
- Inspect the filesystem tree for SELinux context mismatches and add
  them to the report.
- Read configuration files from /etc/modprobe.d/ and for now report only
  all blacklisted kernel modules.
- Read RHSM configuration from /etc/rhsm/rhsm.conf and add it to the
  report.
- Read cloud-init configuration from /etc/cloud/cloud.conf and add it to
  the report.
- Read all *.conf files from /etc/dracut.conf.d/ and add their content to
  the report.
- Read VC and X11 keyboard configuration and add it to the report.
- Read specific configuration directives from Chrony configuration and
  add them to the report. Specifically 'server', 'pool', 'peer' and
  'leapsectz'.
- Read drop-in configurations for *.service unit files from
  /etc/systemd/system/ and add them to the report.
- Read all configuration files from /etc/tmpfiles.d/ and add them to the
  report.
- Read all configuration files from /etc/sysctl.d/ and add them to the
  report.
- Read the Tuned active profile and profile mode and add them to the
  report.
- Read all configuration files from /etc/security/limits.d and add them
  to the report.
- Read sudoers configuration from /etc/sudoers and files in
  /etc/sudoers.d/ and add uncommented lines to the report. No
  sophisticated parsing is done, because the configuration format
  grammar is too complicated for the purpose of image-info.
- Read udev rules configuration files from /etc/udev/rules.d/ and add
  them to the report.
- Read DNF configuration and defined vars and add them to the report.
- Read profile ID and enabled features used by authselect.
- Enable SELinux, extended attributes and POSIX ACLs support when
  unpacking 'tar' image type to prevent potential mismatches

Regenerate all image test cases to reflect changes in the image-info
output. Modify the distro-arch-imagetype-map.json to cover all
combinations currently covered by existing image test cases.

Add doc strings to all read_* functions.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-06-09 18:23:00 +02:00
Alexander Todorov
2cabaa5477 tests: Use CI_BUILD_ID, not CI_PIPELINE_ID. Fixes #1448
PIPELINE_ID is the same across different jobs running in the same
pipeline while BUILD_ID is unique for every job.

Note: In the case where we have 1 test script/runner
CI_BUILD_ID == CI_JOB_ID
2021-06-08 09:07:43 +02:00
Martin Sehnoutka
71233fd860 distro: add fedora 34 and 35 aliases to f33
composer doesn't support f34 or f35, but it should be possible to build
these even with the f33 distro definition. Introduce f34 and f35 repos
and aliases for f33.
2021-06-05 20:31:45 +02:00
sanne
19db3ff1d4 cloudapi: Add x-rh-identity header filter 2021-06-05 14:47:38 +01:00
sanne
2a42d05a10 distribution: Add PVC to clouddot template
This will make the job queue persistent over redeployments.
2021-06-04 20:21:16 +02:00
Ondřej Budai
024236be6a readme: add IRC
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-04 18:19:42 +01:00
Jakub Rusz
3a8c6c8ab8 tests: kill journalctl even if compose fails
This prevents Gitlab CI from getting stuck if something
goes wrong with the compose.
2021-06-04 14:18:11 +03:00
Alexander Todorov
8c1afdd727 CI: Remove Jenkinsfile, use GitLab instead 2021-06-04 10:48:04 +03:00
Alexander Todorov
9a4b5763e9 GitLab CI: Move Container build under rpmbuild stage
so taht it can be running in parallel instead of blocking all of
the other test jobs in the pipeline.
2021-06-03 11:45:09 +03:00
Alexander Todorov
0d04ab9752 GitLab CI: 1 test script/runner 2021-06-03 11:45:09 +03:00
Christian Kellner
b4773caebc schutzbot: send notifications to slack
Send notifications about successful and failed builds to slack instead
of Telegram.
2021-06-02 10:16:08 +02:00
Alexander Todorov
1927abea46 tests: Adjust vmware.sh for GitLab CI 2021-05-31 11:44:37 +02:00
Alexander Todorov
3f823be4b1 GitLab CI: Add vmware integration test 2021-05-31 11:44:37 +02:00
Alexander Todorov
591b0fa1be Disable Shutzbot in favor of GitLab CI 2021-05-31 11:44:37 +02:00
Alexander Todorov
3717ddfbbd GitLab CI: Add GCP tests 2021-05-31 11:44:37 +02:00
yih
661d59e534 add test case to push/pull edge container images in quay.io 2021-05-26 12:16:42 +03:00
Alexander Todorov
dedc4b9fc9 GitLab CI: User newer terraform SHA
brings in some of the missing openstack/ images definitions
2021-05-25 12:39:59 +03:00