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

auto-t: update all tests to remove bad scanning logic

This changes all tests to use the default get_ordered_network behavior
rather than some custom or incorrect logic. Any use of
scan_if_needed=True has been removed since this is now the default.
Also any explicit scanning has been removed for tests which do not
require it (where the default behavior is good enough).
This commit is contained in:
James Prestwood 2021-08-12 13:38:11 -07:00 committed by Denis Kenzior
parent 89c1ec3d79
commit a15b781feb
69 changed files with 40 additions and 482 deletions

View File

@ -15,7 +15,7 @@ class Test(unittest.TestCase):
def client_connect(self, wd, dev): def client_connect(self, wd, dev):
hostapd = HostapdCLI(config='psk-ccmp.conf') hostapd = HostapdCLI(config='psk-ccmp.conf')
ordered_network = dev.get_ordered_network('TestAP1', True) ordered_network = dev.get_ordered_network('TestAP1')
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -45,14 +45,6 @@ class Test(unittest.TestCase):
perm_addr = device.address perm_addr = device.address
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
# 1. Test per-network deterministic MAC generation # 1. Test per-network deterministic MAC generation
os.system('cat pernetwork.psk > /tmp/iwd/ssidCCMP.psk') os.system('cat pernetwork.psk > /tmp/iwd/ssidCCMP.psk')
new_addr = self.try_connection(wd) new_addr = self.try_connection(wd)

View File

@ -17,7 +17,7 @@ class Test(unittest.TestCase):
def check_connection(self, wd, ssid): def check_connection(self, wd, ssid):
device = wd.list_devices(1)[0] device = wd.list_devices(1)[0]
ordered_network = device.get_ordered_network(ssid, scan_if_needed=True) ordered_network = device.get_ordered_network(ssid)
ordered_network.network_object.connect() ordered_network.network_object.connect()

View File

@ -47,7 +47,7 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
ordered_network = device.get_ordered_network("TestBlacklist", scan_if_needed=True) ordered_network = device.get_ordered_network("TestBlacklist")
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -47,7 +47,7 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
ordered_network = device.get_ordered_network("TestBlacklist", scan_if_needed=True) ordered_network = device.get_ordered_network("TestBlacklist")
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -51,7 +51,7 @@ class Test(unittest.TestCase):
devices[1].disconnect() devices[1].disconnect()
ordered_network = device.get_ordered_network("TestBlacklist", scan_if_needed=True) ordered_network = device.get_ordered_network("TestBlacklist")
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -46,7 +46,7 @@ class Test(unittest.TestCase):
dev1, dev2 = wd.list_devices(2) dev1, dev2 = wd.list_devices(2)
ordered_network = dev1.get_ordered_network("TestBlacklist", scan_if_needed=True) ordered_network = dev1.get_ordered_network("TestBlacklist")
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)
@ -63,14 +63,6 @@ class Test(unittest.TestCase):
# dev1 now connected, this should max out the first AP, causing the next # dev1 now connected, this should max out the first AP, causing the next
# connection to fail to this AP. # connection to fail to this AP.
condition = 'not obj.scanning'
wd.wait_for_object_condition(dev2, condition)
dev2.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(dev2, condition)
ordered_network = dev2.get_ordered_network("TestBlacklist") ordered_network = dev2.get_ordered_network("TestBlacklist")
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)
@ -92,14 +84,6 @@ class Test(unittest.TestCase):
dev1.disconnect() dev1.disconnect()
dev2.disconnect() dev2.disconnect()
condition = 'not obj.scanning'
wd.wait_for_object_condition(dev2, condition)
dev2.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(dev2, condition)
ordered_network = dev2.get_ordered_network("TestBlacklist") ordered_network = dev2.get_ordered_network("TestBlacklist")
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -98,6 +98,9 @@ class Test(unittest.TestCase):
device.scan() device.scan()
condition = 'obj.scanning'
cls.wd.wait_for_object_condition(device, condition)
condition = 'not obj.scanning' condition = 'not obj.scanning'
cls.wd.wait_for_object_condition(device, condition) cls.wd.wait_for_object_condition(device, condition)

View File

@ -20,14 +20,6 @@ class Test(unittest.TestCase):
device = wd.list_devices(1)[0] device = wd.list_devices(1)[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
wpa_net = device.get_ordered_network('ssidTKIP') wpa_net = device.get_ordered_network('ssidTKIP')
self.assertEqual(wpa_net.type, NetworkType.psk) self.assertEqual(wpa_net.type, NetworkType.psk)

View File

@ -22,14 +22,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-AKA') ordered_network = device.get_ordered_network('ssidEAP-AKA')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -22,14 +22,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-AKA') ordered_network = device.get_ordered_network('ssidEAP-AKA')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -18,14 +18,6 @@ class Test(unittest.TestCase):
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-PEAPv1-GTC-nosecret') ordered_network = device.get_ordered_network('ssidEAP-PEAPv1-GTC-nosecret')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -17,14 +17,6 @@ class Test(unittest.TestCase):
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-PEAPv1-GTC') ordered_network = device.get_ordered_network('ssidEAP-PEAPv1-GTC')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -17,14 +17,6 @@ class Test(unittest.TestCase):
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-PEAP-MSCHAPv2') ordered_network = device.get_ordered_network('ssidEAP-PEAP-MSCHAPv2')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -17,14 +17,6 @@ class Test(unittest.TestCase):
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-PEAP-SIM') ordered_network = device.get_ordered_network('ssidEAP-PEAP-SIM')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -16,14 +16,6 @@ class Test(unittest.TestCase):
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-PEAP-frag') ordered_network = device.get_ordered_network('ssidEAP-PEAP-frag')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -16,14 +16,6 @@ class Test(unittest.TestCase):
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-PEAPv0') ordered_network = device.get_ordered_network('ssidEAP-PEAPv0')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -16,14 +16,6 @@ class Test(unittest.TestCase):
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-PEAPv1') ordered_network = device.get_ordered_network('ssidEAP-PEAPv1')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -19,14 +19,6 @@ class Test(unittest.TestCase):
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-PEAPv0-ISK') ordered_network = device.get_ordered_network('ssidEAP-PEAPv0-ISK')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -23,14 +23,6 @@ class Test(unittest.TestCase):
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-PEAPv0-NoISK') ordered_network = device.get_ordered_network('ssidEAP-PEAPv0-NoISK')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -26,14 +26,6 @@ class Test(unittest.TestCase):
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-PWD') ordered_network = device.get_ordered_network('ssidEAP-PWD')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -15,14 +15,6 @@ class Test(unittest.TestCase):
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-PWD-frag') ordered_network = device.get_ordered_network('ssidEAP-PWD-frag')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -23,14 +23,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-SIM') ordered_network = device.get_ordered_network('ssidEAP-SIM')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -16,14 +16,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-TLS') ordered_network = device.get_ordered_network('ssidEAP-TLS')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -24,16 +24,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
if not device.get_ordered_networks():
device.scan()
condition = 'obj.scanning'
wd.wait_for_object_condition(device, condition)
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network(ssid) ordered_network = device.get_ordered_network(ssid)
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -24,16 +24,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
if not device.get_ordered_networks():
device.scan()
condition = 'obj.scanning'
wd.wait_for_object_condition(device, condition)
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network(ssid) ordered_network = device.get_ordered_network(ssid)
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -16,14 +16,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-TLS') ordered_network = device.get_ordered_network('ssidEAP-TLS')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -16,14 +16,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-TLS') ordered_network = device.get_ordered_network('ssidEAP-TLS')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -26,14 +26,6 @@ class Test(unittest.TestCase):
device = wd.list_devices(1)[0] device = wd.list_devices(1)[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-TTLS-CHAP') ordered_network = device.get_ordered_network('ssidEAP-TTLS-CHAP')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -21,16 +21,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
if not device.get_ordered_networks():
device.scan()
condition = 'obj.scanning'
wd.wait_for_object_condition(device, condition)
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-TTLS') ordered_network = device.get_ordered_network('ssidEAP-TTLS')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -16,14 +16,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-TTLS') ordered_network = device.get_ordered_network('ssidEAP-TTLS')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -26,14 +26,6 @@ class Test(unittest.TestCase):
device = wd.list_devices(1)[0] device = wd.list_devices(1)[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-TTLS-MSCHAP') ordered_network = device.get_ordered_network('ssidEAP-TTLS-MSCHAP')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -24,16 +24,7 @@ class Test(unittest.TestCase):
device = wd.list_devices(1)[0]; device = wd.list_devices(1)[0];
condition = 'not obj.scanning' ordered_network = device.get_ordered_network('ssidEAP-TTLS-MSCHAPv2')
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_networks = device.get_ordered_networks()
ordered_network = ordered_networks[0]
self.assertEqual(ordered_network.name, "ssidEAP-TTLS-MSCHAPv2") self.assertEqual(ordered_network.name, "ssidEAP-TTLS-MSCHAPv2")
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -24,16 +24,7 @@ class Test(unittest.TestCase):
device = wd.list_devices(1)[0]; device = wd.list_devices(1)[0];
condition = 'not obj.scanning' ordered_network = device.get_ordered_network("ssidEAP-TTLS-MSCHAPv2")
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_networks = device.get_ordered_networks()
ordered_network = ordered_networks[0]
self.assertEqual(ordered_network.name, "ssidEAP-TTLS-MSCHAPv2") self.assertEqual(ordered_network.name, "ssidEAP-TTLS-MSCHAPv2")
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -26,14 +26,6 @@ class Test(unittest.TestCase):
device = wd.list_devices(1)[0] device = wd.list_devices(1)[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-TTLS-PAP') ordered_network = device.get_ordered_network('ssidEAP-TTLS-PAP')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -17,14 +17,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidEAP-TTLS') ordered_network = device.get_ordered_network('ssidEAP-TTLS')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -25,14 +25,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidFILS-256') ordered_network = device.get_ordered_network('ssidFILS-256')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -25,14 +25,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidFILS-384') ordered_network = device.get_ordered_network('ssidFILS-384')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -15,7 +15,7 @@ class Test(unittest.TestCase):
device = wd.list_devices(1)[0] device = wd.list_devices(1)[0]
ordered_network = device.get_ordered_network('TestFT', scan_if_needed=True) ordered_network = device.get_ordered_network('TestFT')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -25,7 +25,11 @@ class Test(unittest.TestCase):
condition = 'not obj.scanning' condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition) wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('testSSID') #
# Scanning must be explicitly done to get updated RSSI values. Therefore
# scan_if_needed is set false because of the previous scan.
#
ordered_network = device.get_ordered_network('testSSID', scan_if_needed=False)
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -33,8 +33,7 @@ class TestConnectionAfterHiddenNetwork(unittest.TestCase):
wd.register_psk_agent(psk_agent) wd.register_psk_agent(psk_agent)
device = wd.list_devices(1)[0] device = wd.list_devices(1)[0]
ordered_network = device.get_ordered_network('ssidOpen', ordered_network = device.get_ordered_network('ssidOpen')
scan_if_needed=True)
device.connect_hidden_network_async(name='ssidSomeHidden', device.connect_hidden_network_async(name='ssidSomeHidden',
reply_handler = self._success, reply_handler = self._success,

View File

@ -44,6 +44,17 @@ class Test(unittest.TestCase):
condition = 'not obj.scanning' condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition) wd.wait_for_object_condition(device, condition)
# If no networks were found we likely had a quick scan. Try again to
# allow the full autoconnect scan to happen.
try:
ordered_network = device.get_ordered_network('Hotspot')
except:
condition = 'obj.scanning'
wd.wait_for_object_condition(device, condition)
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('Hotspot') ordered_network = device.get_ordered_network('Hotspot')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -25,14 +25,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('Hotspot') ordered_network = device.get_ordered_network('Hotspot')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -25,14 +25,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('Hotspot') ordered_network = device.get_ordered_network('Hotspot')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -25,14 +25,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('Hotspot') ordered_network = device.get_ordered_network('Hotspot')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -38,14 +38,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
# #
# Connect to the PSK network, then Hotspot so IWD creates 2 entries in # Connect to the PSK network, then Hotspot so IWD creates 2 entries in
# the known frequency file. # the known frequency file.

View File

@ -14,14 +14,6 @@ class Test(unittest.TestCase):
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
device.scan()
condition = 'obj.scanning'
wd.wait_for_object_condition(device, condition)
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidNew') ordered_network = device.get_ordered_network('ssidNew')
condition = 'not obj.connected' condition = 'not obj.connected'

View File

@ -61,14 +61,6 @@ class TestMFP(unittest.TestCase):
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
if config_dir == '/tmp/IWD-MFP2': if config_dir == '/tmp/IWD-MFP2':
self.check_mfp_connection(wd, device, 'ssidMFP0', True) self.check_mfp_connection(wd, device, 'ssidMFP0', True)
else: else:

View File

@ -24,14 +24,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidTKIP') ordered_network = device.get_ordered_network('ssidTKIP')
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -30,14 +30,6 @@ class Test(unittest.TestCase):
dev1 = wd.list_devices(1)[0] dev1 = wd.list_devices(1)[0]
dev2 = wd_ns0.list_devices(1)[0] dev2 = wd_ns0.list_devices(1)[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(dev1, condition)
dev1.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(dev1, condition)
ordered_network = dev1.get_ordered_network('ssidTKIP') ordered_network = dev1.get_ordered_network('ssidTKIP')
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -20,7 +20,7 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
device.get_ordered_network('ssidOWE', scan_if_needed=True) device.get_ordered_network('ssidOWE')
device.connect_bssid(hapd.bssid) device.connect_bssid(hapd.bssid)
@ -41,7 +41,7 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
device.get_ordered_network('ssidOWE', scan_if_needed=True) device.get_ordered_network('ssidOWE')
device.connect_bssid(hapd0.bssid) device.connect_bssid(hapd0.bssid)

View File

@ -27,17 +27,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'obj.scanning'
wd.wait_for_object_condition(device, condition)
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidOWE') ordered_network = device.get_ordered_network('ssidOWE')
self.assertEqual(ordered_network.type, NetworkType.open) self.assertEqual(ordered_network.type, NetworkType.open)

View File

@ -17,14 +17,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidOpen') ordered_network = device.get_ordered_network('ssidOpen')
self.assertEqual(ordered_network.type, NetworkType.open) self.assertEqual(ordered_network.type, NetworkType.open)

View File

@ -34,7 +34,7 @@ class Test(unittest.TestCase):
device = wd.list_devices(1)[0] device = wd.list_devices(1)[0]
ordered_network = device.get_ordered_network('TestPreauth', scan_if_needed=True) ordered_network = device.get_ordered_network('TestPreauth')
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)

View File

@ -36,14 +36,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidRRM') ordered_network = device.get_ordered_network('ssidRRM')
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -61,14 +61,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('TestRoamRetry') ordered_network = device.get_ordered_network('TestRoamRetry')
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -60,14 +60,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('TestRoamRetry') ordered_network = device.get_ordered_network('TestRoamRetry')
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -30,7 +30,12 @@ class Test(unittest.TestCase):
wd.wait_for_object_condition(device, 'obj.scanning') wd.wait_for_object_condition(device, 'obj.scanning')
wd.wait_for_object_condition(device, 'not obj.scanning') wd.wait_for_object_condition(device, 'not obj.scanning')
network = device.get_ordered_network('ssidSAE') #
# An explicit scan was done prior due to hostapd options changing.
# Because of this scan_if_needed is set to False to avoid a redundant
# scan
#
network = device.get_ordered_network('ssidSAE', scan_if_needed=False)
self.assertEqual(network.type, NetworkType.psk) self.assertEqual(network.type, NetworkType.psk)

View File

@ -19,14 +19,6 @@ class Test(unittest.TestCase):
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
network = device.get_ordered_network('ssidSAE') network = device.get_ordered_network('ssidSAE')
self.assertEqual(network.type, NetworkType.psk) self.assertEqual(network.type, NetworkType.psk)

View File

@ -23,14 +23,6 @@ class Test(unittest.TestCase):
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
network = device.get_ordered_network('ssidSAE') network = device.get_ordered_network('ssidSAE')
self.assertEqual(network.type, NetworkType.psk) self.assertEqual(network.type, NetworkType.psk)

View File

@ -29,10 +29,7 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning' ordered_network = device.get_ordered_network('ssidCCMP')
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidCCMP', scan_if_needed=True)
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -23,14 +23,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidCCMP') ordered_network = device.get_ordered_network('ssidCCMP')
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -21,14 +21,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidTKIP') ordered_network = device.get_ordered_network('ssidTKIP')
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -20,14 +20,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidCCMP') ordered_network = device.get_ordered_network('ssidCCMP')
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -21,14 +21,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidCCMP') ordered_network = device.get_ordered_network('ssidCCMP')
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -21,14 +21,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidCCMP') ordered_network = device.get_ordered_network('ssidCCMP')
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -22,14 +22,6 @@ class Test(unittest.TestCase):
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidCCMP') ordered_network = device.get_ordered_network('ssidCCMP')
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)

View File

@ -22,16 +22,6 @@ class Test(unittest.TestCase):
condition = 'obj.state == DeviceState.disconnected' condition = 'obj.state == DeviceState.disconnected'
wd.wait_for_object_condition(device, condition) wd.wait_for_object_condition(device, condition)
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
if not device.get_ordered_networks():
device.scan()
condition = 'obj.scanning'
wd.wait_for_object_condition(device, condition)
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network("ssidCCMP") ordered_network = device.get_ordered_network("ssidCCMP")
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)
network = ordered_network.network_object network = ordered_network.network_object

View File

@ -20,14 +20,6 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network('ssidCCMP') ordered_network = device.get_ordered_network('ssidCCMP')
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)