3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 09:39:25 +01:00

auto-t: release radio/hostapd instances from cls

The cls object is part of the unittest framework and its lifespan
is out of test-runner's control. Setting objects into the cls
object sometimes keeps those objects around longer than desired.
Its best to unset anything set in cls when the test is tore down.
This commit is contained in:
James Prestwood 2021-02-25 14:00:54 -08:00 committed by Denis Kenzior
parent e5a66bf51f
commit bb27cea54c
10 changed files with 17 additions and 0 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -143,6 +143,8 @@ class Test(unittest.TestCase):
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
IWD.clear_storage() IWD.clear_storage()
cls.bss_hostapd = None
cls.bss_radio = None
if __name__ == '__main__': if __name__ == '__main__':
unittest.main(exit=True) unittest.main(exit=True)

View File

@ -174,6 +174,8 @@ class Test(unittest.TestCase):
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
IWD.clear_storage() IWD.clear_storage()
cls.bss_hostapd = None
cls.bss_radio = None
if __name__ == '__main__': if __name__ == '__main__':
unittest.main(exit=True) unittest.main(exit=True)

View File

@ -174,6 +174,9 @@ class Test(unittest.TestCase):
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
IWD.clear_storage() IWD.clear_storage()
cls.bss_hostapd = None
cls.bss_radio = None
if __name__ == '__main__': if __name__ == '__main__':
unittest.main(exit=True) unittest.main(exit=True)

View File

@ -147,6 +147,8 @@ class Test(unittest.TestCase):
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
IWD.clear_storage() IWD.clear_storage()
cls.bss_hostapd = None
cls.bss_radio = None
if __name__ == '__main__': if __name__ == '__main__':
unittest.main(exit=True) unittest.main(exit=True)

View File

@ -140,6 +140,8 @@ class Test(unittest.TestCase):
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
IWD.clear_storage() IWD.clear_storage()
cls.bss_hostapd = None
cls.bss_radio = None
if __name__ == '__main__': if __name__ == '__main__':
unittest.main(exit=True) unittest.main(exit=True)

View File

@ -197,6 +197,8 @@ class Test(unittest.TestCase):
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
IWD.clear_storage() IWD.clear_storage()
cls.bss_hostapd = None
cls.bss_radio = None
if __name__ == '__main__': if __name__ == '__main__':
unittest.main(exit=True) unittest.main(exit=True)