tests: Add rojig spec into base config

This is prep for fully dropping the separate spec file, which
is now just used by `commit2rojig`.

A compose test can now specify it wants YAML instead of JSON.

Closes: #1561
Approved by: jlebon
This commit is contained in:
Colin Walters 2018-09-13 16:59:28 +00:00 committed by Atomic Bot
parent f098d22e03
commit e208383526
3 changed files with 18 additions and 9 deletions

View File

@ -29,6 +29,7 @@ pyappendjsonmember() {
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
@ -48,6 +49,17 @@ EOF
pysetjsonmember "repos" '["fedora-local"]' ${treefile}
# FIXME extract from json
export treeref=fedora/stable/x86_64/${name}
if [ "${filetype}" = "yaml" ]; then
python <<EOF
import json, yaml, sys
ifn="${treefile}"
ofn=ifn.replace('.json', '.yaml')
jd=json.load(open(ifn))
with open(ofn, "w") as f:
f.write(yaml.dump(jd))
EOF
export treefile=composedata/fedora-${name}.yaml
fi
}
compose_base_argv="--repo ${repobuild}"

View File

@ -7,15 +7,7 @@ dn=$(cd $(dirname $0) && pwd)
. ${dn}/libcomposetest.sh
. ${dn}/../common/libtest.sh
prepare_compose_test "compose2jigdo"
pysetjsonmember "rojig" '{ "name": "fedora-atomic-host", "license": "MIT", "summary": "Fedora Atomic Host"}'
python <<EOF
import json, yaml
jd=json.load(open("$treefile"))
with open("$treefile.yaml", "w") as f:
f.write(yaml.dump(jd))
EOF
export treefile=$treefile.yaml
prepare_compose_test "compose2jigdo" "yaml"
mkdir cache
mkdir jigdo-output

View File

@ -1,5 +1,10 @@
{
"ref": "fedora/stable/${basearch}",
"rojig": {
"name": "fedora-atomic-host",
"license": "MIT",
"summary": "Fedora Atomic Host"
},
"releasever": "28",
"repos": ["fedora", "updates"],