To accompany https://reviews.freebsd.org/D8746 .
Details
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 6189 Build 6439: arc lint + arc unit
Event Timeline
tests/sys/vfs/lookup_cap_dotdot.c | ||
---|---|---|
42 | 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. | |
57–61 | ATF_CHECK(mkdirat(testdir_fd, "b", 0700) == 0); is simpler. | |
85–98 | 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
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 | ||
---|---|---|
194 | We use c89-style /* */ comments in FreeBSD source code. |