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: set autoconnect=True for tests that need it

After the default behavior was changed to disable autoconnect there
were several tests which still needed it to be turned on.
This commit is contained in:
James Prestwood 2021-08-12 13:38:12 -07:00 committed by Denis Kenzior
parent a15b781feb
commit 836f0d9a08
9 changed files with 12 additions and 4 deletions

View File

@ -81,10 +81,8 @@ class Test(unittest.TestCase):
rule0.drop = False rule0.drop = False
# Next try autoconnecting to a network with a blacklisted BSS. Since an device.disconnect()
# explicit disconnect call would disable autoconnect we reset device.autoconnect = True
# hostapd which will disconnect IWD.
bss_hostapd[1].reload()
condition = 'not obj.connected' condition = 'not obj.connected'
wd.wait_for_object_condition(ordered_network.network_object, condition) wd.wait_for_object_condition(ordered_network.network_object, condition)

View File

@ -28,6 +28,8 @@ class TestConnectAutoConnect(unittest.TestCase):
wd.wait_for_object_condition(device, condition) wd.wait_for_object_condition(device, condition)
def check_autoconnect(self, wd, device, ssid, throws): def check_autoconnect(self, wd, device, ssid, throws):
device.autoconnect = True
if throws is None: if throws is None:
condition = 'obj.state == DeviceState.connected' condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition) wd.wait_for_object_condition(device, condition)

View File

@ -48,11 +48,13 @@ class TestConnectAutoConnect(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
device.autoconnect = autoconnect
if autoconnect: if autoconnect:
self.check_autoconnect_hidden_network(wd, device, ssid, throws) self.check_autoconnect_hidden_network(wd, device, ssid, throws)
else: else:
if wait_periodic_scan: if wait_periodic_scan:
device.autoconnect = True
condition = 'obj.scanning' condition = 'obj.scanning'
wd.wait_for_object_condition(device, condition) wd.wait_for_object_condition(device, condition)
condition = 'not obj.scanning' condition = 'not obj.scanning'

View File

@ -33,6 +33,7 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
device.autoconnect = True
# We are dependent on a periodic scan here. We want to wait for this # We are dependent on a periodic scan here. We want to wait for this
# because this is the first opportunity IWD has to do ANQP. Once ANQP # because this is the first opportunity IWD has to do ANQP. Once ANQP

View File

@ -23,6 +23,7 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
device.autoconnect = True
condition = 'obj.scanning' condition = 'obj.scanning'
wd.wait_for_object_condition(device, condition) wd.wait_for_object_condition(device, condition)

View File

@ -17,6 +17,7 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
device.autoconnect = True
condition = 'obj.state == DeviceState.connected' condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition) wd.wait_for_object_condition(device, condition)

View File

@ -28,6 +28,7 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
device.autoconnect = True
# Device initiates a passive periodic scan. # Device initiates a passive periodic scan.
condition = 'obj.scanning' condition = 'obj.scanning'

View File

@ -30,6 +30,7 @@ class Test(unittest.TestCase):
devices = wd.list_devices(1) devices = wd.list_devices(1)
self.assertIsNotNone(devices) self.assertIsNotNone(devices)
device = devices[0] device = devices[0]
device.autoconnect = True
condition = 'obj.scanning' condition = 'obj.scanning'
wd.wait_for_object_condition(device, condition) wd.wait_for_object_condition(device, condition)

View File

@ -24,6 +24,7 @@ class Test(unittest.TestCase):
def validate_quick_scan(self, wd): def validate_quick_scan(self, wd):
devices = wd.list_devices(1) devices = wd.list_devices(1)
device = devices[0] device = devices[0]
device.autoconnect = True
# Device initiates a passive quick scan and scans only for the known # Device initiates a passive quick scan and scans only for the known
# frequencies (listed in .known_network.freq file). # frequencies (listed in .known_network.freq file).