- done
- echo "Done"
-}
-
-install_yardstick()
-{
- echo "Create install directory... $INSTALL_BIN_PATH"
- mkdir -p $INSTALL_BIN_PATH
- echo "Install yardstick dependencies and build Yardstick in venv..."
- pushd .
- rm -rf $VIRTUAL_VENV
- echo $VIRTUAL_VENV
- virtualenv $VIRTUAL_VENV
- if [ ! -f "$INSTALL_BIN_PATH/yardstick_venv/bin/activate" ]; then
- echo "Installation Error. Failed to create yardstick virtual env..."
- exit 1
- fi
- source $VIRTUAL_VENV/bin/activate
- bash ./install.sh
- python setup.py install
- popd
-
- pushd .
- echo "Copying yardstick sample conf & pod file to /etc/yardstick/nodes"
- mkdir -p /etc/yardstick/nodes
- cp "$REPO_DIR/etc/yardstick/yardstick.conf.sample" "/etc/yardstick/yardstick.conf"
- cp "$REPO_DIR/etc/yardstick/nodes/pod.yaml.nsb.sample" "/etc/yardstick/nodes/"
- popd
-}
-
-#
-# Install trex for TH setup
-#
-install_trex()
-{
- TREX_DIR=$INSTALL_BIN_PATH/trex/scripts
- if [ -d "$TREX_DIR" ]; then
- echo "Trex v2.20 already installed. Make sure it contains PYTHONPATH which is required to run TRex"
- else
- echo "Build TRex and installing Trex TG in $INSTALL_BIN_PATH/trex"
- rm -rf ${TREX_DOWNLOAD##*/}
- if [ ! -e ${TREX_DOWNLOAD##*/} ] ; then
- wget $TREX_DOWNLOAD
- fi
- tar zxvf ${TREX_DOWNLOAD##*/}
- pushd .
- rm -rf trex
- mkdir -p trex
- mv $TREX_VERSION trex/scripts
- rm -rf $TREX_VERSION.tar.gz
- cd trex/scripts/ko/src/
- make
- make install
- # workaround trex module issue
- touch "$REPO_DIR/trex/scripts/automation/trex_control_plane/stl/__init__.py"
- cp "$REPO_DIR/trex/scripts/dpdk_nic_bind.py" "$INSTALL_BIN_PATH"
- popd
- fi
- echo "Done."
-}
-
-install_dpdk()
-{
- if [ -d "$INSTALL_BIN_PATH/dpdk-16.07" ]; then
- echo "DPDK already installed make sure.. igb_uio is loaded."
- else
- echo "Build DPDK 16.07..."
- pushd .
- rm -rf ${DPDK_DOWNLOAD##*/}
- rm -rf "$REPO_DIR/dpdk-16.07/"
- if [ ! -e ${DPDK_DOWNLOAD##*/} ] ; then
- wget ${DPDK_DOWNLOAD}
- fi
- unzip -o ${DPDK_DOWNLOAD##*/}
-
- cd dpdk-16.07
- make config T=x86_64-native-linuxapp-gcc O=x86_64-native-linuxapp-gcc
- cd x86_64-native-linuxapp-gcc
- echo "Enable Port Stats..."
- sed -i -e 's/CONFIG_RTE_PORT_STATS_COLLECT=n/CONFIG_RTE_PORT_STATS_COLLECT=y/g' .config
- sed -i -e 's/CONFIG_RTE_PORT_PCAP=n/CONFIG_RTE_PORT_PCAP=y/g' .config
- sed -i -e 's/CONFIG_RTE_TABLE_STATS_COLLECT=n/CONFIG_RTE_TABLE_STATS_COLLECT=y/g' .config
- sed -i -e 's/CONFIG_RTE_PIPELINE_STATS_COLLECT=n/CONFIG_RTE_PIPELINE_STATS_COLLECT=y/g' .config
- make
-
- echo "Load DPDK modules and setup hugepages"
- modprobe uio
- mkdir -p "/lib/modules/$(uname -r)/extra"
- cp -r "kmod/igb_uio.ko" "/lib/modules/$(uname -r)/extra"
- depmod -a
- modprobe igb_uio
- sh -c "echo 'uio\nigb_uio\n' > /etc/modules-load.d/nsb.conf"