Commit graph

253 commits

Author SHA1 Message Date
Jouni Malinen f164dd87b9 tests: Make INTERWORKING_SELECT test cases more reliable
These could fail if a scan entry from a previous test case was still
present in the BSS table, e.g., by wpa_supplicant selecting the SSID
from that old entry instead of the new SSID. Try to avoid that by
explicitly flushing the scan results before starting these tests.

Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-12 11:46:22 +02:00
Jouni Malinen 39ff1a67ad tests: Invalid DAC_REQUEST values
Signed-off-by: Jouni Malinen <j@w1.fi>
2021-03-07 12:46:38 +02:00
Jouni Malinen 892ac42bdc tests: wpa_supplicant global pmf parameter
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2020-06-09 00:59:26 +03:00
Jouni Malinen b50b8f0429 tests: HS 2.0 deauthentication request PMF misbehavior (+HTC)
Verify driver/mac80211 behavior with HT Control field in Public Action
frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2020-05-29 20:55:18 +03:00
Jouni Malinen 0132a72922 tests: Use test-name.* style files more consistently
Use params['prefix'] to build the file names for dynamically generated
files.

Signed-off-by: Jouni Malinen <j@w1.fi>
2020-05-17 16:03:29 +03:00
Thomas Pedersen 7ec86f6599 tests: Skip proxyarp tests properly if ebtables rule install fails
Otherwise the test will continue on and fail later due to unexpected
foreign ARP request. The try/except design here did not work properly to
detect this.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
2020-05-03 18:46:34 +03:00
Jouni Malinen 21cf2c5baf tests: Skip more tests based on missing TKIP support
This makes it more convenient to run tests with builds that disable
TKIP/WPA(v1) support completely.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2020-04-17 23:51:58 +03:00
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>
2020-02-29 17:45:25 +02:00
Jouni Malinen ca10117cd7 tests: Make ap_hs20_connect_no_full_match more robust
Explicitly clear cfg80211 scan cache to avoid issues with old BSS
entries from previous test cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2020-01-23 16:54:45 +02:00
Jouni Malinen 961eb08723 tests: Flush scan results in more Hotspot 2.0 test cases
This makes testing of INTERWORKING_CONNECT more robust.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2020-01-10 22:55:44 +02:00
Jouni Malinen 696acdf333 tests: Make ap_hs20_roaming_consortiums_match more robust
Explicitly clear cfg80211 scan cache to avoid issues with old BSS
entries from previous test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
2020-01-02 22:54:29 +02:00
Jouni Malinen 7aa03cfa7b tests: Make ap_hs20_eap_tls more robust
Explicitly clear cfg80211 scan cache to avoid issues with old BSS
entries from previous test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
2019-12-30 22:07:27 +02:00
Jouni Malinen deb92a6bf9 tests: Make ap_hs20_gas_while_associated_with_pmf more robust
Explicitly clear cfg80211 scan cache to avoid issues with old BSS
entries from previous test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
2019-12-28 23:38:36 +02:00
Jouni Malinen d0cd750435 tests: Make ap_hs20_roaming_consortium more robust
Explicitly clear cfg80211 scan cache to avoid issues with old BSS
entries from previous test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
2019-12-28 19:05:50 +02:00
Jouni Malinen 53a96146fb tests: Ignore fe80::ff:fe00:300 NS from AP for now in proxyarp tests
This NS seems to go out from the AP interface every now and then and it
makes proxyarp_open_ebtables_ipv6 fails inconveniently often. That frame
should not really be there, but it's not clear what exactly is needed to
stop it going through. It does not come from the test operations
themselves, so ignore it for now to keep test results cleaner.

Signed-off-by: Jouni Malinen <j@w1.fi>
2019-12-28 17:17:05 +02:00
Jouni Malinen e5d9f99b3f tests: Make ap_hs20_nai_realms more robust
Explicitly clear cfg80211 scan cache to avoid issues from scan results
from previous test cases interfering with INTERWORKING_CONNECT
operation.

Signed-off-by: Jouni Malinen <j@w1.fi>
2019-12-28 00:34:25 +02:00
Jouni Malinen 4e9bcdebf3 tests: Replace tcpdump with wlantest
This removes dependency on tcpdump by using an already included test
tool for capturing frames with Ethernet headers. There were some issues
in getting tcpdump working on Ubuntu 19.10, so this seems to be a clean
way of addressing that.

Signed-off-by: Jouni Malinen <j@w1.fi>
2019-12-27 23:43:09 +02:00
Jouni Malinen 81121319a9 tests: ap_hs20_cred_and_no_roaming_consortium to match implementation
Now that wpa_supplicant was modified to use NAI realm query even if
roaming_consortium is set, this test case is actually able to find a
match. Update it to avoid cause incorrect test failures.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-11-17 21:04:42 +02:00
Jouni Malinen c404cd8c7d tests: Avoid race conditions in couple of Hotspot 2.0 test cases
Wait hostapd to complete key setup before asking it to send a frame that
may need PMF. This is needed especially with UML time-travel.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-09-16 18:09:54 +03:00
Jouni Malinen 81d0759cba tests: Hotspot 2.0 open OSU association
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-08-30 15:25:07 +03:00
Jouni Malinen 4fc5c00c78 tests: Specify EAP type in ap_hs20_set_profile_failures
Matching with roaming_consortium requires EAP type to be specified to
work for the connection. This test case was not really testing the
connection part, so this has not been much of an issue in the past, but
in preparation for the matching rules to start filtering out invalid
credential configurations from selection, the EAP type needs to be
explicitly set here.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-06-14 23:10:51 +03:00
Jouni Malinen 7d89a99714 tests: Add more wait around tcpdump capture processes for proxyarp
It looks like the previously used sleep time was not sufficient to allow
capturing the frames from wlan0/wlan1/wlan2 to start and complete so
that all the necessary frames can be checked. This was the case
especially with UML time-travel=inf-cpu.

Signed-off-by: Jouni Malinen <j@w1.fi>
2019-05-28 23:37:25 +03:00
Jouni Malinen e4b4e1748a tests: Clear monitor socket queue in ap_hs20_interworking_oom
Do not leave all the event messages pending in the socket queue for the
full duration of the test case to avoid hitting the TX socket queue
limit.

Signed-off-by: Jouni Malinen <j@w1.fi>
2019-03-17 16:08:31 +02: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 3e1cfead0b tests: Use matching prefix for the ProxyARP IPv6 log files
The "_ipv6" part of the file name was missing and this resulted in file
names that conflicted with the IPv4 test cases and could overwrite logs
for those.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-03-15 23:57:44 +02:00
Jouni Malinen 39139d7ead tests: Decode brctl showmacs output for the debug log
This is needed with python3 to make the debug log more readable.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2019-03-15 23:57:44 +02:00
Jouni Malinen 55845e190b tests: Clean up pyrad test cases for python3 compatibility
All other test cases seem to work, but radius_das_disconnect_time_window
is still failing due to incorrect authenticator or Message-Authenticator
in Disconnect-Request.

Signed-off-by: Jouni Malinen <j@w1.fi>
2019-02-04 20:03:29 +02:00
Jouni Malinen fd86ea402e tests: Remove forgotten development time print
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-02-04 12:26:34 +02:00
Masashi Honma 27a7e75651 tests: Open Hotspot 2.0 icon files in binary modes for python3
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2019-02-04 12:26:34 +02:00
Jouni Malinen 95d013f530 tests: Replace str.translate() with str.replace()
This is needed for python3 since the two argument version of
str.translate() is not available for unicode. Furthermore, these cases
of delete colons from the string are simple enough for replace.

Signed-off-by: Jouni Malinen <j@w1.fi>
2019-02-04 12:26:34 +02:00
Masashi Honma 54c58f29c0 tests: Replace str.encode('hex') with binascii.hexlify() for python3
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-02-04 12:26:34 +02:00
Masashi Honma 15dfcb69df tests: Use 'b' prefix to mark Bytes literals explicitly for python3
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-02-04 12:26:33 +02:00
Masashi Honma d5e6ffd661 tests: Decode subprocess.check_output() return value for python3
Explicit conversion to str is needed here for python3 compatibility.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2019-02-04 12:26:33 +02:00
Masashi Honma 7ab74770e7 tests: Convert binascii.hexlify() output to a string object for python3
This is needed in cases the hexlify() output is used to concatenate with
a string or used in string comparisons.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-02-04 12:26:33 +02:00
Masashi Honma 04fa9fc7fd tests: Decode Popen() output values for python3
Explicit conversion to str is needed here for python3 compatibility.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2019-02-04 12:26:33 +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
Masashi Honma 89896c0008 tests: Use python3 compatible print statement
This patch is made by using 2to3 command.

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

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2019-01-26 12:37:25 +02:00
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>
2019-01-26 12:11:35 +02:00
Jouni Malinen 0456b7d312 tests: Add UDP checksum into DHCP frames in ProxyARP/DGAF disabled case
Previously, the special value 0 was used to indicate no UDP checksum.
Replace that with the calculated checksum for more like use case.

Signed-off-by: Jouni Malinen <j@w1.fi>
2018-12-30 01:04:58 +02:00
Jouni Malinen 4992582187 tests: Hotspot 2.0 AAA server behavior for SIM provisioning
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2018-12-15 18:01:38 +02:00
Jouni Malinen 842c29c173 tests: Hotspot 2.0 connection attempt without PMF
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2018-12-08 14:06:58 +02:00
Jouni Malinen c8f7a83c65 tests: Fix ap_hs20_deauth_req_without_pmf
Now that hostapd starts mandating PMF for Hotspot 2.0 Release 2
association, this test case needs some more tweaks to work. Hardcode
Hotspot 2.0 Release 1 to be used and disable PMF explicitly.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2018-12-08 14:06:58 +02:00
Jouni Malinen 647c0ed679 tests: Fix ap_hs20_ft with PMF enabled
The Beacon loss event was not reported anymore, so remove that as an
unnecessary step in the test case. In addition, check the key_mgmt
values explicitly.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2018-12-08 14:06:58 +02:00
Jouni Malinen f40f8860d2 tests: Enable PMF in ap_hs20_unexpected configuration
This is needed to meet the Hotspot 2.0 Release 2 requirement for the
third station that is actually using RSN.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2018-12-08 14:06:58 +02:00
Jouni Malinen ea57b0bcfe tests: Enable PMF in ap_hs20_external_selection network profile
This is required for Hotspot 2.0 Release 2.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2018-12-08 14:06:58 +02:00
Jouni Malinen dfd1b69de2 tests: Hotspot 2.0 release number indication
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2018-12-08 14:06:58 +02:00
Jouni Malinen 7436cd366e tests: Update Hotspot 2.0 release number expectation to 3
Match the implementation change to fix the test cases that verified a
specific Hotspot 2.0 release number indication.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2018-12-08 14:06:58 +02:00
Jouni Malinen db368b2e13 tests: ap_hs20_osen to test group cipher selection in SME case
Go through the group cipher selection in both the wpa_supplicant and
driver SME cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2018-11-09 18:09:34 +02:00
Jouni Malinen 97e27300f4 tests: Maximum number of cred roaming_consortiums
Signed-off-by: Jouni Malinen <j@w1.fi>
2018-10-14 20:48:32 +03:00