diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/tests/rebuild.fmf b/tests/rebuild.fmf new file mode 100644 index 0000000..a1414be --- /dev/null +++ b/tests/rebuild.fmf @@ -0,0 +1,16 @@ +summary: Rebuild dependents to ensure that builds pass +discover: + - name: Rebuild collection packages + how: shell + tests: + - name: Rebuild ansible-collection-community-docker + test: tests/rebuild.sh ansible-collection-community-docker + require: + - ansible-core + - ansible-packaging + - ansible-srpm-macros + - fedpkg + - rpm-build + - sudo +execute: + how: tmt diff --git a/tests/rebuild.sh b/tests/rebuild.sh new file mode 100755 index 0000000..fbbb8b8 --- /dev/null +++ b/tests/rebuild.sh @@ -0,0 +1,27 @@ +#!/usr/bin/bash -x +set -euo pipefail + +package="${1}" + +cat <<'EOF' > ~/.rpmmacros +%_topdir %(echo $HOME)/rpmbuild +%_sourcedir %(pwd) +%_srcrpmdir %(pwd) +%_rpmdir %(pwd)/rpms +EOF + +mkdir -p clones +cd clones +fedpkg clone -a "${package}" +cd "${package}" +fedpkg srpm +sudo dnf builddep -y *.src.rpm +rc=0 +rpmbuild --rebuild *.src.rpm | tee build.log || rc=$? + +# move the results to the artifacts directory, so we can examine them +artifacts="${TEST_ARTIFACTS:-/tmp/artifacts}" +mkdir -p "${artifacts}" +mv -v *.rpm rpms/*/* build.log "${artifacts}/" || : + +exit "${rc}"