Patch: Detection of running t-rex instance before initializing 32/1132/4
authorPeter Mikus <pmikus@cisco.com>
Mon, 16 May 2016 07:55:39 +0000 (09:55 +0200)
committerMiroslav Miklus <mmiklus@cisco.com>
Wed, 18 May 2016 06:13:41 +0000 (06:13 +0000)
- 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>
resources/libraries/python/TrafficGenerator.py

index b125a0b..7f53836 100644 (file)
@@ -167,6 +167,9 @@ class TrafficGenerator(object):
                 logger.error('trex-cfg failed: {0}'.format(stdout + stderr))
                 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 &'"

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.