Documentation
¶
Overview ¶
Command guard runs one call of a scenario for the test kit, which builds it from this source, as it builds the fake child. It runs only on Linux, where it starts the call as its child and supervises it:
- It adopts each orphan of the call as a subreaper. After the call exits, it waits up to two seconds for each descendant to exit. Then it records each descendant that still runs, and kills it
- Its seccomp filter sends each link and rename of the call and of its descendants to the guard, which reads the target path. The guard itself and the kit stay outside the filter
- It records each such operation whose target is in the scope folder, outside the skipped folders. It makes that operation itself, so it knows whether the operation succeeded. With -refuse, it refuses that operation there, as a file system without that ability does
The usage is guard -report <file> -scope <folder> [-skip <folder>]... [-refuse <operation>] -- <program> <arg>... It exits with the exit code of the call, or 128 plus the number of the signal that ended it. It writes the report as one JSON object, when the call and its descendants have ended. It exits with 125 when it cannot supervise the call, and the report gives the reason.
Click to show internal directories.
Click to hide internal directories.