X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Ftransportpce_tests%2F2.2.1%2Ftest_end2end.py;h=755d0c668bb9289214544bd7e323f6f6bc7ba20a;hb=f4d7679be9ffcc5ef14241cbfe9040c1c177b260;hp=1b1aab3dbc29b74ba8f3dee1616fa1c99159ba10;hpb=31bc01d3dab733bbb6ad48cc43586de43cb6c5c9;p=transportpce.git diff --git a/tests/transportpce_tests/2.2.1/test_end2end.py b/tests/transportpce_tests/2.2.1/test_end2end.py index 1b1aab3db..755d0c668 100644 --- a/tests/transportpce_tests/2.2.1/test_end2end.py +++ b/tests/transportpce_tests/2.2.1/test_end2end.py @@ -18,70 +18,29 @@ import shutil import subprocess import time import unittest -import test_utils +from common import test_utils class TransportPCEFulltesting(unittest.TestCase): - odl_process = None - sim_process1 = None - sim_process2 = None - sim_process3 = None - sim_process4 = None + processes = None restconf_baseurl = "http://localhost:8181/restconf" WAITING = 20 # nominal value is 300 -# START_IGNORE_XTESTING - @classmethod def setUpClass(cls): - 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') - print("all sims started") - - cls.odl_process = test_utils.start_tpce() - time.sleep(80) - print("opendaylight started") + 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): # instruction executed before each test method print("execution of {}".format(self.id().split(".")[-1])) -# END_IGNORE_XTESTING - # connect netconf devices def test_01_connect_xpdrA(self): url = ("{}/config/network-topology:"