From 9d7b1f7525dd1836d2315822d0a2f744a2ef4ba4 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Mon, 18 May 2020 17:32:01 +0200 Subject: [PATCH] vm_setup: Clone spdk from a separate function Change-Id: I59030c4570a03f8c6dfcf4a5f86426e3b5875744 Signed-off-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2527 Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris Reviewed-by: Karol Latecki --- test/common/config/pkgdep/git | 21 +++++++++++++++++++++ test/common/config/vm_setup.sh | 13 +------------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/test/common/config/pkgdep/git b/test/common/config/pkgdep/git index 4a3861f9a..a8e62f5a8 100644 --- a/test/common/config/pkgdep/git +++ b/test/common/config/pkgdep/git @@ -1,3 +1,16 @@ +function install_spdk() { + mkdir -p spdk_repo/output || echo "Can not create spdk_repo/output directory." + + if [ -d spdk_repo/spdk ]; then + echo "spdk source already present, not cloning" + else + git -C spdk_repo clone "${GIT_REPO_SPDK}" + fi + git -C spdk_repo/spdk config submodule.dpdk.url "${GIT_REPO_DPDK}" + git -C spdk_repo/spdk config submodule.intel-ipsec-mb.url "${GIT_REPO_INTEL_IPSEC_MB}" + git -C spdk_repo/spdk submodule update --init --recursive +} + function install_refspdk() { local last_release local output_dir @@ -318,6 +331,14 @@ sources+=(install_fio) sudo mkdir -p /usr/{,local}/src +if [[ $INSTALL_REFSPDK == true ]]; then + # Serialize builds as refspdk depends on spdk + install_spdk + install_refspdk +else + sources+=(install_spdk) +fi + for source in "${sources[@]}"; do source_conf=${source^^} if [[ ${!source_conf} == true ]]; then diff --git a/test/common/config/vm_setup.sh b/test/common/config/vm_setup.sh index 5460553fb..adbe26983 100755 --- a/test/common/config/vm_setup.sh +++ b/test/common/config/vm_setup.sh @@ -24,7 +24,7 @@ VM_SETUP_PATH=$(readlink -f ${BASH_SOURCE%/*}) UPGRADE=false INSTALL=false -CONF="rocksdb,fio,flamegraph,tsocks,qemu,vpp,libiscsi,nvmecli,qat,refspdk" +CONF="rocksdb,fio,flamegraph,tsocks,qemu,vpp,libiscsi,nvmecli,qat,spdk,refspdk" gcc_version=$(gcc -dumpversion) gcc_version=${gcc_version%%.*} if [[ -e /etc/os-release ]]; then @@ -122,17 +122,6 @@ if $INSTALL; then install "${packages[@]}" fi -mkdir -p spdk_repo/output || echo "Can not create spdk_repo/output directory." - -if [ -d spdk_repo/spdk ]; then - echo "spdk source already present, not cloning" -else - git -C spdk_repo clone "${GIT_REPO_SPDK}" -fi -git -C spdk_repo/spdk config submodule.dpdk.url "${GIT_REPO_DPDK}" -git -C spdk_repo/spdk config submodule.intel-ipsec-mb.url "${GIT_REPO_INTEL_IPSEC_MB}" -git -C spdk_repo/spdk submodule update --init --recursive - source "$vmsetupdir/pkgdep/git" # create autorun-spdk.conf in home folder. This is sourced by the autotest_common.sh file.