Commit 08939a77 authored by Seth Howell's avatar Seth Howell Committed by Daniel Verkamp
Browse files

vm_setup.sh: add pre-existing directory checks.



This will allow us to run vm setup multiple times on a vm without it
failing due to pre-existing directories.

Change-Id: Ied17dd40daaa4b5f9a1e2448940d413c7db7cc96
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/405508


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent ac277af9
Loading
Loading
Loading
Loading
+86 −48
Original line number Diff line number Diff line
@@ -74,18 +74,27 @@ mkdir -p spdk_repo
# The librxe-dev repository provides a command line tool called rxe_cfg which makes it
# very easy to use Soft-RoCE. The build pool utilizes this command line tool in the absence
# of any real RDMA NICs to simulate one for the NVMe-oF tests.
if [ -d librxe-dev ]; then
    echo "librxe-dev source already present, not cloning"
elif [ hash rxe_cfg ]; then
    echo "rxe_cfg is already installed. skipping"
else
    git clone https://github.com/SoftRoCE/librxe-dev.git
sudo dnf install -y perl-Switch librdmacm-utils libibverbs-utils

    cd librxe-dev
    ./configure --libdir=/usr/lib64/ --prefix=
    make -j${jobs}
    sudo make install
    cd ~
fi
sudo dnf install -y perl-Switch librdmacm-utils libibverbs-utils

cd spdk_repo
mkdir -p output
if [ -d spdk ]; then
    echo "spdk source already present, not cloning"
else
    git clone https://review.gerrithub.io/spdk/spdk
fi
cd spdk
git submodule update --init --recursive
cd ~
@@ -96,6 +105,7 @@ cd ~
CURRENT_VERSION=$(iscsiadm --version)
OPEN_ISCSI_VER='iscsiadm version 6.2.0.874'
if [ "$CURRENT_VERSION" == "$OPEN_ISCSI_VER" ]; then
    if [ ! -d open-iscsi-install ]; then
        mkdir -p open-iscsi-install
        cd open-iscsi-install
        sudo dnf download --source iscsi-initiator-utils
@@ -118,34 +128,58 @@ if [ "$CURRENT_VERSION" == "$OPEN_ISCSI_VER" ]; then
        make -j${jobs}
        sudo make install
        cd ~
    else
        echo "custom open-iscsi install located, not reinstalling"
    fi
fi


sudo mkdir -p /usr/src

# Rocksdb is installed for use with the blobfs tests.
if [ ! -d /usr/src/rocksdb ]; then
    git clone https://review.gerrithub.io/spdk/rocksdb
    git -C ./rocksdb checkout spdk-v5.6.1
    sudo mv rocksdb /usr/src/

else
    sudo git -C /usr/src/rocksdb checkout spdk-v5.6.1
    echo "rocksdb already in /usr/src. Not checking out again"
fi
if [ ! -d /usr/src/fio ]; then
    if [ ! -d fio ]; then
        git clone http://git.kernel.dk/fio.git
        sudo mv fio /usr/src/
    else
        sudo mv fio /usr/src/
    fi
    (
        cd /usr/src/fio &&
        git checkout master &&
        git pull &&
        git checkout fio-3.3 &&
        make -j${jobs} &&
        sudo make install
    )
else
    echo "fio already in /usr/src/fio. Not installing"
fi
cd ~

if [ ! -d /usr/local/flamegraph ]; then
    git clone https://github.com/brendangregg/FlameGraph.git
    mkdir -p /usr/local
    sudo mv FlameGraph /usr/local/FlameGraph

else
    echo "flamegraph already installed. Skipping"
fi
SPDK_QEMU_BRANCH=spdk-2.12-pre
mkdir -p qemu
cd qemu
if [ ! -d "$SPDK_QEMU_BRANCH" ]; then
    git clone https://github.com/spdk/qemu -b "$SPDK_QEMU_BRANCH" "$SPDK_QEMU_BRANCH"
else
    echo "qemu already checked out. Skipping"
fi
cd "$SPDK_QEMU_BRANCH"
if hash tsocks &> /dev/null; then
    git_param="--with-git='tsocks git'"
@@ -183,7 +217,11 @@ cd ~

# We currently don't make any changes to the libiscsi repository for our tests, but it is possible that we will need
# to later. Cloning from git is just future proofing the machines.
if [ ! -d libiscsi ]; then
    git clone https://github.com/sahlberg/libiscsi
else
    echo "libiscsi already checked out. Skipping"
fi
cd libiscsi
./autogen.sh
./configure --prefix=/usr/local/libiscsi