Commit 460ec2a7 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

test/check_so_deps: refactor pulling spdk-abi repo



This patch refactors pulling spdk-abi repository for
confirm_abi_deps test.

Main goal is to make it easier to developers to execute
check_so_deps.sh, by allowing to have a pre-existing
spdk-abi repository on their system and point to it.
Rather than hide it in SPDK_ABI_DIR variable passed in
autotest config file.

Now if second argument is provided it will be used as
path to spdk-abi. This repository will not be removed
at the end of the test.

If not provided, the repo will be cloned and then deleted
at the end of the test.

CI used to pass the path via SPDK_ABI_DIR, so it is now
included as second parameter when called from autobuild.

Change-Id: I8110c2bf4b25658d7f7f6758d00ea57e3ea6e60a
Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19275


Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 3c37900b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -357,7 +357,7 @@ check_format() {
}

check_so_deps() {
	run_test "autobuild_check_so_deps" "$rootdir/test/make/check_so_deps.sh" "$spdk_conf"
	run_test "autobuild_check_so_deps" "$rootdir/test/make/check_so_deps.sh" "$spdk_conf" "$SPDK_ABI_DIR"
}

external_code() {
+13 −18
Original line number Diff line number Diff line
@@ -4,21 +4,6 @@
#  All rights reserved.
#
shopt -s extglob
git_repo_abi="https://github.com/spdk/spdk-abi.git"

function get_spdk_abi() {
	local dest=$1
	mkdir -p $dest
	if [[ -d $SPDK_ABI_DIR ]]; then
		echo "spdk-abi found at $SPDK_ABI_DIR"
		cp -r "$SPDK_ABI_DIR"/* "$dest/"
	else
		# In case that someone run test manually and did not set existing
		# spdk-abi directory via SPDK_ABI_DIR
		echo "spdk-abi has not been found${SPDK_ABI_DIR:+ at $SPDK_ABI_DIR}, cloning"
		git clone $git_repo_abi "$dest"
	fi
}

function get_release_branch() {
	tag=$(git describe --tags --abbrev=0 --exclude=LTS --exclude=*-pre $1)
@@ -41,6 +26,10 @@ fi
source $1
source "$rootdir/test/common/autotest_common.sh"

if [[ -d $2 ]]; then
	user_abi_dir="$2"
fi
source_abi_dir="${user_abi_dir:-"$rootdir/test/make/abi"}"
libdir="$rootdir/build/lib"
libdeps_file="$rootdir/mk/spdk.lib_deps.mk"
suppression_file="$HOME/abigail_suppressions.ini"
@@ -74,11 +63,15 @@ function confirm_abi_deps() {
	local processed_so=0
	local abidiff_output
	local release
	local source_abi_dir="$rootdir/test/make/abi"

	release=$(get_release_branch)

	get_spdk_abi "$source_abi_dir"
	if [[ ! -d $source_abi_dir ]]; then
		mkdir -p $source_abi_dir
		echo "spdk-abi has not been found at $source_abi_dir, cloning"
		git clone "https://github.com/spdk/spdk-abi.git" "$source_abi_dir"
	fi

	echo "* Running ${FUNCNAME[0]} against the latest (${release%.*}) release" >&2

	if ! hash abidiff; then
@@ -217,7 +210,9 @@ EOF
	done
	rm -f $suppression_file
	echo "Processed $processed_so objects."
	if [[ -z $user_abi_dir ]]; then
		rm -rf "$source_abi_dir"
	fi
}

function get_lib_shortname() {