Commit graph

60 commits

Author SHA1 Message Date
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
Jozef Mikovic
dc31fb3f21 repositories: use snapshots for rhel90 repos 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
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
Achilleas Koutsou
f317b0a3d9 test/data: test cases for rhel-edge-container 2021-03-17 18:12:17 +00:00
Ondřej Budai
60e12212c5 test cases: regenerate qcow2 for rhel-84 and centos-8
So they contain the net-tools change.
2021-03-14 15:03:58 +00:00
Aleksandar Todorov
fc2d2894d4 tests: add manifest file for CentOS 8 aarch64 AMI 2021-03-12 11:59:21 +00:00
Tom Gundersen
4805eeedf8 test/data/manifests: drop .rpmmd.checksums
These are no longer used.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2021-03-10 11:52:05 +00:00
Christian Kellner
ee08790504 test: regenerate -cusomize manifests
Use `generate-test-cases` to generate the qcow2 image types with
customization for fedora 32, 33 and CentOS 8 and RHEL 8 and 8.4.
The previous commit changed the customization blueprint but the
changes to the resulting manifest and test data was done by hand.
2021-03-09 21:45:27 +00:00
Christian Kellner
8da813ecd2 rhel84: use en_US.UTF-8 as default for LANG
Use en_US.UTF-8 as default for LANG, which is what previously was
used and is also needed to properly work on non-us/latin setups[1].

In the customization tests, use a different value than the default
one to check that the customization does in fact work.

[1] http://git.app.eng.bos.redhat.com/git/spin-kickstarts.git/tree/rhel8/rhel-8.2-kvm-x86_64.ks#n4

Co-authored-by: Achilleas Koutsou <achilleas@koutsou.net>
2021-03-09 21:45:27 +00:00
Tom Gundersen
130218778f test/repositories/rhel-84: update to the most recent snashot
In particular, make sure the -rt repositories and match the
base ones.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2021-03-09 21:39:46 +00:00
Xiaofeng Wang
0350768d73 test: Add 'kernel-rt' and kernel customization test
Since kernel upgrading from 'default' to 'rt kernel' has SSH
connection issue, 'install' kernel and 'upgrade' kernel must
have 'kernel-rt' included.
https://github.com/osbuild/osbuild-composer/issues/1222

Only RHEL 8.4 repo has 'rt kernel' repo, 'rt kernel' test will be
RHEL 8.4 only
2021-03-09 21:39:46 +00:00
Tom Gundersen
167fdc44bc test/data/manifests: avoid duplicate booting
We have integration tests that boot most of the image types, let
the image tests focus on the actual content of the images, shaving
off considerable CI time.

The only missing one is OpenStack (which should be ported over) and
tar (which we need to define the integration test for).

Signed-off-by: Tom Gundersen <teg@jklm.no>
2021-03-08 13:22:26 +01:00
Tom Gundersen
59d2f505cc test/data/manifests: add trailing newline
Mostly to avoid future noisy diffs.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2021-03-08 13:22:26 +01:00
Achilleas Koutsou
83d87a953d test/data: regenerate existing test cases (x86_64)
A few recent changes in image type definitions haven't been reflected in
the test cases yet.  This also acts as a check to make sure that the
changes in composer don't affect the old behaviour.

Causes for (some) changes:
- Kernel modules added to package lists:
  Prior to PR #1175 image types defined the kernel package in their
  package list.  Some only included `kernel-core` and not the `kernel`
  metapackage.  Now images default to having the `kernel` metapackage
  included which also adds `kernel-modules` and `alsa-sof-firmware`.
- New package source for rt kernel.
2021-03-08 13:22:26 +01:00
Xiaofeng Wang
3ed3f2ed95 test: Update dmesg test to work with only one failed log 2021-03-06 13:00:05 +00:00
Tomas Hozza
02ad5a3199 test: Fix installation of osbuild-worker.toml in provision.sh
The tools/provision.sh script is sourced by all test cases and it sets
up the system and software for running test cases. As part of the setup,
it copied over the whole content of test/data/composer/ to
/etc/osbuild-composer. However the source directory contains not only
osbuild-composer's configuration, but also configuration for the worker.
The worker however expects its configuration in /etc/osbuild-worker.

The fact that provision.sh does not copy the worker configuration to the
correct directory didn't affect the CI, because the only test case that
relied on it is koji.sh, which copies the worker configuration
explicitly.

Move osbuild-worker test configuration to a separate 'test/data/worker/'
subdirectory. Also install the osbuild-worker test configuration to its
own subdirectory in the "-test" RPM.

Move the copying of worker configuration to the correct destination
directory from koji.sh to provision.sh, so that all test cases can rely
on the system being set up properly. Do not use wildcard for copying
osbuild-{composer,worker} configuration files, but explicitly copy each
file to its respective destination directory.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-25 18:44:21 +00:00
Ondřej Budai
f2243151be test: remove podman-plugins workaround for RHEL/CentOS
https://bugzilla.redhat.com/show_bug.cgi?id=1877865 is now fixed and
podman-plugins is now shipped in stable RHEL. One less hack in our codebase!

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-02-25 12:14:56 +01:00
Aleksandar Todorov
fbbdd2aa26 tests: Use full repo name to ubi8-minimal to workaround bug
/etc/containers/registries.conf.d/rhel-shortnames.conf shipped in
containers-common-1:1.2.2-1.module+el8.4.0+10073+30e5ea69 has a wrong
shortname for ubi8-minimal:

"ubi8-minimal" = "registry.access.redhat.com/repository/ubi8-minimal"

resulting in `name unknown: Repo not found` when trying to pull the image
via its short name.

Related: rhbz#1931785
2021-02-23 12:11:30 +01:00
Tom Gundersen
9d477e339b test/manifets: update test cases
Signed-off-by: Tom Gundersen <teg@jklm.no>
2021-02-20 20:01:15 +01:00
Antonio Murdaca
21319520e5 internal/distro/rhel8: un-exclude subman from edge
We aim at shrinking our deps eventually but we need subman for the time
being. This patch basically un-exclude subman which was introduced by
https://github.com/osbuild/osbuild-composer/pull/893

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2021-02-18 13:08:32 +01:00
Achilleas Koutsou
8438078c50 tools: test cases for alt kernel selection
Two new test cases added to format-request-map and test cases are
generated.

1. kernel-rt for RHEL images:
Requires new package repositories for RHEL 8.3 and 8.4.
Creates an OSTree commit with the `kernel-rt` as a customization.

2. kernel-debug for Fedora images:
kernel-rt isn't included in the official fedora repositories.  Using
kernel-debug at least tests the feature with the fedora-iot-commit type.
2021-02-16 13:51:26 +00:00
Ondřej Budai
5eb402415d distro/rhel84: add centos 8 stream support
The image definition is shared with the latest RHEL 8.y one (8.4 currently).
I expect that we the introduction of 8.5 support, we point the centos 8
distro at it.

The test repositories and manifests use the official CentOS composes. From
what I can tell, they are persistent. This is not guaranteed though, so we
might need to switch to RPMRepo at some point.

The "classic" CentOS 8 should also be buildable but due to the chicken and egg
issue (this commit will get into Centos "8.4" but Centos "8.4" isn't a thing
yet), we cannot test it and therefore it might be broken.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-02-14 16:08:08 +00:00
Tomas Hozza
220c77e37f image-tests: Add RHEL-8.4 test cases for all architectures
Add RHEL-8.4 image test case manifests for all architectures. The set of
image types per architecture is based on what is currently available for
RHEL-8.3.

The image test case for RHEL-8.4 tar image on s390x is not added yet
because of Issue #1220.

Fixes #1167

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-12 18:53:18 +01:00
Tomas Hozza
af3c572f9a distro: Disable RHSM DNF plugins on RHEL qcow2 images
Modify RHEL 8.3 and 8.4 KVM guest images definition to produce osbuild
manifest with `org.osbuild.rhsm` stage to disable both RHSM DNF plugins
(`product-id` and `subscription-manager`).

Update `/docs/news/unreleased/osbuild-rhsm-stage.md` to note that RHEL
8.3 and 8.4 qcow2 image definitions are updated to disable RHSM DNF
plugins by default.

Enhance `tools/image-info` tool to add RHSM-specific section to its
output in case RHSM DNF plugins configurations exist in the tree.

Regenerate all RHEL image test cases affected by the patch set.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-11 11:10:47 +01:00
Jacob Kozol
eea18fc897 distro/rhel84: add sysconfig stage
The org.osbuild.sysconfig stage is now supported. Config updates can be
made to the kernel and network files. Currently, the same values are
used for all image types in rhel84. The image-info script is updated to
allow testing the sysconfig info.
2021-02-09 14:13:25 +01:00
Achilleas Koutsou
a7d982d9be image-tests: fix hostname typo in customizations
The test case generation script contained a typo in the blueprint
customizations dictionary: "hosname" instead of "hostname".

Fixed typo and regenerated relevant test cases.
2021-02-08 09:11:07 +01:00
Ondřej Budai
6456fbe6a5 image-info: do not include inputhash in the report
The algorithm from calculating changed in osbuild 24, thus breaking the
testsuite. As the the inputhash is merely a implementation detail, there's
no need to test it in the image tests. Nevertheless, the inputhash is also
tested in the osbuild's testsuite.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-02-04 13:39:23 +01:00
Tomas Hozza
0d1c2bc0bf image-tests: fixup for rhel-8 aarch64 edge test case after PR#1178
Tom was too quick to merge PR#1178 and as a result, one image test case
was not properly regenerated in that PR. The CI passed for PR#1178,
because RHEL-8.3 images in CI are not tested on aarch64.

Add properly regenerated image test case for rhel-8 aarch64 edge commit.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-02 11:40:13 +01:00
Tomas Hozza
89df6ab328 image-tests: remove 'subscription' customization, update repos, regenerate
Remove 'subscription' customization from 'format-request-map.json',
because it currently has no effect on image test cases. The reason is
that this customization of image is possible only via Cloud API in
composer and setting imageOptions. However image test cases currently
support image customization only via Blueprint customizations.

Update repo links in 'repos.json' to the latest rpmrepo snapshots.

Regenerate all image test cases affected by updates to 'repos.json'
and 'format-request-map.json'. This includes all `rhel-8` and `rhel-84`
image test cases.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-01 23:20:01 +00:00
Tomas Hozza
1a3cbb282a image-info: Add workaround for listing services by status
`image-info` tools parses output of `systemctl list-unit-files` run on a
different tree (with `--root` option), to determine the list of enabled
and disabled services on the inspected image. However since Fedora 33
(and presumably since systemd v246), the output of `systemctl
list-unit-files` changed. Some units previously reported as "enabled" or
"disabled" are now reported as "alias", which means, that they are just
a symlink to a different unit.

There is no systemd command, that would take an "alias" unit and would
report its state as "enabled" or "disabled" and could run on a different
tree (with "--root" option).

To make the list of reported services in the given state consistent on
systems with older and new (v246+) systemd version, check all "alias"
units and append them to the list of services with a specific status,
if their target is also listed in in the list.

Example of the `systemctl list-unit-files` output change:

~]# rpm -q systemd
systemd-246.6-3.fc33.x86_64
~]# systemctl list-unit-files ctrl-alt-del.target
UNIT FILE           STATE VENDOR PRESET
ctrl-alt-del.target alias -

~]# rpm -q systemd
systemd-245.8-2.fc32.x86_64
~]# systemctl list-unit-files ctrl-alt-del.target
UNIT FILE           STATE   VENDOR PRESET
ctrl-alt-del.target enabled disabled

This change makes it possible to produce consistent output for an
inspected image, regardless if the `image-info` tool is run on Fedora
32, Fedora 33 or RHEL-8.

Also regenerate all Fedora 33 test cases, since this commit changes the
content of produced list of enabled / disabled services since Fedora 33.
The list is now consistent with what would be produced by `image-info`
for an image on older Fedora (e.g. 32) or RHEL-8.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-01 11:22:57 +01:00
Jacob Kozol
ee5d73eb41 distro/rhel84: remove rng-tools from qcow2
rng-tools was added back into the qcow2 packages by mistake. It should
be an excluded package and rngd.service should not be enabled.
2021-02-01 11:20:35 +01:00
Jacob Kozol
59adc4d11a distro/rhel84: remove packages not in imagefactory image
The last imagefactory nightly did not contain dnf-plugin-spacewalk,
fwupd, nss, or udisks2. These packages are now excluded. The
udisks2.service and mdmonitor.service are no longer enabled. Also, the
fwupd-refresh, mdcheck_continue, mdcheck_start, and mdmonitor-oneshot
timers are no longer listed as disabled services.
2021-01-29 11:22:26 +00:00
Jacob Kozol
a3cb930d6a distro/rhel84: add packages to be match imagefactory
The packages in the last imagefactory nightly differ from ours. The
following packages are now added:

oddjob
oddjob-mkhomedir
psmisc
authselect-compat
rng-tools
dbxtool

Also, the rngd and nfs-convert services are enabled.
2021-01-28 11:31:42 +01:00
Jacob Kozol
be2478e4a5 distro/rhel84: include timedatex in qcow2 image
timedatex was an exlcuded package due to an selinux-policy issue. This
issue is resolved and timedatex is no longer excluded.
2021-01-27 11:38:14 +01:00
Jacob Kozol
15969e0adc distro/{rhel8,rhel84}: set systemd default targets
An image only had a systemd stage added if its blueprint contained
services or if its image type contained enabled services. The systemd
stage is now also added if the image type contains disabled services or
a default target.

The RHEL 8.4 qcow2 image type now specifies the multi-user default target.

In order to test this the image-info tool now includes the default
target in its output. Image test manifests are updated to include this
change.
2021-01-21 11:58:06 +01:00
Jacob Kozol
9d0d5967d6 distro/rhel84: use New York as default timezone
RHEl 8.4 guest images need to have the default timezone of EST/EDT
unless the user specifies one in their blueprint. New York is a major
location for this timezone.
2021-01-13 17:49:51 +01:00
Ondřej Budai
973639d372 distro/rhel84: use a random uuid for XFS partition
Imagine this situation: You have a RHEL system booted from an image produced
by osbuild-composer. On this system, you want to use osbuild-composer to
create another image of RHEL.

However, there's currently something funny with partitions:

All RHEL images built by osbuild-composer contain a root xfs partition. The
interesting bit is that they all share the same xfs partition UUID. This might
sound like a good thing for reproducibility but it has a quirk.

The issue appears when osbuild runs the qemu assembler: it needs to mount all
partitions of the future image to copy the OS tree into it.

Imagine that osbuild-composer is running on a system booted from an imaged
produced by osbuild-composer. This means that its root xfs partition has this
uuid:

efe8afea-c0a8-45dc-8e6e-499279f6fa5d

When osbuild-composer builds an image on this system, it runs osbuild that
runs the qemu assembler at some point. As I said previously, it will mount
all partitions of the future image. That means that it will also try to
mount the root xfs partition with this uuid:

efe8afea-c0a8-45dc-8e6e-499279f6fa5d

Do you remember this one? Yeah, it's the same one as before. However, the xfs
kernel driver doesn't like that. It contains a global table[1] of all xfs
partitions that forbids to mount 2 xfs partitions with the same uuid.

I mean... uuids are meant to be unique, right?

This commit changes the way we build RHEL 8.4 images: Each one now has a
unique uuid. It's now literally a unique universally unique identifier. haha

[1]: a349e4c659/fs/xfs/xfs_mount.c (L51)
2020-12-15 16:43:39 +01:00
Jacob Kozol
51c08105fe distro/rhel84: update kernel options
The kernel options are updated to remove the read only option "ro" from
the qcow2 and amazon image types. Also, the qcow2's kernel options are
updated to only set console=ttyS0 once. It was declared twice which is
redundant so now it is set for both tty0 and ttyS0.
2020-12-11 18:53:30 +01:00
Jacob Kozol
a827e594bf distro/rhel84: remove rng-tools
rng-tools is no longer included as a package in the RHEL 8.4 image. This
package is both removed from being an included package and also
specifically declared as excluded. The test manifests are updated.
2020-12-08 14:04:40 +01:00
Christian Kellner
f0896be0c0 distro/rhel84: use the org.osbuild.rhel84 runner
The RHEL 8.4 specific runner was introduced in osbuild 22, released
on the 8th of October 2020. It should by now be in relevant Fedora
releases and RHEL 8.4.
Adapt the corresponding test cases.
2020-12-04 19:28:44 +01:00
Ondřej Budai
915c9d6c50 distro/rhel84: change the default size of qcow2 to 10 GiB
The default size of RHEL 8 qcow2 images is 10 GiB, let's align our default.

Related: rhbz#1846087
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-12-01 14:33:23 +00:00
Ondřej Budai
aa8a581273 test/manifest: add fedora 33 aarch64 ami manifest
Our current testing environment cannot run VMs for aarch64, therefore we
cannot test the qcow2 image. Also, we don't have an openstack account with
aarch64 so also we cannot test openstack image type. Additionaly, we cannot
selectively disable boot testing for now.

Let's do the smallest change possible and just add ami test case - we can boot
test these images in AWS.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-12-01 08:27:44 +01:00
Ondřej Budai
67d6b58e24 test/repositories: add Fedora 33 aarch64 ones
We don't have a snapshot yet, let's use the official ones for now.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-12-01 08:27:44 +01:00
Jacob Kozol
7b40a3b38e schutzbot: add rhel 8.4 tests to jenkins pipeline
rhel 8.4 tests are added. The configs are based off of those used for
rhel 8.3. The Schutzbot Mockbuild, Base, Image, Integration, and OSTree
tests are added for 8.4. Repo overrides are added for the rhel 8.4 tests
so that the tests use rpmrepo snapshots.

The mockbuild uses the jenkins rhel84-nightly-repo credential to
override the rhel mock template's repos with rhel 8.4 nightly repos.
These repos are stored in a credential because they are internal links.

The image tests and koji tests need a special distro selector since the
rhel-8 test cases are only for rhel 8 versions less than 8.4. The rhel
8.4 tests are named with the rhel-84 pattern whereas the other rhel 8
versions have the rhel-8 pattern.

Also, instead of having only rhel-8 and rhel-8-beta repo configs for the
tests, we now have a specific repo config for each rhel release we test.
The repo is also now pulled from an rpmrepo snapshot. For whichever
distro is being tested, the approriate repo config will be copied to
/etc/osbuild-composer/repositories as rhel-8 and rhel-8-beta since this
is the naming osbuild-composer looks for. For testing purposes, the
rhel-8 and rhel-8-beta repo should be the same since eventually all rhel
releases will go from beta to not beta. The fedora repo overrides are
already done in tools/provision.sh so the rhel override is set there as
well. Currently, only rhel 8.4 requires an override.
2020-11-19 10:36:49 +01:00
Jacob Kozol
0dd17ae3f7 distro: add rhel 84 support
cockpit-composer can now build rhel 8.4 images. Our distro name for
rhel 8.4 is rhel-84 unlike prior rhel releases which fall
under the umbrella name rhel-8. rhel 8.4 still uses the same
repos as the rest of the rhel 8 releases but points to a different
nightly repo for testing purposes. Test cases are added. The changes
between rhel 8.3 and 8.4 are as follows:

There is now a hybrid boot partition scheme for x86_64. x86_64 images
now use uefi boot and have 3 gpt partitions: a small unformated
partition for mbr compatibility, an efi boot partition of type vfat, and
a root partition of type xfs. The packages grub2-efi-x64 and shim-x64
are added as bootloader packages for all x86_64 images.

For qcow2 images ro is added as a kernel option and the following
packages are added (+) or removed (-):
+ dosfstools
+ efi-filesystem
+ efivar
+ efivar-libs
+ grub2-efi-x64
+ shim-x64
- rhn-client-tools
- rhnlib
- rhnsd
- rhn-setup
2020-11-19 10:36:49 +01:00
Tom Gundersen
5dac422b9c cmd/composer: drop koji configuration
Now that all interaciton with the koji API happens in the workers
we can drop koji configuration from composer itself. This means
that composer no longer needs to be provisioned with kerberos
credentials, and does not need to know about which koji servers
the workers support.
2020-11-11 18:16:42 +01:00
Ondřej Budai
8bbe2b9c0e test/image: regenerate the test cases
This commit does several things:

1) Changes the Fedora 33 repos in the test case generator from development
   to release ones.

2) Fixes format-request-map.json so we can generate fedora-iot-commit
   "images".

3) Regenerates all the cases.
2020-11-11 09:52:28 +01:00
Ondřej Budai
085e3d987d test/repos: enable gpg check
We can use GPG when using RPMRepo. Let's turn it on then.
2020-11-10 09:38:25 +01:00
Ondřej Budai
c807820774 test/repos: bump to the latest RPMRepo snapshot
This also fixes Fedora 33 repos that were pointing to a non-existing snapshot.
2020-11-10 09:38:25 +01:00