review sims/tpce process management in 2.2.1 tests
[transportpce.git] / tests / transportpce_tests / 2.2.1 / test_renderer_service_path_nominal.py
index da93789ef90b13781fabb1e2b9f4309d75ed6142..213530692198248339403e92d6122ca5c800b5d6 100644 (file)
@@ -24,43 +24,19 @@ import test_utils
 
 class TransportPCERendererTesting(unittest.TestCase):
 
-    sim_process1 = None
-    sim_process2 = None
-    odl_process = None
+    processes = None
     restconf_baseurl = "http://localhost:8181/restconf"
 
-# START_IGNORE_XTESTING
-
     @classmethod
     def setUpClass(cls):
-        cls.odl_process = test_utils.start_tpce()
-
-        cls.sim_process1 = test_utils.start_sim('xpdra')
-        cls.sim_process2 = test_utils.start_sim('roadma')
+        cls.processes = test_utils.start_tpce()
+        cls.processes = test_utils.start_sims(['xpdra', 'roadma'])
 
     @classmethod
     def tearDownClass(cls):
-        for child in psutil.Process(cls.odl_process.pid).children():
-            child.send_signal(signal.SIGINT)
-            child.wait()
-        cls.odl_process.send_signal(signal.SIGINT)
-        cls.odl_process.wait()
-        for child in psutil.Process(cls.sim_process1.pid).children():
-            child.send_signal(signal.SIGINT)
-            child.wait()
-        cls.sim_process1.send_signal(signal.SIGINT)
-        cls.sim_process1.wait()
-        for child in psutil.Process(cls.sim_process2.pid).children():
-            child.send_signal(signal.SIGINT)
-            child.wait()
-        cls.sim_process2.send_signal(signal.SIGINT)
-        cls.sim_process2.wait()
-
-    def setUp(self):
-        print("execution of {}".format(self.id().split(".")[-1]))
-        time.sleep(10)
-
-# END_IGNORE_XTESTING
+        for process in cls.processes:
+            test_utils.shutdown_process(process)
+        print("all processes killed")
 
     def test_01_rdm_device_connected(self):
         url = ("{}/config/network-topology:"