iwd/autotests
James Prestwood da3f66ea68 auto-t: add optional scan argument to get_ordered_network(s)
There is a very common block of code inside many autotests
which goes something like:

device.scan()
condition = 'obj.scanning'
wd.wait_for_object_condition(device, condition)
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
network = device.get_ordered_network('an-ssid')

When you see the same pattern in nearly all the tests this shows
we need a helper. Basic autotests which merely check that a
connection succeeded should not need to write the same code again
and again. This code ends up being copy-pasted which can lead to
bugs.

There is also a code pattern which attempts to get ordered
networks, and if this fails it scans and tries again. This, while
not optimal, does prevent unneeded scanning by first checking if
any networks already exist.

This patch solves both the code reuse issue as well as the recovery
if get_ordered_network(s) fails. A new optional parameter was
added to get_ordered_network(s) which is False by default. If True
get_ordered_network(s) will perform a scan if the initial call
yields no networks. Tests will now be able to simply call
get_ordered_network(s) without performing a scan before hand.
2020-05-02 06:40:23 -05:00
..
misc auto-t: Test PEAPv0 cryptobinding 2020-02-03 11:34:29 -06:00
shell auto-t: add shell test 2019-08-07 16:37:51 -05:00
testAP auto-t: remove iwd_config_dir from autotests 2020-03-21 00:10:36 -05:00
testAP-no-support auto-t: add AP test with no AP iftype support 2019-05-13 16:38:23 -05:00
testAPRoam auto-t: updated autotests to use hwsim.get_radio 2019-06-11 11:44:00 -05:00
testAdHoc auto-t: Remove unused imports 2020-04-09 16:46:31 -05:00
testAddressRandomization auto-t: fix testAddressRandomization 2020-03-21 00:10:34 -05:00
testBSSBlacklist auto-t: change blacklist test RSSI values 2020-05-01 23:01:42 -05:00
testClientNonInteractive auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testConnectAutoconnect auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testDisconnectByAP auto-t: update tests to use get_ordered_network call 2018-12-14 13:47:00 -06:00
testDisconnectOnConnect auto-t: Test disconnect on connect while connected 2019-07-23 17:19:12 -05:00
testEAP-AKA auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testEAP-AKA-ofono auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testEAP-AKA-prime auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testEAP-AKA-prime-ofono auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testEAP-MSCHAPV2 auto-t: fix intermittent failures in testEAP-MSCHAPV2 2019-11-14 12:58:18 -06:00
testEAP-PEAP treewide: Rename EAP mtu key to MTU 2019-10-24 13:51:20 -05:00
testEAP-PEAP-GTC auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testEAP-PEAP-MSCHAPv2 auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testEAP-PEAP-SIM auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testEAP-PEAPv0-CryptoBinding auto-t: Test PEAPv0 cryptobinding 2020-02-03 11:34:29 -06:00
testEAP-PWD treewide: Rename EAP mtu key to MTU 2019-10-24 13:51:20 -05:00
testEAP-SIM auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testEAP-SIM-ofono auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testEAP-TLS auto-t: update testEAP-TLS to use HostapdCLI 2019-10-28 15:01:36 -05:00
testEAP-TLS-Frag auto-t: remove iwd_config_dir from autotests 2020-03-21 00:10:36 -05:00
testEAP-TLS-embedded-pems auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testEAP-TLSwithMFPC auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testEAP-TLSwithMFPR auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testEAP-TTLS auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testEAP-TTLS-CHAP auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testEAP-TTLS-EAP-MSCHAPV2 auto-t: update tests to use get_ordered_network call 2018-12-14 13:47:00 -06:00
testEAP-TTLS-Frag auto-t: remove iwd_config_dir from autotests 2020-03-21 00:10:36 -05:00
testEAP-TTLS-MSCHAP auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testEAP-TTLS-MSCHAPv2 auto-t: let testEAP-TTLS-MSCHAPv2 use HostapdCLI easier 2019-11-14 15:23:03 -06:00
testEAP-TTLS-PAP auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testEAP-WPS auto-t: check for known networks in EAP-WSC 2019-08-28 13:06:40 -05:00
testEAP-WPS-Frag auto-t: remove iwd_config_dir from autotests 2020-03-21 00:10:36 -05:00
testFILS auto-t: Remove unused imports 2020-04-09 16:46:31 -05:00
testFT-8021x-roam auto-t: remove iwd_config_dir from autotests 2020-03-21 00:10:36 -05:00
testFT-FILS-SHA256 auto-t: remove iwd_config_dir from autotests 2020-03-21 00:10:36 -05:00
testFT-FILS-SHA384 auto-t: remove iwd_config_dir from autotests 2020-03-21 00:10:36 -05:00
testFT-PSK-over-DS auto-t: remove iwd_config_dir from autotests 2020-03-21 00:10:36 -05:00
testFT-PSK-roam auto-t: remove iwd_config_dir from autotests 2020-03-21 00:10:36 -05:00
testFT-SAE-roam auto-t: remove iwd_config_dir from autotests 2020-03-21 00:10:36 -05:00
testHT-VHT auto-t: remove iwd_config_dir from autotests 2020-03-21 00:10:36 -05:00
testHiddenNetworks treewide: Use CamelCase for [Scan] settings 2019-10-24 15:58:08 -05:00
testHotspot auto-t: Fix event order 2020-04-09 16:46:31 -05:00
testKnownNetworks treewide: Use CamelCase for disable_anqp setting 2019-10-24 23:18:23 -05:00
testMFP-Options autotests: Remove del wd at the end function pattern 2019-04-22 18:20:01 -05:00
testOWE auto-t: add ctrl_interface to testOWE 2019-11-13 16:37:17 -06:00
testOpen auto-t: update tests to use get_ordered_network call 2018-12-14 13:47:00 -06:00
testPreauth-roam auto-t: Rename setting Autoconnect to AutoConnect 2019-10-24 13:04:53 -05:00
testRRM auto-t: add RRM test for scan duration 2019-11-15 14:17:25 -06:00
testRSSIAgent auto-t: remove iwd_config_dir from autotests 2020-03-21 00:10:36 -05:00
testSAE auto-t: remove dbus scan call in SAE autoconnect test 2019-08-02 02:23:45 -05:00
testSAQuery autotests: Use hostapd_map in place of wiphy_map 2019-04-22 18:16:14 -05:00
testSAQuery-spoofing auto-t: updated autotests to use hwsim.get_radio 2019-06-11 11:44:00 -05:00
testScan treewide: Use CamelCase for [Scan] settings 2019-10-24 15:58:08 -05:00
testScanKnownFreqs auto-t: updated testScanKnownFreqs 2019-09-12 11:36:00 -05:00
testWPA auto-t: update tests to use get_ordered_network call 2018-12-14 13:47:00 -06:00
testWPA2 autotests: Remove del wd at the end function pattern 2019-04-22 18:20:01 -05:00
testWPA2-SHA256 auto-t: update tests to use get_ordered_network call 2018-12-14 13:47:00 -06:00
testWPA2-no-CCMP auto-t: add test for CCMP with no support 2019-05-13 16:38:23 -05:00
testWPA2withMFP auto-t: update tests to use get_ordered_network call 2018-12-14 13:47:00 -06:00
util auto-t: add optional scan argument to get_ordered_network(s) 2020-05-02 06:40:23 -05:00