aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/t-rex/t-rex-installer.sh
diff options
context:
space:
mode:
authorMiroslav Miklus <mmiklus@cisco.com>2016-02-26 18:35:27 +0100
committerMiroslav Miklus <mmiklus@cisco.com>2016-02-26 18:35:39 +0100
commitbf06c80efd215b28b2e23cb9db7c464e9e29c321 (patch)
treeeb43cf5f38aaeb37e1802e48c2d405eacef7cbc5 /resources/tools/t-rex/t-rex-installer.sh
parente9bf539548e36bc8648d055303982e977c5b57e9 (diff)
T-REX: startup config generation
- T-rex startup config generated based on computed path - move t-rex tooling to t-rex directory Change-Id: I3ac698f41f98934bcce4af35dc3a755a8948e887 Signed-off-by: Miroslav Miklus <mmiklus@cisco.com>
Diffstat (limited to 'resources/tools/t-rex/t-rex-installer.sh')
-rwxr-xr-xresources/tools/t-rex/t-rex-installer.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/resources/tools/t-rex/t-rex-installer.sh b/resources/tools/t-rex/t-rex-installer.sh
new file mode 100755
index 0000000000..781b73c3c2
--- /dev/null
+++ b/resources/tools/t-rex/t-rex-installer.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+TREX_VERSION="1.91"
+
+TREX_DOWNLOAD_REPO="https://github.com/cisco-system-traffic-generator/trex-core/archive/"
+TREX_DOWNLOAD_PACKAGE="v${TREX_VERSION}.zip"
+TREX_PACKAGE_URL="${TREX_DOWNLOAD_REPO}${TREX_DOWNLOAD_PACKAGE}"
+TARGET_DIR="/opt/"
+TREX_DIR="trex-core-${TREX_VERSION}/"
+TREX_INSTALL_DIR="${TARGET_DIR}${TREX_DIR}"
+
+if test "$(id -u)" -ne 0
+then
+ echo "Please use root or sudo to be able to access target installation directory: ${TARGET_DIR}"
+ exit 1
+fi
+
+WORKING_DIR=$(mktemp -d)
+test $? -eq 0 || exit 1
+
+cleanup () {
+ rm -r ${WORKING_DIR}
+}
+
+trap cleanup EXIT
+
+test -d ${TREX_INSTALL_DIR} && echo "T-REX aleready installed: ${TREX_INSTALL_DIR}" && exit 1
+
+wget -P ${WORKING_DIR} ${TREX_PACKAGE_URL}
+test $? -eq 0 || exit 1
+
+unzip ${WORKING_DIR}/${TREX_DOWNLOAD_PACKAGE} -d ${TARGET_DIR}
+test $? -eq 0 || exit 1
+
+cd ${TREX_INSTALL_DIR}/linux_dpdk/ && ./b configure && ./b build || exit 1
+cd ${TREX_INSTALL_DIR}/scripts/ko/src && make && make install || exit 1
+