tests: Check "refs -c PREFIX" behavior

This commit adds tests to check the behavior of "refs -c PREFIX", where
prefix is interpreted as a collection ID.

Closes: #1149
Approved by: cgwalters
This commit is contained in:
Matthew Leeds 2017-09-07 11:19:34 -07:00 committed by Atomic Bot
parent 3f476ac547
commit 1e3f87c34c

View File

@ -112,9 +112,16 @@ mkdir -p adir
${CMD_PREFIX} ostree --repo=collection-repo commit --branch=rcommit -m rcommit -s rcommit adir
${CMD_PREFIX} ostree --repo=repo remote add --no-gpg-verify --collection-id org.example.RemoteCollection collection-repo-remote "file://${test_tmpdir}/collection-repo"
${CMD_PREFIX} ostree --repo=repo pull collection-repo-remote rcommit
${CMD_PREFIX} ostree --repo=repo refs --collections > refs
assert_file_has_content refs "^(org.example.RemoteCollection, rcommit)$"
${CMD_PREFIX} ostree --repo=repo refs --collections org.example.RemoteCollection > refs
assert_file_has_content refs "^(org.example.RemoteCollection, rcommit)$"
${CMD_PREFIX} ostree --repo=repo refs --collections org.example.NonexistentID > refs
assert_not_file_has_content refs "^(org.example.RemoteCollection, rcommit)$"
cd ${test_tmpdir}
mkdir no-collection-repo
ostree_repo_init no-collection-repo