summaryrefslogtreecommitdiff
path: root/tests/pull-test.sh
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2017-05-26 10:22:52 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2017-05-26 14:33:59 +0000
commitad119aece9a6c9c547d6a8dbbac020d1c0e4fdad (patch)
tree4a80ee37b6155269de59969e9375993be54e0459 /tests/pull-test.sh
parent07acb5b82cfab8383a89c58e3197bcbc8fcb0d0f (diff)
downloadostree-ad119aece9a6c9c547d6a8dbbac020d1c0e4fdad.tar.gz
pull-test: Add some 404 tests
See: https://github.com/flatpak/flatpak/issues/816 Closes: #887 Approved by: jlebon
Diffstat (limited to 'tests/pull-test.sh')
-rw-r--r--tests/pull-test.sh19
1 files changed, 18 insertions, 1 deletions
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
@@ -296,6 +296,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 \
--gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_1} -b main \