summaryrefslogtreecommitdiffstats
path: root/src/spdk/test/rpc_client/rpc_client.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/spdk/test/rpc_client/rpc_client.sh')
-rwxr-xr-xsrc/spdk/test/rpc_client/rpc_client.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/spdk/test/rpc_client/rpc_client.sh b/src/spdk/test/rpc_client/rpc_client.sh
new file mode 100755
index 00000000..296a6fff
--- /dev/null
+++ b/src/spdk/test/rpc_client/rpc_client.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+testdir=$(readlink -f $(dirname $0))
+rootdir=$(readlink -f $testdir/../..)
+
+set -e
+
+source $rootdir/test/common/autotest_common.sh
+
+function rpc_client_test() {
+ if [ $(uname -s) = Linux ]; then
+ local conf=$rootdir/test/bdev/bdev.conf.in
+
+ if [ ! -e $conf ]; then
+ return 1
+ fi
+
+ $rootdir/test/app/bdev_svc/bdev_svc -i 0 -c ${conf} &
+ svc_pid=$!
+ echo "Process bdev_svc pid: $svc_pid"
+ waitforlisten $svc_pid
+ trap "killprocess $svc_pid" SIGINT SIGTERM EXIT
+
+ $rootdir/test/rpc_client/rpc_client_test
+
+ killprocess $svc_pid
+ fi
+
+ return 0
+}
+
+timing_enter rpc_client
+rpc_client_test
+timing_exit rpc_client
+
+trap - SIGINT SIGTERM EXIT