From: Colin Walters Date: Fri, 26 May 2017 14:22:52 +0000 (-0400) Subject: pull-test: Add some 404 tests X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~36^2~66 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ad119aece9a6c9c547d6a8dbbac020d1c0e4fdad;p=ostree.git pull-test: Add some 404 tests See: https://github.com/flatpak/flatpak/issues/816 Closes: #887 Approved by: jlebon --- diff --git a/tests/pull-test.sh b/tests/pull-test.sh index 3a836da9..4a4ef069 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..18" +echo "1..20" # Try both syntaxes repo_init --no-gpg-verify @@ -295,6 +295,23 @@ assert_file_has_content err.txt "ONE BILLION DOLLARS" echo "ok unconfigured" +cd ${test_tmpdir} +repo_init +${CMD_PREFIX} ostree --repo=repo remote add origin-bad $(cat httpd-address)/ostree/noent +if ${CMD_PREFIX} ostree --repo=repo --depth=0 pull origin-bad main 2>err.txt; then + assert_not_reached "pull repo 404 succeeded?" +fi +assert_file_has_content err.txt "404" +echo "ok pull repo 404" + +cd ${test_tmpdir} +repo_init --set=gpg-verify=true +if ${CMD_PREFIX} ostree --repo=repo --depth=0 pull origin main 2>err.txt; then + assert_not_reached "pull repo 404 succeeded?" +fi +assert_file_has_content err.txt "GPG verification enabled, but no signatures found" +echo "ok pull repo 404 (gpg)" + cd ${test_tmpdir} repo_init --set=gpg-verify=true ${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo commit \