diff options
author | Jan Gelety <jgelety@cisco.com> | 2020-02-24 20:20:59 +0100 |
---|---|---|
committer | Jan Gelety <jgelety@cisco.com> | 2020-02-24 21:47:16 +0100 |
commit | 45a4fa1a5f974865b60be2b686858039a9e243bc (patch) | |
tree | 04573a0980c1f549141795cc5992bb37c2f162ef /resources/libraries/python | |
parent | 6cec6f6777286dc5a09dafc8e8829d55fc799779 (diff) |
FIX: avoid t-rex suite tear down action to fail successfull tests
- try to kill t-rex only if it is running
- do not fail the whole test suite when t-rex test suite tear down
action has failed
Change-Id: I3748a08a3da4dd3617cb54e8fdd344d49566fc7d
Signed-off-by: Jan Gelety <jgelety@cisco.com>
Diffstat (limited to 'resources/libraries/python')
-rw-r--r-- | resources/libraries/python/TrafficGenerator.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py index 1b519d5713..4294a8fdaa 100644 --- a/resources/libraries/python/TrafficGenerator.py +++ b/resources/libraries/python/TrafficGenerator.py @@ -427,8 +427,11 @@ class TrafficGenerator(AbstractMeasurer): subtype = check_subtype(node) if subtype == NodeSubTypeTG.TREX: exec_cmd_no_error( - node, u"sh -c \"sudo pkill t-rex && sleep 3\"", - sudo=False, message=u"pkill t-rex failed" + node, + u"sh -c " + u"\"if pgrep t-rex; then sudo pkill t-rex && sleep 3; fi\"", + sudo=False, + message=u"pkill t-rex failed" ) def _parse_traffic_results(self, stdout): |