Commit graph

76 commits

Author SHA1 Message Date
Jouni Malinen 8f5b1c40bd tests: scan_multi_bssid_check_ie to allow for Multi BSSID Index IE
cfg80211 was modified to allow the Multiple BSSID Index element to be
included in the IEs for a nontransmitted BSS. Update the validation step
in this test case to allow that different with the IEs in the Beacon
frame (transmitted BSS).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-04-08 23:44:45 +03:00
Jouni Malinen fab49f6145 tests: Python coding style cleanup (pylint3 bad-whitespace)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-03-16 18:52:09 +02:00
Jouni Malinen abaa0893f0 tests: Fix scan_specific_bssid in case Beacon frame is seen
The first scan for the unknown BSSID could have been timed in a manner
that allows passive scanning to find the real AP even if that AP's
beacon interval was 1000 (e.g., heavy CPU load changed timing so that
the AP beaconing started at suitable time). The check for BSS result
entry not including Probe Response frame was comparing incorrect BSS
entries (bss2 vs. bss1) which resulted in the test case claiming failure
even when there was no unexpected Probe Response frame.

Fix this by comparing the beacon_ie and ie parameters from the same BSS
entry (bss1).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-03-12 16:36:46 +02:00
Jouni Malinen d5cac05952 tests: Multi-BSSID test cases with python3
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-02-04 20:03:29 +02:00
Jouni Malinen 58be42b264 tests: Remove trailing semicolons from python code
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-02-02 12:10:53 +02:00
Masashi Honma 35d8c2545e tests: Use python3 compatible dict operation
This patch is made by using 2to3 command.

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

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2019-01-26 12:53:05 +02:00
Jouni Malinen ba3146e154 tests: Wait a bit after 'iw reg set 00' at the end of test cases
This is needed to avoid leaving unexpected cfg80211 regulatory country
code in place at the point when a test case terminates.

Signed-off-by: Jouni Malinen <j@w1.fi>
2019-01-01 11:46:50 +02:00
Jouni Malinen 432c0972ad tests: Connect attempt with transmitting/nontransmitting BSS
This adds some minimal testing for Multi-BSS connection attempts. The
part for nontransmitted BSS is limited since hostapd/mac80211 does not
yet have sufficient support for Multi-BSS in AP mode.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2018-12-20 21:44:33 +02:00
Peng Xu 8d176ae689 tests: Additional Multiple BSSID IE parsing tests
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2018-12-20 21:41:40 +02:00
Jouni Malinen 586826d4f5 tests: Multiple BSSID element in scan results
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2018-12-20 21:41:34 +02:00
Jouni Malinen e18b479299 tests: More coverage for ATTACH command parameter setting
Signed-off-by: Jouni Malinen <j@w1.fi>
2018-11-25 12:02:07 +02:00
Jouni Malinen 9f85f0edd3 tests: Probe Request frame RX events from hostapd
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2017-11-23 20:12:34 +02:00
Jouni Malinen 1c13be83d3 tests: Scan for a specific BSSID
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2017-07-05 02:02:35 +03:00
Jouni Malinen c7a7218951 tests: Scan failures for TYPE=ONLY
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2017-03-01 16:42:56 +02:00
Jouni Malinen e437a5aba1 tests: Scan result parsing
Signed-off-by: Jouni Malinen <j@w1.fi>
2017-01-08 18:54:36 +02:00
Jouni Malinen 0aca60b84c tests: Fix scan_reqs_with_non_scan_radio_work error reporting
Raise an exception instead of printing out to stdout if scan fails to
complete.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-12-13 20:07:52 +02:00
Jouni Malinen 58bd7dc341 tests: Scan and both Beacon and Probe Response frame IEs
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-12-13 20:07:52 +02:00
Jouni Malinen 15aa804285 tests: Make scan_trigger_failure more informative
If wpa_state is left to SCANNING by a previously executed test case,
scan_trigger_failure will fail. Instead of waiting for that failure,
check for wpa_state at the beginning of the test case and report a more
helpful error message if the test case would fail due to a previously
executed test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
2016-12-11 18:41:04 +02:00
Jouni Malinen 0ef0921a1b tests: Ongoing scan and FLUSH
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-12-11 12:45:08 +02:00
Jouni Malinen 79124c7ba1 tests: Scan and only_new=1 multiple times
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-12-10 17:04:08 +02:00
Jouni Malinen 27b698338f tests: Scanning and AP changing channels
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-12-03 18:53:36 +02:00
Jouni Malinen dff690b859 tests: Random MAC address in scans while connected
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-11-25 22:52:39 +02:00
Jouni Malinen bc6e32880f tests: Remove extra semicolons from python scripts
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-07-03 22:37:01 +03:00
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>
2016-06-27 21:47:37 +03:00
Jonathan Afek 2d588c6578 tests: Use cmd_execute() for iw scan
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 scan .." so that this would also work on remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-06-27 21:10:35 +03:00
Jouni Malinen 20c7d26f80 tests: More wpa_supplicant/bss.c OOM coverage
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-06-17 20:41:09 +03:00
Jouni Malinen 4208329528 tests: Scan with SET freq_list and scan_cur_freq
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-05-28 22:47:31 +03:00
Jouni Malinen fccc4bd518 tests: Duplicate SSID removal with scan_id list
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-05-28 22:47:31 +03:00
Jouni Malinen 0b0e4792d3 tests: Increase scan_fail coverage
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-05-28 22:47:31 +03:00
Jouni Malinen 7f03ecc884 tests: Scan failures
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-05-23 18:43:58 +03:00
Jouni Malinen 2d3525bed4 tests: VENDOR_ELEM 14 to add an IE into Probe Request frame
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-04-09 00:30:49 +03:00
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>
2016-04-03 22:45:57 +03:00
Jouni Malinen 96425ea502 tests: Make scan test cases more robust by allowing retries
These test caases depended on a single active scan round finding the AP.
It is possible for the Probe Response frame to get delayed sufficiently
to miss the response especially when testing under heavy load with
multiple parallel VMs. Allow couple of scan retries to avoid reporting
failures from these test cases.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-12-30 19:52:42 +02:00
Jouni Malinen f0154bf434 tests: Extend scan_dfs to cover US-disallowed channels 12 and 13
Verify that active scanning is not used in US regulatory domain on 2.4
GHz channels 12 and 13.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-11-30 14:03:23 +02:00
Jouni Malinen b25f04d44a tests: Clean up frequency list in scan_dfs
This makes the test log more readable by converting the values to
integers and sorting the array.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-11-26 23:42:30 +02:00
Jouni Malinen 7767687109 tests: Abort scan
This verifies the nl80211 behavior to abort a scan on an explicit
control interface request and on connection request.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-11-26 19:44:14 +02:00
Jouni Malinen f9bf222552 tests: Scan on DFS channels
This is a test case for mac80211 behavior regarding active scanning on
DFS channels.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-11-26 19:24:25 +02:00
Jouni Malinen 2313e6c96b tests: BSS entry expiration when AP changes SSID
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-08-26 16:46:28 +03:00
Jouni Malinen 76de2b6708 tests: Scan and TSF updates from Beacon/Probe Response frames
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-08-13 21:06:23 +03:00
Jouni Malinen 708ec753bc tests: ap_scan=2 AP mode operation and scan failure
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-08-11 21:48:55 +03:00
Jouni Malinen e51c8b2e97 tests: Make ap_wps_ap_scan_2 more robust
The test sequence "scan_and_bss_entry_removed ap_wps_ap_scan_2" resulted
in failure due to an old BSS entry remaining from the first test case to
the second and the WPS_PBC operation on a forced BSSID ending up picking
the incorrect BSS entry. Make this more robust by clearing the scan
results from cfg80211.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-06-18 22:33:48 +03:00
Jouni Malinen 98c71cf6b5 tests: Control interface behavior on scan SSID parameter
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-06-05 15:55:26 +03: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 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 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
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 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 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 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