-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
capability: add/use testInChild helper
Houston, we have a problem: $ go test -exec sudo -run AmbientCapSet -count 3 -v === RUN TestAmbientCapSet --- PASS: TestAmbientCapSet (0.00s) === RUN TestAmbientCapSet capability_test.go:113: The test needs `CAP_SETPCAP`. --- SKIP: TestAmbientCapSet (0.00s) === RUN TestAmbientCapSet capability_test.go:113: The test needs `CAP_SETPCAP`. --- SKIP: TestAmbientCapSet (0.00s) PASS ok github.com/moby/sys/capability 0.024s The solution is, tests that manipulate capabilities should be run in a separate process. Add a helper to do just that, and modify TestAmbientCapSet to use it. In particular, the child needs to call os.Exit (which it does directly, in the end, and also indirectly, via log.Fatal). Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
- Loading branch information
Showing
1 changed file
with
49 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters