diff options
author | Colin Walters <walters@verbum.org> | 2021-09-07 18:02:24 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2021-09-08 07:42:25 -0400 |
commit | 511c7a13eeae0161f16a11033eec36252c6390ae (patch) | |
tree | 28a996981826f87109b615fefa4fa0acfbb47434 /tests/pull-test.sh | |
parent | 55a7e74fee369a22f9154b66136c7935fd3129f8 (diff) | |
download | ostree-511c7a13eeae0161f16a11033eec36252c6390ae.tar.gz |
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)
Diffstat (limited to 'tests/pull-test.sh')
-rw-r--r-- | tests/pull-test.sh | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/tests/pull-test.sh b/tests/pull-test.sh index 274bd978..fcc22812 100644 --- a/tests/pull-test.sh +++ b/tests/pull-test.sh @@ -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 @@ -599,6 +599,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 if ${CMD_PREFIX} ostree --repo=repo --depth=0 pull origin-bad main 2>err.txt; then |