diff --git a/minimal/tmpfiles.yaml b/minimal/tmpfiles.yaml index f47d3a4..e9846cb 100644 --- a/minimal/tmpfiles.yaml +++ b/minimal/tmpfiles.yaml @@ -6,5 +6,13 @@ postprocess: # Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=771713 d /var/lib/rpm-state 0755 - - - EOF + cat > /usr/lib/tmpfiles.d/konflux-buildinfo-contentsets.conf <<'EOF' + # Workaround for https://github.com/konflux-ci/build-tasks-dockerfiles/pull/243 + d /var/roothome/buildinfo 0755 - - - + d /var/roothome/buildinfo/content_manifests 0755 - - - + # Note we don't actually try to recreate the content; this just makes the linter ignore it + f /var/roothome/buildinfo/content_manifests/content-sets.json 0644 - - - + f /var/roothome/buildinfo/labels.json 0644 - - - + EOF # Workaround for https://issues.redhat.com/browse/RHEL-106203 rm -f /usr/lib/tmpfiles.d/home.conf diff --git a/tests/rootfs/cases/tmpfiles-konflux-buildinfo b/tests/rootfs/cases/tmpfiles-konflux-buildinfo new file mode 100755 index 0000000..e03a3b6 --- /dev/null +++ b/tests/rootfs/cases/tmpfiles-konflux-buildinfo @@ -0,0 +1,18 @@ +#!/bin/bash +set -xeuo pipefail +# Verify our custom tmpfiles.d configs by actually running systemd-tmpfiles +# against a temporary root and checking the expected paths are created. +# Workaround for https://github.com/konflux-ci/build-tasks-dockerfiles/pull/243 + +tmproot=$(mktemp -d) +trap 'rm -rf "${tmproot}"' EXIT + +systemd-tmpfiles --create --root="${tmproot}" \ + /usr/lib/tmpfiles.d/bootc-base-rpmstate.conf \ + /usr/lib/tmpfiles.d/konflux-buildinfo-contentsets.conf + +test -d "${tmproot}/var/lib/rpm-state" +test -d "${tmproot}/var/roothome/buildinfo" +test -d "${tmproot}/var/roothome/buildinfo/content_manifests" +test -f "${tmproot}/var/roothome/buildinfo/content_manifests/content-sets.json" +test -f "${tmproot}/var/roothome/buildinfo/labels.json"