Commit graph

333 commits

Author SHA1 Message Date
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
Alexander Todorov
132c082464 tests: Document examples of good/bad BZs for qa_ack+ 2021-04-27 15:52:59 +03:00
Alexander Todorov
ef0105945a tests: Revert a lorax patch
BZ 1843704 has been fixed and shipped in 8.3. We shouldn't need this
patch anymore!
2021-04-22 15:03:42 +03:00
Alexander Todorov
140ae9f75d Add traling newline to test manifest. Closes #1201
The rest were fixed in 59d2f505c before this file was added.
2021-04-19 18:11:58 +03:00
Xiaofeng Wang
bd07936367 test: Install and run ostree commit on UEFI VM
Update ostree-ng.sh to install and run ostree commit on UEFI VM
ostree.sh keeps on BIOS VM. Both of BIOS and UEFI are covered.
check_ostree.yaml ansible playbook has to be updated to support
both BISO and UEFI
2021-04-19 21:13:16 +08:00
Xiaofeng Wang
32dd9cb614 test: Simply .ks and add edge repo setup in .ks
1. Make .ks as simple as possible. only keep must-have options
2. Add edge repo setup in .ks instead of after installation
2021-04-14 16:08:55 +08:00
Ondřej Budai
e7b3063f7e test: properly kill journalctl
sudo journalctl -af -n 1 -u "${WORKER_UNIT}" &
WORKER_JOURNAL_PID=$!

In this snippet, WORKER_JOURNAL_PID is set to the PID of the sudo process.
Sudo doesn't propagate any signals - therefore the child process of sudo
(journalctl in this case) isn't killed when a signal is sent to the parent.

Use pkill -P instead which kills all processes where sudo is the parent.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-04-14 09:18:06 +02:00
Xiaofeng Wang
df74343eb8 test: Update test to align with customer scenario
According to Ben's suggestion, test has been updated to aligin with
customer scenario.
1. Setup ostree prod repo, building installer and edge upgrade
will be from prod repo
2. Containers for building installer and edge upgrade will be
running as stage repo
3. Before edge system update, prod repo will pull update content
from stage repo, make static-delta and summary
2021-04-12 18:37:42 +08:00
Ondřej Budai
973b4b2714 distro/rhel84: build qcow2 images with compat=0.10
By default, `qemu-img convert` creates qcow2 images usable in qemu 1.1 and
newer. RHEL 8 guest images are meant to be bootable on RHEL 6 though.
Unfortunately, RHEL 6 has qemu 0.12, therefore these images cannot be used
there.

To fix this, we need to use the new qcow2_compat option in qemu assembler
to override the default compat version and make qcow2 images that can be used
in qemu 0.10 and newer.

For this, we need osbuild 28 that isn't yet available in of any of
downstreams, therefore we need to pin it everywhere.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-04-10 19:18:13 +01:00
Christian Kellner
5937b9adca image-info: show format version for qcow2
Change the "image-format" from a string to a dict, with a "type":
$value entry, where $value contains the previous plain string
data.
Additionally, include the qcow2 format version, if the given
image is indeed a qcow2.
Adapt all manifest test accordingly (partly done by Ondřej)

Python 3 script used for conversion of manifest tests:
import os
import json

for name in os.listdir(os.getcwd()):
    if not name.endswith(".json"):
        continue
    print(name)
    with open(name, "r") as old:
        data = json.load(old)
        info = data.get("image-info", {})
        format = info.get("image-format")
        if not format:
            continue
        info["image-format"] = {
            "type": format
        }
        if format != "qcow2":
            continue
        info["image-format"]["compat"] = "1.1"
        with open(name + ".new", "w") as new:
            json.dump(data, new, indent=2)
            new.write("\n")
            new.flush()
    os.rename(name+".new", name)

test: use the new image-info format in all test manifests

The previous commit converted only qcow2 and openstack manifests but this change
is actually needed for all manifests produced by the qemu assembler.

Co-Developed-by: Ondřej Budai <ondrej@budai.cz>
2021-04-10 10:06:11 +02:00
Xiaofeng Wang
41fdfbd168 test: Add --ref for non-default ref
Because test uses 'test/rhel/8/x86_64/edge', building rhel-edge
image should include --ref arg
2021-04-08 16:26:00 +08:00
Xiaofeng Wang
3a0d1bb2de test: Remove selinux work around and Schutzfile osbuild pinning
Since selinux fix has been release in osbuild 27.1 and it's in
nightly compose. It's time to remove selinux work around and Schutzfile
osbuild pinning
2021-04-07 19:57:06 +01:00
Xiaofeng Wang
87921f0319 test: Replace API calling with composer-cli
composer-cli-28.14.58 is in nightly compose of RHEL 8.4, it's time
to replace API calling with composer-cli
2021-04-07 11:43:36 +02:00
Tomas Hozza
c91f3b11f6 Rename all occurrences of "Compute Node" to "Compute Engine"
This is an error, there is no such thing as "Compute Node" in GCP.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-04-01 20:12:39 +02:00
Xiaofeng Wang
0bbc83b6dc test: Update test to cover two more scenarios:
1. Test --url arg following by URL without tailling slash
2. Test ref begining with /
3. But we still have "regular" ref and --url arg test
2021-03-30 00:22:04 +01:00
Jozef Mikovic
dc31fb3f21 repositories: use snapshots for rhel90 repos 2021-03-26 14:05:20 +00:00
Jozef Mikovic
165ecafeb2 test: use DISTRO_CODE to select tests case
Using DISTRO_CODE simplifies test case selection and allows to test
different distro than the one test is running on.
This is used to run tests for RHEL 9.0 on F33 or RHEL 8.4
2021-03-26 14:05:20 +00:00
Jozef Mikovic
a9e8ea2a21 distro/rhel90: add RHEL9 support
osbuild-composer can now build rhel 9.0 images.
Added support is limited to qcow2 image type.
2021-03-26 14:05:20 +00:00
Tomas Hozza
4a47ad36af Cloud API: fix image_status.status value for running compose
Previously, the Cloud API endpoint `/v1/compose/{id}` return value's
`image_status.status` for a running worker job was "running", which didn't
comply with the Cloud API specification. Equivalents allowed by the API
specification are "building", "uploading" or "registering".

As a result, the Image Builder API also does not comply in this regard
to its specification, because it currently just copies the status value
string returned by osbuild-composer.

Define the `image_status.status` as a reusable type in the Cloud API
specification. This forces openapi to generate an explicit type for it,
which can be then explicitly used in the code, instead of plain strings.

Return "building", instead of "running"  for running compose.

Modify api integration test to check for all valid `image_status.status`
values for a compose.

Add News entry explaining this change.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-03-26 11:59:07 +01:00
Aleksandar Todorov
aa21b57daf tests: install awscli from EPEL. Fix #1037 2021-03-19 11:21:50 +01:00
Achilleas Koutsou
7066b02bf7 ostree-ng.sh: use non-default ostree ref
Run tests with user-specified ostree ref.
The ref needs to be specified in the container build as well (without a
URL) to be used for the commit that will be served to the installer.

The same variable/ref is also used to retrieve the $UPGRADE_HASH for the
final OS test.
2021-03-18 20:06:25 +00:00
Achilleas Koutsou
65ca29badb test/repositories/rhel-84: change to rh dev snapshots
For the new features, we need a very recent release of Anaconda.
2021-03-17 18:12:17 +00:00
Xiaofeng Wang
20af9a7258 test: Remove user SSH key work around
It's been fixed already by commit 1b0e9e3
2021-03-17 18:12:17 +00:00
Xiaofeng Wang
4844f4bc7a test: Fix ssh public key issue
The public key should be osbuild-composer CI's key, not my local
test one
2021-03-17 18:12:17 +00:00
Tom Gundersen
955585072d ostree-ng.sh: set VERSION-ID and ID variables
We only support one combination for now, but let's stay compatible with the old tests.

This fixes the places where these variables are still used.
2021-03-17 18:12:17 +00:00
Xiaofeng Wang
5445acb0cc test: Update ostree-ng to support container and installer tests
The ostree-ng will only be run on RHEL 8.4 because
rhel-edge-container and rhel-edge-installer image type are
supported by RHEL 8.4 only
2021-03-17 18:12:17 +00:00
Xiaofeng Wang
e4419ed752 test: Update ostree-ng.sh to work with rhel-edge-container test
rhel-edge-container is only supported by RHEL 8.4, so the test is
for RHEL 8.4 only
2021-03-17 18:12:17 +00:00
Achilleas Koutsou
f317b0a3d9 test/data: test cases for rhel-edge-container 2021-03-17 18:12:17 +00:00