mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-26 18:59:22 +01:00
auto-t: scan as many times as needed to find networks
Certain autotests coupled with slower test machines can result in lost beacons and "Network not found" errors. In attempt to help with this the test can just rescan (30 seconds max) until the network is found.
This commit is contained in:
parent
3616b37789
commit
1e0553250b
@ -489,16 +489,24 @@ class Device(IWDDBusAbstract):
|
|||||||
network wasn't found. If the network is not found an exception is
|
network wasn't found. If the network is not found an exception is
|
||||||
raised, this removes the need to extra asserts in autotests.
|
raised, this removes the need to extra asserts in autotests.
|
||||||
'''
|
'''
|
||||||
ordered_networks = self.get_ordered_networks(scan_if_needed)
|
def wait_for_network(self, network, scan_if_needed):
|
||||||
|
networks = self.get_ordered_networks(scan_if_needed)
|
||||||
|
|
||||||
if not ordered_networks:
|
if not networks:
|
||||||
raise Exception('Network %s not found' % network)
|
# No point in continuing if we aren't going to re-scan
|
||||||
|
if not scan_if_needed:
|
||||||
|
raise Exception("Network %s not found" % network)
|
||||||
|
|
||||||
for n in ordered_networks:
|
return False
|
||||||
if n.name == network:
|
|
||||||
return n
|
|
||||||
|
|
||||||
raise Exception('Network %s not found' % network)
|
for n in networks:
|
||||||
|
if n.name == network:
|
||||||
|
return n
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
return ctx.non_block_wait(wait_for_network, 30, self, network, scan_if_needed,
|
||||||
|
exception=Exception("Network %s not found" % network))
|
||||||
|
|
||||||
def wps_push_button(self):
|
def wps_push_button(self):
|
||||||
self._wps_manager.PushButton(dbus_interface=IWD_WSC_INTERFACE,
|
self._wps_manager.PushButton(dbus_interface=IWD_WSC_INTERFACE,
|
||||||
|
Loading…
Reference in New Issue
Block a user