Spdk/test/nvmf/nvmfjson/json_config.sh
Seth Howell d5de73e017 test/nvmf: Clean up Soft-RoCE NICs after json_config tests
This was leaving soft-roce nics around from run to run.

Change-Id: Ia1114f40aeeae3332aa30310235feab14a1006d4
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/421653
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-08-09 06:22:30 +00:00

41 lines
948 B
Bash
Executable File

#!/usr/bin/env bash
set -xe
NVMF_JSON_DIR=$(readlink -f $(dirname $0))
. $NVMF_JSON_DIR/../../json_config/common.sh
base_nvmf_config=$JSON_DIR/base_nvmf_config.json
last_nvmf_config=$JSON_DIR/last_nvmf_config.json
function test_subsystems() {
run_spdk_tgt
rpc_py="$spdk_rpc_py"
clear_config_py="$spdk_clear_config_py"
$rpc_py start_subsystem_init
create_nvmf_subsystem_config
$rpc_py save_config -f $base_nvmf_config
test_json_config
clear_nvmf_subsystem_config
kill_targets
run_spdk_tgt
$rpc_py load_config -f $base_nvmf_config
$rpc_py save_config -f $last_nvmf_config
diff $base_nvmf_config $last_nvmf_config
clear_nvmf_subsystem_config
kill_targets
rm -f $base_nvmf_config $last_nvmf_config
}
trap 'on_error_exit "${FUNCNAME}" "${LINENO}"; rm -f $base_nvmf_config $last_nvmf_config' ERR
timing_enter nvmf_json_config
test_subsystems
timing_exit nvmf_json_config
revert_soft_roce
report_test_completion nvmf_json_config