From 2bb25a05b0e4a3945a41ab10ac83ccc3b729bf4c Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Fri, 11 Mar 2016 13:04:54 +0100 Subject: [PATCH] tests: add test for summary file caching Signed-off-by: Giuseppe Scrivano --- tests/test-pull-summary-sigs.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/test-pull-summary-sigs.sh b/tests/test-pull-summary-sigs.sh index 95375b7f..202efdae 100755 --- a/tests/test-pull-summary-sigs.sh +++ b/tests/test-pull-summary-sigs.sh @@ -21,7 +21,7 @@ set -euo pipefail . $(dirname $0)/libtest.sh -echo "1..5" +echo "1..6" COMMIT_SIGN="--gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_1}" setup_fake_remote_repo1 "archive-z2" "${COMMIT_SIGN}" @@ -73,8 +73,25 @@ repo_reinit () { cd ${test_tmpdir} repo_reinit ${OSTREE} --repo=repo pull origin main +assert_has_file repo/tmp/cache/summaries/origin +assert_has_file repo/tmp/cache/summaries/origin.sig + +rm repo/tmp/cache/summaries/origin +${OSTREE} --repo=repo pull origin main +assert_has_file repo/tmp/cache/summaries/origin + echo "ok pull with signed summary" +touch repo/tmp/cache/summaries/foo +touch repo/tmp/cache/summaries/foo.sig +${OSTREE} --repo=repo prune +assert_not_has_file repo/tmp/cache/summaries/foo +assert_not_has_file repo/tmp/cache/summaries/foo.sig +assert_has_file repo/tmp/cache/summaries/origin +assert_has_file repo/tmp/cache/summaries/origin.sig +echo "ok prune summary cache" + + cd ${test_tmpdir} repo_reinit mv ${test_tmpdir}/ostree-srv/gnomerepo/summary.sig{,.good}