From 94eae4eef56665cc32ffa19287acbf1a007bdc7c Mon Sep 17 00:00:00 2001 From: Pawel Wodkowski Date: Thu, 9 Aug 2018 12:26:36 +0200 Subject: [PATCH] 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: Pawel Wodkowski Reviewed-on: https://review.gerrithub.io/421684 Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- test/vhost/common/common.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/vhost/common/common.sh b/test/vhost/common/common.sh index e01c82088a..27a9c6db5e 100644 --- a/test/vhost/common/common.sh +++ b/test/vhost/common/common.sh @@ -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 - # 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 + 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. + VM_SSH_OPTIONS="-O exit" vm_ssh $1 "true" 2>/dev/null return 1 fi