auto-t: add more cleanup to ofono based tests (again)

The AuthCenter was still not being fully cleaned up in these
tests. It was being stopped but there was still a reference being
held which prevented __del__ from being called.
This commit is contained in:
James Prestwood 2021-04-22 10:37:43 -07:00 committed by Denis Kenzior
parent 8aac527e29
commit 1f4d73ab73
4 changed files with 9 additions and 6 deletions

View File

@ -61,6 +61,7 @@ class Test(unittest.TestCase):
IWD.clear_storage()
cls.auth.stop()
cls.auth = None
if __name__ == '__main__':
unittest.main(exit=True)

View File

@ -60,6 +60,7 @@ class Test(unittest.TestCase):
def tearDownClass(cls):
IWD.clear_storage()
cls.auth.stop()
cls.auth = None
if __name__ == '__main__':
unittest.main(exit=True)

View File

@ -44,26 +44,26 @@ class Test(unittest.TestCase):
def test_connection_success(self):
auth = AuthCenter('/tmp/hlrauc.sock', '/tmp/sim.db')
ofono = Ofono()
ofono.enable_modem('/phonesim')
ofono.wait_for_sim_auth()
wd = IWD(True)
try:
self.validate_connection(wd)
finally:
auth.stop()
self.validate_connection(wd)
@classmethod
def setUpClass(cls):
cls.auth = AuthCenter('/tmp/hlrauc.sock', '/tmp/sim.db')
IWD.copy_to_storage('ssidEAP-PEAP-SIM.8021x')
@classmethod
def tearDownClass(cls):
IWD.clear_storage()
cls.auth.stop()
cls.auth = None
if __name__ == '__main__':
unittest.main(exit=True)

View File

@ -62,6 +62,7 @@ class Test(unittest.TestCase):
IWD.clear_storage()
cls.auth.stop()
cls.auth = None
if __name__ == '__main__':
unittest.main(exit=True)