diff options
author | Colin Walters <walters@verbum.org> | 2015-04-06 18:29:01 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2015-04-07 15:12:16 -0400 |
commit | c2aabcac3b69aa64ac6eb9c9b09c237e24634a65 (patch) | |
tree | e01c1c29aa972e963431a3c784a6b5be33750507 /tests/basic-test.sh | |
parent | 115e05746beac7b52f8515e34b339d65e105b5e0 (diff) | |
download | ostree-c2aabcac3b69aa64ac6eb9c9b09c237e24634a65.tar.gz |
ostree_repo_checkout_tree_at: New API for checkouts
rpm-ostree currently uses ostree_repo_checkout_tree(), which as a side
effect will use the uncompressed objects cache by default. This is
rather annoying if you're using rpm-ostree on a server-side
repository, because if you then rsync the repo, you'll be syncing out
the uncompressed objects unless you exclude them.
We added the ability to disable the uncompressed cache in the
repository config to fix this, but it's better to allow application
control over this. The uncompressed cache will in some future version
become opt in as well.
This new API further:
- Drops the `GFile` usage in favor of `openat` APIs
- Improves ergonomics by avoiding callers having to query the source
`GFileInfo` (and carry around a copy of `OSTREE_GIO_FAST_QUERYINFO`)
- Has a more extensible options structure
Per the comment, I rather crudely have the `ostree checkout` builtin
call both APIs to ensure some testing coverage.
However, I'd like to in the future have easier-to-set-up testing code
that calls `libtest.sh` to set up dummy data.
Diffstat (limited to 'tests/basic-test.sh')
-rwxr-xr-x | tests/basic-test.sh | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/basic-test.sh b/tests/basic-test.sh index 65e2229e..753f5004 100755 --- a/tests/basic-test.sh +++ b/tests/basic-test.sh @@ -19,7 +19,7 @@ set -e -echo "1..47" +echo "1..48" $OSTREE checkout test2 checkout-test2 echo "ok checkout" @@ -363,6 +363,25 @@ fi echo "ok commit of fifo was rejected" cd ${test_tmpdir} +rm repo2 -rf +mkdir repo2 +${CMD_PREFIX} ostree --repo=repo2 init --mode=archive-z2 +${CMD_PREFIX} ostree --repo=repo2 pull-local repo +rm -rf test2-checkout +${CMD_PREFIX} ostree --repo=repo2 checkout -U --disable-cache test2 test2-checkout +if test -d repo2/uncompressed-objects-cache; then + ls repo2/uncompressed-objects-cache > ls.txt + if test -s ls.txt; then + assert_not_reached "repo has uncompressed objects" + fi +fi +rm test2-checkout -rf +${CMD_PREFIX} ostree --repo=repo2 checkout -U test2 test2-checkout +assert_file_has_content test2-checkout/baz/cow moo +assert_has_dir repo2/uncompressed-objects-cache +echo "ok disable cache checkout" + +cd ${test_tmpdir} rm -rf test2-checkout mkdir -p test2-checkout cd test2-checkout |