X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Ftransportpce_tests%2F2.2.1%2Ftest_otn_topology.py;h=89a2eef03d9c298ec0e1f64e718df49b1b852a96;hb=f4d7679be9ffcc5ef14241cbfe9040c1c177b260;hp=7505306cc77dd58a9f4e3f0470c577364ca44cd2;hpb=38788ce8eedd77f7b1dc089df00d9e2a9bcfc1f8;p=transportpce.git diff --git a/tests/transportpce_tests/2.2.1/test_otn_topology.py b/tests/transportpce_tests/2.2.1/test_otn_topology.py index 7505306cc..89a2eef03 100644 --- a/tests/transportpce_tests/2.2.1/test_otn_topology.py +++ b/tests/transportpce_tests/2.2.1/test_otn_topology.py @@ -19,32 +19,24 @@ import subprocess import time import unittest import logging -import test_utils +from common import test_utils class TransportPCEtesting(unittest.TestCase): - sim_process1 = None - odl_process = None + processes = None restconf_baseurl = "http://localhost:8181/restconf" @classmethod def setUpClass(cls): - cls.odl_process = test_utils.start_tpce() - cls.sim_process1 = test_utils.start_sim('spdrav2') + cls.processes = test_utils.start_tpce() + cls.processes = test_utils.start_sims(['spdrav2']) @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 process in cls.processes: + test_utils.shutdown_process(process) + print("all processes killed") def setUp(self): time.sleep(5)