Open
Description
#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:
`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 fromCargo.toml
, and then callunshare(2)
from usesync::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.
Activity
kamalmarhubi commentedon Jan 26, 2016
I just remembered I filed rust-lang/rfcs#1442 almost a month ago because of this issue! I'm going to try and see if this is feasible.