diff options
author | Alexander Larsson <alexl@redhat.com> | 2020-10-09 16:30:29 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2020-10-23 13:55:33 +0200 |
commit | bc924ff8709845ab1add41367d51a972d89a7488 (patch) | |
tree | b12a448e7bb3d1cb57d6f04aa1cf7f5fa57d697c | |
parent | 125ed2b199153768f92049e48eb2cd40010f87ca (diff) | |
download | ostree-bc924ff8709845ab1add41367d51a972d89a7488.tar.gz |
tests: Add a testcase to ensure we're not using the summary if we don't need it
With deltas outside the summary, if a commit is specified when pulling
we don't download the summary. Verify this.
-rw-r--r-- | tests/pull-test.sh | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/tests/pull-test.sh b/tests/pull-test.sh index 082ed315..08921838 100644 --- a/tests/pull-test.sh +++ b/tests/pull-test.sh @@ -55,10 +55,10 @@ function verify_initial_contents() { } if has_gpgme; then - echo "1..35" + echo "1..36" else # 3 tests needs GPG support - echo "1..32" + echo "1..33" fi # Try both syntaxes @@ -381,6 +381,25 @@ assert_file_has_content err.txt "Upgrade.*is chronologically older" ${CMD_PREFIX} ostree --repo=repo pull --timestamp-check-from-rev=${oldrev} origin main@${middlerev} echo "ok pull timestamp checking" +# test pull without override commit use summary, but with doesn't use summary +# We temporarily replace summary with broken one to detect if it is used +mv ostree-srv/gnomerepo/summary ostree-srv/gnomerepo/summary.backup +echo "broken" > ostree-srv/gnomerepo/summary + +repo_init --no-sign-verify +rev=$(ostree --repo=ostree-srv/gnomerepo rev-parse main) +# This will need summary, so will fail +if ${CMD_PREFIX} ostree --repo=repo -v pull origin main; then + assert_not_reached "Should have failed with broken summary" +fi +# This won't need summary so will not fail +${CMD_PREFIX} ostree --repo=repo pull origin main@${rev} + +# Restore summary +mv ostree-srv/gnomerepo/summary.backup ostree-srv/gnomerepo/summary + +echo "ok pull with override id doesn't use summary" + cd ${test_tmpdir} repo_init --no-sign-verify ${CMD_PREFIX} ostree --repo=repo pull origin main |