tests/prime_self_import: Add racing handle2fd testcase

Similar to how we test flink races. Note that on unfixed kernels this
oopses, and with my current set of patches it still leaks like mad.

v2: Only close the prime fd if we've successfully created it.

v3: Add a reimport test to check whether we don't race when reaping
the obj->dma_buf link.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2 files changed