diff --git a/.gitignore b/.gitignore index 67fd1bd..0e225c6 100644 --- a/.gitignore +++ b/.gitignore @@ -81,3 +81,4 @@ /osbuild-composer-113.tar.gz /osbuild-composer-114.tar.gz /osbuild-composer-115.tar.gz +/osbuild-composer-116.tar.gz diff --git a/osbuild-composer.spec b/osbuild-composer.spec index 7c51492..be696bd 100644 --- a/osbuild-composer.spec +++ b/osbuild-composer.spec @@ -8,11 +8,11 @@ %bcond_with relax_requires # The minimum required osbuild version -%global min_osbuild_version 116 +%global min_osbuild_version 120 %global goipath github.com/osbuild/osbuild-composer -Version: 115 +Version: 116 %gometa @@ -172,7 +172,9 @@ install -m 0644 -vp repositories/centos-stream-%{centos}* %{buildroot}% %if 0%{?rhel} # RHEL 10 supports building all RHEL versions %if 0%{?rhel} >= 10 -install -m 0644 -vp repositories/rhel-* %{buildroot}%{_datadir}/osbuild-composer/repositories/ +for REPO_FILE in $(ls repositories/rhel-* | grep -v 'no-aux-key'); do + install -m 0644 -vp ${REPO_FILE} %{buildroot}%{_datadir}/osbuild-composer/repositories/$(basename ${REPO_FILE}) +done # RHEL-8 auxiliary key is signed using SHA-1, which is not enabled by default on RHEL-10 and later for REPO_FILE in $(ls repositories/rhel-8*-no-aux-key.json); do @@ -181,11 +183,15 @@ done %else # All other RHEL versions support building for the same version -install -m 0644 -vp repositories/rhel-%{rhel}* %{buildroot}%{_datadir}/osbuild-composer/repositories/ +for REPO_FILE in $(ls repositories/rhel-%{rhel}* | grep -v 'no-aux-key'); do + install -m 0644 -vp ${REPO_FILE} %{buildroot}%{_datadir}/osbuild-composer/repositories/$(basename ${REPO_FILE}) +done # RHEL 9 supports building also for RHEL 8 %if 0%{?rhel} == 9 -install -m 0644 -vp repositories/rhel-8* %{buildroot}%{_datadir}/osbuild-composer/repositories/ +for REPO_FILE in $(ls repositories/rhel-8* | grep -v 'no-aux-key'); do + install -m 0644 -vp ${REPO_FILE} %{buildroot}%{_datadir}/osbuild-composer/repositories/$(basename ${REPO_FILE}) +done %endif %endif @@ -446,6 +452,9 @@ Integration tests to be run on a pristine-dedicated system to test the osbuild-c %endif %changelog +* Thu Aug 15 2024 imagebuilder-bot - 116-1 +- New upstream release + * Wed Aug 07 2024 imagebuilder-bot - 115-1 - New upstream release diff --git a/plans/unit-tests.fmf b/plans/unit-tests.fmf index 7fc52d4..2ed8514 100644 --- a/plans/unit-tests.fmf +++ b/plans/unit-tests.fmf @@ -2,5 +2,7 @@ summary: Run unit tests from source discover: how: fmf dist-git-source: true + dist-git-remove-fmf-root: true + filter: tag:unit-test execute: how: tmt diff --git a/sources b/sources index 7155482..b3d7699 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (osbuild-composer-115.tar.gz) = a71a7a6fd479411f35424c95d4f826c4a5574595f61173301483fef1f6c035adbc4ed2222fca0d00a5de51c9c9c60b7af0c94177adead1600a486ccd9a8dfce7 +SHA512 (osbuild-composer-116.tar.gz) = ba4b1b78742943e9e69d20e3348053bc5821a0446782b1b6a950ce6d8d6ba30f242d69fc28d87d88a671cec03d720b015845009ea14bdb5c5363d7dadcc8b01f diff --git a/tests/unit-tests/main.fmf b/tests/unit-tests/main.fmf new file mode 100644 index 0000000..a00d71d --- /dev/null +++ b/tests/unit-tests/main.fmf @@ -0,0 +1,5 @@ +summary: Run osbuild-composer unit tests from dist-git sources +tag: unit-test +duration: 1h +test: ./run-unit-tests.sh + diff --git a/tests/unit-tests/run-unit-tests.sh b/tests/unit-tests/run-unit-tests.sh new file mode 100755 index 0000000..4295359 --- /dev/null +++ b/tests/unit-tests/run-unit-tests.sh @@ -0,0 +1,25 @@ +#!/usr/bin/bash + +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 +sudo dnf builddep -y osbuild-composer.spec + +# Move to the directory with sources +cd "${TMT_SOURCE_DIR}" + +# Extract the Source0 basename without extension +SRC_DIR=$(spectool --source 0 osbuild-composer.spec | sed 's/.\+\(osbuild-composer-[0-9]\+\)\.tar\.gz/\1/') + +# Move to the extracted sources directory (patches are applied by default) +cd "${SRC_DIR}" + +GOFLAGS="-mod=vendor -tags=exclude_graphdriver_btrfs" go test ./... + diff --git a/tests/unit.fmf b/tests/unit.fmf deleted file mode 100644 index 16dfdee..0000000 --- a/tests/unit.fmf +++ /dev/null @@ -1,5 +0,0 @@ -summary: Run unit tests -require: - - golang -test: cd ../osbuild-composer-*/ && sudo dnf builddep -y osbuild-composer.spec && GOFLAGS="-mod=vendor -tags=exclude_graphdriver_btrfs" go test ./... -duration: 1h