numam-spdk/test/config_converter/test_converter.sh
Michal Berger dfe17a39e8 test/config_converter: Declare $rootdir, $testdir paths
Make sure that $rootdir and $testdir are accessible in the sourced
environment. This is to follow the convention seen throughout the
entire repo and make sure that nothing that depends on these paths
fails in case they are missing.

Change-Id: Ie20754fc7aca7aab3636cb022499e9ff2f2dd30b
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/777
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-02-20 09:54:15 +00:00

27 lines
926 B
Bash
Executable File

#!/usr/bin/env bash
testdir=$(readlink -f "$(dirname "$0")")
rootdir=$(readlink -f "$testdir/../../")
source "$rootdir/test/common/autotest_common.sh"
CONVERTER_DIR=$testdir
SPDK_BUILD_DIR=$rootdir
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
$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
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