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:
parent
f098d22e03
commit
e208383526
@ -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}"
|
||||
|
@ -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
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"ref": "fedora/stable/${basearch}",
|
||||
"rojig": {
|
||||
"name": "fedora-atomic-host",
|
||||
"license": "MIT",
|
||||
"summary": "Fedora Atomic Host"
|
||||
},
|
||||
"releasever": "28",
|
||||
|
||||
"repos": ["fedora", "updates"],
|
||||
|
Loading…
Reference in New Issue
Block a user