SetupFramework to detect failures, part II 66/13266/3
authorPeter Mikus <pmikus@cisco.com>
Thu, 28 Jun 2018 07:29:06 +0000 (07:29 +0000)
committerPeter Mikus <pmikus@cisco.com>
Fri, 29 Jun 2018 06:33:59 +0000 (06:33 +0000)
- This patch is enforcing evaluation and aligning all __init__.robot
files to use the same logic.

Change-Id: I9e2bf5e904bb6d22f4e6a153c951c3b3c233e2fb
Signed-off-by: Peter Mikus <pmikus@cisco.com>
resources/libraries/python/SetupFramework.py
tests/dpdk/perf/__init__.robot
tests/honeycomb/perf/__init__.robot
tests/kubernetes/perf/__init__.robot
tests/vpp/perf/__init__.robot

index 61a0234..ccf4e4f 100644 (file)
@@ -224,8 +224,7 @@ class SetupFramework(object):
 
         :param nodes: Topology nodes.
         :type nodes: dict
-        :returns: True - success, False - error
-        :rtype: bool
+        :raises RuntimeError: If setup framework failed.
         """
 
         tarball = pack_framework_dir()
@@ -256,10 +255,8 @@ class SetupFramework(object):
         delete_local_tarball(tarball)
         if node_success:
             logger.console('All nodes are ready')
-            return True
         else:
-            logger.console('Failed to setup framework')
-            return False
+            raise RuntimeError('Failed to setup framework')
 
 
 class CleanupFramework(object):
@@ -271,8 +268,7 @@ class CleanupFramework(object):
 
         :param nodes: Topology nodes.
         :type nodes: dict
-        :returns: True - success, False - error
-        :rtype: bool
+        :raises RuntimeError: If cleanup framework failed.
         """
         # Turn off logging since we use multiprocessing
         log_level = BuiltIn().set_log_level('NONE')
@@ -295,7 +291,5 @@ class CleanupFramework(object):
 
         if node_success:
             logger.console('All nodes cleaned up')
-            return True
         else:
-            logger.console('Failed to cleaned up framework')
-            return False
+            raise RuntimeError('Failed to cleaned up framework')
index d7eebe6..6d38c40 100644 (file)
@@ -15,6 +15,7 @@
 | Resource | resources/libraries/robot/shared/default.robot
 | Resource | resources/libraries/robot/shared/interfaces.robot
 | Library | resources.libraries.python.SetupFramework
+| Library | resources.libraries.python.SetupFramework.CleanupFramework
 | Library | resources.libraries.python.DPDK.DPDKTools
 | Suite Setup | Run Keywords | Setup performance global Variables
 | ...         | AND          | Setup Framework | ${nodes}
@@ -22,6 +23,7 @@
 | ...         | AND          | Get CPU Layout from all nodes | ${nodes}
 | ...         | AND          | Update All Numa Nodes
 | ...                        | ${nodes} | skip_tg=${True}
+| Suite Teardown | Cleanup Framework | ${nodes}
 
 *** Keywords ***
 | Setup performance global Variables
index a3d5a8a..dba1392 100644 (file)
@@ -21,6 +21,7 @@
 | Resource | resources/libraries/robot/honeycomb/honeycomb.robot
 | Resource | resources/libraries/robot/honeycomb/performance.robot
 | Library | resources.libraries.python.SetupFramework
+| Library | resources.libraries.python.SetupFramework.CleanupFramework
 | Library | resources.libraries.python.CpuUtils
 | Library | resources.libraries.python.honeycomb.Performance
 | Suite Setup | Setup suite for Honeycomb performance tests
@@ -28,6 +29,7 @@
 | ... | Stop VPP Service on DUT | ${node}
 | ... | AND | Archive Honeycomb Logs | ${node} | perf=${True}
 | ... | AND | Stop honeycomb service on DUTs | ${node}
+| ... | AND | Cleanup Framework | ${nodes}
 
 *** Keywords ***
 | Setup suite for Honeycomb performance tests
index 686ead5..69c6af3 100644 (file)
@@ -20,6 +20,7 @@
 | Library | resources.libraries.python.NodePath
 | Library | resources.libraries.python.SchedUtils
 | Library | resources.libraries.python.SetupFramework
+| Library | resources.libraries.python.SetupFramework.CleanupFramework
 | Library | resources.libraries.python.topology.Topology
 | Library | Collections
 | Suite Setup | Run Keywords | Setup performance global Variables
@@ -29,8 +30,8 @@
 | ...         | AND          | Update all numa nodes | ${nodes}
 | ...                        | skip_tg=${True}
 | ...         | AND          | Update NIC interface names on all duts | ${nodes}
-| ...
-| Suite Teardown | Destroy Kubernetes on all duts | ${nodes}
+| Suite Teardown | Run Keywords | Destroy Kubernetes on all duts | ${nodes}
+| ...            | AND          | Cleanup Framework | ${nodes}
 
 *** Keywords ***
 | Setup performance global Variables
index aa95875..642906d 100644 (file)
@@ -15,6 +15,7 @@
 | Resource | resources/libraries/robot/shared/default.robot
 | Resource | resources/libraries/robot/shared/interfaces.robot
 | Library | resources.libraries.python.SetupFramework
+| Library | resources.libraries.python.SetupFramework.CleanupFramework
 | Library | resources.libraries.python.CpuUtils
 | Suite Setup | Run Keywords | Setup performance global Variables
 | ...         | AND          | Setup Framework | ${nodes}
@@ -23,6 +24,7 @@
 | ...         | AND          | Get CPU Layout from all nodes | ${nodes}
 | ...         | AND          | Update All Interface Data On All Nodes
 | ...                        | ${nodes} | skip_tg=${True} | numa_node=${True}
+| Suite Teardown | Cleanup Framework | ${nodes}
 
 *** Keywords ***
 | Setup performance global Variables