Skip to content

Commit

Permalink
test/json: Test for vhost subsystem.
Browse files Browse the repository at this point in the history
Change-Id: I913d378fe3f324043e8e86c1df209ad19680c60b
Signed-off-by: Pawel Kaminski <[email protected]>
Reviewed-on: https://review.gerrithub.io/410789
Tested-by: SPDK Automated Test System <[email protected]>
Reviewed-by: Pawel Wodkowski <[email protected]>
Reviewed-by: Shuhei Matsumoto <[email protected]>
Reviewed-by: Ben Walker <[email protected]>
  • Loading branch information
pawelkax authored and jimharris committed Jul 5, 2018
1 parent 4265138 commit 9aff546
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
4 changes: 4 additions & 0 deletions autotest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ if [ $SPDK_TEST_VHOST -eq 1 ]; then
run_test ./test/vhost/spdk_vhost.sh --negative
timing_exit negative

timing_enter vhost_json_config
run_test ./test/vhost/json_config/json_config.sh
timing_exit vhost_json_config

if [ $RUN_NIGHTLY -eq 1 ]; then
timing_enter integrity_blk
run_test ./test/vhost/spdk_vhost.sh --integrity-blk
Expand Down
11 changes: 11 additions & 0 deletions test/json_config/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ function run_initiator() {
waitforlisten $virtio_pid /var/tmp/virtio.sock
}

function upload_vhost() {
$rpc_py construct_split_vbdev Nvme0n1 8
$rpc_py construct_vhost_scsi_controller sample1
$rpc_py add_vhost_scsi_lun sample1 0 Nvme0n1p3
$rpc_py add_vhost_scsi_lun sample1 1 Nvme0n1p4
$rpc_py set_vhost_controller_coalescing sample1 1 100
$rpc_py construct_vhost_blk_controller sample2 Nvme0n1p5
$rpc_py construct_vhost_nvme_controller sample3 16
$rpc_py add_vhost_nvme_ns sample3 Nvme0n1p6
}

function kill_targets() {
if [ ! -z $virtio_pid ]; then
killprocess $virtio_pid
Expand Down
25 changes: 25 additions & 0 deletions test/vhost/json_config/json_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -ex
VHOST_JSON_DIR=$(readlink -f $(dirname $0))
. $VHOST_JSON_DIR/../../json_config/common.sh

function test_subsystems() {
run_spdk_tgt

rpc_py="$spdk_rpc_py"
clear_config_py="$spdk_clear_config_py"
load_nvme

upload_vhost
test_json_config
$clear_config_py clear_config

kill_targets
}

trap 'on_error_exit "${FUNCNAME}" "${LINENO}"' ERR
timing_enter json_config_vhost

test_subsystems
timing_exit json_config_vhost
report_test_completion json_config_vhost

0 comments on commit 9aff546

Please sign in to comment.