pull: Cleanly error out on unknown schemes
Previous to this we'd trip an assertion `abort()` deep in the curl code if e.g. a user did `ostree remote add foo htttp://...` etc. Motivated by considering supporting "external remotes" where code outside ostree does a pull, but we want to reuse the signing verification infrastructure.
This commit is contained in:
1 parent
0fcf4a3f30
commit
0f3bccf640
4 files changed
+34
-2
No files matched your search
+10
-2
@@ -55,10 +55,10 @@ function verify_initial_contents() {
|
||||
}
|
||||
|
||||
if has_gpgme; then
|
||||
echo "1..36"
|
||||
echo "1..37"
|
||||
else
|
||||
# 3 tests needs GPG support
|
||||
echo "1..33"
|
||||
echo "1..34"
|
||||
fi
|
||||
|
||||
# Try both syntaxes
|
||||
@@ -142,6 +142,14 @@ ${CMD_PREFIX} ostree --repo=mirrorrepo pull origin main
|
||||
${CMD_PREFIX} ostree --repo=mirrorrepo fsck
|
||||
echo "ok pull (refuses deltas)"
|
||||
|
||||
${CMD_PREFIX} ostree --repo=mirrorrepo remote add broken badscheme://something
|
||||
if ${CMD_PREFIX} ostree --repo=mirrorrepo pull broken main 2>err.txt; then
|
||||
assert_not_reached "pulled from invalid"
|
||||
fi
|
||||
assert_file_has_content_literal err.txt "Invalid URI scheme in badscheme://something"
|
||||
${CMD_PREFIX} ostree --repo=mirrorrepo remote delete broken
|
||||
echo "ok clean error on invalid scheme"
|
||||
|
||||
cd ${test_tmpdir}
|
||||
rm mirrorrepo/refs/remotes/* -rf
|
||||
${CMD_PREFIX} ostree --repo=mirrorrepo prune --refs-only
|
||||
|
||||
Reference in new issue
Block a user