test/nvmf: Don't inherit last exit status from errexit
If return is called without specifying the exit status while being used in the trap context, it inherits the exit status code from the last cmd that triggered the errexit (i.e. the cmd which was run right before the trap). In this particular case it may be quite unexpected since return is called after successful execution of the modprobe, implying the overal success of the function. However, as set -e is called right before return, the function returns with a != 0. To avoid this behavior, explicitly return from the function with 0. Change-Id: I8b21e7aa6cd5628f14b66e559d05b4d0a20e2050 Signed-off-by: Michal Berger <michalx.berger@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1807 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Broadcom CI Reviewed-by: Maciej Szwed <maciej.szwed@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
ab0bc5c254
commit
5000bd4885
@ -156,7 +156,7 @@ function nvmfcleanup()
|
||||
modprobe -v -r nvme-$TEST_TRANSPORT
|
||||
if modprobe -v -r nvme-fabrics; then
|
||||
set -e
|
||||
return
|
||||
return 0
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user