Commit graph

4769 commits

Author SHA1 Message Date
Jouni Malinen
48cb42182f tests: Disable both APs before flushing PBC state
One of the PBC APs was left running at the end of the tet case with
active PBC. Stop that AP as well before flushing scan information on the
STA.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-01-20 19:06:25 +02:00
Jouni Malinen
ec277b5237 tests: Make ap_roam_open work with S1G channels
If mac80211_hwsim has S1G channels enabled, the 15 second timeout was
not sufficiently long for full scan while connected.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-01-16 23:06:38 +02:00
Jouni Malinen
415458e2b3 tests: Make wext_pmksa_cache work with S1G channels
If mac80211_hwsim has S1G channels enabled, the 15 second timeout was
not sufficiently long for full scan while connected.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-01-16 12:40:46 +02:00
Jouni Malinen
19d3e0383f tests: Make ap_wps_iteration_error work with S1G channels
If mac80211_hwsim has S1G channels enabled, the 15 second timeout was
not long enough to allow two scan iterations to be completed.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2023-01-16 12:40:41 +02:00
Jouni Malinen
2377d817da tests: DPP QR Code and hostapd as initiator/Configurator (offchannel)
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-12-18 21:07:56 +02:00
Jouni Malinen
6bc9ce67b2 tests: HE on 6 GHz and automatic security settings on STA
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-12-18 21:07:56 +02:00
Jouni Malinen
007a43ac59 tests: Per-ESS MAC address and PMKSA caching
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-12-18 12:33:16 +02:00
Jouni Malinen
823cf218e4 tests: Use different mechanism for failing random MAC address change
gas_failures was using an invalid preassoc_mac_addr value 1111 to
trigger a failure. That won't work once wpa_supplicant starts validating
the range of the configuration parameter. Use a different mechanism to
force a failure in the actual random MAC address change functionality.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-12-18 12:33:02 +02:00
Jouni Malinen
317adf2359 tests: Set address lifetime to be sufficiently large for the test
sta_dynamic_random_mac_addr and sta_dynamic_random_mac_addr_keep_oui
assumed that the same random MAC address remains in use even though it
set the lifetime to 0 seconds. This might have worked in the past by
accident, but set this properly to configure a longer lifetime.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-12-18 12:24:32 +02:00
Jouni Malinen
3b4a5e58b7 tests: EHT with SAE
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-12-17 21:07:42 +02:00
Andrei Otcheretianski
694a1c6873 SAE: Make sme_sae_auth() return IE offset
Authentication frames include several fixed body parts (see Table 9-68
(Authentication frame body) and Table 9-69 (Presence of fields and
elements in Authentication frames) in IEEE P802.11-REVme/D2.0).

To be able to parse the IE part, these fields need to be skipped. Since
SAE logic already implements this parsing, change SAE authentication
handling functions to return the offset to the IE part. This preparation
is needed for future MLD patches that need to parse out the ML related
elements in the Authentication frames.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2022-12-17 17:11:16 +02:00
Jouni Malinen
c58178b922 tests: More coverage for D-Bus CreateInterface() parameters
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-12-17 12:11:15 +02:00
Ilan Peer
24b4c3abef tests: Extend SAE-EXT-KEY testing
Extend the SAE-EXT-KEY testing to also cover GCMP-256.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2022-12-16 22:37:31 +02:00
Jouni Malinen
6cc0a885c8 tests: require_he=1
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-12-16 20:31:14 +02:00
Aloka Dixit
96ab7529c1 tests: MBSSID and EMA
Add test cases for MBSSID functionality with EMA.

Add helper functions to create the configuration file, start hostapd
instance and client association with the transmitting interface.

he_ap_mbssid_open: 4 VAPs with open security in multiple BSSID
configuration. The first interface transmits beacons and probe responses
which include the multiple BSSID element(s) with remaining profiles.

he_ap_mbssid_same_security: 2 VAPs, all with SAE. In such a case the
Multiple BSSID elements in management frames do not include RSN and RSNE
elements as all non-transmitting profiles have exact same security
configuration as the transmitting interface.

he_ap_mbssid_mixed_security{1,2}: 8 VAPs with mixed security
configurations (SAE, OWE, WPA2-PSK, open). he_ap_mbssid_mixed_security1:
Transmitting interface uses SAE. In this case the non-transmitting
profiles will include non inheritance element (IEEE Std 802.11-2020,
9.4.2.240) wherever the security differs from the transmitting profile.
he_ap_mbssid_mixed_security2: Transmitting profile is open hence no need
for the non inheritance elements. Instead each non-transmitting profile
includes RSN, RSNE if applicable.

he_ap_ema: Enhanced multi-BSS advertisements (EMA) with 8 VAPs all with
SAE configuration.

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
2022-12-02 23:06:32 +02:00
Daniel Gabay
bb67d5b52b AP: Add testing option to delay EAPOL Tx
Add a testing option to delay EAPOL-Key messages 1/4 and 3/4. By setting
delay_eapol_tx=1, the actual EAPOL Tx will occur on the last possible
attempt (wpa_pairwise_update_count) thus all previous attempts will fail
on timeout which is the wanted delay.

In addition, add an hwsim test that uses this testing option to verify
that non protected Robust Action frames are dropped prior to keys
installation in MFP.

Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2022-12-02 13:07:03 +02:00
Jouni Malinen
12d8b8a91e tests: EAP-TEAP with and without EAP method sequence optimization
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-12-01 17:53:05 +02:00
Andrei Otcheretianski
1b025bda57 tests: Extend EHT estimated throughput testing
Add a basic test to verify AP selection algorithm with EHT AP.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2022-11-30 20:33:44 +02:00
Jouni Malinen
ed68ac9301 tests: Public key hash information in authentication and AP association
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-11-29 16:37:54 +02:00
Jouni Malinen
8de2881426 tests: Automatic channel selection for 40 MHz channel (HE)
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-11-28 23:31:36 +02:00
Jouni Malinen
cd4be06c2b tests: Random MAC address per ESS (mac_addr=3)
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-11-28 19:10:40 +02:00
Jouni Malinen
ef11556242 tests: DPP Controller/Relay with chirping (duplicate)
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-11-28 16:42:21 +02:00
Johannes Berg
48c7e04be6 tests: Add mode for running UML kernel under gdb
The new --gdb option can be used when KERNELDIR (and optionally
MODULEDIR) are set and we therefore run UML. It runs the entire
VM under the debugger, with a script to load the right modules
into gdb so you can debug easily.

This needs CONFIG_GDB_SCRIPTS=y to be used in the kernel build.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-11-28 15:43:00 +02:00
Jouni Malinen
74874275dc tests: hostapd behavior with second BSS bridge interface already existing
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-11-28 11:39:06 +02:00
Jouni Malinen
e174ec7a07 tests: Check hostapd PID file removal in all cases
Only one of the test cases was doing this, but it's more robust for all
the cases using dynamically started hostapd process to do same.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-11-27 15:54:26 +02:00
Raphaël Mélotte
e7829e4466 tests: Add ap_reload_bss_only
The test checks that when the SSID of a BSS is changed using
SET+RELOAD_BSS, the stations already connected to other BSSes on the
same radio are not disconnected.

It also checks that stations can connect using the new SSID after the
reload.

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
2022-11-27 15:51:08 +02:00
Raphaël Mélotte
1a27b8838a tests: Add ap_config_reload_on_sighup_config_id
The test checks that when reloading the configuration with SIGHUP,
stations that are connected to BSSes whose config_id did not change are
not disconnected. It also checks that for the BSSes that have a
different config_id and SSID, the new SSID is applied correctly.

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
2022-11-27 15:44:58 +02:00
Raphaël Mélotte
34e4a17b48 tests: Add iface_params and bss_params to write_hostapd_config()
To make it easier to write custom hostapd configuration files, add
"iface_params" and "bss_params".

They are both meant to be lists of parameters that the user can supply
to append additional parameters to the configuration file.

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
2022-11-27 15:43:53 +02:00
Jouni Malinen
af97aaa503 tests: Random MAC address with two APs
This verifies locally generated deauthentication determination when the
MAC address changes.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-11-27 14:18:53 +02:00
Damien Dejean
f5ce680ee6 D-Bus: Hotspot 2.0 credentials with multiple domains
Add the support of multiple domains for interworking credentials in
D-Bus API AddCred() using an array of strings.

Signed-off-by: Damien Dejean <damiendejean@chromium.org>
2022-11-27 14:18:53 +02:00
Jouni Malinen
e5dfce38f7 RSN: Split EAPOL-Key group msg 1/2 processing more completely for WPA(v1)
Separate more of WPA(v1) functionality away from the RSN processing
code path.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-11-27 14:18:53 +02:00
Jouni Malinen
5ab43c738e RSN: Split WPA(v1) processing of EAPOL-Key frames into a separate function
This is a step in separating RSN and WPA(v1) processing of EAPOL-Key
frames into separate functions. This allows the implementation to be
simplified and potentially allows the validation rules to be made
stricter more easily. This is also a step towards allowing WPA(v1)
functionality to be removed from the build in the future.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-11-27 08:30:58 +02:00
Damien Dejean
5f89fffb76 tests: New Passpoint Home OI parameters
Move testing to use the new Home OI parameters while maintaining a
couple of tests for the deprecated parameters.

Signed-off-by: Damien Dejean <damiendejean@chromium.org>
2022-11-26 18:59:10 +02:00
Jouni Malinen
bb9099785e tests: WPS PBC provisioning with configured AP and passive scanning
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-11-24 18:54:33 +02:00
Jouni Malinen
00bd744ed5 tests: OCV on 2.4 GHz with PMF getting enabled automatically on STA
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-11-24 17:21:08 +02:00
Jouni Malinen
7c62bccc6e tests: SAE and preferred AP using wrong password
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-11-24 12:06:59 +02:00
Jouni Malinen
22a5d615ba tests: HS 2.0 deauthentication imminent with and without URL timing
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-11-21 22:57:51 +02:00
Glenn Strauss
8e364713ef tests: Check IMSI privacy support using a helper function
Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
2022-11-20 17:23:10 +02:00
Jouni Malinen
bb171f0020 tests: DPP network introduction with PMKSA cleared on AP
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-11-20 11:08:26 +02:00
Jouni Malinen
1e602adabb tests: Add PMKSA cache entry again in dpp_akm_sha*
This is going to be needed once wpa_supplicant starts dropping the PMKSA
cache entry on status code 53 (invalid PMKID) rejection of association.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-11-20 11:08:26 +02:00
Jouni Malinen
f49b604555 tests: Fix pasn-init fuzz tester build
Change of the wpas_pasn_start() prototype did not update the fuzzer
tool.

Fixes: 309765eb66 ("PASN: Use separate variables for BSSID and peer address")
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-11-19 17:21:45 +02:00
Jouni Malinen
6cb34798f8 tests: SAE-EXT-KEY, H2E, and rejected groups indication
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-11-10 21:13:05 +02:00
Jouni Malinen
252729d902 tests: Random MAC address with PMKSA caching
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-11-10 21:13:05 +02:00
Jouni Malinen
f1f796a39f tests: hostapd dump_msk_file
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-11-10 21:13:05 +02:00
Jouni Malinen
1e0b7379d6 tests: FT with mobility domain changes
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-11-09 00:54:41 +02:00
Jouni Malinen
bbe5f0c1eb FT: Do not try to use FT protocol between mobility domains
wpa_supplicant has support for only a single FT key hierarchy and as
such, cannot use more than a single mobility domain at a time. Do not
allow FT protocol to be started if there is a request to reassociate to
a different BSS within the same ESS if that BSS is in a different
mobility domain. This results in the initial mobility domain association
being used whenever moving to another mobility domain.

While it would be possible to add support for multiple FT key hierachies
and multiple mobility domains in theory, there does not yet seem to be
sufficient justification to add the complexity needed for that due to
limited, if any, deployment of such networks. As such, it is simplest to
just prevent these attempts for now and start with a clean initial
mobility domain association.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-11-09 00:54:41 +02:00
Jouni Malinen
0ccb3b6cf2 tests: External password storage for SAE
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-11-07 14:02:55 +02:00
Veerendranath Jakkam
08512e5f35 MLD STA: Extend key configuration functions to support Link ID
Add support to specify a Link ID for set key operation for MLO
connection. This does not change the existing uses and only provides the
mechanism for extension in following commits.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-11-06 23:36:49 +02:00
Jouni Malinen
66d7f554e2 tests: Fuzz testing for PASN
Add test tools for fuzzing PASN initiator and responder handling of
received PASN Authentication frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-11-06 17:22:14 +02:00
Jouni Malinen
2e840fb2ab tests: Fix CC and CFLAGS default processing for fuzzing
"make LIBFUZZER=y" was supposed to set CC and CFLAGS to working values
by default if not overridden by something external. That did not seem to
work since the defaults from the other build system components ended up
setting these variables before the checks here. Fix this by replacing
the known default values for non-fuzzing builds.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-11-06 17:11:47 +02:00
Jeffery Miller
c6f8af507e Add option to disable SAE key_mgmt without PMF
Add the `sae_check_mfp` global option to limit SAE when PMF will
not be selected for the connection.
With this option SAE is avoided when the hardware is not capable
of PMF due to missing ciphers.
With this option SAE is avoided on capable hardware when the AP
does not enable PMF.

Allows falling back to PSK on drivers with the
WPA_DRIVER_FLAGS_SAE capability but do not support the BIP cipher
necessary for PMF. This enables configurations that can fall back
to WPA-PSK and avoid problems associating with APs configured
with `sae_require_mfp=1`.

Useful when `pmf=1` and `sae_check_mfp=1` are enabled and networks
are configured with ieee80211w=3 (default) and key_mgmt="WPA-PSK SAE".
In this configuration if the device is unable to use PMF due to
lacking BIP group ciphers it will avoid SAE and fallback to
WPA-PSK for that connection.

Signed-off-by: Jeffery Miller <jefferymiller@google.com>
2022-11-05 17:48:17 +02:00
Jouni Malinen
a3094ef80d tests: Allow more time for sigma_dut sta_reassoc commands
When these are issued while associated, scanning all channels can take a
significant amount of time. That happened to work for existing test
cases somewhat by accident since the scan was sometimes limited to only
the current operating channel. However, that is now changing and the
following two test cases started failing with the change, so make them
wait longer:
sigma_dut_sae_pw_id_ft sigma_dut_ft_rsnxe_used_mismatch

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-11-05 13:43:06 +02:00
Shivani Baranwal
ef10a574d6 tests: P2P persistent group formation with extended listen
Add a new P2P persistent group formation, re-invocation, and cancel test
to verify that P2P_EXT_LISTEN is avoided and the scan is performed in
the P2P Client role to find the P2P GO for the ongoing P2P persistent
group formation on the current interface.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2022-11-05 12:17:23 +02:00
Jouni Malinen
ab22b676a5 tests: FT-SAE-EXT-KEY
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-10-16 17:43:38 +03:00
Jouni Malinen
2e0400061f tests: wpa_supplicant AP mode with pmf=1/2
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-10-10 12:34:04 +03:00
Jouni Malinen
97104a6588 tests: Clear sae_groups when SAE could be used
This makes sigma_dut_ap_dpp_qr* test cases with SAE more robust by
avoiding unexpected behavior. This was found with the following test
sequence:
mesh_sae_anti_clogging sigma_dut_ap_dpp_qr_sae

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-10-07 20:59:34 +03:00
Jouni Malinen
db46138de4 tests: sigma_dut DPP reconfiguration using SAE (Enrollee)
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-10-07 19:44:48 +03:00
Jouni Malinen
5007766d78 tests: Clear vendor elements at the end of wpas_ap_vendor_elems
This is needed to avoid surprises in the following test cases. This was
found with a failure in the following test sequence:
wpas_ap_vendor_elems p2p_ext_discovery_go

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-10-05 00:22:52 +03:00
Jouni Malinen
56321c0ac2 tests: Make sigma_dut_dpp_qr_mutual_resp_enrollee_connector_privacy more robust
Clear the dpp_connector_privacy_default parameter value that sigma_dut
set in wpa_supplicant at the end of the test case to avoid surprising
behavior for the following test cases. This was found with a failure in
the following test sequence:
sigma_dut_dpp_qr_mutual_resp_enrollee_connector_privacy
sigma_dut_dpp_proto_peer_disc_req

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-10-05 00:22:27 +03:00
Jouni Malinen
ca94fd70c8 tests: sigma_dut and DPP AP provisioning with SAE
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-10-03 19:20:21 +03:00
Jouni Malinen
14cc63295e tests: DPP AP configuration for SAE-only
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-10-03 12:34:16 +03:00
Jouni Malinen
6ef455db67 tests: Automatic channel selection and 2.4 GHz channel 14
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-09-23 00:25:24 +03:00
Jouni Malinen
f47d378cea tests: P2P and avoid frequencies preventing 80 MHz on channel 149"
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-09-23 00:12:33 +03:00
Johannes Berg
c52ec086da tests: hwsim: Search for UBSAN in kernel messages
If UBSAN is enabled, flag errors from it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-09-16 21:39:44 +03:00
Johannes Berg
550ab94e83 tests: vm: Simplify parameter passing
Since the kernel  actually passes the command-line parameters
as environment variables to the init script, there's no need
to parse them out of /proc/cmdline.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-09-16 21:28:23 +03:00
Johannes Berg
6f90aa5a63 tests: hwsim: Allow configuring MODULEDIR
It can be useful to configure a different module directory, so you don't
need to install the kernel modules in the host /lib/modules/ location.
Allow configuring it in the config file.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-09-16 21:16:10 +03:00
Johannes Berg
6f844fa787 tests: Reload correct regdb if possible/needed
If cfg80211 is built into the kernel, then it may/will have
loaded the regdb before we mount our own /lib/firmware. This
may result in using the wrong regulatory data. Fix this by
using iw to reload the regdb after mounting it.

Fixes: a29c2399a7 ("tests: Add regulatory database to VMs")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-09-16 21:13:20 +03:00
Jouni Malinen
a01266c925 tests: sigma_dut and EAP-AKA with imsiPrivacyCertID
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-09-14 20:31:55 +03:00
Jouni Malinen
01e7acc747 tests: DPP push button and unsupported AP configuration
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-08-27 00:51:25 +03:00
Jouni Malinen
05d3681f3e tests: Skip sigma_dut_dpp_tcp_configurator_init_mutual_unsupported_curve if needed
The part about checking the supported curves from the peer depends on
CONFIG_DPP3 and this test case needs to be skipped without that.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-08-26 17:27:45 +03:00
Jouni Malinen
d6e790e209 tests: DPP PB channel changes
Prepare for an implementation change for the PB discovery channel list.
Move the standlone (not an AP) PB Configurators to a preferred channel
and enable Configurator connectivity indication in APs that act as PB
Configurators.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-08-25 15:59:13 +03:00
Jouni Malinen
d68946d510 tests: sigma_dut and DPP push button first on Enrollee
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-08-23 18:56:17 +03:00
Jouni Malinen
b704dc72ef tests: sigma_dut and updated ConfResult value for Configurator failures
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-29 18:56:49 +03:00
Jouni Malinen
10104915af tests: sigma_dut and DPP PB session overlap
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-28 21:17:15 +03:00
Jouni Malinen
8adcdd6593 tests: Temporary workaround for dpp_chirp_ap_5g
Configurator station seems to be unable to get the first Authentication
Request frame transmitted through mac80211_hwsim for some reason. It is
not really clear why this happens and why it started happening now, but
as a temporary workaround, wait a second here since that seems to avoid
this for some unknown reason.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-28 17:58:01 +03:00
Jouni Malinen
ddcd15c2de tests: Fix fuzzing/sae build
sae.c depends on wpa_common.c now and as such, this test build needs to
pull in whatever is needed there and that happens to include sha1-prf.c.
Add that to the fuzzer to fix the build.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-28 17:08:11 +03:00
Jouni Malinen
7fa67861ae tests: Fix p2p_channel_avoid3
This test case assumed that the p2p_pref_chan 128:44 parameter would
have resulted in channel 44 (5220 MHz) being selected. That does not
work anymore since that channel was marked to require DFS/radar
detection in regdb. Fix the text case by changing to use another country
with rules that match the test case expectations.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-28 16:56:21 +03:00
Jouni Malinen
ee3567d659 tests: Add more time for scan/connection
It looks like some test cases could fail due to timeouts since the 10
second wait may not be sufficient to cover some cases where 6 GHz
channels get scanned. Increase the timeouts to avoid hitting such cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-28 16:41:23 +03:00
Jouni Malinen
ac9e6a2ab3 tests: Allow 6 GHz opclasses in MBO checks
It looks like the host update of regulatory information can still get
through somehow, so add alternative expected values for the supported
operating classes for cases where 6 GHz frequencies were added recently.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-28 16:39:41 +03:00
Jouni Malinen
e7cbfa1c12 tests: sigma_dut and DPP Enrollee unsupported curves
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-28 11:22:44 +03:00
Jouni Malinen
ceae05cec2 tests: sigma_dut and DPP MUDURL setting for hostapd
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-27 13:43:58 +03:00
Jouni Malinen
2a9a61d6cd tests: SAE with extended key AKM
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-25 11:12:11 +03:00
Jouni Malinen
e35f6ed1d4 tests: More detailed report on SAE PMKSA caching error case
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-25 00:31:51 +03:00
Jouni Malinen
35587fa8f3 tests: DPP Controller/Relay with need to discover Controller
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-25 00:23:31 +03:00
Jouni Malinen
ca7892e98f tests: DPP Relay and adding/removing connection to a Controller
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-25 00:23:31 +03:00
Jouni Malinen
ff7cc1d490 tests: DPP Relay and dynamic Controller addition
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-23 16:58:00 +03:00
Jouni Malinen
b607d2723e tests: sigma_dut and DPP PB Configurator in wpa_supplicant
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-22 12:39:58 +03:00
Jouni Malinen
b94e46bc71 tests: PB Configurator in wpa_supplicant
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-22 12:27:24 +03:00
Jouni Malinen
ca4e82cbfe tests: sigma_dut DPP/PKEX initiator as Configurator over TCP and Wi-Fi
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-21 20:32:32 +03:00
Jouni Malinen
dfa9183b11 tests: DPP reconfig after Controller-initiated operation through Relay
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-21 13:16:26 +03:00
Jouni Malinen
17216b5242 tests: sigma_dut DPP/PKEX initiator as Configurator (TCP) through Relay
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-19 23:28:33 +03:00
Jouni Malinen
d86ed5b72b tests: Allow DPP_PKEX_REMOVE success in dpp_pkex_hostapd_errors
This is in preparation to allow the implementation in hostapd to be
changed to accept removal of PKEX information without indicating an
error after it have been automatically removed at the successful
completion of PKEX.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-19 23:28:33 +03:00
Jouni Malinen
0a4f391b1c tests: sigma_dut and DPP Connector Privacy
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-19 00:14:41 +03:00
Jouni Malinen
7d12871ba0 test: DPP Private Peer Introduction protocol
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-19 00:14:41 +03:00
Jouni Malinen
f2bb0839fb test: DPP 3rd party config information
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-16 17:22:23 +03:00
Jouni Malinen
004b1ff47a tests: DPP Controller initiating through Relay
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-09 13:09:04 +03:00
Jouni Malinen
248654d36b tests: sigma_dut DPP PB test cases
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-08 14:26:56 +03:00
Jouni Malinen
697b7d7ec7 tests: DPP push button
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-07-08 00:14:06 +03:00
Jouni Malinen
92f5499010 tests: Remove the 80+80 vs. 160 part from wpa2_ocv_ap_vht160_mismatch
This started failing with the OCV implementation change to ignore the
second segment when using a 160 MHz channel.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-06-16 20:31:45 +03:00
Jouni Malinen
c580c2aecd tests: Make OCV negative test error cases more robust
Try to avoid an exception while processing an exception that indicates
the test case failed. Explicit DISCONNECT command here can avoid the
undesired FAIL-BUSY from cleanup SCAN.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-06-16 20:26:11 +03:00
Jouni Malinen
b092d8ee63 tests: imsi_privacy_attr
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-05-25 20:19:52 +03:00
Jouni Malinen
1004fb7ee4 tests: Testing functionality to discard DPP Public Action frames
This can be used to make sure wpa_supplicant does not process DPP
messages sent in Public Action frames when a test setup is targeting
DPP-over-TCP.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-05-24 23:30:39 +03:00
Jouni Malinen
3550696160 tests: Add forgotten files for expired IMSI privacy cert tests
Fixes: 426932f061 ("tests: EAP-AKA and expired imsi_privacy_key")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-05-24 21:16:36 +03:00
Jouni Malinen
b9a222cdd7 tests: sigma_dut and DPP curve-from-URI special functionality
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-05-24 12:49:27 +03:00
Jouni Malinen
fa36e7ee48 tests: sigma_dut controlled STA and EAP-AKA parameters
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-05-24 00:44:03 +03:00
Jouni Malinen
99165cc4b0 Rename wpa_supplicant imsi_privacy_key configuration parameter
Use imsi_privacy_cert as the name of the configuration parameter for the
X.509v3 certificate that contains the RSA public key needed for IMSI
privacy. The only allowed format for this information is a PEM-encoded
X.509 certificate, so the previous name was somewhat confusing.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-05-24 00:44:03 +03:00
Jouni Malinen
dde7f90a41 tests: Update VM setup example to use Ubuntu 22.04 and UML
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-05-24 00:34:08 +03:00
Jouni Malinen
426932f061 tests: EAP-AKA and expired imsi_privacy_key
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-05-24 00:34:08 +03:00
Johannes Berg
39e6623082 tests: Work around reentrant logging issues due to __del__ misuse
Unfortunately, some objects (WlantestCapture, WpaSupplicant
and wpaspy.Ctrl) use __del__ and actually have some logic
there. This is more or less wrong, and we should be using
context managers for it. However, cleaning that up is a
pretty large task.

Unfortunately, __del__ can cause reentrant logging which is
wrong too, because it might be invoked while in the middle
of a logging call, and the __del__ of these objects closes
connections and logs while doing that.

Since we're (likely) using cpython, we can work around this
by explicitly calling gc.collect() in a context where the
logging and close is fine, not only ensuring that all the
connections are closed properly before the next test, but
also fixing the issue with reentrant logging.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-05-22 11:46:57 +03:00
Jouni Malinen
72641f924e tests: Clean up failed test list in parallel-vm.py
Instead of printing a very long line of the failed tests, print the test
case names on separate lines up to the number of available lines at the
bottom of the screen. This avoids some issues with curses and overlong
lines. Furthermore, display the last failed test cases instead of
somewhat confusing sequence of test case names from the VMs.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-05-22 11:43:38 +03:00
Jouni Malinen
e36a7c7940 tests: Support pycryptodome
This is a drop-in replacement for pycrypto and the only version that is
now available in Ubuntu 22.04.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-05-22 11:08:59 +03:00
Jouni Malinen
a44744d3bb tests: Set ECB mode for AES explicitly to work with cryptodome
AES.new() needs the mode to be set explicitly.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-05-22 11:08:23 +03:00
Jouni Malinen
e90ea900a9 tests: sigma_dut DPP TCP Configurator as initiator with addr from URI
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-05-19 22:54:44 +03:00
Jouni Malinen
e58dabbcfb tests: DPP URI with host info
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-05-19 17:55:25 +03:00
Jouni Malinen
7173992b96 tests: Flush scan table in ap_wps_priority to make it more robust
This test case could fail if there was an old BSS entry from a previous
test case in the scan results.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-05-16 19:09:23 +03:00
Jouni Malinen
b9313e17e8 tests: Update ap_wpa2_psk_ext_delayed_ptk_rekey to match implementation
This test case was checking the exact key info bits in EAPOL-Key frames
during PTK rekeying as such, needs to be updated to match the
implementation change on the Secure bit setting.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-05-16 19:06:47 +03:00
Jouni Malinen
d2ce1b4d6c tests: Wait for request before responding in dscp_response
There was a possible race condition here between the hostapd request
transmission and wpa_supplicant response command. Wait for the
wpa_supplicant event that indicates reception of the request before
issuing the DSCP_RESP command to avoid failures.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-05-09 11:45:33 +03:00
Ilan Peer
95f4935739 tests: Add coverage for testing disabling collocated 6 GHz scan
Extend 'scan' test to cover 'non_coloc_6ghz' parsing.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2022-05-07 21:37:08 +03:00
Jouni Malinen
29dcebea70 tests: WPA2-EAP AP with PMF and EAP frame injection
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-05-07 21:37:08 +03:00
Jouni Malinen
18c0ac8901 Provide information about the encryption status of received EAPOL frames
This information was already available from the nl80211 control port RX
path, but it was not provided to upper layers within wpa_supplicant and
hostapd. It can be helpful, so parse the information from the driver
event.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-05-07 21:37:03 +03:00
Jouni Malinen
8bbd62afe4 tests: PMF and EAPOL-Key msg 1/4 injection
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-05-07 18:54:09 +03:00
Jouni Malinen
f8967ece23 tests: Do not require disconnection in ap_wpa2_psk_supp_proto_msg_1_invalid_kde
The wpa_supplicant implementation for this functionality is going to be
changed to not require disconnection, so prepare the test case to not
fail.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-05-07 18:54:09 +03:00
Jouni Malinen
4f0cff704b tests: WPA2-PSK with PMF and Association Request frame injection
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-05-07 18:54:09 +03:00
Veerendranath Jakkam
9d07b9447e tests: EHT open connection
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-05-05 13:26:05 +03:00
Juliusz Sosinowicz
3890fa5031 tests: Enable additional TLS test cases with wolfSSL
Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2022-05-01 17:27:11 +03:00
Juliusz Sosinowicz
b3333a9f4c tests: Add a note for wolfSSL testing with Brainpool curves
Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2022-05-01 17:02:31 +03:00
Jouni Malinen
924fa4c5d9 tests: IMSI privacy with imsi_privacy_key on peer
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-05-01 16:25:16 +03:00
Jouni Malinen
9dd2ea5368 tests: IMSI privacy with imsi_identity
Add RSA public key (in an X.509v3 certificate) and private key for IMSI
privacy. These were generated with
openssl req -new -x509 -sha256 -newkey rsa:2048 -nodes -days 7500 \
	-keyout imsi-privacy-key.pem -out imsi-privacy-cert.pem

Test the case where wpa_supplicant side RSA-OAEP operation for IMSI
privacy is done in an external component while the hostapd (EAP server)
processing of the encrypted identity is internal.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-05-01 16:25:16 +03:00
Jouni Malinen
894b0a120f tests: HE with 20 MHz channel width on 6 GHz
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-04-29 11:19:43 +03:00
Jouni Malinen
794011d465 tests: Update regulatory database to VMs
Update the wireless-regdb database to the wireless-regdb.git version of
2022-04-08.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-04-29 11:19:43 +03:00
Jouni Malinen
b5b5a3951a tests: MBO and dynamic association disallowed change with passive scanning
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-04-24 12:12:21 +03:00
Jouni Malinen
387b341ead tests: Fix SAE-PK capability checks for sigma_dut test cases
These were testing only of SAE, not SAE-PK capability, and needs to be
skipped in SAE-PK is not included in the build.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-04-18 11:20:33 +03:00
Jouni Malinen
cc821f1c32 tests: Check DPP in build for couple of missing cases
These test cases need to be skipped in DPP is not included in the build.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-04-18 11:11:29 +03:00
Juliusz Sosinowicz
af052e6e11 tests: Include additional tests for wolfSSL builds
Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2022-04-17 22:02:55 +03:00
Juliusz Sosinowicz
1cda3e76fc tests: Include EAP-pwd for wolfSSL builds
Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2022-04-17 22:02:55 +03:00
Johannes Berg
2f336ca580 tests: Pretend the RNG is initialized withinthe VM
We don't particularly care about the quality of random numbers
during the test. So far, there hasn't been an issue with the
RNG not being initialized completely, we only get a few prints
about uninitialized reads from urandom. However, if some tool
were to actually use /dev/random, it might get stuck. Call the
RNDADDTOENTCNT ioctl to unblock this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-04-16 16:51:54 +03:00
Jouni Malinen
698c05da2b tests: Update server and user certificates (2022)
The previous versions are going to be expiring soon, so need to re-sign
these to avoid EAP test case failures. This contains updates from
running tests/hwsim/auth_server/update.sh.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-04-16 13:22:16 +03:00
Jouni Malinen
86877bbc32 tests: Remove unused DH file from TLS client fuzzer
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-04-15 23:42:15 +03:00
Jouni Malinen
b08d100de6 tests: Remove test cases for wpa_supplicant dh_file parameter
This parameter has no impact to TLS client functionality, so these is
not really any point to maintain these test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-04-15 23:42:15 +03:00
Jouni Malinen
6c9e76e58a tests: Fix ap_wpa2_eap_fast_eap_vendor to check EAP-FAST support in build
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-04-15 13:49:19 +03:00
Jouni Malinen
e9078209c4 tests: Use group 20 instead of 25 in some SAE test cases
BoringSSL does not support group 25, so replace these cases with a
supported group 20 to meet the real testing need here.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-04-15 13:47:58 +03:00
Jouni Malinen
ae301fd37a tests: Skip sigma_dut_suite_b_rsa DHE case with BoringSSL
BoringSSL is known not to support this option, so skip it to allow rest
of the test case to be performed without known failures.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-04-15 13:43:30 +03:00
Jouni Malinen
26dd47f1d1 tests: Skip sae_pwe_group_25 with BoringSSL
BoringSSL does not support this 192-bit EC group, so do not try to run
the test case that is known to fail.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-04-15 13:36:35 +03:00
Jouni Malinen
3f94dcdd1a tests: Build with LibreSSL 3.4
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-04-15 13:00:26 +03:00
Jouni Malinen
364022ddef tests: sigma_dut DPP URI curves list override
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-04-14 17:06:02 +03:00
Jouni Malinen
339aef0980 tests: DPP URI supported curves
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-04-14 16:59:15 +03:00
Jouni Malinen
73b41762d0 tests: Fetch commitid on the host when running tests in a VM
git has started rejecting repositories owned by other users and refusing
to run the "git rev-parse HEAD" command in this type of cases. That
resulted in issues with the VM testing model where the VM is practically
running everything as root while the host is a normal development
environment and likely a non-root user owned files.

Fix this by fetching the commitid on the host and pass it to the VM so
that no git operations need to be run within the VM itself.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-04-14 11:59:22 +03:00
Jouni Malinen
58701128e8 tests: Handle git rev-parse failures more robustly
Do not add the --commit argument if the current git commitid cannot be
determined. This prevents complete failure to run the tests if the git
command cannot be used for some reason (like a recent change that
stopped allowing root user within the VM from running the git operation
for the case where the host system uses non-root account).

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-04-14 11:50:41 +03:00
Jouni Malinen
658296ea5b tests: Use build_beacon_request() to make beacon request more readable
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-04-09 19:37:58 +03:00
Jouni Malinen
060a522576 tests: Beacon request - active scan mode and NO_IR channel
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-04-09 19:17:00 +03:00
Jouni Malinen
7310995d87 tests: EAP-TLSv1.3 with OCSP stapling
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-04-07 00:47:31 +03:00
Jouni Malinen
1ba0043034 tests: EAP-TLSv1.3 and fragmentation
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-04-07 00:47:31 +03:00
Jouni Malinen
202842b8b3 tests: EAP-TLSv1.3 and missing protected success indication
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-04-07 00:45:40 +03:00
Jouni Malinen
e955998220 tests: WPA2-PSK AP and GTK rekey failing with one STA
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-04-05 17:25:24 +03:00
Jouni Malinen
b1cc775cf3 tests: Opportunistic Wireless Encryption - duplicated association attempt
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-04-02 17:52:50 +03:00
Jouni Malinen
1a630283db tests: wpa_psk_radius=3
Signed-off-by: Jouni Malinen <j@w1.fi>
2022-04-02 17:52:50 +03:00
Jouni Malinen
1fb907a684 tests: wpa_supplicant AP mode - ACL management
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-03-24 23:22:42 +02:00
Jouni Malinen
b37bbcc390 tests: Clear country configuration at the end of wpas_ap_async_fail
This was causing a failure in the following sequence:
wpas_ap_async_fail wpas_ctrl_country

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-03-13 18:26:45 +02:00
Jouni Malinen
7f661f942d tests: Make DPP relay tests more robust
Flush scan results to avoid failure caused by incorrect channel
selection based on an old result for the same BSSID. This was found with
the following test sequence:
ap_track_sta_no_auth dpp_network_intro_version_missing_req dpp_controller_relay_pkex

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-03-13 18:26:45 +02:00
Jouni Malinen
7c8fcd6baf tests: Fix sigma_dut_cmd() processing for the return value
The first sock.recv() may return both the status,RUNNING and the
following status line if the sigma_dut process ends up being faster in
writing the result than the test script is in reading the result. This
resulted in unexpected behavior and odd error messages when parsing the
result in the test cases. Fix this by dropping the status,RUNNING line
from the result in case the buffer includes multiple lines.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-03-12 19:00:36 +02:00
Jouni Malinen
0c51cf624c tests: sigma_dut DPP Configurator (MUD URL, NAK change)
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-03-10 18:29:34 +02:00
Jouni Malinen
e792f38db8 tests: DPP PKEX with netAccessKey curve change
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-03-10 01:30:33 +02:00
Jouni Malinen
5ce5ed88a9 tests: Fix dpp_own_config_curve_mismatch to match implementation
This test case was assuming the Configurator would change the
netAccessKey curve every time based on the protocol keys, but that is
not the case anymore, so force that change here for a negative test.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-03-10 01:30:33 +02:00
Jouni Malinen
c4a36d050a tests: Fix dpp_intro_mismatch to match implementation
This test case was assuming the Configurator would change the
netAccessKey curve every time based on the protocol keys, but that is
not the case anymore, so force that change here for a negative test.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-03-10 01:30:33 +02:00
Jouni Malinen
800ae647df tests: Check DPP3 support in the build for netAccessKey curve changes
These test cases need to be skipped if CONFIG_DPP3=y is not defined in
the build.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-03-09 21:26:28 +02:00
Jouni Malinen
77ae98511d tests: sigma_dut and DPP netAccessKey curve change
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-03-09 01:20:49 +02:00
Jouni Malinen
117dc4ea41 tests: DPP curve change for netAccessKey
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-03-09 01:07:59 +02:00
Jouni Malinen
1d4cd24d0b tests: sigma_dut and DPP Reconfig Auth Req error cases
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-03-08 00:06:00 +02:00
Jouni Malinen
fc78c13550 tests: sigma_dut and DPP PKEXv1 responder
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-03-07 21:38:25 +02:00
Jouni Malinen
c34b35b54e tests: WPA3 with SAE password from RADIUS
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-03-04 12:25:47 +02:00
Jouni Malinen
08cd7a75bf tests: HE AP and capability parsing
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-03-03 01:51:56 +02:00
Jouni Malinen
a201ab385e tests: Fetch all event messages in wpas_ctrl_many_networks
Do not leave a large number of network added/removed events remaining
for the following test case to handle. This removes some possible
failure test case sequences like the following one:
wpas_ctrl_many_networks dbus_ap_scan_2_ap_mode_scan

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-26 19:12:11 +02:00
Jouni Malinen
a038e6dea4 tests: wpa_supplicant AP mode and PSK/PTK lifetime in memory"
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-26 19:12:11 +02:00
Jouni Malinen
fa34e3255e tests: Make test cases more robust by clearing scan cache explicitly
This test cases can fail if previously executed tests leave older scan
results in cfg80211 scan table. Clear that scan table explicitly to
avoid such issues.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-26 19:12:11 +02:00
Jouni Malinen
7a8fff486f tests: Make OCV test cases more robust by clearing scan results on AP
This is needed to avoid pri/sec channel switching based on potential
scan results from the previous test cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-24 00:23:25 +02:00
Jouni Malinen
d5fba20c1e tests: Add a script for find a minimal failing test sequence
min-seq.py can be used to find a minimal test sequence that can be used
to reproduce test failures. This is meant for being able to process the
recently added "Failure sequence:" entries from parallel-vm.log to
reduce manual work needed to debug commonly failing test case sequences.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-24 00:23:25 +02:00
Jouni Malinen
010e7dddce tests: Clear sae_groups in sigma_dut_ap_ft_rsnxe_used_mismatch
This is needed to avoid test failures when a previous test case might
have restricted the set of allowed SAE groups.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-24 00:23:25 +02:00
Jouni Malinen
00163fd741 tests: Make rrm_beacon_req_frame_body_fragmentation more robust
Flush scan results to avoid unexpected behavior due to scan results
remaining available from previous test cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-22 00:05:56 +02:00
Jouni Malinen
b367366dd7 tests: Make WNM BSS TM tests more robust
Flush scan results to avoid unexpected behavior due to scan results
remaining available from previous test cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-22 00:04:15 +02:00
Jouni Malinen
aa2f595bf2 tests: Fix a test case name
The test case name ap_ft_pmf_over_ds was used for two different test
cases which resulted in only one of those being used. Fix this by using
unique test case names.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-21 18:34:42 +02:00
Jouni Malinen
e942c32e97 tests: Make FT-over-DS test cases more robust
Clear scan cache to avoid issues with old scan results from earlier test
cases. This caused issues like the following test case sequence failing:
rrm_beacon_req_active_ap_channels ap_ft_eap_dis_over_ds

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-21 18:26:02 +02:00
Jouni Malinen
d5fbbbbc4c tests: Make wpas_mesh_mode_scan more robust
Clear scan results to avoid issues with get_bss() finding an entry from
an earlier test case when checking for mesh information.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-18 16:47:29 +02:00
Jouni Malinen
d2e11b7dea tests: MACsec with GCM-AES-256
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-17 01:05:08 +02:00
Jouni Malinen
1e0af0cc7e tests: Make wpa2_ocv_ap_ht_mismatch more robust
Clear the scan cache on the AP before running this test since the HT40
operation on the 2.4 GHz band might get disallowed based on scan results
from earlier test cases. This was found with the following hwsim test
case sequence failing:
ap_acs_with_fallback_to_20 wpa2_ocv_ap_ht_mismatch

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-16 21:29:54 +02:00
Jouni Malinen
64008a1ee8 tests: Make SAE roaming test cases more reliable
Flush the scan table explicitly to avoid issues with the ROAM command if
the new AP is not found and an entry from a previous test case is used
instead. This was happening in a number of cases where a SAE test case
was run after sigma_dut_ap_cipher_gcmp_256 which used the second AP
instance and allowed that to show up in the scan results in the next
text case.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-16 19:57:49 +02:00
Jouni Malinen
2e166d9e5b tests: Write full failure sequences into parallel-vm.log
This can be helpful in discovering test case sequences that result in
failures frequently.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-15 20:54:24 +02:00
Jouni Malinen
346b490505 tests: DPP session clearing on failure during GAS request handling
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-15 16:41:25 +02:00
Jouni Malinen
db7f14c825 tests: Make FILS BSS result checks more robust
These can fail if the scan results from the previous test case remain,
e.g., when run immediately after scan_bss_limit.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-15 13:06:36 +02:00
Jouni Malinen
b81c568223 tests: Additional wpa_supplicant AP mode testing
Add a couple of more channel configuration cases and log the channel
parameters with more details in the test log.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-15 12:45:09 +02:00
Jouni Malinen
b9897f1f3c tests: Clear AP scan cache after primary BSS on channel 40
A number of test cases using 40 MHz or wider channels with the primary
channel 36 were failing when executed after dpp_chirp_ap_5g since that
test case was running an AP on the channel 40 and resulting in need to
swap the primary and the secondary channels in the following test case.
Fix this by clearing the AP scan cache explicitly for such cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-15 00:34:55 +02:00
Jouni Malinen
f5ce9111c5 tests: Make GAS/ANQP test cases more robust
Flush the scan cache for all test cases that used get_bss() to check for
particular ANQP information. This was already done for one such case
based on commit dd900637b2 ("tests: Make gas_anqp_extra_elements more
robust"), but other test cases need this as well.

This was showing with frequent errors in test cases sequences like this
one:
dfs_radar_no_ht gas_fragment_with_comeback_delay gas_unknown_adv_proto gas_anqp_venue_url

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-15 00:18:07 +02:00
Jouni Malinen
781720fb1a tests: Clear scan cache at the end of ap_wps_cancel
This is needed to avoid leaving behind a BSS entry with WPS enabled for
the next text case in some cases. In particular, this was causing issues
in the following sequence of test cases:
ap_wps_conf_chan14 ap_wps_cancel ap_wps_pin_request_file

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-15 00:02:34 +02:00
Jouni Malinen
f1e4b23086 tests: WPA2-PSK-FT and different OCV capability between APs
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-09 17:30:02 +02:00
Jouni Malinen
c4dc90c1c0 tests: Remove ignore_old_scan_res clearing from the test scripts
Now that wpa_supplicant does this internally as a part of the FLUSH
command, there is no need for the test scripts to try to clear the
parameter between test cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-04 21:29:52 +02:00
Jouni Malinen
f80d7757fa tests: Use a more reasonable age for a scan result in scan_parsing
This test case could fail in some sequences like "sigma_dut_sae
scan_parsing" due to the ignore_old_scan_res parameter accidentally
being left to 1 by the former test case and the simulated scan result
being older than the previous scan trigger. Reduce the age of that scan
entry to make this less likely to happen.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-04 21:24:19 +02:00
Jouni Malinen
3fb6b7fed6 tests: Increase the wait time of Configurator GAS timeout
dpp_gas_timeout could fail with an increased timeout for the
Configurator.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-04 00:23:19 +02:00
Jouni Malinen
8121cd3934 tests: Increase wait in dpp_qr_code_config_event_initiator_no_response
The DPP Enrollee might wait for up to 60 seconds for the configuration,
so use a longer timeout value to be able to cover this negative test
case where the Configurator never sends the response.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-04 00:23:19 +02:00
Jouni Malinen
263daa30b5 tests: DPP Configurator with config query
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-03 00:35:49 +02:00
Jouni Malinen
bf4002e251 tests: WPA2-PSK AP with PMF association comeback (using radio_disabled)
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-01 19:53:08 +02:00
Jouni Malinen
c0e6aa3450 tests: DPP/PKEXv2 over TCP while associated
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-01 19:53:08 +02:00
Jouni Malinen
a8c43b1822 tests: Use check_sae_capab() where possible
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-02-01 18:16:35 +02:00
Jouni Malinen
4feb46ddb4 tests: Fix CONFIG_DPP3=y dependency in couple of test cases
These could not pass without DPP3 support.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-01-31 18:16:29 +02:00
Jouni Malinen
8670a80ea7 tests: DPP PKEX over TCP and automatic connection and result reporting
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-01-28 17:30:42 +02:00
Jouni Malinen
75f42be0a7 tests: sigma_dut and DPP PKEX over TCP
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-01-27 20:50:39 +02:00
Jouni Malinen
75d791c0e3 tests: sigma_dut and additional protocol tests for DPP Network Intro
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-01-27 18:44:57 +02:00
Jouni Malinen
c93679a87f tests: sigma_dut forcing PKEX v1 only
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-01-26 00:40:09 +02:00
Jouni Malinen
b007bfdf68 tests: DPP PKEX over TCP
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2022-01-26 00:40:09 +02:00
Jouni Malinen
008e177597 tests: Update DPP PKEX version indication style
Update test cases to match implementation.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-01-25 20:42:18 +02:00
Jouni Malinen
53fae01c8b tests: DPP PKEXv2 initiator fallback to v1 in hostapd
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-01-24 22:58:38 +02:00
Jouni Malinen
93a19abcaf tests: sigma_dut DPP/PKEXv2 initiator and fallback to v1
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-01-24 22:58:38 +02:00
Jouni Malinen
9a4feed2f8 tests: Update dpp_proto_after_wrapped_data_pkex_cr_req for PKEXv2
Check for both PKEX v1 and v2 variants of the message.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-01-24 22:58:38 +02:00
Arowa Suliman
a16434ad96 tests: Update the repository branch name
This was forgotten from the earlier commit.

Signed-off-by: Arowa Suliman <arowa@chromium.org>
2022-01-17 17:34:39 +02:00
Jouni Malinen
0b48cfe178 tests: Update eap_proto_pwd_errors to match implementation
A negative test was failing with the PWE derivation change in the
implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-01-11 20:15:36 +02:00
Jouni Malinen
f73e041b9b tests: Update sae_bignum_failure to match implementation
This was failing with the PWE derivation change in the implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
2022-01-11 20:15:36 +02:00
Jouni Malinen
f5fcac731f tests: Update capability checks to include OpenSSL 3.0
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-01-11 17:42:55 +02:00
Jouni Malinen
500813f9f3 tests: Do not use SAE group 26
This group should not be used with SAE and as such, it could cause
confusing test errors here. Use an acceptable group instead.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2022-01-11 17:42:42 +02:00
Jouni Malinen
bb6fa62b3f tests: Fix DPP PKEXv2 capability checks
At least for the time being PKEXv2 needs CONFIG_DPP3=y to work in a
testable manner. Couple of the test cases did not cover this correctly
and resulted in failures (instead of skipping the tests) when the
default build configuration was used. Fix that by checking for DPP
version 3.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2021-12-14 19:45:43 +02:00
Janusz Dziedzic
a6422a860d tests: remotehost: Disable pipe buffering
Before, we could loose some events because of pipe buffering. I saw this
problem when running "ubus listen" or "logread -f" and waiting some
specific events. After disabling buffering this works much better.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
2021-12-12 22:12:02 +02:00
Janusz Dziedzic
5530688b92 MBO: Fix the allowed range of mbo_assoc_disallow values
This parameter was added with the commit message indicating the valid
reason code values to be 1-5, but with the implementation allowed only
1. There are five defined reason code values for the Association
Disallowed attribute, so extend the allowed range to cover all those
values.

Fixes: fb9a1c3e28 ("hostapd: Add MBO IE to Beacon, Probe Response, Association Response")
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
2021-12-12 22:07:19 +02:00
Damien Dejean
c8e4283f90 D-Bus: Interworking network selection
Add the "InterworkingSelect" method to the DBus API to trigger an
Interworking scan with ANQP fetches. When a BSS that matches a
configured credential is found, the result is emitted using the signal
"InterworkingAPAdded". Completion of the full InterworkingSelect
operation is indicated with the "InterworkingSelectDone" signal.

Signed-off-by: Damien Dejean <damiendejean@chromium.org>
2021-12-12 17:51:46 +02:00
Damien Dejean
b44e199676 D-Bus: Interworking/Hotspot 2.0 credential operations
Add "AddCred", "RemoveCred", and "RemoveAllCreds" methods to the D-Bus
API of the network interface to allow the caller to manipulate a set of
Interworking credentials similarly to the way this was enabled through
the control interface.

Signed-off-by: Damien Dejean <damiendejean@chromium.org>
2021-12-12 17:32:51 +02:00
Jouni Malinen
9c352a45c6 tests: Fix a typo in a couple of error messages
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-12-12 16:47:47 +02:00
Jouni Malinen
f373c7b93f tests: DPP PKEXv2
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2021-12-07 23:26:29 +02:00
Jouni Malinen
00b2fb2d04 tests: DPP3 protocol version during network introduction
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2021-12-03 21:24:59 +02:00
Jouni Malinen
77ddd38b66 DPP3: Add build option for version 3 functionality
CONFIG_DPP3=y can now be used to configure hostapd and wpa_supplicant
builds to include DPP version 3 functionality. This functionality is
still under design and the implementation is experimental and not
suitable to be enabled in production uses before the specification has
been finalized.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2021-12-03 21:24:59 +02:00
Jouni Malinen
844f955de4 tests: RNR element generation
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-11-09 18:24:46 +02:00
Cedric Izoard
fa193c1a73 tests: Fix DPP test cases for BoringSSL
When checking DPP capabilities the Brainpool flag was not always set
when needed, leading to run a test with the Brainpool curves not
supported by BoringSSL.

Use a short form for the DER length of EC privateKey with NIST P-521
curve. Indeed BoringSSL returns an error when parsing DER sequence 30 81
50 ... because the length 81 50 could have been encoded as 50 and
according comment in BoringSSL:
ITU-T X.690 section 10.1 (DER length forms) requires encoding the
length with the minimum number of octets.

Signed-off-by: Cedric Izoard <cedric.izoard@ceva-dsp.com>
2021-11-03 15:48:45 +02:00
Cedric Izoard
2086ae46b3 DPP: Replace dpp_bootstrap_key_der() with crypto_ec_key_get_subject_public_key()
As BoringSSL version of i2d_PUBKEY() doesn't respect the
POINT_CONVERSION_COMPRESSED flag redefine a specific
crypto_ec_key_get_subject_public_key() version for BoringSSL based on
dpp_bootstrap_key_der().

The only other user of crypto_ec_key_get_subject_public_key() is SAE-PK
for which the public key should also be formatted using compressed
format.

Signed-off-by: Cedric Izoard <cedric.izoard@ceva-dsp.com>
2021-11-03 15:45:00 +02:00
Cedric Izoard
c6f2103cac DPP: Replace dpp_get_pubkey_point() with crypto_ec_key_get_pubkey_point()
Move code of dpp_get_pubkey_point() to a crypto library specific
function crypto_ec_key_get_pubkey_point().

Signed-off-by: Cedric Izoard <cedric.izoard@ceva-dsp.com>
2021-10-26 18:06:32 +03:00
Jouni Malinen
8a54c252a4 tests: Configuration file comment with "" after #
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-10-22 17:48:08 +03:00
Johannes Berg
a29c2399a7 tests: Add regulatory database to VMs
Add a common well-known regulatory database to the test VMs during runs
to remove one thing to have correct in the host.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2021-10-22 17:17:28 +03:00
Jouni Malinen
139202a116 tests: BSS_TM_REQ with dialog_token parameter
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-10-22 17:14:20 +03:00
Jouni Malinen
a47d484919 tests: DPP Controller management in hostapd over interface addition/removal
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-10-19 00:32:02 +03:00
Jouni Malinen
8601356e3b tests: Update sae_pmk_lifetime to match implementation
The current PMKSA cache entry with SAE does not expire during the
association anymore.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-10-18 21:21:07 +03:00
Jouni Malinen
2fdd40ae2d tests: AP configuration attempt using wps_config when WPS is disabled
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-10-14 16:38:40 +03:00
Arowa Suliman
c025504487 Replace "dummy" with "stub" in VLAN testing ifname
Replace the word "dummy" with the inclusive word "stub".

Signed-off-by: Arowa Suliman <arowa@chromium.org>
2021-10-11 20:56:28 +03:00
Arowa Suliman
e2c31050b4 Replace "dummy" with "stub" in WPS testing
Replace the word "dummy" with the inclusive word "stub".

Signed-off-by: Arowa Suliman <arowa@chromium.org>
2021-10-11 20:53:24 +03:00
Arowa Suliman
ed5e1b7223 Replace "dummy" with "stub" in comments/documentation
Replace the word "dummy" with the inclusive word "stub".

Signed-off-by: Arowa Suliman <arowa@chromium.org>
2021-10-11 20:52:50 +03:00
Arowa Suliman
3955d2af73 Replace "dummy" with "stub" in wps_testing_dummy_cred
Replace the word "dummy" with the inclusive word "stub".

Signed-off-by: Arowa Suliman <arowa@chromium.org>
2021-10-11 20:52:21 +03:00
Arowa Suliman
7b50f2f04c Replace "sanity" with "validity"
Replaced the word "sanity" with the inclusive word "validity". The
comment in acs_survey_interference_factor() was referring a function
that does not exist, so remove it instead of trying rename the function.

Signed-off-by: Arowa Suliman <arowa@chromium.org>
2021-10-11 20:25:21 +03:00
Jouni Malinen
19307ef69a tests: WPA2/WPA-PSK cfg80211 connect command to trigger roam
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-10-06 20:56:24 +03:00
Jouni Malinen
9e46b31273 tests: wpa_supplicant AP mode and vendor elements
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-09-30 18:20:49 +03:00
Jouni Malinen
7dc0e9cf47 tests: Extend DSCP testing coverage
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-09-30 17:53:43 +03:00
Shivani Baranwal
2b4b1742ea tests: DSCP policy
Signed-off-by: Shivani Baranwal <shivbara@codeaurora.org>
2021-09-30 16:56:58 +03:00
Johannes Berg
fde38cac8a tests: test_fst_config: Convert FstLauncher to context manager
Using __del__ for any kind of cleanup is not a good idea
as it's not guaranteed to be called at any particular time,
it's only called whenever the next garbage collect cycle
kicks in.

Use a context manager instead, which basically removes the
need for the try/finally and fixes the reliance on __del__.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2021-08-25 16:20:17 +03:00
Johannes Berg
c8e2fc1fd5 tests: fst_test_common: Remove dead code from HapdRegCtrl
Since refcnt is never incremented, this is dead code, just remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2021-08-25 16:20:17 +03:00
Jouni Malinen
0cc9d7fb12 tests: connected_time for mesh peer
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-08-25 12:26:30 +03:00
Jouni Malinen
2bbc5a2b09 tests: wpa_supplicant config blobs and PEM encoding
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-08-19 17:41:13 +03:00
Jouni Malinen
af89683a43 tests: Update RSA 3k certificates
The previous ones expired and caused test failures.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-08-19 13:57:53 +03:00
Jouni Malinen
3f4e8b93f8 tests: SCS
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-08-12 18:28:07 +03:00
Jouni Malinen
c3155a725d tests: WPS+SAE+H2E
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-08-04 00:41:30 +03:00
Jouni Malinen
d727b5e464 tests: Fix PASN tests to check for PASN support
Couple of the PASN test cases did not verify whether the wpa_supplicant
build used in the test included PASN support.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-07-14 18:18:47 +03:00
Jouni Malinen
295170851d tests: SAE Authetication failure reporting
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-07-14 18:18:47 +03:00
Jouni Malinen
5326c8af3f tests: Fix multi_ap_wps_shared_apdev_csa to remove extra hostapd interface
This test case adds a new AP device (wlan0_ap) with iw and removes it in
the end. However, the hostapd interface for this netdev was only added,
but not removed at the end of the test case. This could result in
consecutive test cases getting confused with the extra interface, e.g.,
if running WPS configuration steps that get applied to all enabled
interfaces.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-06-25 00:31:03 +03:00
Jouni Malinen
b102f19bcc tests: Opportunistic Wireless Encryption - SA Query
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-05-22 00:18:57 +03:00
Jouni Malinen
d98f4c4660 tests: FILS SK and opportunistic key caching
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-05-21 21:07:28 +03:00
Jouni Malinen
81169ebc48 tests: WPA2-PSK AP and GTK rekey request from multiple stations
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-05-11 01:05:22 +03:00
Jouni Malinen
2b6915a139 tests: Extend estimated throughput testing
Cover VHT160 and HE cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-05-07 13:05:58 +03:00
Jouni Malinen
3cefdf0d4a tests: Fix eap_proto_sake_server with Session ID = 255
Need to wrap back to 0 when changing value 255 to avoid generating a too
large value to fit an octet field. This was resulting in errors due to a
python exception (likely for about every 256th run).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-05-06 23:49:12 +03:00
Jouni Malinen
fd4580e1e8 tests: Limit maximum number of frames in fuzzing tests
This limits the EAP-SIM and EAP-AKA tests to 100 test frames to avoid
undesired timeouts in automated fuzz testing. The real world uses are
limited to 50 rounds, so there is not really any point in trying with
thousands of frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-05-04 18:19:23 +03:00
Jouni Malinen
6162890798 tests: Update server and user certificates (2020)
The previous versions expired, so need to re-sign these to fix number of
the EAP test cases. This contains updates from running
tests/hwsim/auth_server/update.sh.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-05-03 20:03:28 +03:00
Jouni Malinen
d5ce180a60 tests: UPDATE_BEACON on disabled interface
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-04-21 23:24:58 +03:00
Jouni Malinen
622be1e10b tests: SAE and WPA3-Personal transition mode roaming
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-04-21 23:01:10 +03:00
Jouni Malinen
d961326f19 tests: DPP Relay and incomplete connections
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-04-13 00:31:36 +03:00
Ilan Peer
d9c566b1b8 tests: Update PASN tests with SAE to use sae_pwe=2
As a preparation for changing wpa_supplicant and hostapd
implementation to use SAE H2E only.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2021-04-10 12:12:22 +03:00
Ilan Peer
09ca9851b3 tests: Use the correct SSID in PASN SAE tests
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2021-04-10 11:55:55 +03:00
Ilan Peer
ab7109f007 tests: Add coverage for PASN authentication with KDK derivation
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2021-04-10 11:55:55 +03:00
Jouni Malinen
f9ca4e3107 tests: Multi-AP and WPS parameter update
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-28 18:43:47 +03:00
Jouni Malinen
838a5aa95a tests: WPS Registrar init errors
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-28 18:35:46 +03:00
Jouni Malinen
7ed1cb8933 tests: WPS PBC session overlap workaround
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-28 18:23:41 +03:00
Jouni Malinen
3f3e77133d tests: WPS ER and UNSUBSCRIBE errors
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-28 18:15:25 +03:00
Jouni Malinen
57de28b94a tests: WPS ER and HTTP client timeout
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-28 18:05:47 +03:00
Jouni Malinen
2445e18b6f tests: assoc+auth driver event
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-28 13:33:40 +03:00
Jouni Malinen
00bec7b5be tests: IEEE 802.1X and FORCE_UNAUTH state
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-28 12:36:18 +03:00
Jouni Malinen
43a65b40b9 tests: P2P peer table limit
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-03-26 00:21:18 +02:00
Jouni Malinen
1a47e2ff8f tests: INTERFACE_ADD behavior on driver init failure
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-03-26 00:21:18 +02:00
Jouni Malinen
6bcd4abdc1 tests: FT with beacon protection
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-26 00:21:18 +02:00
Jouni Malinen
df197713c9 tests: OCV testing with AP special functionality set after ENABLE
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-26 00:21:18 +02:00
Jouni Malinen
30f8b912df tests: WPA2-PSK AP and GTK rekey failure
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-26 00:21:18 +02:00
Jouni Malinen
174433fa04 tests: WNM-Sleep Mode exit with PMF and beacon protection
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-26 00:21:18 +02:00
Jouni Malinen
14d31cd978 tests: Re-enable op class 118-120 tests with new regdb
Move from RS to PA country code to allow these test cases to work since
regdb was updated to require DFS for these operating classes in RS.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-26 00:21:06 +02:00
Jouni Malinen
c705d8421a tests: hostapd configuration with op_class
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-24 00:46:57 +02:00
Jouni Malinen
e6510056db tests: DPP PFS error cases
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-24 00:05:05 +02:00
Jouni Malinen
1aa2bc46f7 tests: MSCS
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-23 00:42:06 +02:00
Ilan Peer
93ef7e8c91 tests: Add PASN tests with comeback flow
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2021-03-21 18:28:34 +02:00
Jouni Malinen
4871df4bf7 tests: DPP NFC operation failures in hostapd
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-21 16:55:44 +02:00
Jouni Malinen
9c809b2aaa tests: DPP bootstrapping via NFC URI record (hostapd reading tag)
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-21 16:39:46 +02:00
Jouni Malinen
c4b2d6f566 tests: DPP GAS Query error cases with hostapd
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-21 16:33:41 +02:00
Jouni Malinen
eff3212763 tests: PMKSA cache add failure
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-20 13:38:49 +02:00
Jouni Malinen
be06fd5b02 tests: hostapd ctrl_iface SET_NEIGHBOR failures
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-20 13:13:24 +02:00
Jouni Malinen
ed8a5733bd tests: DPP and hostapd as Enrollee with GAS fragmentation/timeout
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-20 12:55:21 +02:00
Jouni Malinen
9056f918b6 tests: DPP connection status - success with hostapd as Configurator
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-20 12:19:12 +02:00
Jouni Malinen
bcfcb247db tests: hostapd airtime policy configuration
Add minimal testing for airtime policy configuration. mac80211_hwsim
does not actually support this functionality, so this is just for
testing coverage of src/ap/airtime_policy.c.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-20 12:03:01 +02:00
Jouni Malinen
fb9cd650e5 tests: DPP with hostapd as configurator/initiator with v1 enrollee
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-20 11:57:10 +02:00
Jouni Malinen
68b69d6607 tests: DPP chirp by an AP on 5 GHz
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-20 11:57:10 +02:00
Jouni Malinen
3d23fe32a5 tests: AP tracking STA taxonomy (5 GHz)
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-20 11:57:10 +02:00
Jouni Malinen
8b41ac82e6 tests: HE AP spatial reuse parameters
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-19 23:58:39 +02:00
Jouni Malinen
8c24982e61 tests: Fix error messages for HE config missing
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-19 23:34:58 +02:00
Jouni Malinen
aa6a50849c tests: EAP-SIM with decorated anonymous identity
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-03-19 21:12:43 +02:00
Jouni Malinen
6219d5a5c2 tests: Make FT roaming and data connectivity checks more robust
Dump pending monitor interface messages between each roaming step to
make the test log easier to understand and hostapd wait for the new
connection more robust by ensuring that the processed event if for the
very last reassociation. It looks like at least ap_ft_vlan_over_ds_many
could fail due to the connectivity check being started before the final
roam had been completed on the AP side even though there was an explicit
hapd2ap.wait_sta() wait before the test.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-03-19 20:54:16 +02:00
Matthew Wang
58c5bd762e tests: Check update misbehaving MBO AP test to include roam
APs PMF capabilities can differ. wpa_supplicant should be able to
disable and enable MBO when roaming to and from a misbehaving MBO AP
that doesn't support PMF. Verify that this is indeed happening.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
2021-03-19 18:35:01 +02:00
Jouni Malinen
daa0a22e45 tests: Fix eap_proto_eke_errors with gcc-10
gcc-10 seems to be inlining eap_eke_prf() and eap_eke_prfplus() which
breaks this test case due to a different backtrace being generated for
triggering the local failures. Point to the functions called by those
instead of these two functions to get this working with both gcc-9 and
gcc-10.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-03-17 23:38:26 +02:00
Jouni Malinen
eaf925df00 tests: Speed up tshark operations
Hide /usr/share/wireshark from hostfs to prevent tshark from loading all
the data from there since that can take significant amount of time and
is not really needed for the test cases. In addition, set HOME to point
to local tmpfs to avoid unnecessary references through hostfs.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-03-17 23:36:52 +02:00
Ilan Peer
9d9b423065 tests: Add coverage for PASN deauthentication
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2021-03-16 22:50:10 +02:00
Ilan Peer
b42b6c4d53 tests: Add test coverage for PASN with MIC errors
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2021-03-16 17:22:23 +02:00
Ilan Peer
2264a29890 tests: PASN: configure the nid before sending the command
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2021-03-16 17:15:55 +02:00
Jouni Malinen
19a11f629f tests: Enable HE overrides in wpa_supplicant build
This is needed for the recently added he_disabled_on_sta test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-14 19:12:07 +02:00
Jouni Malinen
6e3fed1d98 tests: DPP Authentication Confirm timeout in hostapd
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-14 18:52:54 +02:00
Jouni Malinen
f18b5542ad tests: OCV without PMF
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-14 18:27:47 +02:00
Jouni Malinen
a288775851 tests: WEP and HE
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-14 18:21:47 +02:00
Jouni Malinen
2cc7f6dfe5 tests: HE AP and 6 GHz security parameter validation
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-14 18:17:33 +02:00
Jouni Malinen
98ce8ae328 tests: Automatic channel selection for VHT 80+80
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-14 18:07:19 +02:00
Jouni Malinen
7d251654db tests: RADIUS Accounting and interim updates failing
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-14 17:59:52 +02:00
Jouni Malinen
49de30404e tests: Fix ap_wpa2_eap_tls_ocsp_multi_revoked
The index-revoked.txt file had not been updated when the server
certificate was updated.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-14 13:46:03 +02:00
Jouni Malinen
9a9b461fee tests: Check SAE capability for couple of forgotten sigma_dut cases
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-14 13:08:04 +02:00
Jouni Malinen
87429fc687 tests: Check DPP capability in couple of forgotten cases
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-14 13:08:04 +02:00
Jouni Malinen
4bfe80f297 tests: Skip ap_cipher_wpa_sae without SAE support
Even though the STA in this test case does not actually use SAE, it
needs to recognize the "SAE H2E only "BSS membership selector.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-14 13:08:04 +02:00
Jouni Malinen
577abde952 tests: Fix check_sae_pk_capab() with non-SAE builds
dev.get_capability() returns None in such a case.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-14 13:08:04 +02:00
Jouni Malinen
4ca8ef3df1 tests: Allow test-rsa-sig-ver data files to be set on command line
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-12 23:24:29 +02:00
Jouni Malinen
2b4db417d5 tests: Work around race conditions in OWE test cases
Need to explicitly wait for hostapd to report STA connection before
starting the traffic test to avoid the potential race condition when
testing with UML and time travel mode.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-12 19:59:52 +02:00
Jouni Malinen
f164dd87b9 tests: Make INTERWORKING_SELECT test cases more reliable
These could fail if a scan entry from a previous test case was still
present in the BSS table, e.g., by wpa_supplicant selecting the SSID
from that old entry instead of the new SSID. Try to avoid that by
explicitly flushing the scan results before starting these tests.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-12 11:46:22 +02:00
Jouni Malinen
5013897532 tests: TWT_SETUP with the control argument
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-12 10:54:14 +02:00
Jouni Malinen
a3c94d61cd tests: Disabling HE support in STA
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-12 10:47:50 +02:00
Jouni Malinen
9216929ab6 tests: HE and TWT
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 22:08:52 +02:00
Jouni Malinen
cf47a43335 tests: EAP-SIM DB error cases (SQLite)
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 17:58:14 +02:00
Jouni Malinen
ac2dddf7d1 tests: DPP NFC with hostapd
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 17:38:27 +02:00
Jouni Malinen
96279a5c51 tests: DPP chirp with an AP as a standalone Configurator
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 13:18:01 +02:00
Jouni Malinen
fd13693cac tests: DPP PKEX errors with hostapd
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 13:12:37 +02:00
Jouni Malinen
d28c2de249 tests: DPP chirp errors in hostapd
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 13:02:59 +02:00
Jouni Malinen
692ff6f002 tests: DPP Controller management in hostapd
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 12:57:25 +02:00
Jouni Malinen
39ff1a67ad tests: Invalid DAC_REQUEST values
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 12:46:38 +02:00
Jouni Malinen
ea82abc18a tests: hostapd ATTACH errors
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 12:41:16 +02:00
Jouni Malinen
234761082a tests: hostapd PMKSA_ADD failures
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 12:34:32 +02:00
Jouni Malinen
e6dae30ce1 tests: EAPOL/key config test command failures
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 12:25:38 +02:00
Jouni Malinen
261dbf7341 tests: hostapd GET_CAPABILITY
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 12:14:54 +02:00
Jouni Malinen
b385b4765d tests: ADD_MAC/DEL_MAC special cases
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 12:11:56 +02:00
Jouni Malinen
b0ded7d273 tests: Additional invalid SET_NEIGHBOR coverage
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 12:08:02 +02:00
Jouni Malinen
924c17aad5 tests: hostapd ctrl_iface SHOW_NEIGHBOR while neighbor report disabled
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 12:05:09 +02:00
Jouni Malinen
8e6a56b6e0 tests: Additional invalid REQ_BEACON cases
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 12:02:46 +02:00
Jouni Malinen
9c47624fc8 tests: VENDOR command
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 11:51:54 +02:00
Jouni Malinen
0a549776ce tests: VHT CSA with VHT80+80 getting enabled
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 01:42:48 +02:00
Jouni Malinen
3c5ea9fd9f tests: VHT CSA with invalid parameters
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-06 17:02:38 +02:00
Jouni Malinen
0922519091 tests: Additional GET_PMK coverage
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-06 16:33:03 +02:00
Jouni Malinen
f7835ac163 tests: IGTK and BIGTK replay protection
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-06 13:17:55 +02:00
Jouni Malinen
5a7e806b69 tests: Invalid MGMT_TX_STATUS_PROCESS
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-06 13:17:55 +02:00
Jouni Malinen
f5439acf6a tests: RELOAD_WPA_PSK failure
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-06 13:17:55 +02:00
Jouni Malinen
b54410127d tests: hapd->tmp_eap_user clearing on interface deinit/reinit
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-06 11:45:48 +02:00
Jouni Malinen
3e735adf0b tests: WNM time advertisement and interface restart
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-06 11:38:18 +02:00
Jouni Malinen
fa4cd46c37 tests: Roam command during a scan operation
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-06 11:11:21 +02:00
Jouni Malinen
8d80aa3fca tests: Fix openssl_systemwide_policy cleanup
Need to close the WpaSupplicant instance on the extra radio before
returning from this test case since that interface is going to be
removed and WpaSupplicant.__del__() can time out on trying to detach the
monitor connection after that.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-03-01 12:34:05 +02:00
Jouni Malinen
024fcb22ca tests: hostapd RELOAD with invalid configuration
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-03-01 11:13:46 +02:00
Jouni Malinen
ff6a305ced tests: OCV override in FT Reassociation Response
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-28 23:50:50 +02:00
Jouni Malinen
fdb8c40c7f tests: OCV override in FILS Association Response
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-28 23:50:50 +02:00
Jouni Malinen
ecc46f2900 tests: Move ERP/FILS capability checks to utils.py
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-28 23:50:50 +02:00
Jouni Malinen
8884e33eef tests: WMM parameter update failing during beacon template update
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-28 22:58:24 +02:00
Jouni Malinen
811d26705a tests: DPP config overrides in hostapd
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-28 22:48:00 +02:00
Jouni Malinen
e5ee60ade0 tests: hostapd and setband
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-28 22:40:43 +02:00
Jouni Malinen
6abf7c0419 tests: wpa_deny_ptk0_rekey in hostapd GET_CONFIG
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-28 22:31:58 +02:00
Jouni Malinen
0f51caa513 tests: hostapd GET_CONFIG entries for Multi-AP
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-28 22:31:58 +02:00
Jouni Malinen
250cb99f4d tests: Additional coverage for hostapd GET_CONFIG key_mgmt values
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-28 22:31:58 +02:00
Jouni Malinen
8c6723b7f3 tests: Invalid COLOC_INTF_REQ parameters
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-28 22:31:58 +02:00
Jouni Malinen
73a3ef8c5d tests: WPS status "Timed-out" from hostapd
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-28 22:31:58 +02:00
Jouni Malinen
35672faae5 tests: WPS PBC overlap indication from hostapd
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-28 22:31:58 +02:00
Jouni Malinen
e8e2d9ff6b tests: Additional coverage for WPS_AP_PIN error case
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-28 22:31:58 +02:00
Jouni Malinen
38e700198e tests: Display unexpected stdout and stderr prints in parallel-vm.py
Make it more difficult to miss issues that were previously only printed
out in /tmp/hwsim-test-logs/*-parallel.log. This covers things like
memory leaks and test script failures or forgotten development time
prints to stdout.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-28 22:31:58 +02:00
Jouni Malinen
8ea3561c6c tests: Fix sigma_dut_ap_dpp_tcp_enrollee_init to stop hostapd
This test case was missing an explicit CAPI ap_reset_default and that
could result in hostapd being left running at the end of the test case.
This could result in issues with following test cases if they used a new
radio interface from HWSimRadio().

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-27 21:07:54 +02:00
Jouni Malinen
468efe79a7 tests: Work around exception handling issue in wpas_config_file
Raising an exception while the wlan5 interface was remove (i.e., between
wpas.interface_remove() and .interface_add() calls) would result in the
cleanup code failing and generating yet another exception while the
first one was being processed. Work around this by re-adding the wlan5
interface back temporarily if the interface is not available for the
cleanup operations.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-27 18:10:41 +02:00
Jouni Malinen
90d3ee383f tests: RADIUS client device specified
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-27 10:51:15 +02:00
Jouni Malinen
39fac5abd1 tests: Fix clean at the end of sigma_dut_client_privacy
These commands were being issues to incorrect wpa_supplicant instance
and were missing clearing of the MAC_RAND_SCAN parameter.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-21 17:21:48 +02:00
Jouni Malinen
c210aed4b6 tests: Fix the cleanup at the end of scan_setband
The iteration of WpaSupplicant instances used incorrect variable and
ended up cleaning up only the wlan5 interface. This left unexpected
setband parameter for wlan0/wlan1/wlan2 which could result in
consecutive test cases failing due to scan not finding the expected
BSSs.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-21 16:58:33 +02:00
Jouni Malinen
fcdf5d93ea tests: EAP-TTLS and PEAP with TLS 1.3
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-20 18:00:54 +02:00
Jouni Malinen
9acf8da223 tests: Use a longer timeout for connection in sigma_dut DPP test cases
It was possible for these test cases to fail if the first scan iteration
did not find the AP since the 10 second timeout was small enough to
terminate the second attempt before fetching the scan results. Increase
this timeout to allow at least two full scan iterations to be completed
before declaring failure.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-20 16:10:47 +02:00
Jouni Malinen
6ef749ce15 tests: Clear scan results at the end of scan-ssid-list tests
These test cases use hidden SSIDs and left behind a BSS entry with no
SSID. That can cause issues for consecutive test cases where the BSSID
can be used as the key for finding a BSS entry. That could end up
picking the old hidden SSID BSS instead of the one that was meant to be
used in the test case.

Flush the scan cache at the end of the scan-ssid-list test cases to
reduce invalid test failures for the consecutive test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-20 16:01:32 +02:00
Jouni Malinen
751ce086aa tests: Make PASN tests more robust
The PASN_START command can fail if there is an old BSS entry for the
same BSSID from an earlier test case. Try to avoid this by flushing the
scan results before running these test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-20 15:45:54 +02:00
Andrei Otcheretianski
fb83e4fbc3 tests: Replace deprecated thread isAlive function
The isAlive() function is deprecated in newer versions of Python
so replace it with the is_alive() instead.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2021-02-20 00:16:33 +02:00
Jouni Malinen
3811645e99 tests: P2P device discovery with invalid group client info
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-02-19 23:34:11 +02:00
Jouni Malinen
7eb222aa89 tests: EXT PW file backend
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-02-16 00:47:43 +02:00
Patrick Steinhardt
e9f449ba59 wpa_supplicant: Move wpa_config_get_line() into utils
The function wpa_config_get_line() is used by the wpa_supplicant config
file parser to retrieve the next non-comment non-blank line. We'll need
the same kind of functionality to implement the file-based external
password backend, so as a preparatory step this commit extracts the
function into its own standalone file in the utils package.

No functional changes are expected from this commit.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
2021-02-16 00:47:43 +02:00
Jouni Malinen
fd78ab8270 tests: ACS for HE 40 MHz channel in 2.4 GHz
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-02-15 18:27:10 +02:00
Jouni Malinen
11736a1a78 tests: Make ap_sae_tdls more robust
Need to clear sae_groups parameter before using SAE in this test case to
avoid issues if previous test cases have left a specific group
configured.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-14 20:16:18 +02:00
Jouni Malinen
2c98cbecb4 tests: Make multi_ap_backhaul_roam_with_bridge more robust
Clear the scan cache and make sure the new AP gets discovered before
issuing the ROAM command.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-14 20:12:48 +02:00
Jouni Malinen
7a7e45ae68 tests: FILS Discovery frame generation
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-14 18:20:49 +02:00
Jouni Malinen
a000710835 tests: Multi-AP backhaul BSS reassociation to another BSS with bridge
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-14 00:01:29 +02:00
Jouni Malinen
ffcca901e7 tests: DPP Authentication Request destination address in chirp case
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2021-02-09 20:43:33 +02:00
Jouni Malinen
cc96f45f4f tests: New HE configuration parameters
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-08 00:45:42 +02:00
Jouni Malinen
bd8b170302 EAP-AKA: Check that ID message storing succeeds
This could fail in theory if running out of memory, so better check for
this explicitly instead of allowing the exchange to continue and fail
later due to checkcode mismatch.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-07 23:40:20 +02:00
Jouni Malinen
11cd1ffc71 tests: Fix fuzzing test build after file rename
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-07 18:16:28 +02:00
Jouni Malinen
626fc0dcd0 Rename wpa_blacklist to wpa_bssid_ignore
This is more accurate name for this functionality of temporarily
ignoring BSSIDs.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-07 17:28:45 +02:00
Jouni Malinen
7a1f1d8d77 tests: Use the new BSSID_IGNORE name for the command
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-07 16:41:10 +02:00
Jouni Malinen
125f0748e4 tests: Use new names for network profile BSSID ignore/accept parameters
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-07 16:19:09 +02:00
Janusz Dziedzic
fce6fb0ec2 tests: DFS pre CAC tests
Add test cases that check preCAC, which is available for EU regulatory
domain. Also confirm that preCAC is not used for US.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
2021-02-07 10:34:02 +02:00
Jouni Malinen
045a24273e tests: MAC ACL accept list changes
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-02-07 10:23:45 +02:00
Janusz Dziedzic
0f8994b11d tests: Extend Multi AP tests
Add option to:
 - add a new AP on the same phy that the backhaul-sta uses
 - run CSA from the parent

Adding a new AP (backhaul/fronthaul) on the same phy we have for
backhaul-sta is closer to the real repeater implementation.

Add a test case for that and run CSA.

This is a common problem when we have on the same phy:
 - connected backhaul STA
 - we started fronthaul/backhaul AP
 - we receive (from parent) CSA on the STA interface

This is multi_ap_wps_shared_apdev_csa test case, which fails today with
both mac80211_hwsim and ath9k. To avoid always failing test cases,
ignore this failure for now. Full validation can be enabled once the
issue behind this is fixed.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
2021-02-06 18:05:50 +02:00
Janusz Dziedzic
e663221727 tests: Pass ful params_backhaul in Multi AP test cases
Pass the backhaul parameters as a parameter. This is in preparation for
channel switch test for Multi AP.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
2021-02-06 18:03:58 +02:00
Raphaël Mélotte
3a3ea68a36 tests: Add WPS test with dynamic update
This test first configure hostapd with an initial SSID
('test-wpa2-psk-start'). Then a new SSID is configured
('test-wpa2-psk-new') using SET and RELOAD. Next, a station is
associated using WPS, and the test verifies that the new SSID was served
to the station.

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
2021-02-06 18:03:41 +02:00
Andrei Otcheretianski
a033e886b2 tests: Fix regdom cleanup in some p2p_channel tests
cfg80211 may ignore user hints while there are active COUNTRY_IE hints,
thus at some timings it may ignore the country setting back to world
domain. Fix it by making sure the country is set only after all the
interfaces are stopped. In addition, call a more robust
clear_regdom_dev() function.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2021-02-06 16:18:40 +02:00
Raphaël Mélotte
9ec28b657e tests: Add ap_notify_mgmt_frames
Test that if notify_mgmt_frames is enabled and a station connects we do
get AP-MGMT-FRAME-RECEIVED, and that it includes an Authentication
frame.

Also test that if notify_mgmt_frames is disabled, no Management frame is
sent on ctrl_iface when a station connects.

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
2021-02-06 13:58:02 +02:00
Andrei Otcheretianski
ba7542f62d tests: Add mixed SAE/WPA-PSK AP test
Verify WPA-PSK/TKIP connection on SAE configured AP.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2021-02-06 12:09:30 +02:00
Andrei Otcheretianski
5acc20e8f4 tests: Fix sporadic failures in p2p_channel_avoid3
The P2P group may be originally formed on UNII-3, so disabling UNII-1
and UNII-2 will not result in a channel switch failing the test.
Fix this by setting 44 as a preferred channel.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2021-02-06 12:09:30 +02:00
Andrei Otcheretianski
7546a70fbb tests: Fix ap_ft_r0_key_expiration test
The test configures ft_r0_key_lifetime parameter, however ft_params
already contain the r0_key_lifetime. Since both options are accepted by
hostapd and set the same field, one of them gets overwritten.
As the dictionary enumeration order is not guaranteed in python, the
test may sporadically fail.
Fix that by explicitely removing the unneeded parameter.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2021-02-06 12:09:30 +02:00