test/nvmf: make nvme-* kmod removal optional.

When we insert the nvme-$TEST_TRANSPORT modules into the kernel, we
allow for it to fail. So, for the sake of symmetry, we should allow for
the opposite to be true.

Thanks to Maciej Wawryk for pointing out the discrepancy.

Change-Id: I3c551950cbe25382c2bbea4f390bead0ba6f2a37
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460395
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Seth Howell 2019-07-03 17:59:13 -07:00 committed by Ben Walker
parent 8b539eb553
commit 0b8e0d81f2

View File

@ -141,7 +141,8 @@ function nvmfcleanup()
sync sync
set +e set +e
for i in {1..20}; do for i in {1..20}; do
modprobe -v -r nvme-$TEST_TRANSPORT nvme-fabrics modprobe -v -r nvme-$TEST_TRANSPORT
modprobe -v -r nvme-fabrics
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
set -e set -e
return return
@ -152,7 +153,10 @@ function nvmfcleanup()
# So far unable to remove the kernel modules. Try # So far unable to remove the kernel modules. Try
# one more time and let it fail. # one more time and let it fail.
modprobe -v -r nvme-$TEST_TRANSPORT nvme-fabrics # Allow the transport module to fail for now. See Jim's comment
# about the nvme-tcp module below.
modprobe -v -r nvme-$TEST_TRANSPORT || true
modprobe -v -r nvme-fabrics
} }
function nvmftestinit() function nvmftestinit()