numam-spdk/test/nvmf/nvmfjson/json_config.sh
Pawel Wodkowski bd0abde125 test: sort objects in JSON cofniguration tests
Python 3 is changing order of objects in JSON object when doing load ->
dump. Using OrderedDict solves this issue.

Change-Id: I0aa6364de31e871aed36edd918d25c261c66b506
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/425494
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-09-14 22:24:30 +00:00

41 lines
950 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 > $base_nvmf_config
test_json_config
clear_nvmf_subsystem_config
kill_targets
run_spdk_tgt
$rpc_py load_config < $base_nvmf_config
$rpc_py save_config > $last_nvmf_config
json_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