mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-25 16:42:37 +01:00
auto-t: Use proper connection status indicator
'Connected' property of the network object is set before the connection attempt is made and does not indicate a connection success. Therefore, use device status property to identify the connection status of the device.
This commit is contained in:
parent
104e6898ca
commit
d3339ddb72
@ -40,10 +40,8 @@ class Test(unittest.TestCase):
|
|||||||
# while there are hotspot networks in range. This should result in
|
# while there are hotspot networks in range. This should result in
|
||||||
# autoconnect *after* ANQP is performed
|
# autoconnect *after* ANQP is performed
|
||||||
#
|
#
|
||||||
condition = 'obj.connected'
|
condition = 'obj.state == DeviceState.connected'
|
||||||
wd.wait_for_object_condition(wpa_network.network_object, condition)
|
wd.wait_for_object_condition(device, condition)
|
||||||
|
|
||||||
sleep(2)
|
|
||||||
|
|
||||||
testutil.test_iface_operstate()
|
testutil.test_iface_operstate()
|
||||||
testutil.test_ifaces_connected(device.name, hapd_wpa.ifname)
|
testutil.test_ifaces_connected(device.name, hapd_wpa.ifname)
|
||||||
@ -53,10 +51,10 @@ class Test(unittest.TestCase):
|
|||||||
#
|
#
|
||||||
os.remove("/var/lib/iwd/ssidWPA2-1.psk")
|
os.remove("/var/lib/iwd/ssidWPA2-1.psk")
|
||||||
|
|
||||||
self.assertEqual(len(wd.list_known_networks()), 1)
|
condition = 'obj.state == DeviceState.disconnected'
|
||||||
|
wd.wait_for_object_condition(device, condition)
|
||||||
|
|
||||||
condition = 'not obj.connected'
|
self.assertEqual(len(wd.list_known_networks()), 1)
|
||||||
wd.wait_for_object_condition(wpa_network.network_object, condition)
|
|
||||||
|
|
||||||
condition = 'obj.scanning'
|
condition = 'obj.scanning'
|
||||||
wd.wait_for_object_condition(device, condition)
|
wd.wait_for_object_condition(device, condition)
|
||||||
@ -71,10 +69,8 @@ class Test(unittest.TestCase):
|
|||||||
# Since there are no other provisioned networks, we should do ANQP and
|
# Since there are no other provisioned networks, we should do ANQP and
|
||||||
# autoconnect to the hotspot network.
|
# autoconnect to the hotspot network.
|
||||||
#
|
#
|
||||||
condition = 'obj.connected'
|
condition = 'obj.state == DeviceState.connected'
|
||||||
wd.wait_for_object_condition(hotspot_network.network_object, condition)
|
wd.wait_for_object_condition(device, condition)
|
||||||
|
|
||||||
sleep(2)
|
|
||||||
|
|
||||||
testutil.test_iface_operstate()
|
testutil.test_iface_operstate()
|
||||||
testutil.test_ifaces_connected(device.name, hapd_hotspot.ifname)
|
testutil.test_ifaces_connected(device.name, hapd_hotspot.ifname)
|
||||||
@ -87,8 +83,8 @@ class Test(unittest.TestCase):
|
|||||||
#
|
#
|
||||||
# make sure removal of hotspot conf file resulted in disconnect
|
# make sure removal of hotspot conf file resulted in disconnect
|
||||||
#
|
#
|
||||||
condition = 'not obj.connected'
|
condition = 'obj.state == DeviceState.disconnected'
|
||||||
wd.wait_for_object_condition(wpa_network.network_object, condition)
|
wd.wait_for_object_condition(device, condition)
|
||||||
|
|
||||||
condition = 'obj.scanning'
|
condition = 'obj.scanning'
|
||||||
wd.wait_for_object_condition(device, condition)
|
wd.wait_for_object_condition(device, condition)
|
||||||
@ -99,14 +95,14 @@ class Test(unittest.TestCase):
|
|||||||
hotspot_network = device.get_ordered_network("ssidWPA2-1")
|
hotspot_network = device.get_ordered_network("ssidWPA2-1")
|
||||||
self.assertEqual(hotspot_network.type, NetworkType.psk)
|
self.assertEqual(hotspot_network.type, NetworkType.psk)
|
||||||
|
|
||||||
condition = 'obj.connected'
|
condition = 'obj.state == DeviceState.connected'
|
||||||
wd.wait_for_object_condition(hotspot_network.network_object, condition)
|
wd.wait_for_object_condition(device, condition)
|
||||||
|
|
||||||
sleep(2)
|
|
||||||
|
|
||||||
testutil.test_iface_operstate()
|
testutil.test_iface_operstate()
|
||||||
testutil.test_ifaces_connected(device.name, hapd_wpa.ifname)
|
testutil.test_ifaces_connected(device.name, hapd_wpa.ifname)
|
||||||
|
|
||||||
|
device.disconnect()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
IWD.copy_to_hotspot('autoconnect.conf')
|
IWD.copy_to_hotspot('autoconnect.conf')
|
||||||
|
Loading…
Reference in New Issue
Block a user