aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
Diffstat (limited to 'resources')
-rw-r--r--resources/libraries/python/TrafficGenerator.py12
-rwxr-xr-xresources/tools/t-rex/t-rex-installer.sh4
-rwxr-xr-xresources/tools/t-rex/t-rex-stateless-stop.py2
-rwxr-xr-xresources/tools/t-rex/t-rex-stateless.py2
4 files changed, 14 insertions, 6 deletions
diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py
index 267f5d2f03..3f5cbe6675 100644
--- a/resources/libraries/python/TrafficGenerator.py
+++ b/resources/libraries/python/TrafficGenerator.py
@@ -132,8 +132,6 @@ class TrafficGenerator(object):
:return: nothing
"""
- trex_path = "/opt/trex-core-2.02"
-
topo = Topology()
if tg_node['type'] != NodeType.TG:
@@ -141,9 +139,19 @@ class TrafficGenerator(object):
self._node = tg_node
if tg_node['subtype'] == NodeSubTypeTG.TREX:
+ trex_path = "/opt/trex-core-2.03"
+
ssh = SSH()
ssh.connect(tg_node)
+ (ret, stdout, stderr) = ssh.exec_command(
+ "sudo sh -c '/tmp/openvpp-testing/resources/tools/t-rex/"
+ "t-rex-installer.sh'", timeout=300)
+ if int(ret) != 0:
+ logger.error('trex installation failed: {0}'.format(
+ stdout + stderr))
+ raise RuntimeError('Installation of TG failed')
+
if1_pci = topo.get_interface_pci_addr(tg_node, tg_if1)
if2_pci = topo.get_interface_pci_addr(tg_node, tg_if2)
if1_mac = topo.get_interface_mac(tg_node, tg_if1)
diff --git a/resources/tools/t-rex/t-rex-installer.sh b/resources/tools/t-rex/t-rex-installer.sh
index b7e9261106..1bf665c2de 100755
--- a/resources/tools/t-rex/t-rex-installer.sh
+++ b/resources/tools/t-rex/t-rex-installer.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-TREX_VERSION="2.02"
+TREX_VERSION="2.03"
TREX_DOWNLOAD_REPO="https://github.com/cisco-system-traffic-generator/trex-core/archive/"
TREX_DOWNLOAD_PACKAGE="v${TREX_VERSION}.zip"
@@ -24,7 +24,7 @@ cleanup () {
trap cleanup EXIT
-test -d ${TREX_INSTALL_DIR} && echo "T-REX aleready installed: ${TREX_INSTALL_DIR}" && exit 1
+test -d ${TREX_INSTALL_DIR} && echo "T-REX aleready installed: ${TREX_INSTALL_DIR}" && exit 0
wget -P ${WORKING_DIR} ${TREX_PACKAGE_URL}
test $? -eq 0 || exit 1
diff --git a/resources/tools/t-rex/t-rex-stateless-stop.py b/resources/tools/t-rex/t-rex-stateless-stop.py
index ed5ed7f590..4f222a75b1 100755
--- a/resources/tools/t-rex/t-rex-stateless-stop.py
+++ b/resources/tools/t-rex/t-rex-stateless-stop.py
@@ -28,7 +28,7 @@ Functionality:
import sys
-sys.path.insert(0, "/opt/trex-core-2.02/scripts/automation/"+\
+sys.path.insert(0, "/opt/trex-core-2.03/scripts/automation/"+\
"trex_control_plane/stl/")
from trex_stl_lib.api import *
diff --git a/resources/tools/t-rex/t-rex-stateless.py b/resources/tools/t-rex/t-rex-stateless.py
index c68e2c4f48..77895d7b68 100755
--- a/resources/tools/t-rex/t-rex-stateless.py
+++ b/resources/tools/t-rex/t-rex-stateless.py
@@ -48,7 +48,7 @@ import string
import struct
import sys
-sys.path.insert(0, "/opt/trex-core-2.02/scripts/automation/"+\
+sys.path.insert(0, "/opt/trex-core-2.03/scripts/automation/"+\
"trex_control_plane/stl/")
from trex_stl_lib.api import *