summaryrefslogtreecommitdiff
path: root/tests/pull-test.sh
diff options
context:
space:
mode:
authorJonathan Lebon <jlebon@redhat.com>2017-03-02 12:11:17 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2017-03-02 20:35:24 +0000
commit199646ccfa59f919d92af956195e3997d370d236 (patch)
tree5d60a3ddaca5131f634d112ddf6a6a9cc4609995 /tests/pull-test.sh
parent64422a7d0beb5243d051320cc94c14324b845049 (diff)
downloadostree-199646ccfa59f919d92af956195e3997d370d236.tar.gz
pull: don't use static deltas if archive repo
In https://github.com/ostreedev/ostree/pull/408, we disabled the use of static deltas when mirroring. Later, https://github.com/ostreedev/ostree/pull/506 loosened this up again so that we could use static deltas when mirroring into bare{-user} repos. However, the issue which originally spurrred #408 is even more generic than that: we want to avoid static deltas for any archive repo, not just when doing a mirror pull. This patch tightens this up, and also relocates the decision code to make it easier to read. Closes: #715 Approved by: cgwalters
Diffstat (limited to 'tests/pull-test.sh')
-rw-r--r--tests/pull-test.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/pull-test.sh b/tests/pull-test.sh
index 693eac06..f6176079 100644
--- a/tests/pull-test.sh
+++ b/tests/pull-test.sh
@@ -35,7 +35,7 @@ function verify_initial_contents() {
assert_file_has_content baz/cow '^moo$'
}
-echo "1..14"
+echo "1..15"
# Try both syntaxes
repo_init
@@ -70,6 +70,16 @@ ${CMD_PREFIX} ostree --repo=mirrorrepo fsck
echo "ok pull mirror (should not apply deltas)"
cd ${test_tmpdir}
+if ${CMD_PREFIX} ostree --repo=mirrorrepo \
+ pull origin main --require-static-deltas 2>err.txt; then
+ assert_not_reached "--require-static-deltas unexpectedly succeeded"
+fi
+assert_file_has_content err.txt "Can't use static deltas in an archive repo"
+${CMD_PREFIX} ostree --repo=mirrorrepo pull origin main
+${CMD_PREFIX} ostree --repo=mirrorrepo fsck
+echo "ok pull (refuses deltas)"
+
+cd ${test_tmpdir}
rm mirrorrepo/refs/remotes/* -rf
${CMD_PREFIX} ostree --repo=mirrorrepo prune --refs-only
${CMD_PREFIX} ostree --repo=mirrorrepo pull origin main