Commit b6acb821 authored by Kamil Godzwon's avatar Kamil Godzwon Committed by Tomasz Zawadzki
Browse files

test/autobuild_common: modify native DPDK repository fetching



To reduce the number of requests to clone an external DPDK
repository, check if there is already a DPDK repository at the
given location. Currently, in our CI, we use tools to fetch repositories
and we can pass their location in a parameter. If no repository is
available at the specified location, as a fall back, clone it locally.

Signed-off-by: default avatarKamil Godzwon <kamilx.godzwon@intel.com>
Change-Id: I999b71e6f2200e8fbac07b543ed11212b5e5c09b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17553


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent f46b6ba4
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -65,23 +65,21 @@ _build_native_dpdk() {
		return 1
	fi

	if [[ $SPDK_TEST_NATIVE_DPDK != 'main' ]]; then
		repo='dpdk-stable'
	fi

	compiler_version=$("$compiler" -dumpversion)
	compiler_version=${compiler_version%%.*}
	external_dpdk_dir="$SPDK_RUN_EXTERNAL_DPDK"
	external_dpdk_base_dir="$(dirname $external_dpdk_dir)"

	if [[ ! -d "$external_dpdk_base_dir" ]]; then
		if [[ $SPDK_TEST_NATIVE_DPDK != 'main' ]]; then
			repo='dpdk-stable'
		fi
		echo "DPDK directory does not exist at the provided location."
		sudo mkdir -p "$external_dpdk_base_dir"
		sudo chown -R $(whoami) "$external_dpdk_base_dir"/..
		git clone --branch "$SPDK_TEST_NATIVE_DPDK" --depth 1 http://dpdk.org/git/${repo} "$external_dpdk_base_dir"
	fi
	orgdir=$PWD

	rm -rf "$external_dpdk_base_dir"
	git clone --branch $SPDK_TEST_NATIVE_DPDK --depth 1 http://dpdk.org/git/${repo} "$external_dpdk_base_dir"
	git -C "$external_dpdk_base_dir" log --oneline -n 5

	dpdk_cflags="-fPIC -g -fcommon"