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 <[email protected]>
- Loading branch information