Skip to content

Commit

Permalink
iotests: Only kill NBD server if it runs
Browse files Browse the repository at this point in the history
There may be NBD tests which do not create a sample image and simply
test whether wrong usage of the protocol is rejected as expected. In
this case, there will be no NBD server and trying to kill it during
clean-up will fail.

Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
XanClic authored and kevmw committed Dec 10, 2014
1 parent b2439d2 commit f798068
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/qemu-iotests/common.rc
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ _cleanup_test_img()
case "$IMGPROTO" in

nbd)
kill $QEMU_NBD_PID
if [ -n "$QEMU_NBD_PID" ]; then
kill $QEMU_NBD_PID
fi
rm -f "$TEST_IMG_FILE"
;;
file)
Expand Down

0 comments on commit f798068

Please sign in to comment.