231 enables mount. The test includes a hackish little macro-based test runner because the user and mount namespaces must be entered with unshare(2) before any threads spawn, and the built in test runner doesn't allow that.
`CLONE_NEWUSER` requires that the calling process is not
threaded; specifying `CLONE_NEWUSER` automatically implies
`CLONE_THREAD`.
It would be better if we could use the default test runner, but this is not possible right now. We'd need either:
the ability to specify RUST_TEST_THREADS=1 for this test from Cargo.toml, and then call unshare(2) from use sync::Once at the start of each test to ensure we've already entered the namespaces
the ability to run setup code before the test harness spawns any threads
I think both are worthwhile options, but for this use case 2. would be nicer, as it would then allow the tests to run in concurrently which might be quicker.
231 enables mount. The test includes a hackish little macro-based test runner because the user and mount namespaces must be entered with
unshare(2)
before any threads spawn, and the built in test runner doesn't allow that.Relevant bit of
unshare(2)
man page:It would be better if we could use the default test runner, but this is not possible right now. We'd need either:
RUST_TEST_THREADS=1
for this test fromCargo.toml
, and then callunshare(2)
from usesync::Once
at the start of each test to ensure we've already entered the namespacesI think both are worthwhile options, but for this use case 2. would be nicer, as it would then allow the tests to run in concurrently which might be quicker.