aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Gelety <jgelety@cisco.com>2020-02-24 20:20:59 +0100
committerJan Gelety <jgelety@cisco.com>2020-02-25 11:41:41 +0000
commitcc02a78ee4480370ace4e22f0a346185c9a049af (patch)
treef6200c28ee731c2ddc4b4f1d7292b92c80962632
parentbb17ef2ed01e4dd1448c65f6df0d117b73e18dc0 (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>
-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 f48792db3d..c99ea36f71 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]