Commit graph

2319 commits

Author SHA1 Message Date
Achilleas Koutsou
359100e1a1 test/api.sh: more robust edge commit validation
Instead of inspecting the tarball directly, extract it and use ostree to
verify the ref and commit ID.

Adds some data to the CI artifacts directory:
- Build manifest
- Tarball file list for s3 edge commit with s3 upload
- Build metadata
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
fe1ed9f869 distro/rhel85: remove broken arch-imgType combo check
The specific combination isn't broken in RHEL 8.5. The condition check
was added accidentally when copying the tests from RHEL 8.4.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
67c5e099ed tools: flush print in test case generator
When not flushed, the line often doesn't get printed until after the job
is done. Printing it before the job is useful for knowing the progress
of a multi-job run.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
347fcf74a6 osbuild2: base device options are optional 2021-07-24 15:54:00 +02:00
Achilleas Koutsou
2b558e49ab distro/rhel85: init mounts array to 0 elements
Since partitions without a filesystem are skipped, we need to
dynamically append to create the mounts array instead of pre-allocating
to the number of partitions.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
6313532c90 distro/rhel85: add blueprint pkgs to ostree pipeline
Blueprint packages are now defined and passed into Manifest()
separately. The main osPipelines() already has an argument for
explicitly passing the blueprint packages. Added the same for the ostree
pipelines.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
4048383e07 distro/rhel85: package set key consts in pipelines
Use the package set key constants defined in distro in the pipeline
definitions as well.
2021-07-24 15:54:00 +02:00
Ondřej Budai
57e8ca0e5f distro/rhel85: sort mounts
Previously, /boot/efi mount was specified before /. This obviously doesn't
work because we need to mount / firstly.

This commit adds explicit ordering of the mounts.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-07-24 15:54:00 +02:00
Ondřej Budai
c656972f25 osbuild2: specify mounts as an array
osbuild has recently got support for specifying mounts as an array. This
commit takes advantage of it and uses this new format.

This allows us to specify the order of mounts which is important because
we cannot mount /boot/efi before / is mounted.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-07-24 15:54:00 +02:00
Tomas Hozza
3a2415d970 distro/rhel85: add image type aliases for EDGE image types
EDGE image types are defined under a different name for RHEL-8.5,
specifically they don't contain the "rhel-" prefix any more. To ensure
backward compatibility, add image type aliases for all EDGE image types
with the "rhel-" prefix.

Image type aliases are used only when getting a specific imageType
instance by its name. When listing all available image types for an
architecture, only the current image type names are returned, without
any aliases. This prevents the image types from being exposed multiple
times under different names via Weldr API.

Extend the distro unit tests to test image type aliases.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-07-24 15:54:00 +02:00
Tomas Hozza
b3cb01cea4 distro/rhel85: refactor TestFilenameFromType test
Refactor data structures used for test cases in the
`TestFilenameFromType()` to have more descriptive names.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-07-24 15:54:00 +02:00
Tomas Hozza
e45e117a0b distro/rhel85: don't copy architecture when adding it to a distro
Originally, a copy of an architecture instance was always created when it
was added to a distro definition using the `addArches()` method.
However in reality, only a subset of structure members were copied,
which could create unexpected behavior and issues. This behavior is
identical to the behavior when image types are added to an architecture.
However the situation with image types differs in one aspect,
specifically that a single image type definition is usually reused
by multiple architecture definitions, while an architecture definition
is always used only by a single distribution definition.
Due to the fact that the image type contains a reference to the
architecture to which it has been added, the creation of a copy can not
be reasonably avoided. On the other hand, adding a copy of an architecture
to a distribution definition is not necessary.

Downside of creating copies of the architecture is that the image types
associated with it referred always to the original architecture
definition instance and not to the copy. So while references in the
direction of Distro -> Arch -> Image Type were correct and working, the
other direction was broken. Image Type -> (original) Arch -> (nil)
Distro.

Modify `distribution.AddArches()` method to directly add the passed
architecture instances to the distribution definition, instead of adding
their copies.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-07-24 15:54:00 +02:00
Ondřej Budai
025403ad34 tests/rhel8.5: use nightly composes instead of development ones
Nightly composes are more stable because they contain only builds attached
to advisories whereas development composes contain latest brew builds.

Use nightlies because they should be stabler.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-07-24 15:54:00 +02:00
Ondřej Budai
dc2458fc23 test/libvirt: run the uefi test also for 8.5
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-07-24 15:54:00 +02:00
Ondřej Budai
985dbcfeec distro/rhel85: handle subscriptions only once in the pipeline
Previously, the first boot stage was added twice if the subscription
customization was enabled. This doesn't work because the first boot stage
cannot be specified twice in one pipeline. Also, it didn't make much sense
because it just duplicated the effort so I just removed one of the two stages.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-07-24 15:54:00 +02:00
Ondřej Budai
d1da221a8c distro/rhel85: fix name of exported pipeline
it's actually vpc, not vhd

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-07-24 15:54:00 +02:00
Ondřej Budai
fba77534fd test/api: add RHEL 8.5 case
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-07-24 15:54:00 +02:00
Ondřej Budai
9e4052e0e6 ci: enable all RHEL 8.5 tests
run 8.5 libvirt tests on openstack so we have KVM.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
47ae5de5c0 test/cases: stop the spread of the tet typo
Hoping this is the end of this viral typo.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
8d64cb9665 distro/rhel85: const strings for package set keys
const string keys make the names easier to reuse or change and is less
error prone.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
5909ca202d disk: boot partition finder as partitiontable method
Moved the function that searches for the boot partition index to the
PartitionTable struct as a method. The method returns -1 if not found
and it's now the responsibility of the caller to handle the case where
it is not found.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
bc1b45f7fa qemu stage test squash 2021-07-24 15:54:00 +02:00
Achilleas Koutsou
8fc74d1e73 tools/test-case-generators: update distro map
Added RHEL 8.5 image types to distro-arch-imagetype map
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
35f0ef1053 test: regression test installing excluded dependency
Unlike the original regression test which explicitly names the excluded
dependency, this test installs a package that depends on the excluded
package without naming it. Based on the new way we depsolve blueprint
packages in RHEL 8.5, this should now work as well.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
2444e633fb test: separate regression from base tests
- Rewrote regression.sh to be like base tests with list of regression
  test scripts to be run and fail counts
- Separate regression tests in CI to have better control of distro
  runners
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
ce0fddf4c2 osbuild2: unit tests for new stages 2021-07-24 15:54:00 +02:00
Achilleas Koutsou
dc62275d4d common: helper function for uint64 ptr 2021-07-24 15:54:00 +02:00
Achilleas Koutsou
cba720e63f rhel85: depsolve blueprint packages separately
To avoid packages specified in a blueprint from conflicting with exclude
lists, we depsolve blueprint packages separately and pass them into the
Manifest generator under the new "blueprint" package set key.

This approach has the added benefit that dependencies of packages
specified in the blueprint are not subject to exclusion in addition to
the explicitly named packages.

The OS pipeline which installs the packages for the base system merges
the two package sets before running the RPM stage. The signature of the
function is changed to explicitly require blueprint packages be
specified (though `nil` or empty slice is valid).

The kernel selection test is adapted to merge the package sets before
counting kernel package.

Adaptation of changes in
https://github.com/osbuild/osbuild-composer/pull/1349
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
cc0f75b38f CI: remove rhel-8.4 runner for base tests 2021-07-24 15:54:00 +02:00
Achilleas Koutsou
190f473b04 distro/rhel85: update unit tests 2021-07-24 15:54:00 +02:00
Achilleas Koutsou
d6ec5aa59e distro/rhel85: update ami package set
Based on http://git.app.eng.bos.redhat.com/git/spin-kickstarts.git/tree/rhel8/rhel-8.5-ec2.ks
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
b8d34d7679 distro/rhel85: introduce the ami image type
This is a copy of the ami image type from RHEL 8.4.
Small modifications are necessary.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
1f005a55b9 distro/rhel85: don't always install bootloader
Don't install bootloader unless `platform` (imageType.arch.legacy) is
defined.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
9c3c956655 distro/rhel85: aarch64 uefi: true 2021-07-24 15:54:00 +02:00
Achilleas Koutsou
3f0f4ffab9 distro/rhel85: simplify edge types and package sets
- Cleaned up distro-specific edge package sets
- Added edge package set merging in PackageSets() function
- Edge image type definitions are no longer arch specific, just like the
  other image types
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
44a22bbb14 test/data: add aarch64 repos for RHEL 8.5 2021-07-24 15:54:00 +02:00
Achilleas Koutsou
78920efc36 distro/rhel85: partition table fixes
- Automatically find /boot partition (fallback to root)
- Partition sizes need a bit of a shrink
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
cd030c0bd6 CI: enable base tests on RHEL 8.5 2021-07-24 15:54:00 +02:00
Achilleas Koutsou
876a67ccb0 distro/rhel85: introduce the openstack image type 2021-07-24 15:54:00 +02:00
Achilleas Koutsou
ceba83dcca distro/rhel85: introduce the vmdk image type 2021-07-24 15:54:00 +02:00
Achilleas Koutsou
2ef462bdaa distro/rhel85: add dhcp-client to vhd packages
Is no longer installed by default but is required to boot in Azure
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
1ed9008785 distro/rhel85: introduce the vhd image type 2021-07-24 15:54:00 +02:00
Achilleas Koutsou
3eae16badb distro/rhel85: remove installer type for aarch64
The installer image type needs package definitions and testing before it
can be included in aarch64.
Removing for now.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
f09bf063c8 distro/rhel85: tidy up package sets
- Move all package set definitions to package_sets.go file.
- Do not append image package sets to arch and distro sets; this happens
  automatically in PackageSets() method.
- Fix architecture-specific package sets (boot and build where
  available).
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
dec74dba32 distro/rhel85: add image and qcow pipelines
Live image pipeline: Creates the live image in a file through a loopback
device.

Stages:
- truncate: create the file to hold the image
- sfdisk: partition the device
- mkfs.fat, mkfs.xfs: create the filesystems
- copy: copy the tree from the previous pipeline (the OS pipeline) into
  the directories where the partitions are mounted
- grub2.inst: install the bootloader

QEMU pipeline: Convert the live image from the previous pipeline to a
qcow2 image.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
6debb62758 osbuild2: separate input base types into new file
Keep input base types / interfaces separately from stages for
readability.
Cleaned up some unused interfaces in the process.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
e85fc3b48c osbuild2: new stages and osbuild features
Stages:
- org.osbuild.copy
- org.osbuild.truncate
- org.osbuild.sfdisk
- org.osbuild.qemu
- org.osbuild.mkfs.btrfs
- org.osbuild.mkfs.ext4
- org.osbuild.mkfs.fat
- org.osbuild.mkfs.xfs
- org.osbuild.grub2.inst

Stages can now have devices and mounts in addition to options and
inputs.

Devices:
- org.osbuild.loopback

Mounts:
- org.osbuild.btrfs
- org.osbuild.ext4
- org.osbuild.fat
- org.osbuild.xfs
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
4cf26bb628 distro/rhel85: split coreStages() implementation
coreStages() was meant to produce the stages that are common between all
image types. Since there are too many exceptions and differences between
traditional and edge image types, keep the two pipelines separately
instead.

Moved SELinux stages to the end of each pipeline.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
39371b01ba distro/rhel85: document selinuxStageOptions arg
Renamed the argument to have clearer (and correct) meaning and added a
function docstring to describe the purpose.

The argument is set to 'true' in the build pipeline.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
708de084aa distro/rhel85: add grub2 stage options 2021-07-24 15:54:00 +02:00