2018-07-26 01:32:05 +00:00
|
|
|
#!/usr/bin/env bash
|
2020-02-11 15:11:57 +00:00
|
|
|
testdir=$(readlink -f "$(dirname "$0")")
|
|
|
|
rootdir=$(readlink -f "$testdir/../../")
|
|
|
|
source "$rootdir/test/common/autotest_common.sh"
|
|
|
|
|
|
|
|
CONVERTER_DIR=$testdir
|
|
|
|
SPDK_BUILD_DIR=$rootdir
|
2018-07-26 01:32:05 +00:00
|
|
|
|
|
|
|
function test_cleanup() {
|
|
|
|
rm -f $CONVERTER_DIR/config_converter.json $CONVERTER_DIR/config_virtio_converter.json
|
|
|
|
}
|
|
|
|
|
|
|
|
function on_error_exit() {
|
|
|
|
set +e
|
|
|
|
test_cleanup
|
|
|
|
print_backtrace
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
trap 'on_error_exit' ERR
|
|
|
|
|
2021-01-12 11:37:04 +00:00
|
|
|
empty_json=$(echo "" | $SPDK_BUILD_DIR/scripts/config_converter.py | jq -c)
|
|
|
|
[[ ${empty_json} == '{"subsystems":[]}' ]]
|
|
|
|
|
2020-01-14 12:03:17 +00:00
|
|
|
$SPDK_BUILD_DIR/scripts/config_converter.py < $CONVERTER_DIR/config.ini > $CONVERTER_DIR/config_converter.json
|
|
|
|
$SPDK_BUILD_DIR/scripts/config_converter.py < $CONVERTER_DIR/config_virtio.ini > $CONVERTER_DIR/config_virtio_converter.json
|
2018-07-26 01:32:05 +00:00
|
|
|
diff -I "cpumask" -I "max_queue_depth" -I "queue_depth" <(jq -S . $CONVERTER_DIR/config_converter.json) <(jq -S . $CONVERTER_DIR/spdk_config.json)
|
|
|
|
diff <(jq -S . $CONVERTER_DIR/config_virtio_converter.json) <(jq -S . $CONVERTER_DIR/spdk_config_virtio.json)
|
|
|
|
test_cleanup
|