diff options
author | Colin Walters <walters@verbum.org> | 2017-10-19 11:18:00 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-10-20 13:20:27 +0000 |
commit | b8251d26bd22338ca65a9ea52c6ca5107e572738 (patch) | |
tree | b0f017edb07b4f2dc8085a4b393b91815dd15a1c /tests/basic-test.sh | |
parent | 9166605e5acbffd2c4db4e8a374770830f900fbc (diff) | |
download | ostree-b8251d26bd22338ca65a9ea52c6ca5107e572738.tar.gz |
lib/checkout: For "process whiteouts" mode, replace directories too
I'm playing around with some ostree ⇔ OCI/Docker bits, and ran
into this while importing an OCI image that built from the Fedora
base image where `/home` is a regular directory, and I added a layer
that did the ostree bits of moving it to `/var` and leaving a symlink.
OCI/Docker supports this. Now since "process whiteouts" is really the
"enable OCI/Docker" mode, let's only replace dirs if that's enabled.
This leaves the `UNION_FILES` targeted for its original use case
which is unioning components/packages. (Although that use case itself
is now a bit superceded by `UNION_IDENTICAL`, but eh).
Closes: #1294
Approved by: jlebon
Diffstat (limited to 'tests/basic-test.sh')
-rw-r--r-- | tests/basic-test.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/basic-test.sh b/tests/basic-test.sh index decaf603..d7c5425c 100644 --- a/tests/basic-test.sh +++ b/tests/basic-test.sh @@ -879,6 +879,20 @@ if touch overlay/baz/.wh.cow && touch overlay/.wh.deeper; then assert_has_file overlay-co/anewdir/blah assert_has_file overlay-co/anewfile + # And test replacing a directory wholesale with a symlink as well as a regular file + mkdir overlay + echo baz to file > overlay/baz + ln -s anewfile overlay/anewdir + $OSTREE --repo=repo commit ${COMMIT_ARGS} -b overlay-dir-convert --tree=dir=overlay + rm overlay -rf + + rm overlay-co -rf + for branch in test2 overlay-dir-convert; do + $OSTREE --repo=repo checkout --union --whiteouts ${branch} overlay-co + done + assert_has_file overlay-co/baz + test -L overlay-co/anewdir + echo "ok whiteouts enabled" # Now double check whiteouts are not processed without --whiteouts |