xref: /src/tests/sys/capsicum/README.md (revision fba81b33aabff74ad03d5f9f9663c176cf060fa6)
1# Capsicum User Space Tests
2
3This directory holds unit tests for [Capsicum](https://man.freebsd.org/cgi/man.cgi?query=capsicum)
4object-capabilities. The tests exercise the syscall interface to a Capsicum-enabled operating system,
5Currently, [FreeBSD >=10.x](http://www.freebsd.org) is the only such operating system.
6
7The tests are written in C++11 and use the [Google Test](https://code.google.com/p/googletest/)
8framework, with some additions to fork off particular tests (because a process that enters capability
9mode cannot leave it again).
10
11## Provenance
12
13The original basis for these tests was:
14
15 - [unit tests](https://github.com/freebsd/freebsd/tree/master/tools/regression/security/cap_test)
16   written by Robert Watson and Jonathan Anderson for the original FreeBSD 9.x Capsicum implementation
17 - [unit tests](http://git.chromium.org/gitweb/?p=chromiumos/third_party/kernel-capsicum.git;a=tree;f=tools/testing/capsicum_tests;hb=refs/heads/capsicum) written by Meredydd Luff for the original Capsicum-Linux port.
18
19These tests were coalesced and moved into an [independent repository](https://github.com/google/capsicum-test)
20to enable comparative testing across multiple OSes, and then substantially extended.
21
22Subsequently, the [capsicum-linux port](https://github.com/google/capsicum-linux) was abandoned by
23its maintainers, rendering the independent repository obsolete.  So the tests were copied back into
24the FreeBSD source tree in time for 16.0-RELEASE.
25
26## Configuration
27
28The following kernel configuration options are needed so that all tests can run:
29
30  - `options P1003_1B_MQUEUE`: Enable POSIX message queues (or `kldload mqueuefs`)
31