Merge "improve tc055 results"
[yardstick.git] / nsb_setup.sh
index 05d1fd6..c11dc10 100755 (executable)
@@ -28,7 +28,7 @@ if [ "$(whoami)" != "root" ]; then
 fi
 
 INSTALL_BIN_PATH="/opt/nsb_bin"
-TREX_VERSION="v2.20"
+TREX_VERSION="v2.28"
 TREX_DOWNLOAD="https://trex-tgn.cisco.com/trex/release/$TREX_VERSION.tar.gz"
 DPDK_DOWNLOAD="http://dpdk.org/browse/dpdk/snapshot/dpdk-16.07.zip"
 VIRTUAL_VENV="$INSTALL_BIN_PATH/yardstick_venv"
@@ -40,7 +40,7 @@ install_libs()
 {
     echo "Install libs needed to build and run NSB Testing..."
     apt-get update > /dev/null 2>&1
-    pkg=(git build-essential python-dev virtualenv python-virtualenv virtualenv linux-headers-$(uname -r) unzip  python-pip libpcap-dev)
+    pkg=(git build-essential python-dev virtualenv python-virtualenv virtualenv linux-headers-$(uname -r) unzip  python-pip libpcap-dev cmake)
     for i in "${pkg[@]}"; do
     dpkg-query -W --showformat='${Status}\n' "${i}"|grep "install ok installed"
     if [  "$?" -eq "1" ]; then
@@ -83,7 +83,7 @@ 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"
+        echo "Trex $TREX_VERSION already installed."
     else
         echo "Build TRex and installing Trex TG in $INSTALL_BIN_PATH/trex"
         rm -rf ${TREX_DOWNLOAD##*/}
@@ -99,9 +99,7 @@ install_trex()
         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"
+        ln -s $TREX_DIR/automation/trex_control_plane $INSTALL_BIN_PATH/trex_client
         popd
     fi
     echo "Done."
@@ -202,6 +200,12 @@ push_nsb_binary()
     cp "$REPO_DIR/yardstick/network_services/nfvi/collectd.sh" "$INSTALL_BIN_PATH"
     cp "$REPO_DIR/yardstick/network_services/nfvi/collectd.conf" "$INSTALL_BIN_PATH"
     cp "$REPO_DIR/nsb_setup.sh" "$INSTALL_BIN_PATH"
+
+    # Get "dpdk-devbind.py" to find the ports for VNF to run
+    wget http://dpdk.org/browse/dpdk/plain/usertools/dpdk-devbind.py?h=v17.05 -O dpdk-devbind.py
+    chmod 777 dpdk-devbind.py
+    mv dpdk-devbind.py "$INSTALL_BIN_PATH"
+    ln "$INSTALL_BIN_PATH"/dpdk-devbind.py "$INSTALL_BIN_PATH"/dpdk_nic_bind.py
     echo "Done"
 }