3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-06 12:09:23 +01:00
Commit Graph

607 Commits

Author SHA1 Message Date
James Prestwood
416ad05ce7 auto-t: fix up a few issues in testNetconfig
- Setting the IP address was resulting in an error:

   Error: any valid prefix is expected rather than "wln58".

   This is fixed by reordering the arguments with the IP address first

 - Remove the sleep, and use non_block_wait to wait for the IPv6 address
   to be set.
2022-03-30 15:26:42 -05:00
James Prestwood
b1bc8fb7fb auto-t: testSAE-roam: wait for ip link down
Before setting the address, wait for the interface to go down. This
fixes somewhat rare cases where setting the address returns -EBUSY
and ultimately breaks the neighbor reports.
2022-03-30 15:26:39 -05:00
James Prestwood
1fca13f07a auto-t: testutil: wait for operstate
Depending on timing the operstate may not be set even when IWD shows
as connected. Instead wait for the operstate to become set.
2022-03-30 15:26:36 -05:00
James Prestwood
a773aa6a07 auto-t: remove direct scan() call when possible
All tests which could avoid calling scan() directly have been
changed to use the 'full_scan' argument to get_ordered_network.

This was done because of unreliable scanning behavior on slower
systems, like VMs. If we get unlucky with the scheduler some beacons
are not received in time and in turn scan results are missing.
Using full_scan=True works around this issue by repeatedly scanning
until the SSID is found.
2022-03-30 15:25:55 -05:00
James Prestwood
cc9f8d7489 auto-t: don't wait for wpa_supplicant to connect
When configuring wpa_supplicant all we care about is that it
received the configuration object. wpa_supplicant takes quite a bit
of time to connect in some cases so waiting for that is unneeded.

This also increases the DPP timeout which may be required on slower
systems or if the timing is particularly unlucky when receiving
frames.
2022-03-28 12:38:15 -05:00
James Prestwood
f717480c18 auto-t: do a full scan when getting network
This ensures the network will be scanned for again if not found.
2022-03-28 12:38:15 -05:00
James Prestwood
12c77ef647 auto-t: use wait_for_event in testPSK-roam
Depending on timing hostapd may not show a station with list_sta()
Instead use wait_for_event
2022-03-28 12:38:15 -05:00
James Prestwood
51d4e14440 auto-t: do full scan for testSAE
This will ensure the IWD scans until the network is found.
2022-03-28 12:38:15 -05:00
James Prestwood
c852892426 auto-t: use wait_for_event in testSAE-roam
Depending on timing hostapd may not show a station with list_sta().
Instead use wait_for_event.
2022-03-28 12:38:15 -05:00
James Prestwood
2ee4e95193 auto-t: use wait_for_event in testBSSBlacklist
Depending on timing hostapd may not show a station with list_sta().
Instead use wait_for_event.
2022-03-28 12:38:15 -05:00
James Prestwood
f1a7e23eea auto-t: fixup testRoamRetry for better timing reliability
Change a few critical checks that were failing sometimes:
 - A few asserts were changed to wait_for_object_condition
 - A 15 second timeout was removed (default used instead)
 - Do a full scan at beginning of each test to clear any
   cached BSS's. The second test run was getting stale results
   and the RSSI values were not expected.
2022-03-28 12:38:15 -05:00
James Prestwood
6e608b14f5 auto-t: iwd.py: fix full_scan argument
This was not being properly honored when existing networks were
already populated. This poses an issue for any test which uses
full_scan after setting radio values such as signal strength.
2022-03-28 12:38:15 -05:00
James Prestwood
327f719f91 auto-t: remove waitstatus_to_exitcode for better compatibility
This was added in Python 3.9 which isn't always supported. Instead use
the subprocess module which automatically checks the command output.
2022-03-28 12:38:15 -05:00
James Prestwood
521960c7d6 auto-t: add test for IWD as configurator + initiator 2022-02-22 16:25:57 -06:00
James Prestwood
cfb0987eb5 auto-t: wpas.py: handle enrollee as responder
This adds support for wpa_supplicant to generate its own URI and
start presence announcements (DPP_CHIRP).
2022-02-22 16:25:55 -06:00
James Prestwood
69c1a1ba7c auto-t: wpas.py: allow arbitrary events to be handled
If an event is in response to some command which is returning an
unexpected value (unexpected with respect to wpas.py) handle_eow
would raise an exception.

Specifically with DPP this was being hit when the URI was being
returned.
2022-02-22 16:25:53 -06:00
James Prestwood
50a546705e auto-t: iwd.py: allow passing uri to start_configurator
If a URI is passed this will envoke ConfigureEnrollee()
2022-02-22 16:25:50 -06:00
James Prestwood
15c0920777 auto-t: hwsim.py: support async radio creation
Adds a new wait argument which, if false, will call the DBus method
and return immediately. This allows the caller to create multiple
radios very quickly, simulating (as close as we can) a wifi card
with dual phy's which appear in the kernel simultaneously.

The name argument was also changed to be mandatory, which is now
required by hwsim.
2022-02-16 16:27:42 -06:00
James Prestwood
73e428cf3f auto-t: add test for encrypted profiles 2022-02-15 17:44:25 -06:00
James Prestwood
9966533e6a auto-t: add test for fixed scanning crash
This simulates the conditions that trigger a free-after-use which was
fixed with:

2c355db7 ("scan: remove periodic scans from queue on abort")

This behavior can be reproduced reliably using this test with the above
patch reverted.
2022-02-14 16:02:23 -06:00
James Prestwood
94cc957c5e auto-t: iwd.py: add wait argument to scan()
Lets the test continue without waiting for the method return
2022-02-14 16:02:23 -06:00
James Prestwood
b44e32fde9 auto-t: only wait for wpa_s to get the DPP configuration
As far as wpa_supplicant goes we don't need to test if it can actually
connect to the network, just that it receives the DPP configuration.
2022-02-03 13:54:54 -06:00
James Prestwood
c3b18c44e0 auto-t: roam test to simulate reported crash
During investigation another separate crash was found. The original is
caused by a disconnect event coming in after a neighbor report scan
was completed (roam failed) during the full roam scan.

The second crash is caused by a disconnect coming in during a full
roam scan when no neighbor report scan was ever issued.
2022-01-19 16:37:51 -06:00
James Prestwood
301a55c8c3 auto-t: hostapd.py: add remove_neighbor() 2022-01-19 16:37:51 -06:00
James Prestwood
b7b0b4eb02 auto-t: improve testDPP reliablity
First disconnect wpa_supplicant to make sure it wont miss frames if
it decides to connect. Also alter the order of things for the
configurator test so autoconnect doesn't start until after hostapd
is up (avoids additional scanning and delays)
2022-01-12 12:46:27 -06:00
James Prestwood
c5fb68bb2e auto-t: wpas.py: add disconnect() 2022-01-12 12:46:24 -06:00
James Prestwood
627e54eb20 auto-t: wpas.py: increase timeout for auth protocol
Sometimes wpa_supplicant takes some time to respond to the initial
presence anouncements.
2022-01-12 12:46:21 -06:00
James Prestwood
7a3d4dabb1 auto-t: add a few more DPP tests
This adds 3 more tests:
 - Channel switch during authentication
 - Scan after configuring
 - Retransmit auth frames
2022-01-12 10:05:16 -06:00
James Prestwood
692d137a21 auto-t: wpas.py: add configurator_remove
wpa_supplicant has a limited number of configurator IDs, and its
good practice to remove them after we are done.
2022-01-12 10:05:13 -06:00
James Prestwood
0b36f497c5 auto-t: wpas.py: add freq argument to configurator_start
This forces the configurator to request a new channel during the
authentication protocol.
2022-01-12 10:05:11 -06:00
James Prestwood
c78573b468 auto-t: wpas.py: read DPP event until expected result
Controlling wpa_supplicant/hostapd from a text based interface is
problematic in that there is no way of knowing if an event corresponds
to a request. In certain cases if wpa_s/hostapd is sending out multiple
events and we make a request, a random event may come back after the
request, but before the actual result.

To fix this, at least for this specific case, we can continue to read
from the socket until the result is numeric.
2022-01-12 09:27:45 -06:00
James Prestwood
f8459427d3 auto-t: update wpas.py to use non_block_wait
This should be used as a replacement for the common GLib
wait loop (internally this is all it does).
2022-01-12 09:27:39 -06:00
James Prestwood
994c18c44e auto-t: iwd.py: use spaces instead of tabs 2022-01-04 12:34:22 -06:00
James Prestwood
7d9b198df6 auto-t: add DPP autotests 2022-01-04 12:02:42 -06:00
James Prestwood
0fd7cdcb78 auto-t: wpas.py: add DPP utilities 2022-01-04 12:02:42 -06:00
James Prestwood
7ef165035e auto-t: iwd.py: add DPP utilities 2022-01-04 12:02:42 -06:00
James Prestwood
88f2309796 auto-t: wpas.py: add wait_for_result
Some wpa_cli utilities return some result which isn't possible to
get with wait_for_event unless you know what the result will be.
This adds wait_for_result which just returns the first event that
comes in.
2022-01-04 12:02:42 -06:00
James Prestwood
8178ea17fd auto-t: iwd.py: remove unused members 2022-01-04 12:02:42 -06:00
James Prestwood
cbe454a46a auto-t: wpas.py: don't require strict match on wait_for_event
wait_for_event was checking the event string presence in the rx_data
array which meant the event string had to match perfectly to any
received events. This poses problems with events that include additional
information which the caller may not be able to know or does not care
about. For example:

DPP-RX src=02:00:00:00:02:00 freq=2437 type=11

Waiting for this event previously would require the caller know src, freq,
and type. If the caller only wants to wait for DPP-RX, it can now do that.
2022-01-04 12:02:42 -06:00
James Prestwood
4ee44ee0ea auto-t: iwd.py: remove StationDebug out of Device init
Since a Device class can represent multiple modes (AP, AdHoc, station)
move StationDebug out of the init and only create this class when it
is used (presumably only when the device is in station mode).

The StationDebug class is now created in a property method consistent
with 'station_if'. If Device is not in station mode it is automatically
switched if the test tries any StationDebug methods.

If the Device mode is changed from 'station' the StationDebug class
instance is destroyed.
2022-01-04 11:40:52 -06:00
Denis Kenzior
c3a76e0f9d auto-t: Drop !used hostapd instances in testHotspot 2021-12-24 14:28:55 -06:00
Denis Kenzior
4e2005d53b auto-t: Disable Scan address randomization 2021-12-23 18:38:18 -06:00
James Prestwood
1825fd7ab7 auto-t: iwd.py: fix namespaces on StationDebug
Passing the full argument list to StationDebug was removed
because any existing properties (for Device) were being
included and causing incorrect behavior.

This neglected to handle namespaces which should also be
passed to StationDebug. Unfortunately the arguments are not
named when Device() is initialized so they cannot easily be
sorted. Instead just define Device() arguments to match the
DBus abstraction and pass only the path and namespace to
StationDebug
2021-12-22 19:10:43 -06:00
James Prestwood
76d54b28ea auto-t: add missing config files (testOWE-transition) 2021-12-22 18:10:42 -06:00
Andrew Zaborowski
7ecdee6eaa autotests: p2p: Make waiting for dhclient more reliable
Make sure we wipe the leases file both for server and client, so that
dhclient doesn't try to re-use leases from previous tests (should really
happen) and waste time waiting for a reply.  Extend the timeout from 1s
to 5s, sometimes it takes dhclient 1s just to start.  Disable verbose
mode if not needed to avoid dhclient stalling if the pipe is not being
read.
2021-11-30 15:49:08 -06:00
James Prestwood
61dfa943c6 auto-t: testPSK-roam deauthenticate IWD after roam
After roaming deauth IWD and check the connection state.
2021-11-23 12:19:18 -06:00
James Prestwood
44faa81a06 auto-t: iwd.py: use args[0] for station debug interface
Passing *args, **kwargs into StationDebug ended up initializing the
class with Station properties since devices can be initialized from
existing property dictionaries. Since the object path is all
StationDebug needs, pass args[0] instead.
2021-11-22 15:29:42 -06:00
Torsten Schmitz
22c77cc037 auto-t: replace ifconfig with ip commands
ifconfig has long been deprecated in favor of ip from iproute2.
It is usually no longer installed by default.
2021-11-11 14:29:54 -06:00
Denis Kenzior
05ae9689eb auto-t: use tmp radvd pid file
On some systems the default radvd pid file location is not accessible.
Specify it to be under /tmp instead.

While there, enable full radvd debug output so it is logged when
test-runner is invoked with the --log option.
2021-11-10 09:17:17 -06:00
Andrew Zaborowski
d30fc97815 autotests: Test DHCPv6 client in testNetconfig 2021-11-09 14:32:50 -06:00