Commit Graph

61 Commits (vlan_per_psk)

Author SHA1 Message Date
Jouni Malinen bcfcb247db tests: hostapd airtime policy configuration
Add minimal testing for airtime policy configuration. mac80211_hwsim
does not actually support this functionality, so this is just for
testing coverage of src/ap/airtime_policy.c.

Signed-off-by: Jouni Malinen <j@w1.fi>
3 years ago
Jouni Malinen b385b4765d tests: ADD_MAC/DEL_MAC special cases
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years ago
Jouni Malinen 8884e33eef tests: WMM parameter update failing during beacon template update
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years ago
Jouni Malinen 045a24273e tests: MAC ACL accept list changes
Signed-off-by: Jouni Malinen <j@w1.fi>
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
Jouni Malinen 83c9b69b01 tests: Wait a bit to get Beacon frames into capture
The ap_beacon_rate_* test cases could end up terminating before the very
first Beacon frame is captured, so wait a bit after the connection to
make sure at least one Beacon frame is going to be in the capture file.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen 40341e16a5 tests: Move check_wep_capa() into utils.py
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen 20cace9014 tests: WPA2-EAP AP with STA using 4addr mode
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen 200c7693c9 Make WEP functionality an optional build parameter
WEP should not be used for anything anymore. As a step towards removing
it completely, move all WEP related functionality to be within
CONFIG_WEP blocks. This will be included in builds only if CONFIG_WEP=y
is explicitly set in build configuration.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen af9d8c758d tests: Use proper temp files for dynamically created config
Replace the hardcoded /tmp filenames for generated ACL and BSS
configuration files with proper temporary files from tempfile.mkstemp()
to avoid conflicts with existing files or with parallel uses. Remove ACL
files from the local directory at the end of each test case. BSS files
are currently left behind, but can be cleaned up separately if needed
for non-VM testing (VM testing has those on ramdrive so they get dropped
automatically at the end) and for remote devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Janusz Dziedzic 4d14838421 tests: Generate ACL files
Generate ACL files instead of using files with hardcoded values for the
STA MAC addresses. Send the generated files also to the remote client if
required.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years ago
Jouni Malinen e01a492caa tests: Helper function for DISCONNECT + ABORT_SCAN + wait
Use a helper function to perform this common sequence to disconnect and
stop any possibly started reconnection attempt.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years ago
Jouni Malinen 2b4263d06f tests: Handle scan result clearing more carefully in ap_country
If the ABORT_SCAN command succeeds, CTRL-EVENT-SCAN-RESULTS event is
delivered for the aborted scan. Following this with an immediate
flush_scan_cache() call can result in the first scan interpreting that
pending event as the completion and that results in trying to start
another scan while the first scan is still in progress.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years ago
Jouni Malinen fab49f6145 tests: Python coding style cleanup (pylint3 bad-whitespace)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years ago
Jouni Malinen 53b4f0fe6a tests: Disable fragm/rts_threshold after testing it
The configurated fragmentation/RTS threshold value survives AP mode
interface restarts, so these values need to be explicitly cleared back
to default (disabled). This fixes an issue where some test cases could
not work correctly if fragmentation on the interface was enabled. For
example, this combination used to fail:
ap_fragmentation_open ap_hs20_fetch_osu

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years ago
Masashi Honma bab493b904 tests: Use python3 compatible "except" statement
This patch is made by using 2to3 command.

$ find . -name *.py | xargs 2to3 -f except -w -n

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years ago
Jouni Malinen b586054f95 tests: Work around cfg80211 reg.c intersection (country 98) issues
The Linux kernel commit 113f3aaa81bd ("cfg80211: Prevent regulatory
restore during STA disconnect in concurrent interfaces") broke the
regulatory clearing attempt in many test cases since
cfg80211_is_all_idle() is now returning false due to the AP interface
being up and that results in the Country IE -based regulatory
information not getting cleared back to defaults.

Work around this by stopping the AP interface first so that when the
station interface receives the disconnection, there are no other active
interfaces in the system. In addition, wait for REGDOM event for the
Country IE hint after association to avoid disconnection before the
regulatory events have been fully processed.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years ago
Ayala Beker fcc65290d4 tests: Fix ap_acl_deny test
In ap_acl_deny test, the AP doesn't send probe responses during scan due
to ACL reject. As the result, dev[0] might miss the AP's Beacon frame
because the dwell time is too short. Make the test more robust and
trigger passive scan, and by that increase the probability of hearing
the AP.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
6 years ago
Jouni Malinen 02342a2a2a tests: WMM advertisement parameter change
Signed-off-by: Jouni Malinen <j@w1.fi>
6 years ago
Jouni Malinen c3d45e130a tests: WDS STA interface events and STA command output
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years ago
Jouni Malinen 8f7a50a63e tests: MAC ACL accept/deny management
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years ago
Jouni Malinen a81ac2d6d7 tests: AP with wowlan_triggers
Signed-off-by: Jouni Malinen <j@w1.fi>
8 years ago
Jouni Malinen 678dcebedd tests: AP with U-APSD advertisement
Signed-off-by: Jouni Malinen <j@w1.fi>
8 years ago
Jouni Malinen 7f73fbd5ef tests: AP with long preamble
Signed-off-by: Jouni Malinen <j@w1.fi>
8 years ago
Jouni Malinen c0dd37f5f8 tests: AP with Probe Response frame sending from hostapd disabled
Signed-off-by: Jouni Malinen <j@w1.fi>
8 years ago
Jouni Malinen 0447ef6cd5 tests: DTIM period configuration
Signed-off-by: Jouni Malinen <j@w1.fi>
8 years ago
Jouni Malinen c24ca04a52 tests: hostapd eapol_version configuration
Signed-off-by: Jouni Malinen <j@w1.fi>
8 years ago
Jouni Malinen ce5f5cad6b tests: Invalid TX queue params set (cwmin/cwmax)
Signed-off-by: Jouni Malinen <j@w1.fi>
8 years ago
Jouni Malinen 78f00634ba tests: WPA2-PSK AP and no PSK configured
Signed-off-by: Jouni Malinen <j@w1.fi>
8 years ago
Jouni Malinen ad02e79d12 tests: Disable HT in ap_wds_sta_wep
HT cannot be used with WEP-only network, so don't try to do that here.
This get rids of some unnecessary Beacon frame updates during
disassociation/association and can make the test case a bit more robust.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years ago
Jouni Malinen 29bf636e12 tests: WEP to WPA2-PSK configuration change in hostapd
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years ago
Jouni Malinen f0b6d1edfb tests: WDS 4addr behavior on reassociation and with open and WEP
This extends the ap_wds_sta test case to cover post-reassociation case
(both with and without Authentication frame exchange) and add similar
test cases to cover open and WEP cases in addition to this existing
WPA2-PSK test case.

These cover functionality testing for the previous fix in
reassociation-without-new-authentication case. In addition, these find a
new mac80211 issue for the WEP + 4addr combination.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years ago
Jouni Malinen bacbb62294 tests: Beacon frame TX rate configuration
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years ago
Jonathan Afek 9fd6804d61 tests: Mark 525 tests as remote compatible
After successfully passing the 525 tests on a remote setup mark the
tests as remote compatible.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
8 years ago
Jonathan Afek bb04a9a9a3 tests: Use general cmd_execute() for bridge setup commands
The hwsim tests used to execute shell commands in the tests using the
subprocess python module. Use the cmd_execute() general function for
executing shell commands to setup bridge so that this would also work on
remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
8 years ago
Jonathan Afek a548c37bad tests: Use cmd_execute() for iw reg set 00
The hwsim tests used to execute shell commands in the tests using the
subprocess python module. Use the cmd_execute() general function for
executing "iw reg set 00" so that this would also work on remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
8 years ago
Jouni Malinen 49ae6ddbca tests: hostapd assocresp_elements
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
8 years ago
Janusz Dziedzic 8b8a1864ff tests: Pass full apdev to add_ap() function (1)
Pass the full apdev to the add_ap() function instead of just ifname.
This allows us to handle also remote hosts while we can check
apdev['hostname'], apdev['port'].

This step (1) converts the cases where apdev[#]['ifname'] was used as
the argument to hostapd.add_ap().

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
8 years ago
Jouni Malinen 0215543103 tests: Information element parsing OOM
Signed-off-by: Jouni Malinen <j@w1.fi>
8 years ago
Jouni Malinen 4d2c287466 tests: Information element parsing - extra coverage
Signed-off-by: Jouni Malinen <j@w1.fi>
8 years ago
Jouni Malinen 542c68a688 tests: QCA vendor element parsing
Signed-off-by: Jouni Malinen <j@w1.fi>
8 years ago
Jouni Malinen bc321e1597 tests: Make ap_max_num_sta_no_probe_resp more robust
It was possible for the AP's Beacon frame to be seen by dev[0] when
running a scan. This is not an error case. Make this test case more
robust by verifying with a sniffer whether a Probe Response frame was
sent to unexpected STA.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years ago
Jouni Malinen dd0d294d2f tests: Maximum STA count and limit on Probe Response frames
This verifies hostapd behavior with no_probe_resp_if_max_sta=1.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years ago
Jouni Malinen efe353d1aa tests: UPDATE_BEACON to change vendor_elements at runtime
Signed-off-by: Jouni Malinen <j@w1.fi>
9 years ago
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>
9 years ago
Jouni Malinen 9d7fdac5b3 tests: Try to clear scan results after regulatory domain changes
It was possible for regulatory domain changes to "leak" into following
test cases in number of cases where the cfg80211 BSS table remained
after regulatory domain had been restored to world roaming. Try to make
this less likely to occur by explicitly clearing BSS table at the end of
test cases that use different regulatory domain. This makes P2P test
cases that verify channel selection based on world roaming rules more
robust.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years ago
Jouni Malinen 1131a1c8d2 tests: Replace last remaining hwsim_test uses with DATA_TEST
External tool is not needed anymore to run the data connectivity tests
since hostapd test mode now allows the possible bridge or VLAN interface
to be specified.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
10 years ago
Jouni Malinen a8375c94c0 tests: Pass wpas/hapd instance to test_connectivity()
This makes it easier to replace data connectivity testing to use
something else than local hwsim_test binary on the controller device.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years ago
Jouni Malinen 7e49399b6f tests: Make ap_acl_accept and ap_acl_deny more robust
Use scan_for_bss() to make sure the AP is seen even under heavy CPU
load.

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years ago
Jouni Malinen 6acecce1fe tests: hostapd configuration parameters
Signed-off-by: Jouni Malinen <j@w1.fi>
10 years ago