osbuild/tests/unit-tests/prep-host-environment.sh
Tomáš Hozza 3ab1933d04
Don't rely on rhpkg and centpkg tools
Since [1], TMT finally applies downstream patches when extracting
sources for testing. Fixing this took eternity, and in the meantime, we
moved to using rhpkg / centpkg to prepare the sources for testing. This
is however now causing a lot of pain in c10s / el10, because these tools
are not yet build for the new distro versions.

Let's move back to relying on TMT to extract sources and apply
downstream, patches.

[1] https://github.com/teemtee/tmt/pull/2641

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-05-31 12:13:49 +02:00

35 lines
885 B
Bash
Executable File

#!/usr/bin/bash
# Prepare the host environment for running the osbuild unit tests.
# This includes installing missing dependencies and tools.
set -euxo pipefail
source /etc/os-release
# Move to the checked out git repo with the test plans
# this should be the root of the dist-git repo
cd "${TMT_TREE}"
# install all test dependencies
sudo dnf install -y \
rpmdevtools \
python3-mako \
python3-pip \
rpm-ostree \
dosfstools \
gdisk
sudo dnf builddep -y osbuild.spec
# Install pytst from pip, because the version in some RHEL / CentOS releases is too old
sudo pip3 install pytest
# Make sure that /usr/lib/systemd/boot/efi/linuxx64.efi.stub is available to enable pe32p tests
case "${ID}-${VERSION_ID}" in
rhel-8.* | centos-8)
sudo dnf install -y systemd-udev
;;
*)
sudo dnf install -y systemd-boot-unsigned
;;
esac