Commit 6ca184b0 authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

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: default avatarMichal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2791


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 210f61ec
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -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=