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: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5025
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
This commit is contained in:
Karol Latecki 2020-11-05 09:01:47 +01:00 committed by Tomasz Zawadzki
parent c38a1bc002
commit 13cf7a656c

View File

@ -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