Commit 9ba446a2 authored by Ed rodriguez's avatar Ed rodriguez Committed by Jim Harris
Browse files

test: Add support to configure ipsec git repo



  Also make ipsec configuration and install optional
  in pkgdep.sh.

Change-Id: I0c973398cebce0f50c704b21f6397e8d996ba9f9
Signed-off-by: default avatarEd rodriguez <edwinr@netapp.com>
Signed-off-by: default avatarJohn Meneghini <johnm@netapp.com>
Reviewed-on: https://review.gerrithub.io/432424


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent b3db2a65
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -367,7 +367,7 @@ if [[ "${CONFIG[CRYPTO]}" = "y" ]]; then
		echo or upgrade then re-run this script.
		exit 1
        else
		if [[ "$(find /usr -name intel-ipsec-mb.h 2>/dev/null)" == "" ]]; then
		if [[ "$(find /usr -xdev -name intel-ipsec-mb.h 2>/dev/null)" == "" ]]; then
			echo "To enable crypto you must first go to the intel-ipsec-mb directory and "
			echo "run 'make' then 'sudo make install' then re-run this script."
			exit 1
+52 −15
Original line number Diff line number Diff line
@@ -2,6 +2,39 @@
# Please run this script as root.

set -e

function usage()
{
	echo ""
	echo "This script is intended to automate the installation of package dependencies to build SPDK."
	echo "Please run this script as root user."
	echo ""
	echo "$0"
	echo "  -h --help"
	echo "  -i --install-crypto Install ipsec dependencies"
	echo ""
	exit 0
}

INSTALL_CRYPTO=false

while getopts 'hi-:' optchar; do
	case "$optchar" in
		-)
		case "$OPTARG" in
			help) usage;;
			install-crypto) INSTALL_CRYPTO=true;;
			*) echo "Invalid argument '$OPTARG'"
			usage;;
		esac
		;;
	h) usage;;
	i) INSTALL_CRYPTO=true;;
	*) echo "Invalid argument '$OPTARG'"
	usage;;
	esac
done

trap 'set +e; trap - ERR; echo "Error!"; exit 1;' ERR

scriptsdir=$(readlink -f $(dirname $0))
@@ -81,13 +114,16 @@ else
fi

# Only crypto needs nasm and this lib but because the lib requires root to
# install we do it here.
# install we do it here - when asked.

if $INSTALL_CRYPTO; then

	nasm_ver=$(nasm -v | sed 's/[^0-9]*//g' | awk '{print substr ($0, 0, 5)}')
	if [ $nasm_ver -lt "21202" ]; then
			echo Crypto requires NASM version 2.12.02 or newer.  Please install
			echo or upgrade and re-run this script if you are going to use Crypto.
	else
	ipsec="$(find /usr -name intel-ipsec-mb.h 2>/dev/null)"
		ipsec="$(find /usr -xdev -name intel-ipsec-mb.h 2>/dev/null)"
		if [ "$ipsec" == "" ]; then
			ipsec_submodule_cloned="$(find $rootdir/intel-ipsec-mb -name intel-ipsec-mb.h 2>/dev/null)"
			if [ "$ipsec_submodule_cloned" != "" ]; then
@@ -99,3 +135,4 @@ else
			fi
		fi
	fi
fi
+3 −1
Original line number Diff line number Diff line
@@ -310,6 +310,7 @@ cd ~
: ${GIT_REPO_VPP=https://gerrit.fd.io/r/vpp}; export GIT_REPO_VPP
: ${GIT_REPO_LIBISCSI=https://github.com/sahlberg/libiscsi}; export GIT_REPO_LIBISCSI
: ${GIT_REPO_SPDK_NVME_CLI=https://github.com/spdk/nvme-cli}; export GIT_REPO_SPDK_NVME_CLI
: ${GIT_REPO_INTEL_IPSEC_MB=https://github.com/spdk/intel-ipsec-mb.git}; export GIT_REPO_INTEL_IPSEC_MB

jobs=$(($(nproc)*2))

@@ -329,10 +330,11 @@ 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

if $INSTALL; then
    sudo spdk_repo/spdk/scripts/pkgdep.sh
    sudo spdk_repo/spdk/scripts/pkgdep.sh -i

    if echo $CONF | grep -q tsocks; then
        sudo dnf install -y tsocks