X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Ftransportpce_tests%2F1.2.1%2Ftest_gnpy.py;h=447e65f3174e005a74dbefd82804b874c7e464b0;hb=f4d7679be9ffcc5ef14241cbfe9040c1c177b260;hp=64a88194a9a9dc471a66f302e38ca1e8fe0db7d3;hpb=31bc01d3dab733bbb6ad48cc43586de43cb6c5c9;p=transportpce.git diff --git a/tests/transportpce_tests/1.2.1/test_gnpy.py b/tests/transportpce_tests/1.2.1/test_gnpy.py index 64a88194a..447e65f31 100644 --- a/tests/transportpce_tests/1.2.1/test_gnpy.py +++ b/tests/transportpce_tests/1.2.1/test_gnpy.py @@ -16,33 +16,28 @@ import requests import signal import time import unittest -import test_utils +from common import test_utils class TransportGNPYtesting(unittest.TestCase): - gnpy_process = None - odl_process = None - restconf_baseurl = "http://localhost:8181/restconf" - @classmethod def __init_logfile(cls): if os.path.isfile("./transportpce_tests/gnpy.log"): os.remove("transportpce_tests/gnpy.log") + processes = None + restconf_baseurl = "http://localhost:8181/restconf" + @classmethod def setUpClass(cls): - cls.odl_process = test_utils.start_tpce() - time.sleep(30) - print("opendaylight started") + cls.processes = test_utils.start_tpce() @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 process in cls.processes: + test_utils.shutdown_process(process) + print("all processes killed") def setUp(self): time.sleep(2)