Commit 94eae4ee authored by Pawel Wodkowski's avatar Pawel Wodkowski Committed by Jim Harris
Browse files

test/vhost: dont't terminate existing master connection if OS is booted



Terminating master connection will terminate other connections so can't
use test/vhost/common/vm_ssh.sh to connect from two terminals. This
patch terminate master connection only if guest OS is not booted.

Change-Id: I711fed525f1ce813c3aa3d03255a1b32513d24bd
Signed-off-by: default avatarPawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/421684


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent f56b2300
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -324,7 +324,7 @@ function vm_ssh()
	local ssh_config="$VM_BASE_DIR/ssh_config"

	local ssh_cmd="ssh -i $SPDK_VHOST_SSH_KEY_FILE -F $ssh_config \
		-p $(vm_ssh_socket $1) 127.0.0.1"
		-p $(vm_ssh_socket $1) $VM_SSH_OPTIONS 127.0.0.1"

	shift
	$ssh_cmd "$@"
@@ -386,10 +386,9 @@ function vm_os_booted()
		return 1
	fi

	if ! VM_SSH_OPTIONS="-o ControlMaster=no" vm_ssh $1 "true" 2>/dev/null; then
		# Shutdown existing master. Ignore errors as it might not exist.
	ssh -O exit -F $VM_BASE_DIR/ssh_config -p $(vm_ssh_socket $1) 127.0.0.1 2> /dev/null || true

	if ! vm_ssh $1 "true" 2>/dev/null; then
		VM_SSH_OPTIONS="-O exit" vm_ssh $1 "true" 2>/dev/null
		return 1
	fi