Commit 13cf7a65 authored by Karol Latecki's avatar Karol Latecki Committed by Tomasz Zawadzki
Browse files

test/vm_setup: install last SPDK LTS reference build



Reference builds created by vm_setup.sh script are
needed when executing ABI tests. So far vm_setup.sh
only built reference build for previous release, but
in some cases a LTS build might be needed as well.

Also rename latest ABI reference build directory to
spdk_abi_latest, because that's the name of directory
used in test/make/check_so_deps.sh.

Change-Id: I1cb3e39e96d68051d4142753db5b8b3645016eeb
Signed-off-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5025


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarMichal Berger <michalx.berger@intel.com>
parent c38a1bc0
Loading
Loading
Loading
Loading
+37 −8
Original line number Diff line number Diff line
@@ -12,22 +12,35 @@ function install_spdk() {
}

function install_refspdk() {
	local last_release
	local release
	local output_dir
	local config_params
	local rootdir
	local version

	version=$1

	# Create a reference SPDK build for ABI tests
	git -C "$GIT_REPOS/spdk_repo/spdk" fetch --tags
	last_release=$(git -C "$GIT_REPOS/spdk_repo/spdk" tag | sort --version-sort | grep -v rc | tail -n1)
	output_dir="$GIT_REPOS/spdk_$(tr . _ < <(tr -d '[:alpha:]' <<< $last_release))"

	if [[ "$version" == "latest" ]]; then
		release=$(git -C "$GIT_REPOS/spdk_repo/spdk" tag | sort --version-sort | grep -v rc | tail -n 1)
		output_dir="$GIT_REPOS/spdk_abi_latest"
	elif [[ "$version" == "LTS" ]]; then
		release="LTS"
		output_dir="$GIT_REPOS/spdk_abi_lts"
	fi

	if [[ ! -d $output_dir ]]; then
		cp -R "$GIT_REPOS/spdk_repo/spdk" "$output_dir"
	fi

	git -C "$output_dir" checkout "$last_release"
	git -C "$output_dir" checkout "$release"
	git -C "$output_dir" submodule update --init
	lts_2001_fallback=false
	if [[ $(git -C "$output_dir" describe --tags) == v20.01* ]]; then
		lts_2001_fallback=true
	fi

	cat > $HOME/autorun-spdk.conf <<- EOF
		SPDK_BUILD_SHARED_OBJECT=1
@@ -59,12 +72,27 @@ function install_refspdk() {
		# Prepare separate, fixed, cmdline for the FreeBSD, Issue #1397.
		if [[ $OSID == freebsd ]]; then
			config_params="--enable-debug --enable-werror"
			config_params+=" --with-idxd --with-fio=/usr/src/fio"
			config_params+=" --disable-unit-tests --without-isal"
			config_params+=" --without-isal --with-fio=/usr/src/fio"

			# TODO: Remove this if-block after 21.01 LTS is released and 20.01 LTS is deprecated.
			if ! lts_2001_fallback; then
				config_params+=" --with-idxd --disable-unit-tests"
			fi

			MAKE=gmake
		else
			# TODO: "get_config_params" was not available in 20.01 LTS release.
			# Remove this if-block after 21.01 release.
			if lts_2001_fallback; then
				config_params="--enable-debug --enable-werror --with-rdma"
				config_params+=" --with-fio=/usr/src/fio --with-iscsi-initiator"
				config_params+=" --with-nvme-cuse --with-pmdk --with-reduce"
				config_params+=" --with-rbd --with-crypto --with-ocf --enable-ubsan"
				config_params+=" --enable-asan --with-fuse --with-uring"
			else
				config_params="$(get_config_params)"
			fi
		fi
		$output_dir/configure $(echo $config_params | sed 's/--enable-coverage//g')
		if [[ $OSID != freebsd ]]; then
			$MAKE -C $output_dir $MAKEFLAGS include/spdk/config.h
@@ -386,5 +414,6 @@ done
if [[ $INSTALL_REFSPDK == true ]]; then
	# Serialize builds as refspdk depends on spdk
	[[ $INSTALL_SPDK != true ]] && install_spdk
	install_refspdk
	install_refspdk latest
	install_refspdk LTS
fi