From bb27cea54ca857f5593fec9b50a93c1616e4de08 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Thu, 25 Feb 2021 14:00:54 -0800 Subject: [PATCH] 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. --- autotests/testEAP-WPS-Frag/wps_frag_test.py | 1 + autotests/testEAP-WPS/four_digit_pin_test.py | 1 + autotests/testEAP-WPS/pin_test.py | 1 + autotests/testEAP-WPS/push_button_test.py | 1 + autotests/testFT-8021x-roam/connection_test.py | 2 ++ autotests/testFT-FILS-SHA256/connection_test.py | 2 ++ autotests/testFT-FILS-SHA384/connection_test.py | 3 +++ autotests/testFT-PSK-over-DS/connection_test.py | 2 ++ autotests/testFT-PSK-roam/connection_test.py | 2 ++ autotests/testFT-SAE-roam/connection_test.py | 2 ++ 10 files changed, 17 insertions(+) diff --git a/autotests/testEAP-WPS-Frag/wps_frag_test.py b/autotests/testEAP-WPS-Frag/wps_frag_test.py index b9be0159..dcaf1ae2 100644 --- a/autotests/testEAP-WPS-Frag/wps_frag_test.py +++ b/autotests/testEAP-WPS-Frag/wps_frag_test.py @@ -38,6 +38,7 @@ class Test(unittest.TestCase): @classmethod def tearDownClass(cls): IWD.clear_storage() + cls.hostapd = None if __name__ == '__main__': unittest.main(exit=True) diff --git a/autotests/testEAP-WPS/four_digit_pin_test.py b/autotests/testEAP-WPS/four_digit_pin_test.py index 10afaa5d..7bdb57cb 100644 --- a/autotests/testEAP-WPS/four_digit_pin_test.py +++ b/autotests/testEAP-WPS/four_digit_pin_test.py @@ -43,6 +43,7 @@ class Test(unittest.TestCase): @classmethod def tearDownClass(cls): IWD.clear_storage() + cls.hostapd = None if __name__ == '__main__': unittest.main(exit=True) diff --git a/autotests/testEAP-WPS/pin_test.py b/autotests/testEAP-WPS/pin_test.py index 706dc20b..e2fef335 100644 --- a/autotests/testEAP-WPS/pin_test.py +++ b/autotests/testEAP-WPS/pin_test.py @@ -46,6 +46,7 @@ class Test(unittest.TestCase): @classmethod def tearDownClass(cls): IWD.clear_storage() + cls.hostapd = None if __name__ == '__main__': unittest.main(exit=True) diff --git a/autotests/testEAP-WPS/push_button_test.py b/autotests/testEAP-WPS/push_button_test.py index f82a56b5..08463f15 100644 --- a/autotests/testEAP-WPS/push_button_test.py +++ b/autotests/testEAP-WPS/push_button_test.py @@ -41,6 +41,7 @@ class Test(unittest.TestCase): @classmethod def tearDownClass(cls): IWD.clear_storage() + cls.hostapd = None if __name__ == '__main__': unittest.main(exit=True) diff --git a/autotests/testFT-8021x-roam/connection_test.py b/autotests/testFT-8021x-roam/connection_test.py index c50c90ee..f83c430d 100644 --- a/autotests/testFT-8021x-roam/connection_test.py +++ b/autotests/testFT-8021x-roam/connection_test.py @@ -143,6 +143,8 @@ class Test(unittest.TestCase): @classmethod def tearDownClass(cls): IWD.clear_storage() + cls.bss_hostapd = None + cls.bss_radio = None if __name__ == '__main__': unittest.main(exit=True) diff --git a/autotests/testFT-FILS-SHA256/connection_test.py b/autotests/testFT-FILS-SHA256/connection_test.py index 81201e08..c9e8ac7d 100644 --- a/autotests/testFT-FILS-SHA256/connection_test.py +++ b/autotests/testFT-FILS-SHA256/connection_test.py @@ -174,6 +174,8 @@ class Test(unittest.TestCase): @classmethod def tearDownClass(cls): IWD.clear_storage() + cls.bss_hostapd = None + cls.bss_radio = None if __name__ == '__main__': unittest.main(exit=True) diff --git a/autotests/testFT-FILS-SHA384/connection_test.py b/autotests/testFT-FILS-SHA384/connection_test.py index 81201e08..0495d77e 100644 --- a/autotests/testFT-FILS-SHA384/connection_test.py +++ b/autotests/testFT-FILS-SHA384/connection_test.py @@ -174,6 +174,9 @@ class Test(unittest.TestCase): @classmethod def tearDownClass(cls): IWD.clear_storage() + cls.bss_hostapd = None + cls.bss_radio = None + if __name__ == '__main__': unittest.main(exit=True) diff --git a/autotests/testFT-PSK-over-DS/connection_test.py b/autotests/testFT-PSK-over-DS/connection_test.py index ad186d07..4c751841 100644 --- a/autotests/testFT-PSK-over-DS/connection_test.py +++ b/autotests/testFT-PSK-over-DS/connection_test.py @@ -147,6 +147,8 @@ class Test(unittest.TestCase): @classmethod def tearDownClass(cls): IWD.clear_storage() + cls.bss_hostapd = None + cls.bss_radio = None if __name__ == '__main__': unittest.main(exit=True) diff --git a/autotests/testFT-PSK-roam/connection_test.py b/autotests/testFT-PSK-roam/connection_test.py index c0eec0ae..37c6da18 100644 --- a/autotests/testFT-PSK-roam/connection_test.py +++ b/autotests/testFT-PSK-roam/connection_test.py @@ -140,6 +140,8 @@ class Test(unittest.TestCase): @classmethod def tearDownClass(cls): IWD.clear_storage() + cls.bss_hostapd = None + cls.bss_radio = None if __name__ == '__main__': unittest.main(exit=True) diff --git a/autotests/testFT-SAE-roam/connection_test.py b/autotests/testFT-SAE-roam/connection_test.py index f2c694dd..da1ef731 100644 --- a/autotests/testFT-SAE-roam/connection_test.py +++ b/autotests/testFT-SAE-roam/connection_test.py @@ -197,6 +197,8 @@ class Test(unittest.TestCase): @classmethod def tearDownClass(cls): IWD.clear_storage() + cls.bss_hostapd = None + cls.bss_radio = None if __name__ == '__main__': unittest.main(exit=True)