[common-mk] support parallelized qemu unit tests

When running with qemu, we need to bind some mounts from the host into the build
root, and unbind them afterwards. Previously, we would just do this for every
test, but there was an inherent race when parallelizing, and if the test harness
crashed we could leak mounts.

Therefore, run the tests under 'unshare -m', and do the mounts/unmounts inside
that vfs namespace as appropriate. This allows us to fully parallelize (each
test gets its own vfs namespace) and prevents any mount leaks.

BUG=chromium:205496
TEST=cryptohome unit tests

Change-Id: Ie91fa81229738fc50453ca9cbd0e324f8c167796
Signed-off-by: Elly Fong-Jones <[email protected]>
Reviewed-on: https://gerrit.chromium.org/gerrit/49925
Reviewed-by: Mike Frysinger <[email protected]>
Reviewed-by: Will Drewry <[email protected]>
1 file changed