dn=$(cd $(dirname $0) && pwd) test_tmpdir=$(mktemp -d /var/tmp/rpm-ostree-compose-test.XXXXXX) touch ${test_tmpdir}/.test trap _cleanup_tmpdir EXIT cd ${test_tmpdir} . ${dn}/../common/libtest.sh export repo=$(pwd)/repo export repobuild=$(pwd)/repo-build pyeditjson() { cat >editjson.py < ${treefile}.new && mv ${treefile}{.new,} } pyappendjsonmember() { pyeditjson "jd['"$1"'] += $2" < ${treefile} > ${treefile}.new && mv ${treefile}{.new,} } prepare_compose_test() { name=$1 shift filetype=${1:-json} ostree --repo=${repo} init --mode=archive echo 'fsync=false' >> ${repo}/config ostree --repo=${repobuild} init --mode=bare-user echo 'fsync=false' >> ${repobuild}/config mkdir -p ${test_compose_datadir}/cache cp -r ${dn}/../composedata . # We use the local RPM package cache rm -f composedata/*.repo cat > composedata/fedora-local.repo < ${treefile} pysetjsonmember "repos" '["fedora-local"]' ${treefile} # FIXME extract from json if [ "${filetype}" = "yaml" ]; then python3 <