rpm-ostree/tests/compose-tests/test-mutate-os-release.sh
Jonathan Lebon cf19d83502 ci: unite testsuites and run vmcheck on centos
We can be a bit less wasteful here by merging the check and vmcheck
suites into a single suite. The check suite today takes a negligible
amount of time to run, so we're not gaining much by parallelizing them.
It's more of a sanity check at this point before we start vmcheck.

Also start running vmcheck on CentOS 7. We adapt the ci scripts to
accomodate both Fedora and CentOS target machines.

This commit also switches to Fedora 26 as the primary test base.

Closes: #871
Approved by: cgwalters
2017-07-18 13:58:38 +00:00

60 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
set -xeuo pipefail
dn=$(cd $(dirname $0) && pwd)
. ${dn}/libcomposetest.sh
# specifying the key but neither automatic_version_prefix nor
# --add-metadata-string should cause no mutation
prepare_compose_test "mutate-os-release-none"
pysetjsonmember "mutate-os-release" '"26"'
runcompose
echo "ok compose (none)"
ostree --repo=${repobuild} cat ${treeref} \
/usr/lib/os.release.d/os-release-fedora > os-release.prop
assert_file_has_content os-release.prop VERSION_ID=26
assert_not_file_has_content os-release.prop OSTREE_VERSION=
assert_file_has_content os-release.prop 'VERSION="26 (Twenty Six)"'
echo "ok mutate-os-release-none"
# make sure --add-metadata-string has precedence and works with
# mutate-os-release
prepare_compose_test "mutate-os-release-cli"
pysetjsonmember "automatic_version_prefix" '"26.555"'
pysetjsonmember "mutate-os-release" '"26"'
runcompose --add-metadata-string=version=26.444
echo "ok compose (cli)"
ostree --repo=${repobuild} cat ${treeref} \
/usr/lib/os.release.d/os-release-fedora > os-release.prop
# VERSION_ID *shouldn't* change
# (https://github.com/projectatomic/rpm-ostree/pull/433)
assert_file_has_content os-release.prop VERSION_ID=26
assert_file_has_content os-release.prop OSTREE_VERSION=26.444
assert_file_has_content os-release.prop 'VERSION="26\.444 (Twenty Six)"'
echo "ok mutate-os-release-cli"
# make sure automatic_version_prefix works
prepare_compose_test "mutate-os-release-auto"
pysetjsonmember "automatic_version_prefix" '"26.555"'
pysetjsonmember "mutate-os-release" '"26"'
runcompose
echo "ok compose (auto)"
ostree --repo=${repobuild} cat ${treeref} \
/usr/lib/os.release.d/os-release-fedora > os-release.prop
# VERSION_ID *shouldn't* change
# (https://github.com/projectatomic/rpm-ostree/pull/433)
assert_file_has_content os-release.prop VERSION_ID=26
assert_file_has_content os-release.prop OSTREE_VERSION=26.555
assert_file_has_content os-release.prop 'VERSION="26\.555 (Twenty Six)"'
echo "ok mutate-os-release (auto)"