aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2016-05-16 09:55:39 +0200
committerMiroslav Miklus <mmiklus@cisco.com>2016-05-18 06:13:41 +0000
commit35bee5e3075afa1f7084a6e1195a6a1403091560 (patch)
tree654c1696a385ffcbdf004dfdbbcc7258dd1b5647 /resources
parentee89fd7257288816b1c98b239f438d452764a0de (diff)
Patch: Detection of running t-rex instance before initializing
- JIRA: CSIT-89 - Add detection of running t-rex traffic generator before new instance is initialized. Change-Id: I77009b0c5e83bb6e162b9800d02b4e5a2abd541f Signed-off-by: Peter Mikus <pmikus@cisco.com>
Diffstat (limited to 'resources')
-rw-r--r--resources/libraries/python/TrafficGenerator.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py
index b125a0b53d..7f53836494 100644
--- a/resources/libraries/python/TrafficGenerator.py
+++ b/resources/libraries/python/TrafficGenerator.py
@@ -168,6 +168,9 @@ class TrafficGenerator(object):
raise RuntimeError('trex-cfg failed')
(ret, _, _) = ssh.exec_command(
+ "sh -c 'pgrep t-rex && sudo pkill t-rex'")
+
+ (ret, _, _) = ssh.exec_command(
"sh -c 'cd {0}/scripts/ && "
"sudo nohup ./t-rex-64 -i -c 7 --iom 0 > /dev/null 2>&1 &'"
"> /dev/null"\