Commit Graph

4180 Commits (vlan_per_psk)

Author SHA1 Message Date
Jouni Malinen 125f0748e4 tests: Use new names for network profile BSSID ignore/accept parameters
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years ago
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>
3 years ago
Jouni Malinen 045a24273e tests: MAC ACL accept list changes
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years ago
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>
3 years ago
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>
3 years ago
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>
3 years ago
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>
3 years ago
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>
3 years ago
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>
3 years ago
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>
3 years ago
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>
3 years ago
Jouni Malinen 32cb91549e tests: he_tkip to match implementation change
HE is now getting disabled just like HT and VHT when only TKIP is
enabled.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years ago
Ilan Peer b07b9387d4 tests: Add PASN tests with FT key derivation
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
3 years ago
Ilan Peer 09a9e9939c tests: Add PASN with FILS tests
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
3 years ago
Ilan Peer 8a4a52293a tests: Add PASN tests with SAE
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
3 years ago
Ilan Peer cd2a0a84ce tests: Add PASN test coverage
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
3 years ago
Jouni Malinen 995ee4c94b tests: DPP Responder behavior on missing Auth Confirm
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
3 years ago
Jouni Malinen f34493f2a8 tests: Fix rfkill testing with updated kernel
Kernel commit 14486c82612a ("rfkill: add a reason to the HW rfkill
state") added an extra byte to the end of the rfkill events and that
confused the read loop here since python tried to buffer the results
from multiple read() calls into the local buffer that then delivered the
extra octets in consecutive events. Fix this by disabling buffering for
these reads.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
3 years ago
Andrei Otcheretianski 03125c9ddc tests: Fix ap_ft_eap_pull_wildcard_multi_bss
Python enumerates dictionaries in an arbitrary order, thus the resulting
configuration file will have the parameters shuffled randomly. This may
cause the test to fail when, for example, auth_server_addr is placed
after auth_server_port. Fix this by enforcing some of the fields to be
placed before the others.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
3 years ago
Janusz Dziedzic cb9cc66b35 tests: remote: Allow shuffle
With -S option we will run tests in random order.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
3 years ago
Janusz Dziedzic 3c6468a7f3 tests: remotehost: Add missed select import
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
3 years ago
Janusz Dziedzic b02a56bedb tests: remotehost: Remove wait_execute_complete
Today we have thread_wait().

Fixes: 11b3af3dad ("tests: remotehost: Use correct name")
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
3 years ago
Jouni Malinen 694722516e tests: FT reassociation SAE-PSK-SAE
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
3 years ago
Jouni Malinen 581dfcc413 tests: Fix p2p fuzzer build after API change
Commit 7b121af26a ("P2P: Delay P2P scan when an external scan is in
progress") added a new argument to p2p_scan_res_handled(), but did not
update this test tool. Fix this by using hardcoded value 0 for the new
delay argument.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
3 years ago
Jouni Malinen b3f88b15fb tests: Update ap_open_unexpected_assoc_event to match implementation
Now that wpa_supplicant ignores the unexpected association event in
disconnected-not-trying-to-connect state, this test cases needs to be
modified to avoid incorrect failures.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
3 years ago
Jouni Malinen 9a411882bd tests: setband with band combination
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
3 years ago
Jouni Malinen e4c815a77a tests: Update scan_fail to match implementation change
The function name for adding frequency lists changed, so this test case
needs a matching change to avoid failures.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
3 years ago
Johannes Berg d215f42538 tests: HE: Add a test for wifi generation on 2.4 GHz
This was broken in the kernel in mac80211 for a while, until commit
780a8c9efc65 ("mac80211: do not disable HE if HT is missing on 2.4 GHz")
fixed it.

Add a test for wifi generation on 2.4 GHz in addition to the 5 GHz one.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Janusz Dziedzic 3fd22b6ef4 tests: remotehost: Introduce wait_event()
Allow to run local/remote process like:
 - ubus listen
 - logread -f
 - tail -f
 - wpa_cli
 - hostapd_cli
And next wait for specific event(s).

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years ago
Janusz Dziedzic 11b3af3dad tests: remotehost: Use correct name
While we start thread use:
 - thread_run
 - therad_stop
 - thread_wait

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years ago
Andrei Otcheretianski eac2b65635 tests: Skip dpp_enterprise_tcp tests without OpenSSL
Skip these tests if OpenSSL wasn't loaded, instead of crashing.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
4 years ago
Jouni Malinen 348447c486 tests: Determine number of parallel make jobs automatically
Use nproc (if available) instead of the hardcoded 8 parallel make jobs.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen 0dcfdd5e47 tests: Skip test cases properly if tshark is not available
Instead of trying to process empty results, mark the test case as
skipped if tshark is not available.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Thomas Pedersen 95cff14c6f tests: Fix p2p_autogo_pref_chan_not_in_regulatory
Sweden now allows channel 149 in the updated wireless-regdb. Choose
Japan for the negative test instead.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
4 years ago
Jouni Malinen 67d5328b3c tests: DFS and no available channel after radar detection
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Markus Theil 3806ad73e1 tests: DFS test for mesh
Add a test which uses a DFS channel, waits for CAC afterwards successful
mesh join and then triggers a radar event and checks if the mesh comes
up again on the same device.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
4 years ago
Jouni Malinen 1759a8e3f3 tests: WPA2-PSK and supplicant receiving unexpected EAPOL-Key frames
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 0ea870324e tests: Use helper functions for PSK ext EAPOL-Key processing
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen ff7cae3444 tests: ANQP protection indication
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 5027f34a33 tests: Fix test description strings for couple of SAE cases
Remove the extraneous closing parenthesis.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen f14df9b56a tests: Prepare for control interface message change
Update ap_wpa2_psk_supp_proto_too_long_gtk_in_group_msg to accept
upcoming change in the parsing validation step that catches the issue.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 3b89dbaa7d tests: TDLS with SAE
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 2d8a7cf3f5 tests: Update dpp_controller_rx_errors to use the assigned TCP port
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen ac835ea092 tests: SAE status code handling
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 0747432efd Fix spelling of "unexpected" in messages
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Markus Theil 0be9c232a3 tests: Remove wpas_mesh_open_5ghz_coex
This is in preparation for an implementation change that ends up
contradicting the operations enforced in this test case for mesh coex.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
4 years ago
Jouni Malinen a964cb65a1 tests: Silence compiler warnings from test-base64
Use typecasting to match the base64_{encode,decode}() function prototype
for signed/unsigned char buffer.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 05195189f1 tests: Build test-https and test-https_server as part of ALL
Even though these are not part of run-tests, it is simpler to just build
them like all other tests/test-* tools.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen b746f28c00 tests: Remove unnecessary libraries from tests/test-*.c build
These libraries are not needed anymore with the remaining tests/test-*.c
tools.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 0167a2d165 tests: Remove obsolete ASN.1 parser/fuzzer
tests/fuzzing/asn1 replaced this more than a year ago, so get rid of the
now obsolete version.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 0db20eacaa tests: Remove obsolete TLS fuzzer
tests/fuzzing/tls-{client,server} replaced this more than a year ago, so
get rid of the now obsolete version.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 8a43fcd18c tests: Remove obsolete EAPOL-Key fuzzer
tests/fuzzing/eapol-key-{auth,supp} replaced this more than a year ago,
so get rid of the now obsolete version.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 95cbbf44f0 tests: Remove obsolete json fuzzer
tests/fuzzing/json replaced this more than a year ago, so get rid
of the now obsolete version.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen b1e91a53e4 tests: Remove obsolete ap-mgmt-fuzzer
tests/fuzzing/ap-mgmt replaced this more than a year ago, so get rid
of the now obsolete version.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen e974fad9c5 tests: Remove obsolete eapol-fuzzer
tests/fuzzing/eapol-supp replaced this more than a year ago, so get rid
of the now obsolete version.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 0be7967692 tests: Remove obsolete wnm-fuzzer
tests/fuzzing/wnm replaced this more than a year ago, so get rid of the
now obsolete version.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen ceab836a99 tests: Remove obsolete p2p-fuzzer
tests/fuzzing/p2p replaced this more than a year ago, so get rid of the
now obsolete version.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Masashi Honma 267d619798 tests: Fix mesh_open_vht_160 false negative by using common finalizer
mesh_open_vht_160 might fail with this message:

---------------
wlan0: Country code not reset back to 00: is ZA
wlan0: Country code cleared back to 00
---------------

This patch fixes the issue.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
4 years ago
Masashi Honma fd59cc8924 tests: Fix wpas_mesh_open_vht_80p80 false negative by using common finalizer
wpas_mesh_open_vht_80p80 might fail with this message:

---------------
wlan0: Country code not reset back to 00: is US
wlan0: Country code cleared back to 00
---------------

This patch fixes the issue.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
4 years ago
Masashi Honma 54830a2445 tests: Fix wpas_mesh_open_vht20 false negative by using common finalizer
wpas_mesh_open_vht20 might fails with this message:

---------------
wlan0: Country code not reset back to 00: is US
wlan0: Country code cleared back to 00
---------------

This patch fixes the issue.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
4 years ago
Masashi Honma 91de752d17 tests: Fix wpas_mesh_open_vht40 false negative by using common finalizer
wpas_mesh_open_vht40 might fail with this message:

---------------
wlan0: Country code not reset back to 00: is US
wlan0: Country code cleared back to 00
---------------

This patch fixes the issue.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
4 years ago
Masashi Honma 5eea042220 tests: Fix wpas_mesh_open_ht40 false negative by using common finalizer
wpas_mesh_open_ht40 might fail with this message:

---------------
wlan0: Country code not reset back to 00: is US
wlan0: Country code cleared back to 00
---------------

This patch fixes the issue.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
4 years ago
Masashi Honma 0bea288fbe tests: Fix wpas_mesh_open_5ghz false negative by using common finalizer
wpas_mesh_open_5ghz might fail with this message:

---------------
wlan0: Country code not reset back to 00: is US
wlan0: Country code cleared back to 00
---------------

This patch fixes the issue.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
4 years ago
Masashi Honma ee03056a62 tests: Fix mesh_secure_ocv_mix_legacy false negative by using common finalizer
mesh_secure_ocv_mix_legacy might fail with this message:

---------------
wlan0: Country code not reset back to 00: is AZ
wlan0: Country code cleared back to 00
---------------

This patch fixes the issue.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
4 years ago
Johannes Berg 5c7a048e45 tests: build.sh: Avoid copying .config if identical
If the .config file is already identical, avoid copying it even if -f
was specified; this improves build time if nothing has changed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Johannes Berg e7c11ad249 tests: build.sh: Remove 'make clean' steps
Since the build artifacts are now landing in distinct directories, we
don't need to 'make clean' and save some rebuild time.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Johannes Berg 87098d3324 build: Put archive files into build/ folder too
This is something I hadn't previously done, but there are
cases where it's needed, e.g., building 'wlantest' and then
one of the tests/fuzzing/*/ projects, they use a different
configuration (fuzzing vs. not fuzzing).

Perhaps more importantly, this gets rid of the last thing
that was dumped into the source directories, apart from
the binaries themselves.

Note that due to the use of thin archives, this required
building with absolute paths.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Johannes Berg 00b5e99b65 build: Use the new build system for fuzz tests
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Brian Norris 07aac648a1 tests: dbus: Add test for RemoveAllNetworks while connected
This likely passes today (at least without ASAN), but without the next
commit, it trips up a use-after-free bug, which ASAN can catch.

So consider this a regression test.

Signed-off-by: Brian Norris <briannorris@chromium.org>
4 years ago
Brian Norris 4b0bf0ec6e tests: run-tests: Do not use sudo if already root
Among other things, sudo can disrupt environment variables that a caller
provides.

Signed-off-by: Brian Norris <briannorris@chromium.org>
4 years ago
Brian Norris 4dbba548ae tests: Skip busctl tests when not available
Signed-off-by: Brian Norris <briannorris@chromium.org>
4 years ago
Jouni Malinen 48aebcc31b tests: D-Bus Roam
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen 5653301409 tests: Prepare ap_blacklist_all for implementation change
The blacklist design will be modified in the following commits and that
would result in this validation step based on the older implementation
starting to fail. Remove this check to avoid such testing failures.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Johannes Berg dcc5288e5b gitignore: Add various things
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Johannes Berg b3313939b7 tests: Use new build system for the tests
I had previously kept that building in the sources, but
we can also change that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Johannes Berg e150641f78 tests: Rewrite .gitignore file
The file was already outdated again, so rewrite it to ignore
anything but c, h and sh files that start with "test-".

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Johannes Berg 722138cd25 build: Put object files into build/ folder
Instead of building in the source tree, put most object
files into the build/ folder at the root, and put each
thing that's being built into a separate folder.

This then allows us to build hostapd and wpa_supplicant
(or other combinations) without "make clean" inbetween.

For the tests keep the objects in place for now (and to
do that, add the build rule) so that we don't have to
rewrite all of that with $(call BUILDOBJS,...) which is
just noise there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Johannes Berg 0430bc8267 build: Add a common-clean target
Clean up in a more common fashion as well, initially for ../src/.

Also add $(Q) to the clean target in src/

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Johannes Berg a41a29192e build: Pull common fragments into a build.rules file
Some things are used by most of the binaries, pull them
into a common rule fragment that we can use properly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Jouni Malinen fb0c693d5f tests: bgscan parameter update
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen b2a1424659 tests: Empty network profile parameters will be valid
Remove this part of the dbus_network test case since it would be causing
failures after wpa_supplicant is modified to accept empty strings
through D-Bus.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Janusz Dziedzic 48e4680dae tests: remote: Add run_monitor test case
This is useful to run monitor quickly:
./run-tests.py -t run_monitor -m mon:36,20,36,0:1,20,1,0

In such example we will get one PCAP for 36/20 and 1/20.
After execution, PCAP file is in the log directory, e.g.:
./logs/2019_11_11_13_36_24/run_monitor_mon_wlp3s0_wlp5s0.pcap

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years ago
Janusz Dziedzic c203897a88 tests: remote: Allow passing of parameters with monitor interface
This is mainly for standalone monitor in case we know and would like to
setup specific monitor configuration.

-m monitor:<chan>,<bw>, <cf1>, <cf2>:...

For example:
-m monitor:1,40,3,0
-m e4300:1,40,3,0:11,40,9,0

This also supports monitor with multiple interfaces (one pcap).

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years ago
Janusz Dziedzic 8456b9e7db tests: remote: Allow passing of parameters with devname
Allow parameters to be passed together with the device name. For
example, -m mon1:1,20,1,0

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years ago
Janusz Dziedzic 777afa9f07 tests: remote: Unblock rfkill on monitor
Unblock wifi rfkill before setup/run monitor.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years ago
Janusz Dziedzic 925dea791a tests: remote: Stop wpa_supplicant/hostapd using pidfile
Instead of killall, use pidfile.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years ago
Janusz Dziedzic adf6cfb0ab tests: remote: monitor use execute_stop()
Stop the single thread instead of killing all monitor apps.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years ago
Janusz Dziedzic 14d28a655a tests: remotehost add execute_stop()
Before we have to kill an application we start in the thread - in most
cases using killall and sometimes kill other applicantions, e.g., tcpdump,
iper, iperf3, tshark.

With this patch we are able to stop/kill a single application/thread
instead, based on the pid file.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years ago
Janusz Dziedzic fed855d5dd tests: remote host stderr workaround
In case we are using ssh MUX (which speed up a lot test execution) with
remotehost we could hit cases where ssh will hang up. This depends on
different ssh versions and remotehost implementation.

stderr as a tmpfile fixes this problem.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years ago
Janusz Dziedzic ac6595f281 tests: remote: Sort tests correctly
Problem appeared after introducing python3 support.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years ago
Jouni Malinen e7b27637a5 tests: P2P with 6 GHz disabled
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen fd9fe8bc12 tests: OCV and missing PMF or OCI
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen fe27c464fd tests: DPP-CHIRP-RX reception
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen d049aeb0c6 tests: DPP with hostapd as configurator requiring fragmentation
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen de250a1984 tests: WPA2-PSK AP with PMF association comeback (WPS)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen ce637df76c tests: P2P autonomous GO and interface being removed
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 440a5e235b tests: DPP PFS fallback with SAE enabled
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen db599dbe99 tests: SAE-PK with invalid password on AP
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 0f84a56219 tests: More explicit TLS version enabling in version tests
This is needed to allow the test cases to work on systems using
secpolicy=2 default (e.g., Ubuntu 20.04).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 255e29fcae tests: DPP Controller in hostapd
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 29ff74aef0 tests: Additional coverage for OWE PMKSA caching
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen 5dedbd582a tests: Fix wnm fuzzer build regression
Addition of MSCS support broke the test tool build due to references to
a functions from a new file. Fix this by bringing in that file to the
fuzzer build as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen f6ddda443d tests: sigma_dut DPP AP as TCP Enrollee/initiator
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 97e6ead423 tests: GAS/ANQP query without scan
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 2afc46a0a9 tests: sigma_dut and second DPP reconfiguration
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen ab676bc1fa tests: DPP over TCP (mutual)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 57e2e5ed7a tests: DPP over TCP for enterprise provisioning (Controller initiating)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen b58cd7aa1c tests: DPP reconfiguration retries
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen ad2119cbc6 tests: DPP reconfiguration connector with different groups
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 1837648e71 tests: SAE-PK and PSK using invalid password combination
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen abd950be90 tests: sigma_dut controlled AP using SAE-PK(disabled) and PSK
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 5e6919fd52 tests: SAE-PK and PSK
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 0a9d7b169e SAE-PK: Update design for fingerprint encoding into password
Update the SAE-PK implementation to match the changes in the protocol
design:
- allow only Sec values 3 and 5 and encode this as a single bit field
  with multiple copies
- add a checksum character

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 02f4946172 tests: SAE with OCV and fetching PMK
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 5579da7d5f tests: sigma_dut and WPA3 frame inject
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 8c936926f0 tests: SAE-PK with immediate confirm on AP
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 9d00efd829 tests: Skip sigma_dut_dpp_qr_resp_11 if dpp-ca.py does not exist
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen a80ab0ea95 tests: sigma_dut DPP Configurator reporting MUD URL
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 268433ecd0 tests: DPP Configurator enrolling followed by use of the new Configurator
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 4df892c781 tests: sigma_dut client privacy
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 58b384f467 tests: sigma_dut DPP reconfiguration
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 2f4c6a5bf3 tests: sigma_dut SAE-PK AP with additional SAE_PK_KeyPair values
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 7700146de0 tests: SAE-PK password minimum length
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 27ade59524 tests: sigma_dut sta_scan WaitCompletion,1
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen fc005be6c1 tests: sigma_dut DPP Configurator for dot1x
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen b649fa4f42 tests: nl80211 control port in AP mode disabled/enabled
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen 948bd894f7 tests: EAP-TEAP with client certificate in Phase 1
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen 1046145093 tests: Copy subject from CSR to certificate
Instead of overriding the subject field with something arbitrary, use
the value that is included in the CSR now that there is something there.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen a758a66725 tests: DPP over TCP for enterprise provisioning
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 725d98a513 tests: DPP and enterprise provisioning and CSR getting rejected
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 5abf8ad9b2 tests: DPP enterprise provisioning
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Brian Norris 1ce2a4fbea tests: Add all-blacklist test
Signed-off-by: Brian Norris <briannorris@chromium.org>
4 years ago
Brian Norris ddd821365a tests: Skip malformed SAE authentication frames
The parsed 'length' field might pointsbeyond the end of the frame, for
some malformed frames. I haven't figured the source of said packets (I'm
using kernel 4.14.177, FWIW), but we can at least be safer about our
handling of them here.

Signed-off-by: Brian Norris <briannorris@chromium.org>
4 years ago
Johannes Berg 2f9e2f9044 tests: Check for mac80211_hwsim module before loading it
Instead of checking if the kernel allows modules (via the presence of
/proc/modules), check if mac80211_hwsim is already there and load it
only if not. This gets rid of some ugly prints from modprobe in case
code isn't even a module and cannot be found, etc.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Johannes Berg 4dd712bd36 tests: Use bytes in a few places
With python3 bytes are returned for stdout, so need to use b''
strings instead of normal strings. These are just a few places
I ran into, almost certainly more places need it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Johannes Berg db294952bb tests: Set VHT160 or VHT160-80PLUS80 capability
If we want the test to actually use 160/80+80 we need to explicitly
advertise that we support it ourselves, since the kernel is going to be
a bit more strict about this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Jouni Malinen de36f6b7b3 tests: SAE-PK with group 21
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen f0704e7273 tests: Clean up SAE-PK parameter use
Use the global variables instead of copies of same values.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen cad9ae1dc4 tests: SAE-PK with different SAE group combinations
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 892ac42bdc tests: wpa_supplicant global pmf parameter
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 78c1cb8868 tests: OWE transition mode BSSID mismatches
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 9a0807ce36 tests: sigma_dut controlled AP using SAE-PK misbehavior
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 5a8b366233 tests: Make SAE-PK test cases more robust
Clear scan results explicitly in test cases that check BSS entry flags
to avoid incorrect failures based on results from earlier test cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 232705e3c4 tests: SAE-PK AP misbehavior
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 3a6e674adf tests: sigma_dut controlled AP and transition disabled indication change
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 6d72833236 tests: SAE-PK mixed deployment
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 0f2d5867e3 tests: SAE-PK password, but no PK on AP
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen f179475bf7 tests: Share a single definition of SAE-PK Sec=2 values
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 5ee94a997e tests: Replace sae_pk_only with sae_pk to match implementation
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen f38146e559 tests: PMKSA cache control interface for external management (FT)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 747c69fa90 tests: SAE-PK transition disable indication
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 7937160d24 tests: Verify SAE-PK use more explicitly
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 4ea4df529d tests: SAE-PK only
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen b96a4fa996 tests: Report unknown WpaSupplicant::connect() arguments
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen db23b8f95b tests: sigma_dut and SAE-PK
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen c55a52a85d tests: sigma_dut controlled GTK rekeying
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 37a5b50de3 tests: Fix sigma_dut ap_get_mac_address result parsing
Get only the actual BSSID part from the response string.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen cb43c9bfd0 tests: sigma_dut controlled AP using OCV
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 2c7b5a2c5f tests: Skip too short SAE-PK passwords in positive testing
Lambda >= 12 is needed with Sec = 2, so drop the shorter password
lengths in the sae_pk and module_wpa_supplicant test cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen c3f894ad00 tests: Fix eapol-supp fuzzing tool build
Boolean handling was changed to use "true" instead of "TRUE", but this
location was missed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen fca9ef3fee tests: SAE-PK
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 8019033fc5 tests: OCV channel mismatch validation by STA
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen b50b8f0429 tests: HS 2.0 deauthentication request PMF misbehavior (+HTC)
Verify driver/mac80211 behavior with HT Control field in Public Action
frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen eff431ff38 tests: OWE transition mode with owe_transition_ifname
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 9818fbe9bc tests: Enforce proper OCV behavior for SA Query Response from STA
Now that there is a pending mac80211 patch ("mac80211: allow SA-QUERY
processing in userspace") to allow wpa_supplicant to take care of SA
Query Request processing, start enforcing correct behavior for this in
ocv_sa_query and wpa2_ocv_sta_override_sa_query_resp.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen b96a3bd5df tests: sigma_dut controlled STA using OCV
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 38163b193e tests: OCV and post-CSA SA Query error cases
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 5071248bd4 tests: OCV with OCI override on STA
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen bf47f0542f tests: Suite B using PMKSA caching and roaming
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 0132a72922 tests: Use test-name.* style files more consistently
Use params['prefix'] to build the file names for dynamically generated
files.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen 78c823de4e tests: Handle unexpected get_driver_status_field() error
If the current country code cannot be fetched, do not try to report the
current value in the log since that will result in TypeError exception.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen f382af2c1e tests: Avoid hapd reference before assignment on error cases
Couple of VHT test cases missed explicit setting of hapd to None before
trying to start hostapd. Add those to avoid unexpected exceptions in
case hostapd start fails.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen 7134b2a548 tests: Add description for test cases that were missing it
All test_*() functions are expected to use __doc__ to provide a short
description of the test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen 49d1f9c98e tests: Unify ignore_old_scan_res resetting
Add a decorator that clears ignore_old_scan_res parameter value instead
of doing this with try/finally in large number of test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Johannes Berg 570ae3ef54 tests: Unify IPv6 disabling
Add a decorator that disables IPv6 and requires running
under a VM, rather than open-coding that many times.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Jouni Malinen 87c8e86da9 tests: Fix ACS freqlist testing
The freqlist parameter uses comma, not space, separated values. Add
another test case for checking freqlist values that do not use the
preferred channel numbers to make sure the frequency list is actually
used as a constraint for selecting the channel.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Johannes Berg 34ac7d871a tests: Delayed group rekey retransmit test for IGTK
Add a test for delayed group rekey retransmission that checks that
the IGTK is protected against it by not resetting the IPN replay
counter when reinstalling such a key.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Johannes Berg 7f508ff968 tests: Reset the correct key's PN for group key handshake testing
While adding support for IGTK and BIGTK here, I tested this without
protections (i.e., with protections removed from both wpa_supplicant and
the driver), and while I got some bad resets on the debugfs values, it
should have failed with "unexpected connectivity".

Fix this to be correct - we need to reset the GTK PN, not the PTK PN in
this test.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Johannes Berg 889218c14a tests: Extend debugfs key state reading for IGTK/BIGTK
Extend the debugfs read helpers to work with IGTK and BIGTK.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Johannes Berg 4a0b27c62f tests: Replace gtk boolean by keytype in cipher suite tests
Replace the gtk boolean by a keytype value indicating
GTK or PTK, to be able to extend to other types later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
Jouni Malinen f636bc3abc tests: Skip TOD-TOFU/STRICT tests if build does not support this
This functionality is currently available only with OpenSSL and internal
TLS implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Thomas Pedersen 692bbd25b4 tests: Flush scan results before checking alloc failure
When run after other tests, It was likely that the target
bss was already present in scan_fail, so the
scan_for_bss() wouldn't trip the allocation failure in
wpa_bss_add(). Flush the scan results before the scan to
ensure wpa_bss_add() is called and consistently pass
scan_fail.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
4 years ago
Thomas Pedersen 0218bf05d6 tests: sigma_dut: set regulatory inside try/except
If sigma_dut is not installed, start_sigma_dut() will
throw an exception. Call start_sigma_dut() inside the
try/except to correctly reset the regulatory domain.

This fixes several seemingly random failures due to
regulatory domain not being reset.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
4 years ago
Jouni Malinen 72e10af9ca tests: Automatic channel selection and RX during ACS
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen 47323a6f50 tests: sigma_dut DPP/QR AP as chirping Enrollee
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen d5b596996e tests: DPP chirp by an AP
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen dff67270b5 tests: iftype parameter with GET_CAPABILITY key_mgmt
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 644638819a tests: Additional sigma_dut DPP over TCP coverage
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen b37a1ec24f tests: DPP over TCP (Configurator initiates)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 217656d098 tests: DPP reconfiguration exchange
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 3aaf269f67 DPP: Move TCP encapsulation into a separate source code file
This continues splitting dpp.c into smaller pieces.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 21c612017b DPP: Move configurator backup into a separate source code file
This continues splitting dpp.c into smaller pieces.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen fdbbb74064 DPP: Move authentication functionality into a separate source code file
This continues splitting dpp.c into smaller pieces.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 0c043d9de7 DPP2: Reconfig Announcement transmission
Extend DPP chirping mechanism to allow Reconfig Announcement frames to
be transmitted instead of the Presence Announcement frames. Add a new
wpa_supplicant control interface command "DPP_RECONFIG <network id>" to
initiate reconfiguration for a specific network profile.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen b227515fae tests: Update dpp_peer_intro_local_failures to match implementation
The memory allocation in dpp_peer_intro() was moved into a helper
function dpp_check_signed_connector(), so update the test case to match.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen d4ae12355a DPP: Move PKEX functionality into a separate source code file
This continues splitting dpp.c into smaller pieces.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 87b6572616 DPP: Move crypto routines into a separate source code file
This is an initial step in splitting the overly long dpp.c into smaller
pieces.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 6eb03715e3 tests: Update dpp_pkex_test_fail to match implementation
dpp_derive_ke() was renamed to dpp_derive_bk_ke().

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 046f2d1fb9 tests: DPP URI version information
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen 6b8dde4ec9 tests: sigma_dut controlled AP doing DPP on offchannel
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago