aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries
diff options
context:
space:
mode:
authorJan Gelety <jgelety@cisco.com>2020-02-24 20:20:59 +0100
committerJan Gelety <jgelety@cisco.com>2020-02-24 21:47:16 +0100
commit45a4fa1a5f974865b60be2b686858039a9e243bc (patch)
tree04573a0980c1f549141795cc5992bb37c2f162ef /resources/libraries
parent6cec6f6777286dc5a09dafc8e8829d55fc799779 (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')
-rw-r--r--resources/libraries/python/TrafficGenerator.py7
-rw-r--r--resources/libraries/robot/shared/suite_teardown.robot2
2 files changed, 6 insertions, 3 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):
diff --git a/resources/libraries/robot/shared/suite_teardown.robot b/resources/libraries/robot/shared/suite_teardown.robot
index f0006792ab..362c7366e9 100644
--- a/resources/libraries/robot/shared/suite_teardown.robot
+++ b/resources/libraries/robot/shared/suite_teardown.robot
@@ -39,7 +39,7 @@
| | [Documentation]
| | ... | Additional teardown for suites which uses performance measurement.
| |
-| | Teardown traffic generator | ${tg}
+| | Run Keyword And Ignore Error | Teardown traffic generator | ${tg}
| Additional Suite Tear Down Action For dpdk
| | [Documentation]