To accompany https://reviews.freebsd.org/D8746 .
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
tests/sys/vfs/lookup_cap_dotdot.c | ||
---|---|---|
41 ↗ | (On Diff #22808) | Why is this hardcoded to /tmp ? This violates the kyua test sandbox and makes this test impossible to cleanup after if it's interrupted or killed mid-test :(. Honestly, it seems like you should be able to create a directory under the sandbox, 2 elements deep, which would fulfill your requirements. |
56–60 ↗ | (On Diff #22808) | ATF_CHECK(mkdirat(testdir_fd, "b", 0700) == 0); is simpler. |
84–97 ↗ | (On Diff #22808) | This should be replaced with this simpler logic (which uses the feature_present(3) API): #include "freebsd_test_suite/macros.h" /* ... */ ATF_REQUIRE_FEATURE("security_capabilities"); ATF_REQUIRE_FEATURE("security_capability_mode"); Be sure to add: CFLAGS+= ${SRCTOP}/tests to the Makefile. |
I think it would be useful to include all tests from the original ed program, including non-capsicum kinds.
https://github.com/emaste/snippets/blob/master/test_openat.c
Will do, thanks.
tests/sys/vfs/lookup_cap_dotdot.c | ||
---|---|---|
41 ↗ | (On Diff #22808) | I'm unfamiliar with kyua sandboxing. How do I use it? Is it just the current directory during test body? I'm not attached to /tmp, just not aware of anything better. |
56–60 ↗ | (On Diff #22808) | Ok. |
84–97 ↗ | (On Diff #22808) | Thanks. That's in HEAD or BODY? |
Address ngie@ review feedback.
- Use cwd (assuming that's the sandbox) instead of tmp, drop cleanup code
- Use ATF_CHECK/ATF_REQUIRE for simplicity
- Use ATF_REQUIRE_FEATURE macro instead of raw sysctls
As an ATF test the logical place is under tests/. I don't know any good reason to prefer tools/regression over tests or vice versa, so as this is already implemented, I'm inclined to keep it as-is (if it isn't broken, don't fix it).
tests/sys/vfs/lookup_cap_dotdot.c | ||
---|---|---|
193 ↗ | (On Diff #22818) | We use c89-style /* */ comments in FreeBSD source code. |