tests: Check "refs -c PREFIX" behavior
authorMatthew Leeds <matthew.leeds@endlessm.com>
Thu, 7 Sep 2017 18:19:34 +0000 (11:19 -0700)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 7 Sep 2017 18:49:55 +0000 (18:49 +0000)
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

tests/test-refs-collections.sh

index f36fd7b901b94a6e53d71032fe1ea84abe6d81ee..5e6b50d75124ed3fcbcfe6f087d1b9c34eb3cd1f 100755 (executable)
@@ -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