From 15fd9afbade60e495b98e422e8e697d1b79db83b Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Tue, 3 Dec 2019 13:14:20 -0700 Subject: [PATCH] test/nvmf: call killprocess only when nvmfpid exists In nvmftestfini we try to kill the nvmf application, but this doesn't get set by nvmftestinit. I think that nvmftestfini and nvmftestinit should be symmetric options, or at the very least, one should be able to call fini right after calling init without fini failing. Change-Id: I14f274f940ec20c2d5f8d831fed3f6d6c4c6d2ca Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476687 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Community-CI: Broadcom SPDK FC-NVMe CI --- test/nvmf/common.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/nvmf/common.sh b/test/nvmf/common.sh index 6925ee7de..3159baa3f 100644 --- a/test/nvmf/common.sh +++ b/test/nvmf/common.sh @@ -214,7 +214,9 @@ function nvmfappstart() function nvmftestfini() { nvmfcleanup - killprocess $nvmfpid + if [ -n "$nvmfpid" ]; then + killprocess $nvmfpid + fi if [ "$TEST_MODE" == "iso" ]; then $rootdir/scripts/setup.sh reset if [ "$TEST_TRANSPORT" == "rdma" ]; then