summaryrefslogtreecommitdiff
path: root/tests/test-find-remotes.sh
diff options
context:
space:
mode:
authorMatthew Leeds <matthew.leeds@endlessm.com>2017-08-21 17:08:12 -0700
committerAtomic Bot <atomic-devel@projectatomic.io>2017-08-24 19:57:33 +0000
commit7ed881baa75192521fa972fa702c66470dc0a225 (patch)
tree7a9894b29017f040486928c215e65a860b229bd4 /tests/test-find-remotes.sh
parent95bac299e54020e6cc795b126deefc8c2c7820f4 (diff)
downloadostree-7ed881baa75192521fa972fa702c66470dc0a225.tar.gz
lib/repo-refs: Include remote refs when using collections
When working with collections it can be useful to see remote refs rather than just local and mirrored ones. This commit changes the "ostree refs -c" output to include remote refs, and includes remote refs with collection IDs in summary file generation as well. The former behavior is consistent with how "ostree refs" works, and the latter behavior is useful in facilitating P2P updates even when mirrors haven't been configured. To accomplish this, OstreeRepoListRefsExtFlags was extended with an EXCLUDE_REMOTES flag. This was done rather than an INCLUDE_REMOTES flag so that existing calls to ostree_repo_list_refs_ext continue to have the same behavior. This flag was added to ostree_repo_list_collection_refs (which is an experimental API break). Also, add unit tests for the "refs -c" and summary file behavior, and update relevant tests. Closes: #1069 Approved by: cgwalters
Diffstat (limited to 'tests/test-find-remotes.sh')
-rwxr-xr-xtests/test-find-remotes.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test-find-remotes.sh b/tests/test-find-remotes.sh
index 0cf0127f..0bbe54f0 100755
--- a/tests/test-find-remotes.sh
+++ b/tests/test-find-remotes.sh
@@ -56,8 +56,11 @@ ${CMD_PREFIX} ostree --repo=local refs > refs
assert_file_has_content refs "^apps-remote:app1$"
assert_file_has_content refs "^os-remote:os/amd64/master$"
-${CMD_PREFIX} ostree --repo=local refs --collections | wc -l > refscount
-assert_file_has_content refscount "^0$"
+${CMD_PREFIX} ostree --repo=local refs --collections > refs
+cat refs | wc -l > refscount
+assert_file_has_content refs "^(org.example.AppsCollection, app1)$"
+assert_file_has_content refs "^(org.example.OsCollection, os/amd64/master)$"
+assert_file_has_content refscount "^2$"
# Create a local mirror repository where we pull the branches *in mirror mode* from the two remotes.
# This should pull them into refs/mirrors, since the remotes advertise a collection ID.