diff options
author | Matthew Leeds <matthew.leeds@endlessm.com> | 2019-11-13 18:30:58 -0800 |
---|---|---|
committer | Matthew Leeds <matthew.leeds@endlessm.com> | 2020-03-28 10:35:19 -0700 |
commit | 164b2aa35bc2e39615f461decc90381d9bedd132 (patch) | |
tree | 6be88335c26cb3797449ab6bb7bd1dc3580415b6 /tests/test-pull-collections.sh | |
parent | cd37293b5ad46b6158f46537b1535ae373e10cbe (diff) | |
download | ostree-164b2aa35bc2e39615f461decc90381d9bedd132.tar.gz |
Don't copy summary for collection-ref mirror subset pulls
When we're only pulling a subset of the refs available in the remote, it
doesn't make sense to copy the remote's summary (which may not be valid
for the local repo). This makes the check here match the one done
several lines above when we decide whether to error out if there's no
remote summary available.
This extends the fix in https://github.com/ostreedev/ostree/pull/935 for
the case of collection-refs.
Also, add a unit test for this issue, based on the existing one in
pull-test.sh.
Diffstat (limited to 'tests/test-pull-collections.sh')
-rwxr-xr-x | tests/test-pull-collections.sh | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/test-pull-collections.sh b/tests/test-pull-collections.sh index d1de5f88..cd60ab21 100755 --- a/tests/test-pull-collections.sh +++ b/tests/test-pull-collections.sh @@ -23,7 +23,7 @@ set -euo pipefail . $(dirname $0)/libtest.sh -echo '1..6' +echo '1..7' cd ${test_tmpdir} @@ -258,3 +258,15 @@ then fi echo "ok 6 pull refs from local repos" + +ostree_repo_init local-mirror +do_remote_add local-mirror collection-repo --collection-id org.example.CollectionRepo +# Generate a summary in the local mirror; don't use do_summary to avoid gpg +${CMD_PREFIX} ostree --repo=local-mirror summary --update +summarysig=$(sha256sum < local-mirror/summary | cut -f 1 -d ' ') +# Mirror subset of refs: A collection-ref version of https://github.com/ostreedev/ostree/issues/846 +${CMD_PREFIX} ostree --repo=local-mirror find-remotes --pull --mirror --finders=config org.example.CollectionRepo goodcref1 +newsummarysig=$(sha256sum < local-mirror/summary | cut -f 1 -d ' ') +assert_streq ${summarysig} ${newsummarysig} + +echo "ok 7 mirror pull subset of collection-refs with summary" |