Commit graph

4666 commits

Author SHA1 Message Date
Jouni Malinen
44b233b641 tests: Increase timeout for dpp_qr_code_auth_broadcast
This allows another initiation round to be executed if the first
broadcast frame fails to get through.

Signed-off-by: Jouni Malinen <j@w1.fi>
2024-01-14 12:44:15 +02:00
Ilan Peer
bcc28d4453 tests: Add couple of MBO and RRM tests with MLD
To validate correct operation when configured as MLD.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2024-01-14 11:48:28 +02:00
Daniel Gabay
75ac1f1ac0 tests: Extend MSCS testing
Add tests for new response handling logic:
1. Verify MSCS change response handling in association / action frame.
2. Verify MSCS unsolicited response handling.

Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
2024-01-14 11:26:56 +02:00
Daniel Gabay
3055838ebe tests: Refactor MSCS
Add helper functions for common logic.

Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
2024-01-14 11:19:43 +02:00
Jouni Malinen
6aa16abbe4 tests: Allow more time for dpp_qr_code_no_chan_list_broadcast
It looks like the first broadcast frame might be missed in some cases,
so increase the timeout here to allow another round of frames to be
attempted.

Signed-off-by: Jouni Malinen <j@w1.fi>
2024-01-14 00:21:57 +02:00
Jouni Malinen
30975951de tests: Skip test cases that need FILS if CONFIG_FILS=y was not used
fils_offload_to_driver2 and wpas_config_file_key_mgmt require
CONFIG_FILS=y, but they did not use check_fils_capa().

Signed-off-by: Jouni Malinen <j@w1.fi>
2024-01-13 23:48:38 +02:00
Ilan Peer
9dcb72046f tests: Add MLD tests for deauthentication and disassociation
Verifying that the station can successfully associate again
after being deauthenticated or disassociated.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2024-01-13 22:32:04 +02:00
Benjamin Berg
597e2be398 tests: Run kmemleak between tests if available
This triggers a kmemleak scan between tests. This allows finding memory
leaks and doing this should attribute the leak to the correct test in
most cases. Note that it does add a sleep after each test, as such it is
most sensible when combined with UML time-travel.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
2024-01-13 20:12:00 +02:00
Johannes Berg
fb90e42c37 tests: P2P: Also wait in go_neg_pbc()
Similar to other changes like this, wait a bit before
connectivity checks in go_neg_pbc().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-01-13 20:09:52 +02:00
Johannes Berg
e633811c34 tests: ap_vht_40: wait a bit before connectivity check
We need the station to be fully set up on the AP before
running the connectivity check, not just the station to
be set up itself. Just waiting for the events seems to
still be racy so just sleep a little bit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-01-13 20:09:16 +02:00
Benjamin Berg
dc766bb57e tests: Optimize process memory reading using join
Appending to a bytes() object is rather inefficient. As such, avoid
doing so by first creating a list and then joining all buffers together
at the end only.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
2024-01-13 20:08:57 +02:00
Andrei Otcheretianski
9569315dea Disable _FORTIFY_SOURCE when building with -O0
_FORTIFY_SOURCE requires at least -O2 optimization level.
This may result in compilation warnings. Fix it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2024-01-13 20:07:04 +02:00
Benjamin Berg
1e08a8990d tests: Flag inside VM using an environment variable
It is possible to execute the tests directly inside the a VM without
necessarily running the repository wrapper script to do so. In these
cases, passing the VM flag using an environment variable allows
correctly flagging this fact to the tests.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
2024-01-13 20:06:58 +02:00
Benjamin Berg
ab98ad397b tests: Stop wpa_supplicant AP at end of VHT 80 MHz (US) test
The regulatory domain cannot be reset while the AP is still active. Add
the appropriate commands to bring down the AP after the test, which will
also make resetting the regulatory domain work.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
2024-01-13 20:05:57 +02:00
Benjamin Berg
6278ab7a06 tests: Write services needed for pyrad
pyrad does an internal call to getaddrinfo with the service "www".
Make sure this service is known by writing an appropriate
/etc/services file.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
2024-01-13 19:48:44 +02:00
Benjamin Berg
7a47756373 tests: Explicitly set address to bind to
pyrad internally uses socket.getaddrinfo. While it is documented that
one can pass an empty string to bind to all interfaces. The underlying
function expects None instead though, breaking the call.

Either way, it does not hurt to set the bind address to 127.0.0.1
explicitly, so do so to avoid issues.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
2024-01-13 19:48:09 +02:00
Benjamin Berg
77f0b40872 tests: Strip trailing space from ip output
It seems that the messages from ip may have a trailing space in some
cases, which may break matching in surrounding logic. Strip the output
to remove whitespace and avoid any issues this may cause.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
2024-01-13 19:47:23 +02:00
Jouni Malinen
e7cf39b152 tests: DPP responder while ML associated
Signed-off-by: Jouni Malinen <j@w1.fi>
2024-01-13 19:39:14 +02:00
Jouni Malinen
c0e93bb217 tests: GAS/ANQP during MLO association
Signed-off-by: Jouni Malinen <j@w1.fi>
2024-01-13 19:10:17 +02:00
Jouni Malinen
1bacafce4e tests: Enable full testing for ACS with VHT160
This is now supported in hostapd, so drop the option to fail to start
the AP.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-23 16:53:52 +02:00
Jouni Malinen
6ef0614b36 tests: Automatic channel selection for EHT320
Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-23 16:38:06 +02:00
Jouni Malinen
dc57ede010 tests: Full validation of ACS selecting HT40- channel
Extend the previously used minimal test case with full validation of the
selected channel and connection since hostapd now has support for the
HT40- case as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-23 15:20:24 +02:00
Jouni Malinen
435ff085ee tests: Try to keep GAS frames within gas_concurrent_scan capture
With UML time-travel, it was possible for a GAS frame to end up in the
capture file for the next test case and if that next case used tshark to
count the number of frames (which is done, e.g., in
gas_anqp_address3_assoc), the following test case could have indicated
failure even when everything worked correctly.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-23 12:37:06 +02:00
Jouni Malinen
9c32d04e4d tests: P2P GO starting a persistent group with 80+80 MHz bandwidth
Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-23 12:20:24 +02:00
Ilan Peer
31d33a55f9 tests: Modify the DSCP-to-TID mapping in QoS mapping tests
The cfg80211 default QoS mapping might be updated to align with the
recommendations in section 4 in RF C8325. Align the QoS mapping tests
accordingly. For now, allow both the previous and new mapping to pass
the test.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2023-12-23 11:22:50 +02:00
Ilan Peer
924f328df4 tests: Extend the HE regulatory test to also exemplify SP AP
Extend he_6ghz_reg to also show how to configure SP AP with EIRP TX
power limit.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2023-12-22 20:44:57 +02:00
Ilan Peer
61c0f64360 tests: Add a simple configuration test for TX power control on 6 GHz
Add a simple test that exemplifies TX power configuration when operating
on the 6 GHz band.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2023-12-22 18:12:20 +02:00
Ilan Peer
1e3fbd4e13 tests: Extend MLD SAE test to cover failed authentication
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2023-12-22 16:51:48 +02:00
Ilan Peer
d004700560 tests: Extend testing coverage for MLD association with disabled links
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2023-12-22 16:04:52 +02:00
Jouni Malinen
b86936a58a tests: Use longer timeout with sigma_dut in DPP reconfiguration steps
Some of these can take close to the previously used timeouts and this
could result in reporting failures in cases that worked fine.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-22 14:26:34 +02:00
Ilan Peer
0e8b97cad2 tests: Add tests for EHT operation puncturing override
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2023-12-22 14:19:28 +02:00
Andrei Otcheretianski
8acb6018fd tests: Add more EHT tests with various bandwidths and channels
Test EHT connection on the 5 GHz band with channel bandwidths 20-160 MHz
and up to 320 MHz on the 6 GHz band.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2023-12-22 13:36:04 +02:00
Jouni Malinen
2ae3c61678 tests: Flush scan cache in ap_wps_and_sae
This avoids issues with old scan results from a previous test causing
incorrect association after WPS exchange.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-21 20:49:21 +02:00
Jouni Malinen
d276a5ec0a tests: SAE and sae_password_file in hostapd configuration
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-21 20:09:41 +02:00
Jouni Malinen
fc4532d0d3 tests: Add more time for the Presence Announcements to be received
The previous timeout allowed only a single chirping round, and sometimes
not even that full round. That resulted in test failures for cases where
there was not really any incorrect behavior.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-21 12:13:17 +02:00
Jouni Malinen
38b16904cf tests: Clean up PSK protocol tests to avoid issues
Stop dev[0] from trying to associate at the end of the test case to
reduce risk for leaving out some pending operations that could mess up
the following test case.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-21 12:13:13 +02:00
Jouni Malinen
a46c5738bc tests: Make flush_scan_cache() more robust
Handle the cases where the first attempt to start scan fails due to an
ongoing scan. Stop such scan and try again instead of failing the test
case immediately.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-20 18:21:10 +02:00
Jouni Malinen
4f65f66aeb tests: Make GAS tests more robust and easier to debug
Avoid some race conditions.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-20 13:07:14 +02:00
Jouni Malinen
54ab50d658 tests: Do not check TX status in dpp_qr_code_auth_neg_chan
This avoids race conditions with UML time-travel where some cases ended
up not reporting the DPP-TX-STATUS event and that resulted in discarding
events that are more important to verify for correct behavior.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-20 12:46:05 +02:00
Jouni Malinen
ecb1e04d85 tests: Wait for the dpp_init_enrollee_pkex thread to complete
One of the sigma_dut testing cases missed the t.join() call to make
surte the separate thread terminated. This could result in confusing
"unexpected stdout output" in a middle of an unrelated test case.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-19 13:49:15 +02:00
Jouni Malinen
6f1041b3fb tests: Make p2p_service_discovery_restart more robust
Stop and restart P2P_FIND on dev[1] to avoid timing issues where the
wait on dev[1] makes the test case fail even though this was trying to
verify that dev[0] is reacting quickly enough.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-19 13:03:20 +02:00
Jouni Malinen
79db4092c4 tests: Fix a typo in an error message
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-18 20:36:19 +02:00
Jouni Malinen
4ec67d514f tests: Make DPP mutual authentication cases more robust
Wait a bit between the DPP-SCAN-PEER-QR-CODE event and reporting of the
QR Code to avoid a race condition.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-18 20:35:21 +02:00
Jouni Malinen
808eea4856 tests: Avoid race condition in owe_transition_mode_ifname_acs
AP1 might take longer time than AP2, so add some more wait here.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-18 20:30:11 +02:00
Jouni Malinen
ee5ababa1d tests: Make dpp_controller_init_through_relay* more robust
Avoid a race condition that could result in the relay (hostapd)
maintaining STA association with PMF and discarding of the GAS frames.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-18 20:09:26 +02:00
Jouni Malinen
94cb040021 tests: Make p2p_channel_avoid* more robust
Terminate the group explicitly before cleanup to avoid a race condition
between an automatically started scan to find the GO again and the scan
started to clear the scan cache.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-18 17:12:30 +02:00
Jouni Malinen
48797ff87c tests: Avoid a race condition in DPP retry validation
Wait a bit to allow stopping of the DPP_LISTEN operation to be completed
before issuing the DPP_QR_CODE command that would send the frame that
these test cases expect to not get ACKed.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-18 17:00:55 +02:00
Jouni Malinen
d6509ffb92 tests: AP MLD protocol testing
Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-17 21:56:36 +02:00
Jouni Malinen
d1a2d9bbcb tests: Include MACsec in example configuration
Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-17 18:35:48 +02:00
Jouni Malinen
8b9603c3d1 tests: Include Suite B 192-bit support in the example configuration
Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-17 18:34:45 +02:00
Jouni Malinen
9398586129 tests: Include DPP3 support in the example configuration
Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-17 18:33:52 +02:00
Jouni Malinen
62141825f6 tests: PASN authentication using driver event as trigger
Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-17 18:03:56 +02:00
Jouni Malinen
fe61861984 tests: SCS and QoS characteristics
Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-17 17:26:21 +02:00
Jouni Malinen
7626635ff4 tests: More robust sigma_dut_dpp_qr_mutual_init_enrollee_pending
Wait some time between the first DPP Authentication Response that
indicates the response is not yet available and the second DPP
Authentication Response to make this sequence a bit more realistic and
less likely to hit race conditions with UML time-travel.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-17 17:02:34 +02:00
Jouni Malinen
52e869032a tests: Avoid race condition in autogo_passphrase_len
Wait for 4-way handshake to complete on the GO before the connectivity
test between two P2P clients.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-17 13:52:42 +02:00
Jouni Malinen
fc995d3130 tests: Avoid race condition in WPS ER tests
Wait for hostapd to complete STA authorization before running the
connectivity test between two associated STAs.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-17 12:48:31 +02:00
Jouni Malinen
ae20eb1d27 tests: Make p2p_msg_go_neg_both_start more robust
Use same listen channel on both devices to make this test somewhat more
likely to succeed.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-16 22:59:50 +02:00
Jouni Malinen
406bc79763 tests: Make EAP-IKEv2 protocol tests more robust
Wait a bit more between removal of the network and the next attempt to
avoid race conditions.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-16 22:37:36 +02:00
Ilan Peer
6ced33b43f tests: Verify BTM request with link removal imminent flow
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2023-12-16 20:40:23 +02:00
Jouni Malinen
b283de094b tests: Wait hostapd processing to complete in ap_wpa2_eap_in_bridge
This avoids race conditions with REAUTHENTICATE commands and hostapd
completing previous 4-way handshake.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-14 19:53:18 +02:00
Jouni Malinen
2e0751b2b4 tests: Avoid race condition in ap_pmf_assoc_comeback_wps
This needs similar waits on hostapd as ap_pmf_assoc_comeback.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-14 12:54:10 +02:00
Jouni Malinen
86dd038889 tests: Increase timeout in go_neg_forced_freq_diff_than_bss_freq
It can take significant amount of time to find the peer in this type of
a case where an AP connection is forced on a different channel while
going through p2p_find on both devices.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-14 12:13:20 +02:00
Jouni Malinen
56a944586a tests: Wait longer in sigma_dut_ap_dpp_relay before timing out
DPP initiator will try three channels in this sequence and it can take
very close to the previously used five second timeout before being able
to try on the actual operating channel of the AP. This could result in
the test case failing unnecessarily. Increase the timeout to avoid this.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-14 11:09:53 +02:00
Jouni Malinen
0cd4207b52 tests: Avoid a race in wpas_ap_lifetime_in_memory*
Disconnect processing might require some more time with wpa_supplicant
AP mode.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-14 11:03:45 +02:00
Jouni Malinen
c26081bf92 tests: Wait for group key handshake before testing Michael MIC failure
Avoid potential race condition in ap_cipher_tkip_countermeasures_ap by
sending the first test frame only after the AP has completed processing
the 4-way handshake and also wait a bit to allow the group key handshake
to be completed.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-14 11:02:12 +02:00
Jouni Malinen
7629ac4def tests: Race condition in connect_cmd_concurrent_grpform_while_connecting
Wait for AP to complete connection before running the connectivity test.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-12 20:47:16 +02:00
Jouni Malinen
3104d8057e tests: Wait for AP to complete connection before testing connectivity
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-12 20:18:57 +02:00
Jouni Malinen
e020a98969 tests: Work around a race condition in p2p_device_grpform_timeout_go
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-12-12 20:14:15 +02:00
Johannes Berg
31792fa8d9 tests: Reset WARN_ON_ONCE() state in the kernel
If a tests hits a WARN_ON_ONCE then the retriggering will make it appear
to pass, since the warning will not happen again. Make this more
reliable by resetting the states at the beginning of each test.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-12-12 19:21:22 +02:00
Johannes Berg
29e998d75e tests: Query carrier before data test
The kernel has an asynchronous work to enable TX, which hasn't always
run by the time we get to TX tests. Do a sysfs read from the carrier
file before TX, on newer kernels this synchronises the needed state.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-12-12 19:21:11 +02:00
Jouni Malinen
8d8205f737 tests: Skip memory read errors in read_process_memory()
It looks like the lifetime_in_memory test cases can hit a read failure
(Errno 5 - Input/output error) every now and then, so skip memory areas
that report that, but go through all readable process memory.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-10 21:38:46 +02:00
Jouni Malinen
48bab76ab0 tests: DFS channel switch to VHT80/80+80/160
Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-10 21:05:01 +02:00
Jouni Malinen
9579d4eff9 tests: Wait for AP/GO event in addition to STA
Wait for AP/GO to complete processing before taking the next step in a
test instead of waiting just for STA. This avoids race conditions with
UML time-travel.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-10 19:40:49 +02:00
Jouni Malinen
fe26b7559f tests: Allow more time for DPP Authentication with chirping iteration
Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-10 19:40:18 +02:00
Jouni Malinen
a10158a49a tests: Fix wpas_mesh_pmksa_caching_ext to allow lifetime to decrease
The remaining lifetime of the PMKSA entry is decreasing, so need to
allow it to differ between the old and new entries.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-10 19:40:18 +02:00
Jouni Malinen
bdb44a2936 tests: Fix the regdom wait in wpas_config_file
In addition, print some more debug information to the log.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-10 19:40:18 +02:00
Jouni Malinen
e7d06b508f tests: Avoid race condition in ap_no_auth_ack
Avoid race condition with TX status reporting for the broadcast
Deauthentication frame. This could be delivered after the SET command
for ext_mgmt_frame_handled=1 and as such, could result in an
MGMT-TX-STATUS event that would confuse the next step in the test.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-10 19:40:18 +02:00
Jouni Malinen
4c4ba77e65 tests: Avoid race condition in scan_external_trigger
Wait for the externally triggered scan to actually start before issuing
the own scan command to avoid a race condition with UML time-travel.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-10 19:40:18 +02:00
Jouni Malinen
45817ad1a3 tests: Clear STA state at the end of ap_ft_reassoc_proto
Do not leave dev[0] in state where it is waiting for
NL80211_CMD_ASSOCIATE to complete since that might deliver an
ASSOC_TIMED_OUT event to the next test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-10 19:30:44 +02:00
Jouni Malinen
97f7f9ce9b tests: Make dpp_two_initiators more robust
This test case has a race condition between the first and second
initiated DPP exchange. New kernel scheduling with UML time-travel is
making the first exchange complete before the first one can be started.
Making this fully robust would likely need ext_mgmt_frame_handling=1 and
more complex test script, but as an initial workaround, split URI
parsing from dev[2] to happen before dev[1] is started so that only a
single DPP_AUTH_INIT command is needed during the race window.

In addition, detect the race condition and SKIP the test instead of
reporting FAIL.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-10 19:30:44 +02:00
Jouni Malinen
b0fc0154f5 tests: Wait for hostapd event in addition to wpa_supplicant
Wait for hostapd to complete processing before taking the next step in a
test instead of waiting just for wpa_supplicant. This avoids race
conditions with UML time-travel.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-09 19:02:38 +02:00
Jouni Malinen
37a7b14dd9 tests: Wait for regdom events in wpas_config_file
Make sure the pending regdom changes are processed before returning to
avoid some potential race conditions.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-09 19:02:38 +02:00
Jouni Malinen
5a4a5aa82d tests: Wait for CTRL-EVENT-REGDOM-CHANGE before starting AP
Wait for the country change to take effect before trying to start
wpa_supplicant AP mode on the 5 GHz band.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-09 19:02:38 +02:00
Jouni Malinen
e521477a38 tests: Wait a bit after radio work start in dpp_listen()
Even though the radio work has started here, kernel might not have
started ROC (i.e., the REMAIN_ON_CHANNEL event has not yet been
received). Wait a bit to increase likelihood of everything being ready
for the following DPP operation.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-09 19:02:38 +02:00
Jouni Malinen
c3c326d2a1 tests: Avoid race condition in RRM beacon report tests
At least with UML time-travel, it is possible for the response frame to
be received before the TX status of the request is delivered. Such a
sequence resulted in run_req_beacon() dropping the response event and
the following step failing due to a missing event. Avoid this by caching
the received response in run_req_beacon() and returning them to the
caller.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-09 19:02:38 +02:00
Jouni Malinen
0aecf9e62c tests: Make sigma_dut AP SAE tests more robust
Wait some time before requesting disconnection to allow hostapd to
complete 4-way handshake processing. Wait some time after disconnection
has been completed on the STA before trying to use SAE again with the AP
so that hostapd has a chance to complete disconnection with UML
time-travel.

Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-09 19:02:38 +02:00
Jouni Malinen
2bbcb9ec13 tests: bgscan_simple and BTM query
Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-09 11:38:21 +02:00
Benjamin Berg
5bbc9462a0 tests: Test driver association ML link rejection flow
The underlying driver can reject only specific links in an association
request. In that case we will only ignore the corresponding BSS. Add a
test for this flow by simulating an association failure on the second
link specifically.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
2023-12-06 22:41:40 +02:00
Benjamin Berg
e086ce16a4 tests: Add some MLD association tests
Test ML association, automatic link discovery using ML probe requests
and marking BSSs as failed after an ML association failure, if the
corresponding link also rejected the association.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
2023-12-06 22:39:23 +02:00
Andrei Otcheretianski
a02f52a055 tests: Update ML discovery test to also check probe requests
Also check that we can discover BSSs requests using ML probe requests.
Note that this requires a new enough mac80211 which parses the ML probe
request and reports the contained BSSs.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2023-12-06 22:37:14 +02:00
Johannes Berg
a40f64a198 tests: kernel: Add test for regulatory disconnect in cfg80211
Add a test for regulatory disconnect, since that was broken
for quite a while in various ways.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-12-06 12:51:19 +02:00
Jaap Keuter
e8121c52f4 tests: Drop use of ifconfig, use ip instead
Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2023-12-06 11:57:57 +02:00
Jouni Malinen
b07f19e082 test: Mesh PMKSA entry validation with MESH_PMKSA_ADD
Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-02 20:32:56 +02:00
Andrei Otcheretianski
d5ef16e987 tests: Add a unit test for RNR/basic ML element parsing
Going through everything to test parsing of the basic ML element and the
RNR element is not really feasible for MBSSID mode. As such, add a unit
test to excercise parsing the available links from the RNR, basic ML
element and MBSSID-Index element if present.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2023-12-02 19:02:02 +02:00
Jouni Malinen
a7fdd58039 tests: Update capability checks to include OpenSSL 3.1 and 3.2
Signed-off-by: Jouni Malinen <j@w1.fi>
2023-12-02 11:22:24 +02:00
Ilan Peer
50526415cb tests: Test GTK rekey in test_eht_mld_link_removal()
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2023-11-26 17:01:30 +02:00
Ilan Peer
782d897e3c tests: Verify link removal (MLO)
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2023-11-26 13:25:57 +02:00
Ilan Peer
2a6d094278 tests: Add validation of number of valid and active links for MLO
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2023-11-26 13:03:55 +02:00
Benjamin Berg
a5d5b63d61 tests: Allow specifying multiple failure locations
Having the ability to trigger multiple failures in one test can be
useful. Add support to the test infrastructure to do this.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
2023-11-26 12:56:03 +02:00
Benjamin Berg
85c96b7cf7 tests: Fix some incorrect failure waiting calls
These were either sending the command to the wrong
hostapd/wpa_supplicant instance or using the wrong command. This
currently causes the wait to just immediately stop, but with future
commits it would start failing.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
2023-11-26 11:26:50 +02:00