tests/{ctrl,vty}_test_runner.py: raise an exception if proc's rc != 0

Change-Id: I5fa3477979d41aef7b22464a925941ed0f115193
Depends: osmo-python-tests.git I1e11fcb6c5a587c27fc00920b6e157862d972fd9
Related: OS#5665
This commit is contained in:
Vadim Yanitskiy 2023-06-01 20:09:52 +07:00
parent 8798689f3b
commit 2a6954b3ae
2 changed files with 6 additions and 2 deletions

View File

@ -63,7 +63,9 @@ class TestCtrlBase(unittest.TestCase):
def tearDown(self):
self.disconnect()
osmoutil.end_proc(self.proc)
rc = osmoutil.end_proc(self.proc)
if rc is not None and rc != 0:
raise Exception("Process returned %d" % rc)
def disconnect(self):
if not (self.sock is None):

View File

@ -65,7 +65,9 @@ class TestVTYBase(unittest.TestCase):
if self.vty:
self.vty._close_socket()
self.vty = None
osmoutil.end_proc(self.proc)
rc = osmoutil.end_proc(self.proc)
if rc is not None and rc != 0:
raise Exception("Process returned %d" % rc)
class TestVTYGenericBSC(TestVTYBase):