From 4a9583f7fe8af6847c9b19defd05f744358b30cc Mon Sep 17 00:00:00 2001 From: Pawel Kaminski Date: Mon, 2 Jul 2018 17:17:50 -0400 Subject: [PATCH] test/json: Add pmem bdev test Change-Id: I50a99f029f10f334370013627b75f61e7eecdcf5 Signed-off-by: Pawel Kaminski Reviewed-on: https://review.gerrithub.io/417557 Tested-by: SPDK Automated Test System Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker --- autotest.sh | 1 + test/json_config/common.sh | 10 ++++++++++ test/pmem/json_config/json_config.sh | 25 +++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100755 test/pmem/json_config/json_config.sh diff --git a/autotest.sh b/autotest.sh index de6a1d415..2d267b970 100755 --- a/autotest.sh +++ b/autotest.sh @@ -205,6 +205,7 @@ fi if [ $SPDK_TEST_PMDK -eq 1 ]; then run_test ./test/pmem/pmem.sh -x + run_test ./test/pmem/json_config/json_config.sh fi timing_enter cleanup diff --git a/test/json_config/common.sh b/test/json_config/common.sh index a80fd4612..bcc2587ea 100644 --- a/test/json_config/common.sh +++ b/test/json_config/common.sh @@ -90,6 +90,16 @@ function remove_config_files_after_test_json_config() { rm $tmp_config $full_config $null_json_config } +function create_pmem_bdev_subsytem_config() { + $rpc_py create_pmem_pool /tmp/pool_file1 128 512 + $rpc_py construct_pmem_bdev -n pmem1 /tmp/pool_file1 +} + +function clear_pmem_bdev_subsystem_config() { + $clear_config_py clear_config + $rpc_py delete_pmem_pool /tmp/pool_file1 +} + function create_bdev_subsystem_config() { $rpc_py construct_split_vbdev Nvme0n1 2 $rpc_py construct_null_bdev Null0 32 512 diff --git a/test/pmem/json_config/json_config.sh b/test/pmem/json_config/json_config.sh new file mode 100755 index 000000000..bd232b8f3 --- /dev/null +++ b/test/pmem/json_config/json_config.sh @@ -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" + $rpc_py start_subsystem_init + + create_pmem_bdev_subsytem_config + test_json_config + clear_pmem_bdev_subsystem_config + + kill_targets +} + +trap 'on_error_exit "${FUNCNAME}" "${LINENO}"' ERR +timing_enter json_config_pmem + +test_subsystems +timing_exit json_config_pmem +report_test_completion json_config_pmem