summaryrefslogtreecommitdiff
path: root/tests/test-rofiles-fuse.sh
Commit message (Collapse)AuthorAgeFilesLines
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* rofiles-fuse: Enable support for setting and getting xattrsStefan Berger2021-04-051-1/+21
| | | | | | | | Enable support for setting and getting xattrs. Allow modifications to xattrs only on user.ima xattr. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Co-authored-by: Colin Walters <walters@verbum.org>
* tests/libtest: Allow appending actions to be run on EXITDan Nicholson2019-06-191-1/+1
| | | | | | | | | | Currently if a test script adds a trap on `EXIT` to run some cleanup, it will stomp on the existing trap to run `save_core()`. Allow for scripts to append actions that will run on exit by introducing an array that will be iterated over by a single exit runner. Closes: #1799 Approved by: cgwalters
* Add SPDX-License-Identifier to source filesMarcus Folkesson2018-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | SPDX License List is a list of (common) open source licenses that can be referred to by a “short identifier”. It has several advantages compared to the common "license header texts" usually found in source files. Some of the advantages: * It is precise; there is no ambiguity due to variations in license header text * It is language neutral * It is easy to machine process * It is concise * It is simple and can be used without much cost in interpreted environments like java Script, etc. * An SPDX license identifier is immutable. * It provides simple guidance for developers who want to make sure the license for their code is respected See http://spdx.org for further reading. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Closes: #1439 Approved by: cgwalters
* rofiles: Fix --copyup when creating a new fileColin Walters2018-01-081-8/+43
| | | | | | | | | | | | | | | This tripped up the `docbook-dtds` `%post` in my experiments with doing rpm-ostree for buildroots. I cloned and built [xfstests](https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git) but haven't yet investigated actually running it. In the meantime let's do the obvious fix here; we need to distinguish between "copyup enabled" and "actually did a copyup" in the open path at least, since if we didn't do a copyup we don't need to re-open. Closes: #1396 Approved by: jlebon
* rofiles: Add --copyup optionColin Walters2018-01-051-1/+21
| | | | | | | | | | | | | | | Sadly https://sourceware.org/bugzilla/show_bug.cgi?id=22089 is I think going to actually force us to cave here. Even if we got the glibc patch in today, we need to support the RHEL glibc. See also discussion about fish as part of the general Fedora tracker. This is basically needed to unblock rpm-ostree unified core 🌐: https://github.com/projectatomic/rpm-ostree/issues/729 Closes: https://github.com/ostreedev/ostree/issues/1377 Closes: #1382 Approved by: jlebon
* rofiles-fuse: also pass mode for O_RDONLYJonathan Lebon2017-09-211-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the `O_RDONLY` case, we were calling `openat` without a mode argument. However, it's perfectly legal (albeit unusual) to do `open(O_RDONLY|O_CREAT)`. One such application that makes use of this is `flock(1)`. This was actually caught by `_FORTIFY_SOURCE=2`, and once we run `rofiles-fuse` with `-f`, the message is clear: ``` *** invalid openat64 call: O_CREAT or O_TMPFILE without mode ***: rofiles-fuse terminated ======= Backtrace: ========= /lib64/libc.so.6(+0x7c8dc)[0x7f36d9f188dc] /lib64/libc.so.6(__fortify_fail+0x37)[0x7f36d9fbfaa7] /lib64/libc.so.6(+0x10019a)[0x7f36d9f9c19a] rofiles-fuse[0x401768] ... ``` Without `_FORTIFY_SOURCE`, the file gets created, but its mode is completely random. I ran into this while investigating https://github.com/projectatomic/rpm-ostree/pull/1003. Closes: #1200 Approved by: cgwalters
* rofiles-fuse: Fix lchown() and hardlink verification for symlinksAlexander Larsson2017-09-081-14/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you lchown("symlink") then we were incorrectly trying to chown the symlink target, rather than the symlink itself. In particular, this cause cp -a to fail for a broken symlink. Additionally, it was using the symlink target when verifying writability, rather than the symlink itself. To fix this, we need pass AT_SYMLINK_NOFOLLOW in these cases. In general, the kernel itself will always resolve any symlinks for us before calling into the fuse backend, so we should really never do any symlink following in the fuse fs itself. So, we pro-actively add NOFOLLOW flags to a few other places: truncate: In reality this will never be hit, because the kernel will resolve symlinks before calling us. access: It seems the current fuse implementation never calls this (faccessat w/AT_SYMLINK_NOFOLLOW never reaches the fuse fs) but if this ever is implemented this is the correct behaviour. We would ideally do `chmod` but this is not implemented on current kernels. Because we're not multi-threaded, this is OK anyways. Further, our write verification wasn't correctly handling the case of hardlinked symlinks, which can occur for `bare` checkouts but *not* `bare-user` which the tests were using. Change to `bare` mode to verify that. Closes: #1137 Approved by: alexlarsson
* tests/rofiles-fuse: Add tests for chmod/chownColin Walters2017-09-071-4/+17
| | | | | | | | Prep for https://github.com/ostreedev/ostree/pull/1137 where we were incorrectly handling `chown()` on symlinks. Closes: #1141 Approved by: jlebon
* repo/checkout: Verify early if src/destination are on same deviceColin Walters2017-03-061-1/+1
| | | | | | | | | | At least in all Linux kernels up to today, one can never `link()` across devices, so we might as well verify that up front. This will help for a future patch to add a new type of union-add checkout, since Linux checks for `EEXIST` before `EXDEV`. Closes: #714 Approved by: jlebon
* test-rofiles-fuse: Actually check out via hardlinksColin Walters2016-08-161-1/+1
| | | | | | | | | | | | | The test suite was actually doing something before, just not quite what I intended. Without `-U` for bare-user checkouts we end up doing a copy. Now, a future commit will change how rofiles work, which would cause the test suite to permit inplace mutation for non-hardlinked files. So let's ensure they *are* hardlinked. Closes: #462 Approved by: jlebon
* checkout: Add an option to require hardlinksColin Walters2016-06-271-1/+11
| | | | | | | | | | | | | | | | | I've seen a few people hit this and wonder why checkouts are slow/take space. Really, ensuring this happens is the *point* of OSTree. Physical copies should be a last resort fallback for very unusual situations (one of those is rpm-ostree checking out the db since librpm doesn't know how to read from libostree). Even I hit the fact that `/var` is a mountpoint disallowing hardlinks with `/ostree` once and was confused. =) Add this to the rofiles-fuse test case because it creates a mount point. Closes: #368 Approved by: jlebon
* Skip tests that run rofiles-fuse if /dev/fuse or /etc/mtab unavailableSimon McVittie2016-03-311-5/+1
| | | | | | | Signed-off-by: Simon McVittie <smcv@debian.org> Closes: #232 Approved by: cgwalters
* various tests: skip if temp directory lacks xattr supportSimon McVittie2016-03-311-0/+3
| | | | | | | | | | Some autobuilder environments place the entire build chroot on tmpfs, so even /var/tmp might not have this. Signed-off-by: Simon McVittie <smcv@debian.org> Closes: #232 Approved by: cgwalters
* tests: More TAP fixupsColin Walters2016-03-031-0/+1
| | | | Hopefully getting closer now.
* tests: Convert two more exit 77 instances into TAP-compatible SKIPColin Walters2016-03-031-2/+4
| | | | Followup to https://github.com/GNOME/ostree/pull/194
* test-rofiles-fuse: skip when fusermount is not presentGiuseppe Scrivano2016-03-011-0/+2
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Fix make syntax-checkGiuseppe Scrivano2016-03-011-6/+1
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Import rofiles-fuseColin Walters2016-02-101-0/+74
While it's not strictly tied to OSTree, let's move https://github.com/cgwalters/rofiles-fuse in here because: - It's *very* useful in concert with OSTree - It's tiny - We can reuse OSTree's test, documentation, etc. infrastructure One thing to consider also is that at some point we could experiment with writing a FUSE filesystem for OSTree. This could internalize a better equivalent of `--link-checkout-speedup`, but on the other hand, the cost of walking filesystem trees for these types of operations is really quite small. But if we did decide to do more FUSE things in OSTree, this is a step towards that too.