Commit graph

1679 commits

Author SHA1 Message Date
Jouni Malinen 36e6633415 tests: Fix go_neg_with_bss_connected with P2P Device
Group interface name was fetched from the results of an incorrect group
formation and because of this, group removal failed in case P2P Device
is used and dev[1] ends up getting different group ifname for the
groups.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-08 18:33:16 +03:00
Jouni Malinen f033200e94 tests: Add P2P Device support for persistent_group
The network operations need to use the global control interface to be
performed on the interface that stores the network profiles for
persistent groups.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-08 18:33:11 +03:00
Ben Rosenfeld 622ef15b77 tests: Update group_ifname after group start
After P2P-GROUP-STARTED event, use group_form_result in order to update
the group_ifname for the device. This is needed when using P2P Device
for managing P2P operations which results in a separate group interface
being used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-08 18:32:34 +03:00
Ben Rosenfeld 6f27f79084 tests: Use list_networks with p2p=true in test_p2p_channel
In case that there is a need to list the persistent P2P networks,
the global control interface needs to be used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-08 18:31:05 +03:00
Ben Rosenfeld 9766d403a6 tests: Change persistent_go_client_list to use global interface
Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-08 18:30:45 +03:00
Ben Rosenfeld 85ef1f4345 tests: Use global interface in persistent_group_invite_removed_client
When removing a persistent P2P group, global interface needs to be used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-08 18:29:29 +03:00
Ben Rosenfeld 8e751cfa05 tests: Change list_networks() to use global interface with P2P
list_networks() always used the wlanX control interface to query for the
current list of networks. However, when a dedicated P2P Device is used,
the global control interface should be used when checking persistent
group network profiles.

Fix this by adding an optional parameter indicating that the P2P
networks are requested, and in such a case use the global control
interface.

In addition update test_p2p_persistent to use the argument when needed.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-08 18:29:03 +03:00
Ben Rosenfeld d7e2d79b1a tests: Change persistent_group_per_sta_psk to use global interface
This is required for cases that a dedicated P2P Device interface
is used and then the event will happen on the global interface.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-08 18:27:25 +03:00
Ben Rosenfeld cbeab59c9f tests: Change test_p2p_persistent to use the global control interface
Send request to set persistent_reconnect on the global control
interface so it would also work when using a dedicated P2P Device
interface.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-08 18:27:04 +03:00
Ben Rosenfeld cf5d768b33 tests: Change p2p_device_nfc_invite to use global interface
When testing P2P invitation flow, setting the NFC selector
should be done using the global control interface.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-07 21:35:29 +03:00
Ben Rosenfeld cc259e2650 tests: Change p2p_device_misuses() to use group interface
Calling "DISASSOCIATE" should be done on the group interface.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-07 21:30:40 +03:00
Ilan Peer 6420643d45 tests: Skip some tests in P2PS when a dedicated P2P Device is used
Some tests in test_p2ps.py test a scenario where a separate P2P
group interface is not used. However, this is not a valid case
when a dedicated P2P Device interface is used, as in such a case
a separate group interface must be used.

Handle this by skipping such tests in case a dedicated P2P Device is
used.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-05-07 21:19:38 +03:00
Ilan Peer 5cef80647e tests: Fix test_p2ps.py to save group results
Call group_form_result() whenever a new group is started, so that
group_ifname gets updated and later, the group can be removed when
needed.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-05-07 21:17:31 +03:00
Ben Rosenfeld 09f60224a5 tests: Remove all P2P networks in call to reset
When resetting a device, remove all the P2P networks to prevent
unexpected behavior in following tests. This is needed for the case
where P2P Device interface is used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-07 21:14:31 +03:00
Ben Rosenfeld 6f96fdaefb tests: Change test_p2p_messages to use global interface
This is required for cases where P2P Device is used and the event
happens on the global interface.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-07 21:11:03 +03:00
Ben Rosenfeld eb1d68eff0 tests: Change set_country() to use the global interface to get event
This is required for cases that multiple interfaces are used and the
event can happen on any of them, for example when a dedicated P2P Device
interface is used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-07 21:09:29 +03:00
Ben Rosenfeld 91d3483273 tests: Change p2p_set_ssid_postfix to use the group interface for SSID
This is required for cases where thea P2P Device interface is used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-07 21:07:20 +03:00
Ben Rosenfeld 3d5b1a6452 tests: Fix test_ap_pmf to use own_addr
The tests used p2p_dev_addr that can be different from own_addr,
if a dedicated P2P Device interface is used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-05-07 21:02:37 +03:00
Jouni Malinen f79a5fa006 tests: Add a STA entry for ap-mgmt-fuzzer
This increases the coverage for AP mode management frame fuzzing by
allowing number of additional Action frame code paths to be executed.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-03 18:26:50 +03:00
Jouni Malinen 6838452db8 tests: Invalid WMM Action frame
This is a regression test case for a AP mode WMM Action frame parsing
issue.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-03 18:26:50 +03:00
Jouni Malinen b204753115 tests: WPS HTTP protocol tests
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-03 18:26:50 +03:00
Oren Givon 2380d80493 tests: TDLS link status test
Add a test case for checking TDLS link status.

Signed-off-by: Oren Givon <oren.givon@intel.com>
2015-05-03 17:24:38 +03:00
Jouni Malinen c53a3f29cd tests: IBSS RSN regression test for IBSS_RSN prior IBSS setup
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-03 17:15:45 +03:00
Jouni Malinen f0174bff85 tests: Fix EAP-SIM/AKA protocol tests to use full header
Couple of the EAP-SIM/AKA protocol test cases were leaving out the
Reserved field. This was not intentional since these test cases were
targeting a specific Subtype processing instead of verifying truncated
header case (which is covered separately). Add the Reserved field to
allow the implementation to add an explicit, earlier check for this.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-05-03 16:32:59 +03:00
Jouni Malinen cb346b49d2 tests: Extend D-Bus test cases to cover separate P2P Device operations
Number of the P2P test cases through D-Bus commands were not prepared
for there being a separate group interface when the P2P Device concept
is used.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-04-29 20:44:23 +03:00
Jouni Malinen 798c7951cf tests: ProxyARP with na_mcast_to_ucast=1
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-04-27 12:33:43 +03:00
Michael Braun bbe9eddce0 tests: Change vlan_id back and forth
Enhance test ap_vlan_wpa2_radius_id_change to change the VLAN-ID
back as a last step. This ensures that the wpa_group for VLAN-ID 1
did not enter FATAL_FAILURE state during the test.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
2015-04-26 16:56:22 +03:00
Jouni Malinen f80fd58de6 tests: Check vlan_id information in STA output
In addition, this adds some delay between the authentication and data
connectivity test through the newly added VLAN and by doing so, makes
ap_vlan_wpa2_radius_id_change a bit more robust. It was possible for the
EAPOL-Key message 4/4 not having yet been processed by hostapd at the
time the data test started.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-04-26 15:59:19 +03:00
Mikael Kanstrup 8b423edbd3 Declare all read only data structures as const
By analysing objdump output some read only structures were found in
.data section. To help compiler further optimize code declare these
as const.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
2015-04-25 17:33:06 +03:00
Michael Braun bfcc073caf tests: Verify dynamic_vlan=required is honored with macaddr_acl=2
dynamic_vlan=required also applies to macaddr_acl=2 (RADIUS), especially
when used with WPA-PSK.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
2015-04-25 10:28:19 +03:00
Jouni Malinen 2272f5aada tests: WPS AP iteration on no Selected Registrar and error case
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-04-24 17:55:33 +03:00
Jouni Malinen cfbdb9958f tests: Increase wait timeout in autogo_m2d
The time before trying to associate with an AP that does not advertise
Selected Registrar TRUE is going to be incremented, so increase the
autogo_m2d timeout to avoid reporting incorrect errors due to missing
M2D events.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-04-24 17:55:32 +03:00
Jouni Malinen 9bbce25772 tests: D-Bus AddNetwork for AP mode
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-04-24 01:22:15 +03:00
Jouni Malinen 5bf30c6715 tests: wpa_supplicant INTERFACE_ADD/REMOVE with large number of vifs
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-04-24 01:22:15 +03:00
Jouni Malinen 26b3f64428 tests: Add ap-mgmt-fuzzer
This program can be used to run fuzzing tests for areas related to AP
management frame parsing and processing.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-04-22 11:44:19 +03:00
Jouni Malinen 0af57c3dd8 tests: Add wnm-fuzzer
This program can be used to run fuzzing tests for areas related to WNM
frame parsing and processing on the client side.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-04-22 11:44:19 +03:00
Jouni Malinen 46c3befe24 tests: Add eapol-fuzzer
This program can be used to run fuzzing tests for areas related to EAPOL
frame parsing and processing on the supplicant side.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-04-22 11:44:19 +03:00
Jouni Malinen a65d7495b5 tests: Add p2p-fuzzer
This program can be used to run fuzzing tests for areas related to P2P
message parsing and processing. p2p-fuzzer allows data files to be used
to inject Probe Response and Action frames for processing by the P2P
module.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-04-22 11:44:19 +03:00
Jouni Malinen f371869a96 tests: P2P protocol tests for too long variable length fields
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-04-22 11:44:19 +03:00
Michael Braun 515b176e9c tests: Verify RSN preauth with dynamic VLANs
This change add two new tests to verify hostapd operation when used with
VLANs. Both are based on pmksa_cache_preauth and enable dynamic VLANs,
pmksa_cache_preauth_vlan_used additionally uses a station with VID 1.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
2015-04-13 17:08:10 +03:00
Jouni Malinen 1d0a917f36 tests: D-Bus BSS interface and WPS Type values
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-04-13 15:09:23 +03:00
Jouni Malinen 138bf11852 tests: INTERFACE_ADD/REMOVE with vif without creation/removal
This is also a regression test for INTERFACE_ADD parsing.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-04-04 11:02:22 +03:00
Jouni Malinen febf575200 tests: EAP-TTLS with TLS session ticket enabled
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-04-01 12:57:11 +03:00
Jouni Malinen 0d33f5040f tests: EAP-PEAP/MSCHAPv2 with domain name
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-29 22:06:06 +03:00
Jouni Malinen 53f4ed68ee tests: WPA2-PSK AP with passphrase only in memory
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-28 11:08:31 +02:00
Jouni Malinen b898a6ee72 tests: WPA2-Enterprise connection using EAP-pwd and NTHash
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-28 09:45:25 +02:00
Jouni Malinen ce591c74bf tests: Make parallel-vm.py FAIL parser more robust
It looks like it was possible to receive an incomplete FAIL line and
break out from test execution due to a parsing error. Handle this more
robustly and log the error.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-03-26 22:20:35 +02:00
Jouni Malinen 25f2cb618c tests: INTERFACE_ADD/REMOVE with vif addition/removal
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-03-26 22:20:35 +02:00
Jouni Malinen 8278138e67 tests: Verify OSEN BSS flag in scan results
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-03-25 16:05:35 +02:00
Jouni Malinen 05121d3564 tests: Change proxyarp_open LL src MAC check to match requirements
Now that there is a kernel patch for IPv6 ProxyARP that is capable of
using the non-AP STAs MAC address as the link layer source address in
NA, validate that behavior rather than the temporary check for BSSID.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-03-24 20:33:33 +02:00
Jouni Malinen a539d3f71f tests: Automatic reconnection on re-enabling temporarily disabled network
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-22 20:54:07 +02:00
Jouni Malinen 24b3b32316 tests: Remove debug print from ap_wpa2_psk_incorrect_passphrase
This development time debug print was forgotten into the test script.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-22 20:36:01 +02:00
Jouni Malinen 8aba435b16 tests: Make ap_vlan_wpa2_radius_id_change more robust
Wait for the 4-way handshake completion instead of assuming it gets done
in 0.1 seconds.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-03-20 17:51:18 +02:00
Jouni Malinen 898c959a6f tests: P2P_SERVICE_DEL asp all
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-03-20 15:56:59 +02:00
Jouni Malinen 5f6ce5b503 tests: INTERWORKING_SELECT blocking SCAN
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-03-20 15:56:59 +02:00
Jouni Malinen 97c6d0d873 tests: AP-STA-POSSIBLE-PSK-MISMATCH
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-03-19 13:18:44 +02:00
Jouni Malinen a14a5f244a tests: Disable and re-enable hostapd interface
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-03-19 12:57:37 +02:00
Jouni Malinen 47af258687 tests: GET ip_addr_go
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-15 21:03:39 +02:00
Jouni Malinen 211bb7c5ea tests: WPA2-PSK-FT AP over DS and unexpected response
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-15 16:36:37 +02:00
Jouni Malinen de52a2e259 tests: Fix parallel-vm.py test case name parsing
The 'params' argument was not used at all. Use it as an alternative
means for setting the list of test cases to execute.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-14 12:12:01 +02:00
Jouni Malinen 4f76eb81e9 tests: Add --valgrind argument to parallel-vm.py
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-14 12:09:23 +02:00
Jouni Malinen eb9c155498 tests: P2P autonomous GO and many clients (P2P IE fragmentation)
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-14 10:58:17 +02:00
Jouni Malinen d0cd00de6f tests: Verify wpa_supplicant AP mode events
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-14 10:14:47 +02:00
Jouni Malinen f584b5a196 tests: Document dependency on python-crypto
Crypto.Cipher module is now needed to be able to run the 4-way handshake
protocol tests.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-07 23:47:02 +02:00
Jouni Malinen e0c46c8e44 tests: Protocol testing for EAPOL-Key supplicant processing
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-07 17:18:33 +02:00
Jouni Malinen 0860b2199f tests: Make ap_acs_40mhz more robust
Explicitly clear cached scan results on the AP interface before starting
ACS. This avoids issues where conflicting BSS entries from previously
executed test cases could affect channel selection.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-07 17:02:40 +02:00
Jouni Malinen 68baa82cd2 tests: Add --short option for parallel-vm.py
This can be used to filter out test cases that take significantly longer
time to execute (15 seconds or longer). While this reduces testing
coverage, this can be useful to get a pretty quick coverage in
significantly faster time.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-07 12:23:39 +02:00
Johannes Berg d2002f8334 tests: Allow running with arbitrary working directory
It's somewhat annoying that you can only run parallel-vm.py as
./parallel-vm.py, not from elsewhere by giving the full path,
so fix that by resolving the paths correctly in the scripts where
needed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-03-07 12:23:07 +02:00
Johannes Berg 4f06261bd9 tests: parallel-vm.py: Use argparse module
Instead of hand-writing a (positional) parser, use the argparse module.
This also gets us nice help output.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-03-07 12:23:04 +02:00
Jouni Malinen 4e979d9de6 tests: Make ap_remove_during_acs* more robust
These test cases need to use the previous-AP-on-correct-band workaround
similarly to test_ap_acs.py test cases for now to work with
mac80211_hwsim limitations on channel survey.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-07 00:00:08 +02:00
Jouni Malinen d970337da7 tests: Make suite_b* test cases more robust
Explicitly clear the cfg80211 BSS cache at the beginning of these test
cases to avoid matching BSS flags against incorrect AP.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-06 23:18:46 +02:00
Jouni Malinen 45de328602 tests: More thorough cache clearing in ap_hs20_hidden_ssid_in_scan_res
It looked like cfg80211 BSS entry for the zero-length SSID could remain
after this test case. Stop the AP and scan twice with flush-cache option
to make this less likely to occur and cause issues to following test
cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-06 23:17:12 +02:00
Jouni Malinen 9cc223c2f5 tests: Make offchannel_tx_roc_gas more robust
It was possible for this test case to fail if cfg80211 BSS cache
included an entry for the same BSSID on another channel from an earlier
test case. Fix this by epxlicitly flushing the cache. In addition, use
scan_for_bss() to make the test less likely to fail in case of heavy CPU
load.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-03-06 17:03:06 +02:00
Jouni Malinen 46dea617ae tests: WPS PIN and iterate through APs without selected registrar
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-03-06 15:37:02 +02:00
Jouni Malinen 50c3825c6d tests: DFS with wpa_supplicant AP mode
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-03-05 17:25:16 +02:00
Jouni Malinen 19ec6070ff tests: Fix workaround for limited channel survey in mac80211_hwsim
The way the current channel survey is implemented in mac80211_hwsim
requires for the ACS test cases to be run immediately after the same
radio has been on the expected operating band. This was worked around in
one of the test cases and errors ignored in couple. Extend this
workaround to cover all the test cases.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-03-03 16:01:52 +02:00
Jouni Malinen 9416e47f47 tests: Fix ap_vlan_wpa2_radius_id_change exception
This was supposed to be Exception("string") not "string".

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-03-03 15:40:19 +02:00
Johannes Berg cba262e39b tests: Fix python typo
Clearly that should spell Exception.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-03-03 15:38:01 +02:00
Jouni Malinen 00c35673fd tests: Allow --shuffle-tests to be used with parallel-vm.py
This can be used to get more random sequence of test case execution
into use when running multiple VMs.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-03 09:47:25 +02:00
Jouni Malinen fb7e0998b0 tests: P2P GO start with only 5 GHz band allowed
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-03-02 17:01:15 +02:00
Jouni Malinen 96cbb7b561 tests: Skip radius_acct_unreachable3 when not running under VM
It looks like the IP routing table changes used here to trigger
unreachability and following reachability of the server do not work very
well with full IP routing configuration, so run this test case only when
executed under vm-run.sh.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-03-02 16:30:13 +02:00
Jouni Malinen bfc048b48f tests: P2P autonomous GO with large number of GO instances
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-01 22:36:53 +02:00
Jouni Malinen 58980654af tests: RADIUS server failure cases
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-01 22:36:52 +02:00
Jouni Malinen 5d695df5d1 tests: hostapd and get_station in multi-BSS configuration
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-01 22:36:52 +02:00
Jouni Malinen 5ff53fd6dd tests: RADIUS failover and failed attempt to return to primary server
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-01 22:36:52 +02:00
Jouni Malinen 7c5658c661 tests: RADIUS client address specified
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-01 22:36:52 +02:00
Jouni Malinen 1b5664f0fb tests: RADIUS Accounting server unreachable and multiple STAs
This verifies behavior on reaching RADIUS_CLIENT_MAX_ENTRIES.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-01 22:36:52 +02:00
Jouni Malinen 48d9065f7d tests: RADIUS Accounting server initially unreachable, but then available
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-01 22:36:52 +02:00
Jouni Malinen ec1c483de0 tests: Not ready for GO Negotiation (listen/search)
These test cases verify that P2P_FIND and P2P_LISTEN operation continues
after having replied to GO Negotiation Request frame for which we are
not yet ready (i.e., GO Negotiation Response with status=1).

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-01 22:36:52 +02:00
Jouni Malinen 7041c16d5a tests: Open mode connection and SELECT_NETWORK to change network
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-01 15:56:11 +02:00
Jouni Malinen 6acca70536 tests: cfg80211 P2P Device and P2P_* command on incorrect interface
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-01 12:07:23 +02:00
Jouni Malinen 5de945fcc0 tests: cfg80211 P2P Device misuses
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-01 11:24:41 +02:00
Jouni Malinen 6d0b447464 tests: P2P_FIND with freq parameter to scan a single channel
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-02-28 22:06:24 +02:00
Jouni Malinen dcd378ed2e tests: Make grpform_no_wsc_done more robust
It was possible for this test case to start a new group formation on
dev[1] while the first round was still going through the process of
processing group termination indication. That could result in the second
round failing unexpectedly.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-02-28 16:57:03 +02:00
Jouni Malinen abeea374a4 tests: RADIUS server connect() failing during startup
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-02-28 15:45:17 +02:00
Jouni Malinen 8412dd52d1 tests: Increase default VM memory from 128M to 192M
It looks like the 128M default memory size for the hwsim test setup was
not large enough to cover all the needs anymore. Some of the test cases
using tshark could hit OOM with that size. Increase the default
allocation to 192M to avoid this type of issues.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-25 19:02:43 +02:00
Jouni Malinen 0f74bd41c5 tests: 4-way handshake and the first msg 4/4 getting lost
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-23 15:36:49 +02:00
Jouni Malinen 52352802ee tests: Linux packet socket workaround and EAPOL RX in operational state
This verifies that the packet socket workaround does not get disabled if
EAPOL frames are processed during operation state (i.e., when processing
reauthentication/rekeying on a functional association).

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-02-22 16:06:23 +02:00
Jouni Malinen 528a7d22d0 tests: VHT/HT preference in BSS selection
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-02-22 11:47:28 +02:00
Jouni Malinen cfb5576d93 tests: Rename dmesg files to a unique name
This allows multiple dmesg files to be saved if a test case is executed
multiple times similarly to the other logfiles.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-02-21 16:07:53 +02:00
Johannes Berg d0007ac9d7 tests: Add test to check disconnect in powersave
The kernel had two bugs (one in hwsim and one more important one in
mac80211) in this area, add a test to make sure we can disconnect
without any kernel issues while in powersave.

Also make sure that the TIM bit gets set and cleared again (by checking
with tshark.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-02-21 16:07:52 +02:00
Jouni Malinen 04bb845273 tests: Re-association to same BSS to toggle PMF status
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-19 16:37:12 +02:00
Jouni Malinen 4bcedaa400 tests: Re-sign expired test certificates
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-19 14:18:57 +02:00
Jouni Malinen 792eafa047 tests: Make wpas_mesh_password_mismatch more robust
It seems to be possible for dev2 (the one with incorrect password) to
stop retries before either dev0 or dev1 reports the authentication
failure event. For now, allow the test case pass if either dev0 or dev1
reports the event rather than requiring both to report this. The
expected behavior can be fine-tuned in the future if the reporting
behavior is modified to be more consistent.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-12 15:50:52 +02:00
Jouni Malinen f245b45075 tests: Fix ap_{open,wpa2_psk}_wpas_in_bridge cleanup
Due to a copy-paste error, these test cases left 4addr mode enabled on
wlan5. This resulted in number of connect_cmd_* test cases failing if
executed after the wpas_in_bridge tests.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-11 16:50:06 +02:00
Jouni Malinen 1c9838b388 tests: Remove temporary config file in wpas_config_file
The new wpa_supplicant configuration file writing style leaves behind
the temporary file (<filename>.tmp) if renaming fails. Clean that up in
the test case execution.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-11 14:57:30 +02:00
Jouni Malinen eb88a5ba74 tests: hostapd and external ifconfig down + up
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-11 10:31:12 +02:00
Jouni Malinen 380f3a8ba1 tests: Make autogo_join_auto_go_neg more robust
This test cases used to fail if dev1 had seen dev0 as a GO in an earlier
test case, e.g., when running it after autogo_fail. Fix this by clearing
scan results on dev1 at the beginning of the test case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-10 12:09:07 +02:00
Jouni Malinen c5b535ed1d tests: hostapd and start_disabled=1
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-09 19:57:46 +02:00
Jouni Malinen 7ebc7e8fa6 tests: wpa_supplicant DUMP/GET global parameter
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-02-08 22:49:58 +02:00
Jouni Malinen 2265376271 tests: INTERWORKING_ADD_NETWORK
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-02-08 22:49:58 +02:00
Jouni Malinen 9177b0a8c9 tests: Successful P2P_CONNECT-auto cases
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-02-08 13:59:57 +02:00
Jouni Malinen d2b84e430c tests: P2P_CONNECT-auto not finding GO
This is a regression test for an earlier bug that resulted in using
freed memory after a P2P group interface was removed as part of
fallback-to-GO-Negotiation in P2P_CONNECT-auto.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-02-08 13:35:49 +02:00
Jouni Malinen 874057da4e tests: Make wpas_ctrl_many_networks more robust under valgrind
It is possible for a low powered CPU to take excessively long time to
delete 1000 network blocks when running under valgrind. This would have
resulted in the test case failing and the following reset operation
timing out which would then stop the test sequence completely.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-02-08 13:25:35 +02:00
Jouni Malinen f77d6d4bd8 tests: Mesh authentication failure events
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-02-08 13:25:35 +02:00
Jouni Malinen a0b3f8e2ff tests: Remove forgottend debug print from p2ps_connect_adv_go_persistent
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-02-07 16:29:22 +02:00
Jouni Malinen c62bd5e44d tests: Remove forgotten debug print from grpform_pbc_overlap
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-02-07 15:38:29 +02:00
Ilan Peer d821e2f294 tests: Use the global control interface in test_nfc_p2p.py
Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-07 15:37:13 +02:00
David Spinadel bbcbbd3701 tests: Modify autogo_bridge test to use group interface
1. Add get_group_ifname() to wpasupplicant.py
2. Use the function to get the interface name for the bridge.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
2015-02-07 15:37:13 +02:00
Ilan Peer 4ef05faf43 tests: Modify test_p2p_discovery to use global and group interfaces
Modify the tests in test_p2p_discovery to use the global
control interface and group interface.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-07 15:37:13 +02:00
Ilan Peer da749dc579 tests: Use the group control interface in p2p_channel_avoid
Use the group control interface to wait for P2P-REMOVE-AND-REFORM-GROUP
as the event is a group event.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-07 15:37:13 +02:00
Ilan Peer d4f2ba749e tests: Use group control interface in autogo
P2P-PRESENCE-RESPONSE is a group event, and thus need
to use the group control interface.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-07 15:37:13 +02:00
Ilan Peer 75826fc6e6 tests: Use global control interface in wpas_ctrl_global
Use the global control interface to set/get the status of the
P2P Device.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-07 15:37:13 +02:00
Jouni Malinen c4668009d0 tests: Remove unnecessary use of sudo from test cases
run-tests.py is running as root, so sudo does not need to be used
anymore from within each test case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-07 15:37:13 +02:00
Jouni Malinen b638f70316 tests: Replace subprocess.call for rm with os.remove()
There is no need to use sudo and external rm to remove files now that
run-tests.py is required to run as root.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-07 15:37:13 +02:00
Jouni Malinen 592015c3c1 tests: Fix wpas_config_file after implementation change
The new wpa_supplicant configuration writing design (rename instead of
write to original file) did not fail with the symlink-to-self case, so
replace this with the config file being replaced with a directory. In
addition, get rid of unnecessary use of subprocess since run-tests.py is
running as root nowadays.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-07 15:37:13 +02:00
Jouni Malinen 4cfc46934d tests: IBSS with WEP and TKIP
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-06 21:43:50 +02:00
Jouni Malinen 65013c9331 tests: ACS with acs_chan_bias parameter
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-06 18:02:33 +02:00
Ilan Peer 1cb3ad7362 tests: Use global control interface in test_p2p_concurrency
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-05 13:48:40 +02:00
Ilan Peer 2a9eb1494c tests: Use global control interface in test_p2p_service
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-05 13:48:40 +02:00
Ilan Peer e9986d8b0b tests: Modify test_p2p_discovery to use global control interface
1. Modify discovery_stop to use global control interface when calling
   P2P_FLUSH.
2. Modify p2p_listen_and_offchannel_tx to use the global control
   interface when waiting for P2P PD event.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-05 13:48:40 +02:00
Eliad Peller a918e48af1 tests: Add printk tracer to trace-cmd
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
2015-02-05 13:48:40 +02:00
Ben d715738578 tests: Modify tests in test_ap_pmf to use own_addr()
Some of the tests used p2p_dev_addr() that can be different from
own_addr() if a dedicated P2P Device interface is used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-02-05 13:48:40 +02:00
Ben 3d8c7953e3 tests: Modify tests in test_hapd_ctrl to use own_addr()
Some of the tests used p2p_dev_addr() that can be different from
own_addr() if a dedicated P2P Device interface is used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-02-05 13:48:40 +02:00
Ben 1d21a5bee5 tests: Fix ap_wps_per_station_psk to use own_addr()
The test used p2p_dev_addr() that can be different from own_addr()
if a dedicated P2P Device interface is used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-02-05 13:48:40 +02:00
Ben 18945a8c8e tests: Fix ap_wpa2_psk_file to use own_addr
The test used p2p_dev_addr() that can be different from own_addr()
if a dedicated P2P Device interface is used.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
2015-02-05 13:48:40 +02:00
Matti Gottlieb 83e1bab022 tests: Fix destination address in ap_hs20_remediation_required_ctrl
Fix the destination address that is sent in the WNM-Notification to be
the BSS address opposed to the P2P address.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
2015-02-05 13:48:40 +02:00
Ilan Peer 36f2818784 tests: Use get_bss() with ifname in autogo
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-05 13:48:40 +02:00
Ilan Peer fb9cf82eb3 tests: Add option to specify ifname to get_bss()
This is needed for cases that the group interface differs from the main
interface, i.e., when a dedicated P2P Device interface is used.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-05 13:48:40 +02:00
Ilan Peer 5270b2fbb7 tests: Use the global control interface in test_p2p_grpform
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-05 13:48:35 +02:00
Ilan Peer c282b9b40e tests: Use global_request for SET commands in test_p2p_grpform
When the 'SET' command is used to configure parameters related to P2P
operation use the global control interface and not the per interface one
as otherwise the setting will only have effect on the interface and will
work if a dedicated P2P_DEVICE is used.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-05 13:38:10 +02:00
Ilan Peer cef63d6b2f tests: Update group ifname in p2p_go_invite_auth
Once the connection is established need to call group_form_result() on
the invited device, as otherwise the group interface name is not updated
and the connectivity test is done with the main interface instead of the
group interface.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-05 13:38:10 +02:00
Ilan Peer 098a687ffb tests: Use global control interface in discovery_dev_id
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-05 13:38:10 +02:00
Ilan Peer acd620258d tests: Modify autogo_legacy to use the group interface
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-05 13:38:10 +02:00
Ilan Peer b0d697be91 tests: Use global control interface in wait_go_ending_session()
P2P_EVENT_GROUP_REMOVED is a global event, so use
wait_global_event() instead of wait_event().

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-05 12:50:44 +02:00
Jouni Malinen 644b24c6bb tests: Verify SD TX callback processing after P2P find is stopped
These are far from perfect since timing is quite difficult to match for
the case that behaved incorrectly. Anyway, it looks loke
p2p_service_discovery_peer_not_listening was able to hit the error now
and then, so this should be sufficient as a regression test case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-04 20:47:14 +02:00
Jouni Malinen c4f34de90d tests: P2PS and persistent group
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-03 17:00:56 +02:00
Jouni Malinen 12a793a606 tests: Increase grpform_ext_listen coverage
Include actual extended listen period in the test and confirm that the
device was available on a social channel during such period by using
non-social operating channel.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-03 16:43:02 +02:00
Jouni Malinen 2acd2985c6 tests: P2P_PROV_DISC error case
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-03 16:30:27 +02:00
Jouni Malinen 9406905384 tests: P2P listen channel optimization
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-03 16:22:59 +02:00
Jouni Malinen 2e6085c27b tests: OBSS scanning report processing
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-03 13:26:27 +02:00
Rajiv Ranjan 5095a6b6fc tests: P2P services
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-03 01:42:24 +02:00
Jouni Malinen 364e28c982 tests: Restore p2ps config_method in dbus_get_set_wps
This test case is modifying the list of enabled config_method values and
needs to restore "p2ps" option that is included by default. Without
this, P2PS executed after dbus_get_set_wps could fail.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-03 01:35:07 +02:00
Jouni Malinen f4cd0f6454 tests: EAP-PEAP/MSCHAPv2 password failure
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-02-01 17:37:35 +02:00
Jouni Malinen 54f2cae2e6 tests: Make *_key_lifetime_in_memory more robust
It was possible for the GTK-found-in-memory case to be triggered due to
a retransmission of EAPOL-Key msg 3/4 especially when running test cases
under heavy load (i.e., timeout on hostapd due to not receiving the 4/4
response quickly enough). Make this false failure report less likely by
waiting a bit longer after the connection has been completed before
fetching the process memory.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-31 18:06:06 +02:00
Jouni Malinen a1512a0cc7 tests: wpa_supplicant and station interface in a bridge
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-31 17:28:08 +02:00
Jouni Malinen db5f6b2ca3 tests: RSN pre-authentication OOM in wpa_supplicant
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-31 13:45:52 +02:00
Jouni Malinen 7afa678033 tests: RSN pre-authentication timeout
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-31 13:35:31 +02:00
Jouni Malinen d2432b8b7e tests: PMKSA cache size limit in wpa_supplicant
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-31 13:26:46 +02:00
Jouni Malinen 19879b4572 tests: Invalid NFC NDEF record handling
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-31 02:00:02 +02:00
Jouni Malinen 55c430b63c tests: Add capture file validation for IPv6 in proxyarp_open
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-30 21:55:46 +02:00
Jouni Malinen efd0a6fbf1 tests: Add capture file validation for IPv4 in proxyarp_open
Verify that the expected frames were seend and unexpected frames
weren't.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-30 18:55:22 +02:00
Jouni Malinen 210a4f6a13 tests: Add another bridge port to proxyarp_open
Use another AP instance as a separate bridge port in the proxyarp_open
test cases to increase testing coverage for kernel proxyarp
functionality.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-30 18:55:22 +02:00
Jouni Malinen 87f0ede914 tests: Add brctl showmacs output to proxyarp_open test cases
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-30 18:55:22 +02:00
Jouni Malinen 9934ee1967 tests: Run the proxyarp_open test case both with and without ebtables
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-30 18:55:22 +02:00
Jouni Malinen 2076846cc4 tests: Fix tshark refactoring
Commit 2e1d7386e2 ('tests: Refactor tshark
running') added a helper function for running tshark. However, it did
not use the filter argument correctly, added an extra -Tfields on the
command line, and failed to use global variable. In practice, this ended
up disabling all the tshark sniffer checks. Fix that by using the filter
argument from the caller and marking the _tshark_filter_arg global.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-30 18:55:22 +02:00
Jouni Malinen 3a4bace428 tests: RADIUS server changing VLAN ID assignment
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-30 01:11:56 +02:00
Jouni Malinen 3b86e9d52c tests: PMKSA caching OOM error cases
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-30 00:14:57 +02:00
Jouni Malinen 915135e055 tests: hostapd OOM loop tests for WPA2-PSK and WPA2-EAP connection
These verify number of previously uncovered error paths.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-29 22:33:25 +02:00
Jouni Malinen cdebd24db6 tests: OLBC AP table error cases
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-29 21:11:41 +02:00
Jouni Malinen 496a7a6ff9 tests: hostapd OOM loop targeting RADIUS accounting
The hostapd_oom_wpa2_eap test case did not always catch these code
paths, so add a variant of that test case explicitly targeting RADIUS
functions.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-29 20:52:30 +02:00
Jouni Malinen 2c528e9690 tests: cfg80211 DEL_STATION issued externally to hostapd
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-29 16:26:31 +02:00
Jouni Malinen 4a4cd04cad tests: RADIUS MAC ACL and accounting enabled
This ends up using the special User-Name = STA MAC address case for
Accounting-Request. In addition, add Chargeable-User-Identity for one of
the STAs.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-29 15:55:48 +02:00
Jouni Malinen ef318402f6 tests: EAP-MSCHAPv2 server out-of-memory cases
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-28 16:17:25 +02:00
Jouni Malinen 95a15d793e tests: EAP-GTC server error cases
In addition, no-password-configured coverage extended to EAP-MD5 and
EAP-MSCHAPv2 as well.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-28 15:59:36 +02:00
Jouni Malinen 467775c5ac tests: Pending EAP peer processing with VENDOR-TEST
This extends the VENDOR-TEST EAP method peer implementation to allow
pending processing case to be selected at run time. The
ap_wpa2_eap_vendor_test test case is similarly extended to include this
option as the second case for full coverage.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-28 13:09:31 +02:00
Jouni Malinen a08fdb17aa tests: EAPOL supplicant invalid frame handling
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-28 13:09:31 +02:00
Jouni Malinen 48bb2e68c0 tests: STATUS-VERBOSE
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-28 13:09:31 +02:00
Jouni Malinen 37551fe374 tests: Suite B 192-bit profile
This adds a Suite B test case for 192-bit level.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-27 01:43:55 +02:00
Jouni Malinen 4113a96bba tests: Complete Suite B 128-bit coverage
Enable BIP-GMAC-128 and enforce Suite B profile for TLS.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-27 01:43:55 +02:00
Jouni Malinen f918b95b9d tests: Fix ft_psk_key_lifetime_in_memory with new PTK derivation debug
PTK is not printed out anymore as a single entry, so fetch KCK, KEK, and
TK separately.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-27 01:43:55 +02:00
Jouni Malinen 287eb3f9d7 tests: Group management frame cipher suites
This extends testing coverage of PMF group management cipher suites to
include all the cases supported by the driver (existing BIP =
AES-128-CMAC and the new BIP-GMAC-128, BIP-GMAC-256, BIP-CMAC-256).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-24 19:37:42 +02:00
Jouni Malinen fba25c99a5 tests: Make ap_wps_er_pbc_overlap more robust
Reorder scanning in a way that allows the ER behavior to be more
predictable. The first Probe Request report is for a previously received
frame on the AP and this new sequence avoids leaving either of the PBC
test STAs to be that one.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-23 00:52:56 +02:00
Jouni Malinen 90ad11e625 tests: Make active scans more robust
This makes testing under very heavy load or under extensive kernel
debugging options more robust by allowing number of test cases to scan
multiple times before giving up on active scans. The main reason for
many of the related test failures is in Probe Response frame from
hostapd not getting out quickly enough especially when multiple BSSes
are operating.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-23 00:52:40 +02:00
Jouni Malinen 1f53fe0310 tests: P2P group formation using PBC multiple times in a row
This verifies that PBC session overlap detection does not get indicated
when forming the group with the same peer multiple times.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-22 20:53:03 +02:00
Jouni Malinen 180a858f76 tests: P2P_SERV_DISC_CANCEL_REQ during query
This is a regression test case for a specific sequence that could result
in wpa_supplicant NULL dereference when a SD request is cancelled before
the SD Request TX status callback has been processed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-22 15:55:36 +02:00
Jouni Malinen a60dbbce44 tests: ANQP-QUERY-DONE event
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-20 02:26:21 +02:00
Jouni Malinen 31b7ecb6c8 tests: P2P NFC invitiation with driver using cfg80211 P2P Device
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-20 01:57:59 +02:00
Jouni Malinen 2dc18e9a26 tests: Error handling for scan trigger failure cases
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-19 20:25:22 +02:00
Jouni Malinen e60be3b3d4 tests: WPS registrar learning configuration from WPA+WPA2 AP
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-19 18:39:13 +02:00
Jouni Malinen 059bcc4782 tests: Increase hostapd out-of-memory loop coverage
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-19 02:35:43 +02:00
Jouni Malinen 214457de15 tests: WPA + WEP configuration getting rejected
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-19 01:11:36 +02:00
Jouni Malinen 9eadcfbf06 tests: Add step-by-step guide for setting up test framework
This set of notes provides information on how virtual guess OS can be
used to run the mac80211_hwsim test cases under any host OS. The
specific example here uses Ubuntu 14.04.1 server as the starting point
and lists the additional packages that need to be installed and commands
that can be used to fetch and build the test programs.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-18 18:11:11 +02:00
Jouni Malinen a66d2248a0 tests: Close wlan5 control interface monitor more explicitly
There were couple of common cases where the control interface for the
dynamic wpa_supplicant instance could have been left in attached state
until Python ends up cleaning up the instance. This could result in
issues if many monitor interface events were queued for that attached
socket. Make this less likely to cause issues by explicitly detaching
and closing control interfaces before moving to the next test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-18 17:13:55 +02:00
Jouni Malinen 7f08b2f91d tests: Make WNM Sleep Mode tests more robust
It was possible for the Action frame used for entring WNM Sleep Mode to
get dropped on the AP side due to it arriving prior to having processed
EAPOL-Key message 4/4 due to a race condition between Data and
Management frame processing paths. Avoid this by waiting for
AP-STA-CONNECTED event from hostapd prior to trying to enter WNM Sleep
Mode. In addition, make the check for the STA flag change more robust by
allowing the wait to be a bit longer with a loop that terminates as soon
as the flag has changed.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-18 15:58:05 +02:00
Jouni Malinen 7cc9a81f1e tests: Make PMKSA caching tests more robust
When the STA is forced to disconnect immediately after completion of
4-way handshake, there is a race condition on the AP side between the
reception of EAPOL-Key msg 4/4 and the following Deauthentication frame.
It is possible for the deauthentication notification to be processed
first since that message uses different path from kernel to user space.

If hostapd does not receive EAPOL-Key msg 4/4 prior to deauthentication,
no PMKSA cache entry is added. This race condition was making the test
cases expecting PMKSA caching to work to fail every now and then. Avoid
this issue by waiting for AP-STA-CONNECTED event from hostapd. This
makes sure the PMKSA cache entry gets added on the AP side.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-18 15:47:56 +02:00
Jouni Malinen d4155eb78a tests: Add some more time for olbc_ht update in olbc_5ghz
It looks like this test case is failing every now and then, so add some
more time for the olbc_ht value to get updated before reporting a
failure.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-18 12:55:49 +02:00
Jouni Malinen b4de353c85 tests: Import gobject in a way that allows failures
It looks like the gobject module does not get installed by default for
Python at least on Ubuntu server, so modify the D-Bus test case files to
import this in a way that allows other test cases to be run even without
gobject module being installed.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-18 12:50:20 +02:00
Jouni Malinen 57f08b3f3a tests: Make ap_anqp_sharing more robust
This test case uses get_bss() with a BSSID to find a BSS entry. That can
result in failures if there are multiple BSS entries in wpa_supplicant
BSS table for the same BSSID, e.g., due to an earlier hidden SSID test
case. Explicitly clear the cfg80211 and wpa_supplicant scan caches at
the beginning of this test case to make it less likely for earlier test
cases to trigger a failure here.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-18 12:50:20 +02:00
Jouni Malinen 296186c006 tests: Make ap_mixed_security more robust
This test case uses get_bss() with a BSSID to find a BSS entry. That can
result in failures if there are multiple BSS entries in wpa_supplicant
BSS table for the same BSSID, e.g., due to an earlier hidden SSID test
case. Explicitly clear the cfg80211 and wpa_supplicant scan caches at
the beginning of this test case to make it less likely for earlier test
cases to trigger a failure here.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-18 12:50:20 +02:00
Jouni Malinen 092ac7bb0e tests: Hotspot 2.0 ANQP fetch with hidden SSID BSS entry
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-18 12:50:20 +02:00
Jouni Malinen 3dacd58b0d tests: Write BSS table to debug log in ap_mixed_security
This makes it easier to debug test failures in BSS entry flags field.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-17 17:22:38 +02:00
Jouni Malinen 7e3a6c9e21 tests: Mark proxyarp_open as skip if traffic test fails
This step requires kernel changes that are not yet in upstream Linux
tree, so mark this as skip rather than failure for now.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-17 17:15:42 +02:00
Jouni Malinen 0258cf1006 tests: Clean up ap_wpa2_eap_aka_ext
Use a loop over set of test values instead of duplicated functionality
implemented separately for each case.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-17 17:09:46 +02:00
Jouni Malinen 584e4197bd tests: Make ap_wpa2_eap_aka_ext faster and more robust
Use SELECT_NETWORK instead of REASSOCIATE for the first reconnection to
avoid unnecessary long wait for temporary network disabling to be
cleared. In addition, wait for the disconnect event after issuing the
DISCONNECT commands to avoid issues due to any pending events during the
immediately following reconnection attempt.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-17 16:59:40 +02:00
Jouni Malinen 27f527e0e2 tests: ap_hs20_fetch_osu: Print osu-providers.txt in debug log
This makes it easier to figure out what happened if the test case fails
due to not finding all the needed OSU-PROVIDER information.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-17 16:03:43 +02:00
Jouni Malinen a4a15cf1f9 tests: Skip some scan tests if iw does not support scan flush
The external cfg80211 scan flushing operation requires a relatively
recent iw version and not all distributions include that. Avoid false
failure reports by marking these test cases skipped if the iw command
fails.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-17 13:05:34 +02:00
Jouni Malinen e246d7d5b3 tests: Fix test skipping for some DFS/VHT cases
Due to a typo and missing hapd variable initialization, some of the DFS
and VHT test cases were marked as failures even though they were
supposed to be marked as skipped in case the kernel and wireless-regdb
did not have sufficient support for these modes.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-17 13:04:11 +02:00
Jouni Malinen fb9adae466 tests: Fix dbus_probe_req_reporting_oom if already registered
If dbus_probe_req_reporting was run before dbus_probe_req_reporting_oom,
the SubscribeProbeReq() method succeeded since the memory allocation
that was supposed to fail in the OOM test case was not even tried.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-17 12:39:00 +02:00
Jouni Malinen 90b10d4edd tests: EAP-TNC fragmentation
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-17 12:12:33 +02:00
Jouni Malinen ee9533eb0e tests: EAP-MD5 server error cases
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-17 12:02:11 +02:00
Jouni Malinen 802bf82482 tests: Add optional -1 argument to parallel-vm.py
This can be used to skip rerunning of failed test cases
(e.g., with "./parallel-vm.py 1 -1 <test case>").

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-17 11:28:46 +02:00
Jouni Malinen e912e4bc92 tests: Interworking auto_interworking=1 with mismatching BSS
This is a regression test case to detect a failure that resulted in an
up to five second busy loop through wpa_supplicant_fast_associate() when
interworking_find_network_match() and wpa_supplicant_select_bss() get
different matching results.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-17 01:53:44 +02:00
Jouni Malinen 6ace81ea77 tests: Disconnect-Request with no session identification attributes
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-16 16:16:28 +02:00
Jouni Malinen 9921689759 tests: Use a helper function to send and check RADIUS DAS messages
No need to have this same sequence of steps duplicated in multiple
places.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-16 16:14:54 +02:00
Jouni Malinen 05dad77c8f tests: RADIUS DAS and Disconnect-Request removing PMKSA cache entry
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-16 16:07:52 +02:00
Jouni Malinen e94a3f626d tests: RADIUS DAS with Acct-Multi-Session-Id
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-16 13:10:48 +02:00
Jouni Malinen 9142b4dd45 tests: Disconnect-Request multi-session-match
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-16 12:50:16 +02:00
Jouni Malinen c2b48088f6 tests: Fix radius_das_disconnect match + non-match case
If Calling-Station-Id matches, but CUI does not, NAS is expected to
reject the request instead of accepting it. Verify that Disconnect-NAK
is returned for this.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-16 12:50:16 +02:00
Jouni Malinen 201c9ad77f tests: STA not getting response to SA Query
This verifies that wpa_supplicant reconnects if PMF is enabled,
unprotected Deauthentication/Disassociation frame is received, and the
AP does not reply to SA Query.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-16 01:13:59 +02:00
Jouni Malinen e1f8fe8851 tests: INTERWORKING_CONNECT after having found hidden SSID AP
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-15 12:29:02 +02:00
Jouni Malinen 061cbb258f tests: domain_match checking against server certificate
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-14 15:45:18 +02:00
Jouni Malinen 2099fed400 tests: dbus_connect_eap to verify dNSName constraint configuration
This verifies that Certification signals include the expected
information on peer certificates and that dNSName constraint can be
configured based on that and is working both in matching and not
matching cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-14 15:45:18 +02:00
Jouni Malinen 496c4e45d8 tests: Subset of VHT functionality on 2.4 GHz
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-14 01:12:56 +02:00
Jouni Malinen 615d8a9705 tests: Add room for more vendor elems in wpas_ctrl_vendor_elem
This test case was verifying that the first unused VENDOR_ELEM value
above the current maximum is rejected. That makes it a bit inconvenient
to add new entries, so increase the elem value to leave room for new
additions without having to continuously modify this test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-14 01:12:56 +02:00
Jouni Malinen 37b4a66ce6 tests: Valid OCSP response with revoked and unknown cert status
This increases testing coverage for OCSP processing by confirming that
valid OCSP response showing revoked certificate status prevents
successful handshake completion. In addition, unknown certificate status
is verified to prevent connection if OCSP is required and allow
connection if OCSP is optional.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-12 00:19:21 +02:00
Jouni Malinen 279a0afffb tests: Generate a fresh OCSP response for each test run
GnuTLS has a hardcoded three day limit on OCSP response age regardless
of the next update value in the response. To make this work in the test
scripts, try to generate a new response when starting the authentication
server. The old mechanism of a response without next update value is
used as a backup option if openssl is not available or fails to generate
the response for some reason.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-12 00:19:21 +02:00
Jouni Malinen 0ff7afbc42 tests: Verify mesh support for wpas_add_set_remove_support
This test case fails if wpa_supplicant is built without mesh support, so
need to check for this.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-12 00:19:21 +02:00
Jouni Malinen 2f0347954a tests: Check mesh capability based on the modes capabilities list
This is more robust than checking the driver capability because it is
also possible for the wpa_supplicant build to be configured without mesh
support regardless of whether the driver supports it.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-12 00:19:21 +02:00
Jouni Malinen b9749b6aaa tests: Verify that SAE is supported for test cases requiring it
This makes it more convenient to run tests with wpa_supplicant builds
that do not support SAE (e.g., due to crypto library not providing
sufficient functionality for this).

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-12 00:19:21 +02:00
Jouni Malinen 4bf4e9db86 tests: Skip ap_wpa2_eap_ttls_server_cert_hash if probing not supported
The ca_cert="probe://" functionality is currently supported only with
OpenSSL.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-12 00:19:21 +02:00
Jouni Malinen 62750c3e80 tests: Use RSA key format in ap_wpa2_eap_tls_blob
This format as a DER encoded blob is supported by both OpenSSL and
GnuTLS while the previous OpenSSL specific format did not get accepted
by GnuTLS.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-12 00:19:21 +02:00
Jouni Malinen 24579e7047 tests: Split domain_suffix_match test cases based on match type
With GnuTLS, domain_suffix_match is currently requiring full match, so
split the test cases in a way that can be reported more cleanly as PASS
or SKIP based on TLS library behavior.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-12 00:19:21 +02:00
Jouni Malinen 524c6c33bc tests: Add ca_cert to username/password Hotspot 2.0 credentials
Proper configuration should be used here to get server validation
enabled, so update the test cases to provide the ca_cert parameter. This
was included in number of existing test cases, but not all.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-12 00:19:21 +02:00
Jouni Malinen 506b2f05f2 tests: Split subject_match and altsubject_match to separate test cases
These parameters are supported only with OpenSSL, so split any test case
that used those for a successful connection into two test cases. Skip
all test cases where these are used without the selected TLS library
supporting them to avoid reporting failures incorrectly. Though, verify
that subject_match and altsubject_match get rejected properly if TLS
library does not support these.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-12 00:19:21 +02:00
Jouni Malinen 3b51cc6359 tests: Skip EAP-pwd and EAP-FAST test cases if not supported
Check wpa_supplicant EAP capability and skip EAP-pwd and EAP-FAST test
cases if the build did not include support for these. This is cleaner
than reporting failures for such test cases when the selected TLS
library does not support the EAP method.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-12 00:19:21 +02:00
Jouni Malinen a783340d04 tests: Skip OpenSSL cipher string tests with other TLS libraries
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-12 00:19:21 +02:00
Jouni Malinen 37d6135507 tests: Increase altsubject_match testing coverage
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-11 00:27:01 +02:00
Jouni Malinen c2096d9981 tests: bssid_blacklist and bssid_whitelist
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-10 17:35:53 +02:00
Jouni Malinen 70437ae55a tests: Drop mesh_ht_mode parameter from mesh test cases
This network profile parameter will be removed with the cleanup that
makes mesh use shared functions for setting channel parameters. That
will allow HT to be enabled automatically based on driver capabilities.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-10 17:35:53 +02:00
Jouni Malinen de1d5049dc tests: Mesh in 5 GHz band
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-10 17:35:53 +02:00
Johannes Berg 2e1d7386e2 tests: Refactor tshark running
Refactor the code to run tshark into its own submodule. This allows
even remembering whether -Y or -R needs to be used for filtering.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-01-10 00:53:57 +02:00
Jouni Malinen 0e126c6dca tests: Out-of-memory cases for D-Bus operations
This increases testing coverage on various error paths.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-09 02:46:26 +02:00
Jouni Malinen 795b6f57a8 tests: Additional D-Bus error path coverage
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-09 02:32:15 +02:00
Jouni Malinen cd9548c02f tests: Add out-of-memory loop tests for hostapd startup
These test cases run hostapd interface setup multiple times with
TEST_ALLOC_FAIL commands triggering memory allocation failures one by
one at each possible location in the setup sequence. Effectively, these
test cases will hit most error paths for memory allocation issue cases
(i.e., only the cases requiring more than one allocation failure in a
sequence are not covered).

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-08 22:43:48 +02:00
Jouni Malinen f7af5a48f4 tests: hostapd BSS addition failures
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-08 22:43:48 +02:00
Jouni Malinen fff95bb614 tests: hostapd interface setup and memory allocation failures
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-08 22:43:48 +02:00
Jouni Malinen f12240a371 tests: Memory allocation failure in wpa_supplicant blacklist
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-08 22:43:48 +02:00
Jouni Malinen 81e787b750 tests: Convert test skipping to use exception
Instead of returning "skip" from the test function, raise the new
HwsimSkip exception to indicate a test case was skipped.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-08 22:43:47 +02:00
Johannes Berg 9c8779daf6 tests: Use rfkill python module
Instead of calling the rfkill binary, use the built-in module.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-01-08 20:56:54 +02:00
Johannes Berg bd31b92a68 tests: Add rfkill module
This can be used instead of invoking the rfkill binary.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-01-08 20:56:47 +02:00
Jouni Malinen 6a964b7560 tests: Make scan_random_mac more robust
There is a race condition between wlantest having received and written
the sniffer log and this test case using tshark to process it. Wait one
second before running tshark to make it less likely to get truncated
results that can result in the test case failing.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-07 16:31:22 +02:00
Jouni Malinen 51c5aeb42a tests: Convert "hwsim-SKIP" exception to use a custom class
This makes the design a bit cleaner for catching the exceptions.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-07 16:31:22 +02:00
Jouni Malinen 910eb5b525 tests: Import dbus module in a cleaner way
There is no need to use prepare_dbus() function to check whether the
dbus module can be imported.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-07 13:29:25 +02:00
Jouni Malinen c975e1c1da tests: Additional bgscan coverage
Verify error cases in bgscan module parameters. Increase learn bgscan
module coverage with parsing of the saved data and probe frequency
selection.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-06 02:49:13 +02:00
Jouni Malinen 59be78ef93 tests: Move SHA256 test cases into hwsim framework
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-05 17:34:20 +02:00
Jouni Malinen 4b462a0226 tests: Move SHA1 test cases into hwsim framework
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-05 17:29:00 +02:00
Jouni Malinen 896e1b836f tests: Move MD5 test cases into hwsim framework
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-05 17:12:27 +02:00
Jouni Malinen 88fc0dca98 tests: Move ms_funcs test cases into hwsim framework
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-05 17:05:42 +02:00
Jouni Malinen 1244408401 tests: Move AES key wrap/unwrap test cases into hwsim framework
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-05 16:35:59 +02:00
Jouni Malinen 477f83131f tests: Move AES-CBC test cases into hwsim framework
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-05 16:28:46 +02:00
Jouni Malinen e438fb0d3a tests: Move AES-128 EAX mode test cases into hwsim framework
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-05 16:24:42 +02:00
Jouni Malinen 304d40e904 tests: Move OMAC1-AES test cases into hwsim module tests
This makes sure the test cases are executed automatically with rest of
the hwsim tests.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-05 16:02:08 +02:00
Jouni Malinen 942b75468d tests: Add module tests for AES-SIV
This moves the AES-SIV test case from tests/test-aes.c to be part of
wpa_supplicant module testing framework with a new
src/crypto/crypto_module_tests.c component. In addition, the second test
vector from RFC 5297 is also included for additional coverage.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-05 15:50:53 +02:00
Jouni Malinen 8aeb6e3dbc tests: MAC_RAND_SCAN with valid and invalid arguments
This verifies that random MAC address is used as requested in Probe
Request frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-04 23:06:58 +02:00
Jouni Malinen 5434f07c20 tests: TDLS channel switching
Verify correct behavior with invalid commands. In addition, allow minor
mac80211_hwsim modifications to be used to enable testing of the driver
interface to enable and disable channel switching.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-04 21:46:38 +02:00
Eliad Peller 41bf76447b tests: WMM-AC reassociation-to-same-BSS test
Make sure the tspecs are kept on reassociation to the same BSS.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
2015-01-04 18:59:07 +02:00
Eliad Peller bc32f830f4 tests: wmm_ac_status and roaming case with WMM-AC
Make sure the wmm_ac_status command reflects correctly the existing
tspecs after add_ts/del_ts commands. Add a new test to verify all tspecs
are removed on roaming (while FT is not used).

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
2015-01-04 18:57:23 +02:00
Jouni Malinen 750904dd42 tests: Extend EAP key lifetime in memory to cover MSK and EMSK
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-03 15:49:57 +02:00
Jouni Malinen ce8ca2f9a0 tests: Make wpas_mesh_max_peering more robust
The previous version was enabling all three stations at the same time
and left dev[1] and dev[2] competing on getting connected with dev[0]
that allowed only one pairing. This was not exactly robust and the pass
criteria depended on an extra event from either dev[1] or dev[2]. Fix
that by first connecting dev[0] and dev[1] and only after that, start
dev[2]. This allows proper validation of both the peering limit on
dev[0] and no extra event on dev[2].

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-02 22:50:27 +02:00
Jouni Malinen 29bac7cb89 tests: Make scan_hidden more robust under heavy CPU load
It is possible for the Probe Response frame wait to time out when active
scanning is used under heavy CPU load. Make this test case more robust
by trying multiple times before declaring the scan for a hidden SSID to
have failed.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-02 22:50:27 +02:00
Jouni Malinen 2ec82e67c1 tests: wpa_supplicant D-Bus interface
This adds new files with test cases to verify both the old and new
wpa_supplicant D-Bus interface.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-02 22:50:27 +02:00
Jouni Malinen b0839232fa tests: Enable wpa_supplicant D-Bus support for hwsim tests
This allows automated testing of the wpa_supplicant D-Bus interface. The
instance controlling wlan0 registers with D-Bus if dbus-daemon was
started successfully. This is only used in VM testing, i.e., not when
run-tests.sh is used on the host system with D-Bus running for normal
system purposes.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-02 22:50:27 +02:00
Jouni Malinen 5b3c40a65b tests: Verify that wpa_supplicant clears keys from memory
Check that PMK and PTK and not left in memory (heap or stack)
unnecessarily after they are not needed anymore.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-30 10:37:02 +02:00
Jouni Malinen 13113d127c tests: Filter out extra files from codecov reports
wpa_cli and hostapd_cli are not currently tested for code coverage, so
filter the files specific to those components away from the code
coverage reports. *_module_tests.c are not included in normal builds, so
drop them as well. In addition, drop the system header file (byteswap.h)
that gets somehow unnecessarily included in the reports for couple of
lines.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-29 18:27:23 +02:00
Jouni Malinen 7fe84009f8 tests: Reorder build.sh operations
This leaves the build tree with valid wpa_supplicant object files in the
end and makes it a bit easier to do additional custom builds when
needed.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-29 15:49:05 +02:00
Jouni Malinen 185275228d tests: Use QUIET=1 option to make build.sh output much shorter
Report only fatal errors when building binaries for hwsim testing.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-29 15:49:05 +02:00
Jouni Malinen 31705bf4fc tests: Skip mesh test cases if kernel does have CONFIG_MAC80211_MESH
Previously, these test cases were marked as failures, but it is nicer to
mark as skipped if the kernel does not include support for mesh.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-29 15:49:05 +02:00
Jouni Malinen e2a8db7785 tests: Report missing erp support more nicely in wpas_ctrl_get_capability
Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-29 15:49:05 +02:00
Jouni Malinen 84512f8c9b tests: Support older tshark versions
The -Y command line argument may need to be replaced with -R when an
older tshark version is used.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-29 15:49:05 +02:00
Jouni Malinen 8c6f6ac100 tests: Allow DFS test cases to be skipped
Some of the newer dfs_radar* test cases did not allow hostapd
startup to fail. Since these require relatively recent kernel
support, mark the test cases with skip rather than fail based
on that step failing.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-29 15:49:05 +02:00
Jouni Malinen 752d58c775 tests: Allow SMPS test case to be skipped
ap_ht_smps needs relatively recern kernel support, so allow it to be
skipped rather than claimed as failure, in case hostapd startup fails.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-29 15:49:04 +02:00
Jouni Malinen 6532a84ed3 tests: Fix --codecov cases to find correct wpa_cli/hostapd_cli
It was possible for the separate builds to not include
wpa_cli/hostapd_cli in the default location. Make sure hostapd_cli gets
built for --codecov cases and update both WPACLI and HAPDCLI paths to
match the alternative location.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-29 15:49:04 +02:00
Jouni Malinen de677292d5 tests: Verify that hostapd-as-RADIUS-server started
Large number of test cases will fail if hostapd fails to start as the
RADIUS server. To make this more obvious, verify that the RADIUS server
instance is running and do not even start test execution if the setup if
not work properly.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-26 13:21:00 +02:00
Jouni Malinen ed8a1fa496 tests: Limit number of failed test cases in the curses output
It was possible for the scr.addstr() operations to fail and terminate
parallel-vm.py if the number of failed test cases increased beyond what
fits on the screen.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-26 13:21:00 +02:00
Jouni Malinen c715b31f18 tests: Clear active PBC mode from cfg80211 BSS table in p2p_channel
This reduces number of test combinations in which PBC session overlap
could have been indicated incorrectly.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-25 16:37:12 +02:00
Jouni Malinen dd859e20ac tests: Make p2p_channel test cases more robust
Wait for a CTRL-EVENT-REGDOM-CHANGE even before returning from
set_country() to avoid issues with test operations being executed before
all components have had chance to update their regulatory domain
information. Some of these test cases could fail under heavy load.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-25 16:37:12 +02:00
Jouni Malinen 1f4de34ec1 tests: Maintain test result counters through the run
This avoids having to go through the full output buffer from each
VM for each update during a test run.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-25 16:37:12 +02:00
Jouni Malinen 8041102874 tests: Process VM stdout output in full lines
Merge partial lines together before processing them in parallel-vm.py.
This avoids issues in cases where the stdout read gets split into pieces
that do not include the full READY/PASS/FAIL/SKIP information. In
addition, strip unnecessary whitespace (mainly, '\r') from the log
lines.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-25 16:37:12 +02:00
Jouni Malinen 1942b68172 tests: Disable terminal echo for stdin control (-i)
This makes vm-run.sh output cleaner to parse for parallel-vm.py.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-25 16:37:12 +02:00
Jouni Malinen 2e0d48e5c8 tests: Do not print to stdout during test execution
This cleans up vm-run.sh output and makes information more easily
available from the *.log files.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-25 16:37:12 +02:00
Jouni Malinen d3fb9c1403 tests: Add debug logging for parallel-vm.py
parallel-vm.log is now written with details of test execution steps and
results. This makes it easier to debug if something goes wrong in VM
monitoring. The --debug option can be used to enable verbose debugging.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-25 16:36:51 +02:00
Jouni Malinen 3eb1db0377 tests: Retry failed cases automatically in parallel VM run
parallel-vm.py is now retrying failed cases once at the end of the run.
If all the failed test cases passed on the second attempt, that is noted
in the summary output. Results are also indicated as the exit value from
the run: 0 = all cases passed on first run, 1 = some cases failed once,
but everything passed after one retry, 2 = some cases failed did not
succeed at all.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-23 22:25:29 +02:00
Jouni Malinen a628eeb42b tests: Add more long duration test cases to parallel-vm.py list
This adds the remaining test cases that took more than 15 seconds to run
into the list of test cases to run at the beginning of the execution to
avoid these being left at the end when only some of the VMs may be
running.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-23 20:34:13 +02:00
Jouni Malinen 6d930a1eef tests: Optimize ap_qosmap test cases
Avoid unnecessary DATA_TEST_CONFIG calls and wlantest_cli invocations to
speed up the test cases. This drops ap_qosmap execution time from about
14 seconds to under 3 seconds.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-23 17:46:34 +02:00
Jouni Malinen 4905f1ebfe tests: Optimize multi_check() waits in ap_bss_add* and ap_multi_bss*
There is no need to wait for the longer fixed duration for each STA when
an event message or an earlier wait for another STA can be used instead.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-23 17:20:18 +02:00
Jouni Malinen 610cfff5d7 tests: Make scan_hidden* more robust
Clear cfg80211 BSS table more carefully after the scan_hidden* test
cases. At least scan_hidden_many could have left behind a hidden SSID
entry that could cause problems for following scan_bss_operations test
case.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-23 16:15:11 +02:00
Jouni Malinen e0cfd223c0 tests: Fix mesh no_auto_peer=1 test cases to allow enough time for retry
If the initial Authentication frame was too early for the peer (i.e.,
NEW_PEER_CANDIDATE event arrived only after the Authentication frame),
wpas_mesh_open_no_auto and wpas_mesh_secure_no_auto test cases were
failing since they waited only for 10 seconds for the connection to be
completed while the retry timer was set to 10-20 seconds on the
authenticator side.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-23 13:10:22 +02:00
Jouni Malinen 9828b70ebd tests: Fix wpas_ctrl_data_test with Linux 3.19-rc1
The kernel commit 'packet: make packet_snd fail on len smaller than l2
header' started rejecting <= 14 octet raw packet socket transmission.
This test case was testing with 14 ocets and that is now rejected by the
kernel. While this may be a kernel side issue, use one octet longer test
data for now to avoid undesired FAIL cases in hwsim tests.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-23 12:27:14 +02:00
Jouni Malinen b2eb3fe21c tests: Fix ap_ht_40mhz_intolerant_ap
The previous design did not actually break from the wait loop when the
AP changed back to 40 MHz channel and as such, ended up waiting the full
30 second time. Furthermore, the five second delay time for returning
back to 40 MHz was not sufficiently long to test behavior correctly
since the STA did not have any chances of returning the next coex report
before the AP had returned to 40 MHz. Increase the AP wait time to 15
seconds so that the once per 10 seconds OBSS scan from the STA gets in
before changing back to 40 MHz channel (after the 40 MHz intolerant AP
gets disabled).

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-22 22:07:54 +02:00