#!/bin/bash set -xeuo pipefail # XXX: nuke this test once we fully drop non-unified core mode dn=$(cd "$(dirname "$0")" && pwd) # shellcheck source=libcomposetest.sh . "${dn}/libcomposetest.sh" # Add a local rpm-md repo so we can mutate local test packages treefile_append "repos" '["test-repo"]' # test `recommends: false` (test-misc-tweaks tests the true path) build_rpm foobar recommends foobar-rec build_rpm foobar-rec echo gpgcheck=0 >> yumrepo.repo ln "$PWD/yumrepo.repo" config/yumrepo.repo treefile_append "packages" '["foobar"]' treefile_pyedit "tf['add-commit-metadata']['foobar'] = 'bazboo'" treefile_pyedit "tf['add-commit-metadata']['overrideme'] = 'old var'" # Test metadata json with objects, arrays, numbers cat > metadata.json < autovar.txt # Picked this one at random as an example of something that won't likely be # converted to tmpfiles.d upstream. But if it is, we can change this test. assert_file_has_content_literal autovar.txt 'd /var/cache 0755 root root - -' # And this one has a non-root uid assert_file_has_content_literal autovar.txt 'd /var/log/chrony 0755 chrony chrony - -' echo "ok autovar" # Validate this exists ostree --repo="${repo}" ls "${treeref}" /usr/lib/systemd/system/multi-user.target.wants/ostree-remount.service python3 <