From dcdfdde5dcd9068658b473f316a0a3ffadf161d1 Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Wed, 19 Sep 2018 09:34:55 -0700 Subject: [PATCH] auto-t: use device waiting feature in all tests --- autotests/testAPRoam/connection_test.py | 3 +-- autotests/testDisconnectByAP/disconnect_by_ap_test.py | 3 +-- autotests/testEAP-AKA-ofono/connection_test.py | 3 +-- autotests/testEAP-AKA-prime-ofono/connection_test.py | 3 +-- autotests/testEAP-AKA-prime/connection_test.py | 3 +-- autotests/testEAP-AKA/connection_test.py | 3 +-- autotests/testEAP-MSCHAPV2/connection_test.py | 3 +-- autotests/testEAP-SIM-ofono/connection_test.py | 3 +-- autotests/testEAP-SIM/connection_test.py | 3 +-- autotests/testEAP-TLS-Frag/connection_test.py | 3 +-- autotests/testEAP-TLS/connection_test.py | 3 +-- autotests/testEAP-TLSwithMFPC/connection_test.py | 3 +-- autotests/testEAP-TLSwithMFPR/connection_test.py | 3 +-- autotests/testEAP-TTLS-Frag/connection_test.py | 3 +-- autotests/testEAP-TTLS-MSCHAPV2/connection_test.py | 3 +-- autotests/testEAP-TTLS/connection_test.py | 3 +-- autotests/testEAP-WPS-Frag/wps_frag_test.py | 3 +-- autotests/testEAP-WPS/wps_test.py | 3 +-- autotests/testFT-8021x-roam/test.py | 6 +++--- autotests/testFT-PSK-roam/test.py | 6 +++--- autotests/testOpen/connection_test.py | 3 +-- autotests/testPreauth-roam/test.py | 2 +- autotests/testRSSIAgent/test.py | 2 +- autotests/testSAQuery-spoofing/connection_test.py | 3 +-- autotests/testSAQuery/connection_test.py | 3 +-- autotests/testWPA/connection_test.py | 3 +-- autotests/testWPA2-SHA256/connection_test.py | 3 +-- autotests/testWPA2/connection_test.py | 3 +-- autotests/testWPA2withMFP/connection_test.py | 3 +-- 29 files changed, 33 insertions(+), 58 deletions(-) diff --git a/autotests/testAPRoam/connection_test.py b/autotests/testAPRoam/connection_test.py index 48fea170..7af6749a 100644 --- a/autotests/testAPRoam/connection_test.py +++ b/autotests/testAPRoam/connection_test.py @@ -48,8 +48,7 @@ class Test(unittest.TestCase): psk_agent = PSKAgent("secret123") wd.register_psk_agent(psk_agent) - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testDisconnectByAP/disconnect_by_ap_test.py b/autotests/testDisconnectByAP/disconnect_by_ap_test.py index ac70ceca..fb0987a8 100644 --- a/autotests/testDisconnectByAP/disconnect_by_ap_test.py +++ b/autotests/testDisconnectByAP/disconnect_by_ap_test.py @@ -17,8 +17,7 @@ class Test(unittest.TestCase): def test_disconnect(self): wd = IWD() - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] hostapd_if = list(hostapd_map.values())[0] diff --git a/autotests/testEAP-AKA-ofono/connection_test.py b/autotests/testEAP-AKA-ofono/connection_test.py index 688aeb1d..43bf8c2b 100644 --- a/autotests/testEAP-AKA-ofono/connection_test.py +++ b/autotests/testEAP-AKA-ofono/connection_test.py @@ -21,8 +21,7 @@ class Test(unittest.TestCase): wd = IWD() - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testEAP-AKA-prime-ofono/connection_test.py b/autotests/testEAP-AKA-prime-ofono/connection_test.py index ae100b38..7c177dda 100644 --- a/autotests/testEAP-AKA-prime-ofono/connection_test.py +++ b/autotests/testEAP-AKA-prime-ofono/connection_test.py @@ -21,8 +21,7 @@ class Test(unittest.TestCase): wd = IWD() - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testEAP-AKA-prime/connection_test.py b/autotests/testEAP-AKA-prime/connection_test.py index 5717ecbc..fb237544 100644 --- a/autotests/testEAP-AKA-prime/connection_test.py +++ b/autotests/testEAP-AKA-prime/connection_test.py @@ -16,8 +16,7 @@ class Test(unittest.TestCase): wd = IWD() - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testEAP-AKA/connection_test.py b/autotests/testEAP-AKA/connection_test.py index a80431a8..0d429f48 100644 --- a/autotests/testEAP-AKA/connection_test.py +++ b/autotests/testEAP-AKA/connection_test.py @@ -29,8 +29,7 @@ class Test(unittest.TestCase): wd = IWD() - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testEAP-MSCHAPV2/connection_test.py b/autotests/testEAP-MSCHAPV2/connection_test.py index 99d8a2a1..e5ea4869 100644 --- a/autotests/testEAP-MSCHAPV2/connection_test.py +++ b/autotests/testEAP-MSCHAPV2/connection_test.py @@ -16,8 +16,7 @@ class Test(unittest.TestCase): psk_agent = iwd.PSKAgent(*secrets) wd.register_psk_agent(psk_agent) - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] try: diff --git a/autotests/testEAP-SIM-ofono/connection_test.py b/autotests/testEAP-SIM-ofono/connection_test.py index b35a6e26..f86f8dc5 100644 --- a/autotests/testEAP-SIM-ofono/connection_test.py +++ b/autotests/testEAP-SIM-ofono/connection_test.py @@ -21,8 +21,7 @@ class Test(unittest.TestCase): wd = IWD() - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testEAP-SIM/connection_test.py b/autotests/testEAP-SIM/connection_test.py index 8037bd20..f1f2833f 100644 --- a/autotests/testEAP-SIM/connection_test.py +++ b/autotests/testEAP-SIM/connection_test.py @@ -27,8 +27,7 @@ class Test(unittest.TestCase): wd = IWD() - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testEAP-TLS-Frag/connection_test.py b/autotests/testEAP-TLS-Frag/connection_test.py index 24e163bc..0d2d5aa6 100644 --- a/autotests/testEAP-TLS-Frag/connection_test.py +++ b/autotests/testEAP-TLS-Frag/connection_test.py @@ -13,8 +13,7 @@ class Test(unittest.TestCase): def test_connection_success(self): wd = IWD() - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testEAP-TLS/connection_test.py b/autotests/testEAP-TLS/connection_test.py index 816b04e3..b809ff96 100644 --- a/autotests/testEAP-TLS/connection_test.py +++ b/autotests/testEAP-TLS/connection_test.py @@ -26,8 +26,7 @@ class Test(unittest.TestCase): hostapd_ifname = ifname break - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testEAP-TLSwithMFPC/connection_test.py b/autotests/testEAP-TLSwithMFPC/connection_test.py index 24e163bc..0d2d5aa6 100644 --- a/autotests/testEAP-TLSwithMFPC/connection_test.py +++ b/autotests/testEAP-TLSwithMFPC/connection_test.py @@ -13,8 +13,7 @@ class Test(unittest.TestCase): def test_connection_success(self): wd = IWD() - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testEAP-TLSwithMFPR/connection_test.py b/autotests/testEAP-TLSwithMFPR/connection_test.py index 24e163bc..0d2d5aa6 100644 --- a/autotests/testEAP-TLSwithMFPR/connection_test.py +++ b/autotests/testEAP-TLSwithMFPR/connection_test.py @@ -13,8 +13,7 @@ class Test(unittest.TestCase): def test_connection_success(self): wd = IWD() - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testEAP-TTLS-Frag/connection_test.py b/autotests/testEAP-TTLS-Frag/connection_test.py index a1505dbd..24ed3901 100644 --- a/autotests/testEAP-TTLS-Frag/connection_test.py +++ b/autotests/testEAP-TTLS-Frag/connection_test.py @@ -13,8 +13,7 @@ class Test(unittest.TestCase): def test_connection_success(self): wd = IWD() - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testEAP-TTLS-MSCHAPV2/connection_test.py b/autotests/testEAP-TTLS-MSCHAPV2/connection_test.py index c0a73646..e8d09587 100644 --- a/autotests/testEAP-TTLS-MSCHAPV2/connection_test.py +++ b/autotests/testEAP-TTLS-MSCHAPV2/connection_test.py @@ -18,8 +18,7 @@ class Test(unittest.TestCase): psk_agent = PSKAgent('abc', ('user', 'testpasswd')) wd.register_psk_agent(psk_agent) - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testEAP-TTLS/connection_test.py b/autotests/testEAP-TTLS/connection_test.py index f721de78..c3b376ab 100644 --- a/autotests/testEAP-TTLS/connection_test.py +++ b/autotests/testEAP-TTLS/connection_test.py @@ -14,8 +14,7 @@ class Test(unittest.TestCase): def test_connection_success(self): wd = IWD() - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testEAP-WPS-Frag/wps_frag_test.py b/autotests/testEAP-WPS-Frag/wps_frag_test.py index 53b5db52..a285f340 100644 --- a/autotests/testEAP-WPS-Frag/wps_frag_test.py +++ b/autotests/testEAP-WPS-Frag/wps_frag_test.py @@ -16,8 +16,7 @@ class Test(unittest.TestCase): def test_push_button_success(self): wd = IWD() - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] device.wps_push_button() diff --git a/autotests/testEAP-WPS/wps_test.py b/autotests/testEAP-WPS/wps_test.py index 53b5db52..a285f340 100644 --- a/autotests/testEAP-WPS/wps_test.py +++ b/autotests/testEAP-WPS/wps_test.py @@ -16,8 +16,7 @@ class Test(unittest.TestCase): def test_push_button_success(self): wd = IWD() - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] device.wps_push_button() diff --git a/autotests/testFT-8021x-roam/test.py b/autotests/testFT-8021x-roam/test.py index 3dd17be6..d6abc7ed 100644 --- a/autotests/testFT-8021x-roam/test.py +++ b/autotests/testFT-8021x-roam/test.py @@ -26,7 +26,7 @@ class Test(unittest.TestCase): wd = IWD() - device = wd.list_devices()[0]; + device = wd.list_devices(1)[0]; # Check that iwd selects BSS 0 first rule0.signal = -2000 @@ -107,7 +107,7 @@ class Test(unittest.TestCase): wd = IWD() - device = wd.list_devices()[0]; + device = wd.list_devices(1)[0]; # Check that iwd selects BSS 0 first rule0.signal = -2000 @@ -182,7 +182,7 @@ class Test(unittest.TestCase): hwsim = Hwsim() wd = IWD() - device = wd.list_devices()[0] + device = wd.list_devices(1)[0] try: device.disconnect() except: diff --git a/autotests/testFT-PSK-roam/test.py b/autotests/testFT-PSK-roam/test.py index 60e1594d..fc2694d9 100644 --- a/autotests/testFT-PSK-roam/test.py +++ b/autotests/testFT-PSK-roam/test.py @@ -30,7 +30,7 @@ class Test(unittest.TestCase): psk_agent = PSKAgent("EasilyGuessedPassword") wd.register_psk_agent(psk_agent) - device = wd.list_devices()[0]; + device = wd.list_devices(1)[0]; # Check that iwd selects BSS 0 first rule0.signal = -2000 @@ -116,7 +116,7 @@ class Test(unittest.TestCase): psk_agent = PSKAgent("EasilyGuessedPassword") wd.register_psk_agent(psk_agent) - device = wd.list_devices()[0]; + device = wd.list_devices(1)[0]; # Check that iwd selects BSS 0 first rule0.signal = -2000 @@ -193,7 +193,7 @@ class Test(unittest.TestCase): hwsim = Hwsim() wd = IWD() - device = wd.list_devices()[0] + device = wd.list_devices(1)[0] try: device.disconnect() except: diff --git a/autotests/testOpen/connection_test.py b/autotests/testOpen/connection_test.py index 1e40a346..1593bbff 100644 --- a/autotests/testOpen/connection_test.py +++ b/autotests/testOpen/connection_test.py @@ -14,8 +14,7 @@ class Test(unittest.TestCase): def test_connection_success(self): wd = IWD() - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testPreauth-roam/test.py b/autotests/testPreauth-roam/test.py index 332be143..b6b1402a 100644 --- a/autotests/testPreauth-roam/test.py +++ b/autotests/testPreauth-roam/test.py @@ -62,7 +62,7 @@ class Test(unittest.TestCase): wd = IWD() - device = wd.list_devices()[0]; + device = wd.list_devices(1)[0]; # Check that iwd selects BSS 0 first rule0.signal = -2500 diff --git a/autotests/testRSSIAgent/test.py b/autotests/testRSSIAgent/test.py index c0813dde..db9f0ae0 100644 --- a/autotests/testRSSIAgent/test.py +++ b/autotests/testRSSIAgent/test.py @@ -23,7 +23,7 @@ class Test(unittest.TestCase): wd = IWD() - device = wd.list_devices()[0]; + device = wd.list_devices(1)[0]; # Register agent early to catch any unexpected notifications agent = TstAgent() diff --git a/autotests/testSAQuery-spoofing/connection_test.py b/autotests/testSAQuery-spoofing/connection_test.py index 167bd9a5..1eb46afa 100644 --- a/autotests/testSAQuery-spoofing/connection_test.py +++ b/autotests/testSAQuery-spoofing/connection_test.py @@ -37,8 +37,7 @@ class Test(unittest.TestCase): psk_agent = PSKAgent("secret123") wd.register_psk_agent(psk_agent) - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testSAQuery/connection_test.py b/autotests/testSAQuery/connection_test.py index ae816b3c..095662fb 100644 --- a/autotests/testSAQuery/connection_test.py +++ b/autotests/testSAQuery/connection_test.py @@ -30,8 +30,7 @@ class Test(unittest.TestCase): psk_agent = PSKAgent("secret123") wd.register_psk_agent(psk_agent) - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testWPA/connection_test.py b/autotests/testWPA/connection_test.py index 2dea8573..95532550 100644 --- a/autotests/testWPA/connection_test.py +++ b/autotests/testWPA/connection_test.py @@ -17,8 +17,7 @@ class Test(unittest.TestCase): psk_agent = PSKAgent("secret123") wd.register_psk_agent(psk_agent) - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testWPA2-SHA256/connection_test.py b/autotests/testWPA2-SHA256/connection_test.py index dbdbb281..3bb2e68a 100644 --- a/autotests/testWPA2-SHA256/connection_test.py +++ b/autotests/testWPA2-SHA256/connection_test.py @@ -17,8 +17,7 @@ class Test(unittest.TestCase): psk_agent = PSKAgent("secret123") wd.register_psk_agent(psk_agent) - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testWPA2/connection_test.py b/autotests/testWPA2/connection_test.py index 331a0009..5462c74e 100644 --- a/autotests/testWPA2/connection_test.py +++ b/autotests/testWPA2/connection_test.py @@ -18,8 +18,7 @@ class Test(unittest.TestCase): psk_agent = PSKAgent("secret123") wd.register_psk_agent(psk_agent) - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning' diff --git a/autotests/testWPA2withMFP/connection_test.py b/autotests/testWPA2withMFP/connection_test.py index dbdbb281..3bb2e68a 100644 --- a/autotests/testWPA2withMFP/connection_test.py +++ b/autotests/testWPA2withMFP/connection_test.py @@ -17,8 +17,7 @@ class Test(unittest.TestCase): psk_agent = PSKAgent("secret123") wd.register_psk_agent(psk_agent) - devices = wd.list_devices(); - self.assertIsNotNone(devices) + devices = wd.list_devices(1); device = devices[0] condition = 'not obj.scanning'