#!/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_pyedit " tf['repo-packages'] = [{ 'repo': 'test-repo', '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 assert_file_has_content_literal autovar.txt 'd /var/cache 0755 root root - -' assert_file_has_content_literal autovar.txt 'd /var/lib/chrony 0750 chrony chrony - -' assert_file_has_content_literal autovar.txt 'L /var/mail - - - - spool/mail' assert_file_has_content_literal autovar.txt 'd /var/tmp 1777 root root - -' assert_file_has_content_literal autovar.txt 'd /var/lib/polkit-1 0750 root polkitd - -' echo "ok autovar" # Validate this exists ostree --repo="${repo}" ls "${treeref}" /usr/lib/systemd/system/multi-user.target.wants/ostree-remount.service python3 <