X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Ftransportpce_tests%2F2.2.1%2Ftest_olm.py;h=d96b302aa42288f1f4c77044cf5cb7a31f29abc8;hb=4f3da80ad8db26626a9ecb14c0277431d4a4e416;hp=ab4100dc4718f098f44178bc19aed17aa41cdef3;hpb=14813c3a00068ad2b608a7986371923f8c3c01e9;p=transportpce.git diff --git a/tests/transportpce_tests/2.2.1/test_olm.py b/tests/transportpce_tests/2.2.1/test_olm.py index ab4100dc4..d96b302aa 100644 --- a/tests/transportpce_tests/2.2.1/test_olm.py +++ b/tests/transportpce_tests/2.2.1/test_olm.py @@ -24,57 +24,24 @@ import test_utils class TransportOlmTesting(unittest.TestCase): - sim_process1 = None - sim_process2 = None - sim_process3 = None - sim_process4 = 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.sim_process3 = test_utils.start_sim('roadmc') - cls.sim_process4 = test_utils.start_sim('xpdrc') + cls.processes = test_utils.start_tpce() + cls.processes = test_utils.start_sims(['xpdra', 'roadma', 'roadmc', 'xpdrc']) @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() - for child in psutil.Process(cls.sim_process3.pid).children(): - child.send_signal(signal.SIGINT) - child.wait() - cls.sim_process3.send_signal(signal.SIGINT) - cls.sim_process3.wait() - for child in psutil.Process(cls.sim_process4.pid).children(): - child.send_signal(signal.SIGINT) - child.wait() - cls.sim_process4.send_signal(signal.SIGINT) - cls.sim_process4.wait() + for process in cls.processes: + test_utils.shutdown_process(process) + print("all processes killed") def setUp(self): print("execution of {}".format(self.id().split(".")[-1])) time.sleep(1) -# END_IGNORE_XTESTING - def test_01_xpdrA_device_connected(self): url = ("{}/config/network-topology:" "network-topology/topology/topology-netconf/node/XPDR-A1"