summaryrefslogtreecommitdiff
path: root/tests/admin-test.sh
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2017-10-19 14:28:02 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2017-10-23 14:19:41 +0000
commit795a953a3605e7caab14ecda5d48d70276126bff (patch)
tree2ab7e44d29d407d1366eabad5df8a2bb2d36d59d /tests/admin-test.sh
parent0e0fe859223e7c6e94717f02e8ca04197934b199 (diff)
downloadostree-795a953a3605e7caab14ecda5d48d70276126bff.tar.gz
core: Add standard SOURCE_TITLE metadata key
This is a freeform string useful to track/display when a commit is "derived" from some other format. For example, in the rpm-ostree test we make a `vmcheck` ref that conceptually overlays the default ref like `fedora-atomic:fedora/26/x86_64/atomic-host`. My current patch sets the source title to e.g. "Dev overlay on fedora-atomic:fedora/26/x86_64/atomic-host". Another case I'm working on now is importing OCI images to use as host images. For that case, the source title is With this patch we could then set the original OCI image name + tag as the source name, like: "oci:cgwalters/demo-custom-fedora-atomic-host:26". Closes: #1296 Approved by: jlebon
Diffstat (limited to 'tests/admin-test.sh')
-rw-r--r--tests/admin-test.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/admin-test.sh b/tests/admin-test.sh
index f5d33a6f..dafbc79b 100644
--- a/tests/admin-test.sh
+++ b/tests/admin-test.sh
@@ -19,7 +19,7 @@
set -euo pipefail
-echo "1..$((22 + ${extra_admin_tests:-0}))"
+echo "1..$((23 + ${extra_admin_tests:-0}))"
function validate_bootloader() {
cd ${test_tmpdir};
@@ -277,6 +277,14 @@ assert_streq ${curr_rev} ${head_rev}
echo "ok upgrade with and without override-commit"
+${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string "version=${version}" \
+ --add-metadata-string 'ostree.source-title=libtest os_repository_new_commit()' -b testos/buildmaster/x86_64-runtime \
+ -s "Build" --tree=dir=${test_tmpdir}/osdata
+${CMD_PREFIX} ostree admin upgrade --os=testos
+${CMD_PREFIX} ostree admin status | tee status.txt
+assert_file_has_content_literal status.txt '`- libtest os_repository_new_commit()'
+echo "ok source title"
+
deployment=$(${CMD_PREFIX} ostree admin --sysroot=sysroot --print-current-dir)
${CMD_PREFIX} ostree --sysroot=sysroot remote add --set=gpg-verify=false remote-test-physical file://$(pwd)/testos-repo
assert_not_has_file ${deployment}/etc/ostree/remotes.d/remote-test-physical.conf testos-repo