From 80494b8ec5b10366e705cf0b89961fe3dc2e315f Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Tue, 4 Jun 2019 16:32:14 -0700 Subject: [PATCH] test/vhost: Separate vhost_json_config from vhost_run There are upcoming simplifications where it will be better if these are two separate steps. Change-Id: I618f947dc314b05a4f94ea98c63fe85539544704 Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461386 Tested-by: SPDK CI Jenkins Reviewed-by: Darek Stojaczyk Reviewed-by: Jim Harris --- test/vhost/common.sh | 14 +++++++++----- test/vhost/fiotest/fio.sh | 3 ++- test/vhost/other/negative.sh | 3 ++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/test/vhost/common.sh b/test/vhost/common.sh index ecfce609f..0fae2d624 100644 --- a/test/vhost/common.sh +++ b/test/vhost/common.sh @@ -130,7 +130,6 @@ function vhost_run() vhost_num="${param#*=}" assert_number "$vhost_num" ;; - --json-path=*) local vhost_json_path="${param#*=}" ;; --memory=*) local memory=${param#*=} ;; --no-pci*) local no_pci="-u" ;; *) @@ -185,14 +184,19 @@ function vhost_run() -s $vhost_dir/rpc.sock load_subsystem_config fi - if [[ -n "$vhost_json_path" ]]; then - $rootdir/scripts/rpc.py -s $vhost_dir/rpc.sock load_config < "$vhost_json_path/conf.json" - fi - notice "vhost started - pid=$vhost_pid" timing_exit vhost_start } +function vhost_load_config() +{ + local vhost_num="$1" + local vhost_json_conf="$2" + local vhost_dir="$(get_vhost_dir $vhost_num)" + + $rootdir/scripts/rpc.py -s $vhost_dir/rpc.sock load_config < "$vhost_json_conf" +} + function vhost_kill() { local rc=0 diff --git a/test/vhost/fiotest/fio.sh b/test/vhost/fiotest/fio.sh index 2efe03faf..fc21fdb8d 100755 --- a/test/vhost/fiotest/fio.sh +++ b/test/vhost/fiotest/fio.sh @@ -81,7 +81,8 @@ if [[ $test_type =~ "spdk_vhost" ]]; then notice "" notice "running SPDK" notice "" - vhost_run --json-path=$testdir + vhost_run + vhost_json_config 0 $testdir/conf.json notice "" fi diff --git a/test/vhost/other/negative.sh b/test/vhost/other/negative.sh index b54cd86c4..fc2bed8ab 100755 --- a/test/vhost/other/negative.sh +++ b/test/vhost/other/negative.sh @@ -69,7 +69,8 @@ if [[ $RUN_NIGHTLY -eq 1 ]]; then notice "" notice "running SPDK" notice "" - vhost_run --json-path=$testdir + vhost_run + vhost_json_config 0 $testdir/conf.json notice "" rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"