Add support for "custom remotes"
This will be helpful for the "ostree native container" work in https://github.com/ostreedev/ostree-rs-ext/ Basically in order to reuse GPG/signapi verification, we need to support adding a remote, even though it can't be used via `ostree pull`. (At least, not until we merge ostree-rs-ext into ostree, but even then I think the principle stands)
This commit is contained in:
1 parent
55a7e74fee
commit
511c7a13ee
5 files changed
+93
-22
No files matched your search
+29
-2
@@ -55,10 +55,10 @@ function verify_initial_contents() {
|
||||
}
|
||||
|
||||
if has_gpgme; then
|
||||
echo "1..37"
|
||||
echo "1..38"
|
||||
else
|
||||
# 3 tests needs GPG support
|
||||
echo "1..34"
|
||||
echo "1..35"
|
||||
fi
|
||||
|
||||
# Try both syntaxes
|
||||
@@ -598,6 +598,33 @@ assert_file_has_content err.txt "ONE BILLION DOLLARS"
|
||||
|
||||
echo "ok unconfigured"
|
||||
|
||||
cd ${test_tmpdir}
|
||||
${CMD_PREFIX} ostree --repo=repo remote add --custom-backend=ostree-rs-ext fromcontainer
|
||||
if ${CMD_PREFIX} ostree --repo=repo pull fromcontainer 2>err.txt; then
|
||||
assert_not_reached "pull unexpectedly succeeded?"
|
||||
fi
|
||||
assert_file_has_content err.txt "remote 'fromcontainer' uses custom backend 'ostree-rs-ext'"
|
||||
|
||||
for x in show-url refs; do
|
||||
if ${CMD_PREFIX} ostree --repo=repo remote "$x" fromcontainer 2>err.txt; then
|
||||
assert_file_has_content err.txt "remote 'fromcontainer' uses custom backend 'ostree-rs-ext'"
|
||||
assert_not_reached "no url expected"
|
||||
fi
|
||||
assert_file_has_content err.txt "No \"url\" option in remote"
|
||||
done
|
||||
${CMD_PREFIX} ostree --repo=repo remote delete fromcontainer
|
||||
|
||||
${CMD_PREFIX} ostree --repo=repo remote add --custom-backend=ostree-rs-ext fromcontainer2 docker://quay.io/examplecorp/foo
|
||||
if ${CMD_PREFIX} ostree --repo=repo pull fromcontainer2 main 2>err.txt; then
|
||||
assert_not_reached "pull unexpectedly succeeded?"
|
||||
fi
|
||||
assert_file_has_content err.txt "remote 'fromcontainer2' uses custom backend 'ostree-rs-ext'"
|
||||
${CMD_PREFIX} ostree --repo=repo remote show-url fromcontainer2 >out.txt
|
||||
assert_file_has_content out.txt docker://quay.io/examplecorp/foo
|
||||
${CMD_PREFIX} ostree --repo=repo remote delete fromcontainer2
|
||||
|
||||
echo "ok custom backend"
|
||||
|
||||
cd ${test_tmpdir}
|
||||
repo_init
|
||||
${CMD_PREFIX} ostree --repo=repo remote add origin-bad $(cat httpd-address)/ostree/noent
|
||||
|
||||
Reference in new issue
Block a user