From ec1551c59835666fb4c0fd8a0d419302e2286c65 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 20 Nov 2017 10:28:59 -0700 Subject: [PATCH] test/vhost/initiator: fix discover_bdevs usage discover_bdevs previously took a port number for the RPC service, but after commit 6bef902ca5 ("rpc: add default UNIX domain socket listen address"), running rpc.py with just a -p (port) parameter doesn't have the expected effect, since the default server_addr is now a UNIX domain socket path, and the port is ignored. Change discover_bdevs to accept a socket path instead of a port number to fix the issue for the vhost/initiator test; no other callers use the disover_bdevs rpc_port argument, so this is the only instance that needs to change. Change-Id: I4e290f175ccc79caa3c4ef76c062641b9fe489a8 Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/388283 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- scripts/autotest_common.sh | 6 +++--- test/vhost/initiator/bdev.conf.in | 2 +- test/vhost/initiator/blockdev.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/autotest_common.sh b/scripts/autotest_common.sh index 5ed05ac8d..4f922d85e 100755 --- a/scripts/autotest_common.sh +++ b/scripts/autotest_common.sh @@ -403,7 +403,7 @@ function discover_bdevs() { local rootdir=$1 local config_file=$2 - local rpc_port=$3 + local rpc_server=$3 if [ ! -e $config_file ]; then echo "Invalid Configuration File: $config_file" @@ -419,10 +419,10 @@ function discover_bdevs() done # Get all of the bdevs - if [ -z "$rpc_port" ]; then + if [ -z "$rpc_server" ]; then $rootdir/scripts/rpc.py get_bdevs else - $rootdir/scripts/rpc.py -p $rpc_port get_bdevs + $rootdir/scripts/rpc.py -s "$rpc_server" get_bdevs fi # Shut down the bdev service diff --git a/test/vhost/initiator/bdev.conf.in b/test/vhost/initiator/bdev.conf.in index fb159980d..5efa94dd6 100644 --- a/test/vhost/initiator/bdev.conf.in +++ b/test/vhost/initiator/bdev.conf.in @@ -4,7 +4,7 @@ [Rpc] Enable Yes - Listen 127.0.0.1:5261 + Listen /var/tmp/spdk2.sock [Ioat] Disable Yes diff --git a/test/vhost/initiator/blockdev.sh b/test/vhost/initiator/blockdev.sh index eace20e89..be7cb027f 100755 --- a/test/vhost/initiator/blockdev.sh +++ b/test/vhost/initiator/blockdev.sh @@ -96,7 +96,7 @@ for bdev in $bdevs; do timing_exit bounds timing_enter bdev_svc - bdevs=$(discover_bdevs $rootdir $testdir/bdev.conf 5261 | jq -r '.[] | select(.claimed == false)') + bdevs=$(discover_bdevs $rootdir $testdir/bdev.conf /var/tmp/spdk2.sock | jq -r '.[] | select(.claimed == false)') timing_exit bdev_svc if [ -d /usr/src/fio ]; then