numam-spdk/test/env
Darek Stojaczyk c049304a95 env: add spdk_pci_device_unclaim()
spdk_pci_device_claim() could create a file on the
filesystem that couldn't be deleted programatically.
It could only be overwritten - e.g. by another spdk
instance - but this didn't really work if that
another instance had less privileges and hence no
access to the previous file.

This is exactly the case we're seeing on our CI when
running SPDK as non-root. In general it's a good idea
not to leave any leftover files, so now we'll delete
the pci claim file when the spdk process exits.

spdk_pci_device_claim() used to return a file descriptor
that could be simply closed to "un-claim" the device.
It'll now return only a return code. The fd will be
stored inside spdk_pci_device and will be closed either
when user calls the newly introduced spdk_pci_device_unclaim(),
or when the device is detached.

We'll still need to clean up those files somewhere in
our test scripts (probably ./setup.sh cleanup) to
clean up after crashed processes or so - but we don't
necessarily want to run such scripts inside the autotest
whenever a non-root spdk is about to be started.

Change-Id: I797e079417bb56491013cc5b92f0f0d14f451d18
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467107
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-09-18 20:34:39 +00:00
..
env_dpdk_post_init test/nvme: Allow NVMe with 0 namespaces in tests 2019-07-08 09:39:09 +00:00
mem_callbacks test: add mem_callbacks unit test 2019-03-12 13:58:57 +00:00
memory ut/cunit: added missing semicolon on CU_ASSERT macros 2019-07-24 18:21:22 +00:00
pci env: add spdk_pci_device_unclaim() 2019-09-18 20:34:39 +00:00
vtophys ut/cunit: added missing semicolon on CU_ASSERT macros 2019-07-24 18:21:22 +00:00
env.sh test: remove duplicated set -ex from tests 2019-06-19 03:54:58 +00:00
Makefile test: add mem_callbacks unit test 2019-03-12 13:58:57 +00:00