diff options
author | Colin Walters <walters@verbum.org> | 2018-12-04 09:37:20 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-12-04 20:38:41 +0000 |
commit | dc2a7de2170aa35c33c9e767532f94be7f6f32c0 (patch) | |
tree | 372ddc98f3764e8f957bcdd947dd0231039a68c0 /tests/test-pull-untrusted.sh | |
parent | c515c69d484f37be7d407dbcdaae10f6810b266b (diff) | |
download | ostree-dc2a7de2170aa35c33c9e767532f94be7f6f32c0.tar.gz |
lib/commit: Try checksum+hardlink for untrusted local same-uid repos
This mainly helps flatpak for enabling a hardlink-able local pull
during deploy in the --system case. We assume the files are immutable
when owned by the same uid.
See https://github.com/ostreedev/ostree/issues/1723
and https://github.com/flatpak/flatpak/pull/2342
Closes: #1776
Approved by: uajain
Diffstat (limited to 'tests/test-pull-untrusted.sh')
-rwxr-xr-x | tests/test-pull-untrusted.sh | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/tests/test-pull-untrusted.sh b/tests/test-pull-untrusted.sh index 4c972599..ec48eb3e 100755 --- a/tests/test-pull-untrusted.sh +++ b/tests/test-pull-untrusted.sh @@ -25,53 +25,11 @@ set -euo pipefail . $(dirname $0)/libtest.sh -echo '1..4' +echo '1..1' setup_test_repository "bare" cd ${test_tmpdir} -mkdir repo2 -ostree_repo_init repo2 --mode="bare" - -${CMD_PREFIX} ostree --repo=repo2 --untrusted pull-local repo - -find repo2 -type f -links +1 | while read line; do - assert_not_reached "pull-local created hardlinks" -done -echo "ok pull-local --untrusted didn't hardlink" - -# Corrupt repo -for i in ${test_tmpdir}/repo/objects/*/*.file; do - - # make sure it's not a symlink - if [ -L $i ]; then - continue - fi - - echo "corrupting $i" - echo "broke" >> $i - break; -done - -rm -rf repo2 -mkdir repo2 -ostree_repo_init repo2 --mode="bare" -if ${CMD_PREFIX} ostree --repo=repo2 pull-local repo; then - echo "ok trusted pull with corruption succeeded" -else - assert_not_reached "corrupted trusted pull unexpectedly succeeded!" -fi - -rm -rf repo2 -ostree_repo_init repo2 --mode="bare" -if ${CMD_PREFIX} ostree --repo=repo2 pull-local --untrusted repo; then - assert_not_reached "corrupted untrusted pull unexpectedly failed!" -else - echo "ok untrusted pull with corruption failed" -fi - - -cd ${test_tmpdir} tar xf ${test_srcdir}/ostree-path-traverse.tar.gz rm -rf repo2 ostree_repo_init repo2 --mode=archive |