Commit graph

360 commits

Author SHA1 Message Date
Jakub Rusz
1b5ca0f163 tests: make azure.sh easier to run locally
We've dropped Jenkins already and this change helps by setting
CI variables to a default value in case they're not present.
2021-07-09 19:52:52 +01:00
sanne
4385c39d66 worker: Introduce heartbeats
An occupied worker checks about every 15 seconds if it's current job was
cancelled. Use this to introduce a heartbeat mechanism, where if
composer hasn't heard from the worker in 2 minutes, the job times out
and is set to fail.
2021-07-08 21:14:38 +01:00
Xiaofeng Wang
c025c60544 test: Allow a failed dmesg imported by new RT kernel
Due to bz#1979272, the failed dmesg is not caused by osbuild, but
RT kernel itself. Allow this failed dmesg to make test happy.
2021-07-06 11:41:46 +01:00
Ondřej Budai
0201822c50 tests: remove all traces of Fedora 32
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-07-05 11:16:08 +02:00
Xiaofeng Wang
4e4012df28 test: Update ostree.sh to cover bz#1896178
For RHEL 8.5, user and ssh key are added in blueprint.
For Fedora 33, RHEL 8.3 and 8.4, user and ssh key have to be
added in ks file due to bz#1896178.

bz#1896178 has been fixed already on RHEL 8.5 only, but still exists
on Fedora 33, RHEL 8.3 and 8.4. This update covers Fedora 33,
RHEL 8.5, RHEL 8.4 and RHEL 8.3.
2021-07-05 11:15:58 +02:00
Achilleas Koutsou
6e22e1de64 test/cases: fix installers test
COMPOSE_ID shouldn't be set but taken from the build response
2021-07-02 17:57:22 +02:00
Xiaofeng Wang
a0ec753e05 test: Update check_ostree.yaml to work with RHEL 8.5
There's no any error message in dmesg output on RHEL 8.5 Edge image.
Update playbook to support that.
2021-07-01 13:34:12 +02:00
Xiaofeng Wang
35263e5ab4 test: Remove fedora 32 test
GitLab CI dropped Fedora 32 support, fedora 32 test should be
removed.
2021-07-01 13:34:12 +02:00
Achilleas Koutsou
f557ab57bf test/data: update edge test manifests
Core stages were updated to include the fix-bls stage.
Updating existing RHEL 8.5 test manifests.
2021-07-01 12:48:32 +02:00
Achilleas Koutsou
a877326671 test: add installer integration test
Builds a tar-installer, installs the OS, boots it, and checks if the
packages selected in the blueprint are installed.
2021-07-01 12:48:32 +02:00
Achilleas Koutsou
c4aeb256a5 test/data: test case for tar x86_64 2021-07-01 12:48:32 +02:00
Yuxin Sun
6cd6e81e85 Add subscription test case and Azure boot up case
Signed-off-by: Yuxin Sun <yuxisun@redhat.com>
2021-06-30 12:29:33 +02:00
Achilleas Koutsou
f557bf9a8b test/cases/ostree: test new image types
ostree.sh: add case for RHEL 8.5 edge-commit
ostree-ng.sh: conditional container and installer type and file names
2021-06-29 17:26:43 +01:00
Achilleas Koutsou
0b6452bb34 test: new manifests for RHEL 8.5 edge types 2021-06-29 17:26:43 +01:00
Ondřej Budai
cc2c354371 tests: regenerate manifests for rhel 9.0
Previous commits bumped the repo snapshots and changed the manifest generation
for RHEL 9.0.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-29 13:56:26 +02:00
Ondřej Budai
39f1d4d485 tests: update snapshot for rhel 9.0
We have a newer one so let's use it.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-29 13:56:26 +02:00
Achilleas Koutsou
0ddfc32957 test: verify selected package appears in metadata
Add postgresql to all builds and verify that it's listed in the metadata
2021-06-29 09:33:05 +01:00
Achilleas Koutsou
7e01a9125b test: verify commit ID hash returned from API 2021-06-29 09:33:05 +01:00
Jakub Rusz
b1e40b5ce7 tests: modify image_tests for Gitlab CI 2021-06-28 13:49:57 +03:00
Jakub Rusz
bb2f866470 tests: updating README with info about nightly testing in Gitlab CI 2021-06-25 15:10:40 +03:00
Yuxin Sun
704a3675b9 Update fedora-33 test repo
Signed-off-by: Yuxin Sun <yuxisun@redhat.com>
2021-06-25 08:40:49 +03: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
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
Achilleas Koutsou
8f778af653 test: add API test for S3 upload target
Run on RHEL only.
2021-06-18 14:02:09 +01: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
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
sanne
19db3ff1d4 cloudapi: Add x-rh-identity header filter 2021-06-05 14:47:38 +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
1927abea46 tests: Adjust vmware.sh for 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
Martin Sehnoutka
4a54ab43e5 test/cases: Introduce common "regression" test for all distros
Create an entry point for all regression test called "regression.sh" and
run it as part of the base tests for all our distros. This entry
point contains logic for running only the test cases that are
appropriate for a given distribution.
2021-05-20 13:07:07 +03:00
Ondřej Budai
a19b883727 distro/rhel90: enable cloud-init
cloud-init was enabled explicitly in the image-factory kickstart and thus we
need to explicitly enable it too.

Fixes: rhbz#1960309
Fixes: COMPOSER-920
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-05-17 14:55:50 +02:00
Ondřej Budai
9029d169d9 test/libvirt: don't test vhd images
VHD images are meant for Azure and we indeed test if they're bootable in
test/cases/azure.sh . There's no reason to test them using libvirt anymore
so this commit just removes the test.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-05-17 14:55:50 +02:00
Jakub Rusz
8dcf859473 tests: move some integration tests to gitlab CI
This also includes several modifications to tests scripts to
enable them running in gitlab CI.
2021-05-12 15:38:30 +03:00
Jakub Rusz
e613b2456b tests: modify DISTRO_CODE usage
Set DISTRO_CODE if unset for gitlab CI
2021-05-12 15:38:30 +03:00
Yuxin Sun
5e60485705 Update yuxisun responsibility
Signed-off-by: Yuxin Sun <yuxisun@redhat.com>
2021-05-12 15:11:54 +03:00
Alexander Todorov
57cebbfaea tests: Define COMPOSE_URL/COMPOSE_ID in a single place. Fix #1397
we don't want this defined multiple times in different places
2021-05-12 09:26:31 +02:00
Achilleas Koutsou
c218b5c517 test: x86_64 repos for RHEL 8.5 2021-05-11 12:10:09 +02:00
Alexander Todorov
9728d2361a tests: Define COMPOSE_URL if undefined 2021-05-10 11:15:26 +03:00
Jakub Rusz
cced541eb1 tests: change ostree boot location for RHEL 8.4
Change BOOT_LOCATION to COMPOSE_URL until GA is released.
2021-05-10 11:15:26 +03:00
Martin Sehnoutka
98dd7d7737 rhel84: remove excluded package if explicitly specified in the bp
When a users wants to install a package that itself is excluded or its
dependency is excluded, it fails the build. There is no known workaround
for this shorcoming of our current design.

Therefore, remove a package from the list of excluded if it is
explicitly mentioned in a blueprint. This will not solve the issue with
dependencies, but it will create a possibility of a workaround.

Also, introduce regression test to verify the bug fix and hook it into
CentOS CI (this issue was reported against RHEL, but CentOS runs on AWS
so it is better to verify the fix there).
2021-05-07 09:26:52 +02:00
Jakub Rusz
06361267d5 Add image boot testing in Azure
This uses an image created and uploaded to Azure using composer-cli
and then terraform to spin up a linux vm from that image, check
if the machine works and then cleans up everything.
2021-05-05 12:05:32 +03:00
Xiaofeng Wang
33d85c82c9 test: Update virt-install arg "ks=file:/ks.cfg" to "inst.ks=file:/ks.cfg"
The anaconda-34.24.9-1 in fedora 34 requires inst prefix.
2021-04-30 12:33:44 +02:00
Xiaofeng Wang
a2514dbc1c test: Add installer test on BIOS VM 2021-04-27 22:31:19 +08:00
Alexander Todorov
d12565882a tests: Define who's responsible for what on the team
because we're expecting to onboard other people as well and we need
to start keeping track of this.
2021-04-27 15:52:59 +03:00