From 6ca184b027bf95a83e310ea758b0cc115de5015a Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Fri, 5 Jun 2020 22:53:34 +0200 Subject: [PATCH] autotest_common: Don't use cwd for $output_dir If $output_dir is not set, cwd is used as a designated output dir throughout the runtime of the script that sourced autotest_common.sh. This, however, may fail in some particular cases, e.g. when calling autobuild.sh directly from within the spdk repo. As a result some *.txt files that are created by scanbuild_make() will end up in the root of the repo. This causes porcelain_check() to fail as it does pick these files up after the test is done. To avoid similar scenarios, simply make sure the desired output dir is always created and that it resides outside of the repo. Change-Id: I5b2e142ce9c2a0b8d24d5331f2b52110c9634c67 Signed-off-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2791 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Karol Latecki Reviewed-by: Shuhei Matsumoto Reviewed-by: Paul Luse Reviewed-by: Tomasz Zawadzki --- test/common/autotest_common.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 3433a5f9a..b2a638e4e 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -211,12 +211,8 @@ else fi if [ -z "$output_dir" ]; then - if [ -z "$rootdir" ] || [ ! -d "$rootdir/../output" ]; then - output_dir=. - else - output_dir=$rootdir/../output - fi - export output_dir + mkdir -p "$rootdir/../output" + export output_dir="$rootdir/../output" fi TEST_MODE=