From ad119aece9a6c9c547d6a8dbbac020d1c0e4fdad Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 26 May 2017 10:22:52 -0400 Subject: [PATCH] pull-test: Add some 404 tests See: https://github.com/flatpak/flatpak/issues/816 Closes: #887 Approved by: jlebon --- tests/pull-test.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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 \