diff options
author | Stefan Kobza <skobza@cisco.com> | 2016-02-12 15:28:57 +0100 |
---|---|---|
committer | Stefan Kobza <skobza@cisco.com> | 2016-02-12 15:28:57 +0100 |
commit | e6cb3709bd670738471fff40ce13dcb5aff8692f (patch) | |
tree | 7e98c310b61f3396688d127f2fda6888cc1d9521 /resources/tools/t-rex-installer.sh | |
parent | b92a827b1c7f48da4214e992e5503ebe1c182416 (diff) |
Last bulk update of CSIT.
Change-Id: I815e4d54e74a49fd19a9927554ce5c37a2719f7e
Signed-off-by: Stefan Kobza <skobza@cisco.com>
Diffstat (limited to 'resources/tools/t-rex-installer.sh')
-rwxr-xr-x | resources/tools/t-rex-installer.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/resources/tools/t-rex-installer.sh b/resources/tools/t-rex-installer.sh new file mode 100755 index 0000000000..28d4ecb69d --- /dev/null +++ b/resources/tools/t-rex-installer.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +TREX_DOWNLOAD_REPO="https://github.com/cisco-system-traffic-generator/trex-core/archive/" +TREX_DOWNLOAD_PACKAGE="v1.88.zip" +TREX_PACKAGE_URL="${TREX_DOWNLOAD_REPO}${TREX_DOWNLOAD_PACKAGE}" +TARGET_DIR="/opt/" +TREX_DIR="trex-core-1.88/" +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 || exit 1 + |