mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-25 09:39:25 +01:00
auto-t: replace waiting for network with device
Many tests waited on the network object 'connected' property after issuing a Connect command. This is not correct as 'connected' is set quite early in the connection process. The correct way of doing this is waiting for the device state to change to connected. This common code was replaced, hopefully putting to rest any random failures that happen occasionally.
This commit is contained in:
parent
4676dd7efd
commit
d232edde72
@ -25,8 +25,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(dev, condition)
|
||||
|
||||
wd.unregister_psk_agent(psk_agent)
|
||||
|
||||
|
@ -24,8 +24,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected()
|
||||
|
@ -77,8 +77,8 @@ class Test(unittest.TestCase):
|
||||
# successfully to bss_hostapd[0]
|
||||
self.assertIn(device.address, bss_hostapd[0].list_sta())
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
wd.unregister_psk_agent(psk_agent)
|
||||
|
||||
|
@ -134,8 +134,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
self.assertIn(device.address, bss_hostapd[0].list_sta())
|
||||
|
||||
|
@ -20,8 +20,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network = device.get_ordered_network(ssid)
|
||||
|
||||
condition = 'obj.connected'
|
||||
self.wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
self.wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -24,8 +24,8 @@ class TestConnectAutoConnect(unittest.TestCase):
|
||||
else:
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
def check_autoconnect(self, wd, device, ssid, throws):
|
||||
if throws is None:
|
||||
|
@ -36,16 +36,16 @@ class Test(unittest.TestCase):
|
||||
|
||||
wpa_net.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(wpa_net.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
open_net = device.get_ordered_network('ssidOpen')
|
||||
self.assertEqual(open_net.type, NetworkType.open)
|
||||
|
||||
open_net.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(open_net.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
@ -46,8 +46,8 @@ class Test(unittest.TestCase):
|
||||
auth.stop()
|
||||
raise
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -46,8 +46,8 @@ class Test(unittest.TestCase):
|
||||
auth.stop()
|
||||
raise
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -40,8 +40,8 @@ class Test(unittest.TestCase):
|
||||
auth.stop()
|
||||
raise
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -46,16 +46,16 @@ class Test(unittest.TestCase):
|
||||
auth.stop()
|
||||
raise
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
hostapd.eapol_reauth(device.address)
|
||||
|
||||
hostapd.wait_for_event('CTRL-EVENT-EAP-STARTED')
|
||||
hostapd.wait_for_event('CTRL-EVENT-EAP-SUCCESS')
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -38,8 +38,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
wd.unregister_psk_agent(psk_agent)
|
||||
|
||||
|
@ -35,8 +35,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -34,8 +34,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -34,8 +34,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -33,8 +33,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -33,8 +33,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -33,8 +33,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -33,8 +33,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -36,8 +36,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -40,16 +40,16 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
hostapd.eapol_reauth(device.address)
|
||||
|
||||
hostapd.wait_for_event('CTRL-EVENT-EAP-STARTED')
|
||||
hostapd.wait_for_event('CTRL-EVENT-EAP-SUCCESS')
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected()
|
||||
|
@ -43,16 +43,16 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
hostapd.eapol_reauth(device.address)
|
||||
|
||||
hostapd.wait_for_event('CTRL-EVENT-EAP-STARTED')
|
||||
hostapd.wait_for_event('CTRL-EVENT-EAP-SUCCESS')
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -32,8 +32,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -46,8 +46,8 @@ class Test(unittest.TestCase):
|
||||
auth.stop()
|
||||
raise
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -44,16 +44,16 @@ class Test(unittest.TestCase):
|
||||
auth.stop()
|
||||
raise
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
hostapd.eapol_reauth(device.address)
|
||||
|
||||
hostapd.wait_for_event('CTRL-EVENT-EAP-STARTED')
|
||||
hostapd.wait_for_event('CTRL-EVENT-EAP-SUCCESS')
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -33,8 +33,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -43,8 +43,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected(hostapd.ifname, device.name)
|
||||
|
@ -43,8 +43,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected(hapd.ifname, device.name)
|
||||
|
@ -33,8 +33,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -33,8 +33,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -43,16 +43,16 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
hostapd.eapol_reauth(device.address)
|
||||
|
||||
hostapd.wait_for_event('CTRL-EVENT-EAP-STARTED')
|
||||
hostapd.wait_for_event('CTRL-EVENT-EAP-SUCCESS')
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected()
|
||||
|
@ -40,8 +40,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected()
|
||||
|
@ -33,8 +33,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -43,16 +43,16 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
hostapd.eapol_reauth(device.address)
|
||||
|
||||
hostapd.wait_for_event('CTRL-EVENT-EAP-STARTED')
|
||||
hostapd.wait_for_event('CTRL-EVENT-EAP-SUCCESS')
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected()
|
||||
|
@ -43,16 +43,16 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
hostapd.eapol_reauth(device.address)
|
||||
|
||||
hostapd.wait_for_event('CTRL-EVENT-EAP-STARTED')
|
||||
hostapd.wait_for_event('CTRL-EVENT-EAP-SUCCESS')
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected()
|
||||
|
@ -43,16 +43,16 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
hostapd.eapol_reauth(device.address)
|
||||
|
||||
hostapd.wait_for_event('CTRL-EVENT-EAP-STARTED')
|
||||
hostapd.wait_for_event('CTRL-EVENT-EAP-SUCCESS')
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected()
|
||||
|
@ -34,8 +34,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected()
|
||||
|
@ -42,8 +42,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected(device.name, hapd.ifname)
|
||||
@ -62,8 +62,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected(device.name, hapd.ifname)
|
||||
|
@ -42,8 +42,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected(device.name, hapd.ifname)
|
||||
@ -62,8 +62,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected(device.name, hapd.ifname)
|
||||
|
@ -55,8 +55,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
self.assertTrue(self.bss_hostapd[0].list_sta())
|
||||
self.assertFalse(self.bss_hostapd[1].list_sta())
|
||||
@ -82,7 +82,9 @@ class Test(unittest.TestCase):
|
||||
condition = 'obj.state != DeviceState.roaming'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
self.assertEqual(device.state, iwd.DeviceState.connected)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
self.assertTrue(self.bss_hostapd[1].list_sta())
|
||||
|
||||
testutil.test_iface_operstate(device.name)
|
||||
@ -132,8 +134,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
self.assertTrue(self.bss_hostapd[0].list_sta())
|
||||
self.assertFalse(self.bss_hostapd[1].list_sta())
|
||||
|
@ -60,8 +60,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
self.assertTrue(self.bss_hostapd[0].list_sta())
|
||||
self.assertFalse(self.bss_hostapd[1].list_sta())
|
||||
@ -85,8 +85,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
self.assertTrue(self.bss_hostapd[0].list_sta())
|
||||
self.assertFalse(self.bss_hostapd[1].list_sta())
|
||||
@ -112,7 +112,9 @@ class Test(unittest.TestCase):
|
||||
condition = 'obj.state != DeviceState.roaming'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
self.assertEqual(device.state, iwd.DeviceState.connected)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
self.assertTrue(self.bss_hostapd[1].list_sta())
|
||||
|
||||
testutil.test_iface_operstate(device.name)
|
||||
|
@ -60,8 +60,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
self.assertTrue(self.bss_hostapd[0].list_sta())
|
||||
self.assertFalse(self.bss_hostapd[1].list_sta())
|
||||
@ -85,8 +85,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
self.assertTrue(self.bss_hostapd[0].list_sta())
|
||||
self.assertFalse(self.bss_hostapd[1].list_sta())
|
||||
|
@ -59,8 +59,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
self.assertTrue(self.bss_hostapd[0].list_sta())
|
||||
self.assertFalse(self.bss_hostapd[1].list_sta())
|
||||
|
@ -145,8 +145,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
self.assertTrue(self.bss_hostapd[0].list_sta())
|
||||
self.assertFalse(self.bss_hostapd[1].list_sta())
|
||||
|
@ -65,8 +65,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
self.assertTrue(self.bss_hostapd[0].list_sta())
|
||||
self.assertFalse(self.bss_hostapd[1].list_sta())
|
||||
|
@ -10,7 +10,6 @@ from iwd import PSKAgent
|
||||
from iwd import NetworkType
|
||||
from hwsim import Hwsim
|
||||
import testutil
|
||||
from time import sleep
|
||||
from hostapd import HostapdCLI
|
||||
|
||||
class Test(unittest.TestCase):
|
||||
@ -35,10 +34,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
|
||||
sleep(1)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected(device.name, hostapd.ifname)
|
||||
|
@ -21,8 +21,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -29,8 +29,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -43,8 +43,8 @@ class TestMFP(unittest.TestCase):
|
||||
else:
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -37,8 +37,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected(device.name, hapd.ifname)
|
||||
|
@ -37,8 +37,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected(device.name, hapd.ifname)
|
||||
|
@ -34,8 +34,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected()
|
||||
|
@ -53,8 +53,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected()
|
||||
|
@ -51,8 +51,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
# Test with 5 signal strength levels first, then with 3
|
||||
|
||||
|
@ -43,9 +43,9 @@ class Test(unittest.TestCase):
|
||||
for n in networks:
|
||||
n.network_object.connect(wait=False)
|
||||
|
||||
for n in networks:
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(n.network_object, condition)
|
||||
for d in devices:
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(d, condition)
|
||||
|
||||
for d in devices:
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
|
@ -46,8 +46,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
wd.wait(2)
|
||||
|
||||
|
@ -46,8 +46,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
wd.wait(2)
|
||||
|
||||
|
@ -46,8 +46,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
# TODO: for some reason hostapd does not respond to SA query if done
|
||||
# too soon after connection.
|
||||
@ -60,8 +60,8 @@ class Test(unittest.TestCase):
|
||||
sleep(4)
|
||||
|
||||
# Since disassociate was spoofed we should still be connected
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -40,8 +40,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
# Make AP go down ungracefully, when hostapd comes back up it should
|
||||
# send an unprotected disassociate frame so the client will re-auth.
|
||||
|
@ -38,8 +38,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
testutil.test_iface_operstate()
|
||||
testutil.test_ifaces_connected()
|
||||
|
@ -37,8 +37,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
@ -37,8 +37,8 @@ class Test(unittest.TestCase):
|
||||
|
||||
ordered_network.network_object.connect()
|
||||
|
||||
condition = 'obj.connected'
|
||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||
condition = 'obj.state == DeviceState.connected'
|
||||
wd.wait_for_object_condition(device, condition)
|
||||
|
||||
device.disconnect()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user