From c8436120417dd21623202368334841a5062a7113 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Thu, 20 Feb 2020 11:27:54 +0100 Subject: [PATCH] test/common: Introduce new test flag for enabling debug app runs SPDK_AUTOTEST_DEBUG_APPS - if set to 1, all applications will be executed with --log-flags=all This should increase, to some extent, coverage of each application. Change-Id: I1fc82a837abb7e94bda55f47056a120bd9be40d7 Signed-off-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/691 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Darek Stojaczyk --- test/common/applications.sh | 11 +++++++++++ test/common/autotest_common.sh | 1 + 2 files changed, 12 insertions(+) diff --git a/test/common/applications.sh b/test/common/applications.sh index 6e472cf3e..e268e77cf 100644 --- a/test/common/applications.sh +++ b/test/common/applications.sh @@ -9,3 +9,14 @@ VHOST_FUZZ_APP=("$_test_app_dir/fuzz/vhost_fuzz/vhost_fuzz") ISCSI_APP=("$_app_dir/iscsi_tgt/iscsi_tgt") NVMF_APP=("$_app_dir/nvmf_tgt/nvmf_tgt") VHOST_APP=("$_app_dir/vhost/vhost") + +# Check if apps should execute under debug flags +if [[ -e $_root/include/spdk/config.h ]]; then + if [[ $(<"$_root/include/spdk/config.h") == *"#define SPDK_CONFIG_DEBUG"* ]] \ + && (( SPDK_AUTOTEST_DEBUG_APPS )); then + VHOST_FUZZ_APP+=("--log-flags=all") + ISCSI_APP+=("--log-flags=all") + NVMF_APP+=("--log-flags=all") + VHOST_APP+=("--log-flags=all") + fi +fi diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 8cd0f8790..619080fe3 100644 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -48,6 +48,7 @@ export RUN_NIGHTLY export RUN_NIGHTLY_FAILING # Set defaults for missing test config options +: ${SPDK_AUTOTEST_DEBUG_APPS:=0}; export SPDK_AUTOTEST_DEBUG_APPS : ${SPDK_BUILD_DOC=0}; export SPDK_BUILD_DOC : ${SPDK_BUILD_PACKAGE=0}; export SPDK_BUILD_PACKAGE : ${SPDK_BUILD_SHARED_OBJECT=0}; export SPDK_BUILD_SHARED_OBJECT