Commit Graph

231 Commits (vlan_per_psk)

Author SHA1 Message Date
Jouni Malinen c3155a725d tests: WPS+SAE+H2E
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
3 years ago
Jouni Malinen 838a5aa95a tests: WPS Registrar init errors
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years ago
Jouni Malinen 7ed1cb8933 tests: WPS PBC session overlap workaround
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years ago
Jouni Malinen 3f3e77133d tests: WPS ER and UNSUBSCRIBE errors
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years ago
Jouni Malinen 57de28b94a tests: WPS ER and HTTP client timeout
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years ago
Jouni Malinen 73a3ef8c5d tests: WPS status "Timed-out" from hostapd
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years ago
Jouni Malinen 35672faae5 tests: WPS PBC overlap indication from hostapd
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years ago
Jouni Malinen e8e2d9ff6b tests: Additional coverage for WPS_AP_PIN error case
Signed-off-by: Jouni Malinen <j@w1.fi>
3 years ago
Jouni Malinen 31bdd8b7c7 tests: Move check_sae_capa() into utils.py
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 7e88ed8e2d tests: Use function decorator to clean up --long processing
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen b5bf18768f tests: ap_wps_reg_config_tkip to allow no-TKIP hostapd build
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen d0b382fd11 tests: ap_wps_init to allow TKIP-disabled hostapd build
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
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>
4 years ago
Janusz Dziedzic 60b06d8750 tests: Set device_name for WPS test cases
Set device_name in the test cases instead of relying on the
wpa_supplicant configuration file. This fixes problems when we run WPS
test cases in remote test environment.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
4 years ago
Jouni Malinen 72fd30c4b9 tests: WPS PBC/PIN timeout on AP
Verify that AuthorizedMACs advertisement is removed when a PBC session
or a PIN times out.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
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 ae750570b6 tests: WPS PBC session overlap detection with single BSSID selected
Update grpform_pbc_overlap not to require PBC session overlap to be
detected since in this sequence a single BSSID is specified and other
APs can be ignored while checking for session overlap. Add other test
cases to explicitly check for the PBC session overlap detection in
non-P2P and P2P cases when the BSSID is specified.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Jouni Malinen dd3d5da3c7 tests: WPS PIN provisioning with per-station PSK preset
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen afd10e880b tests: Require wps=1 tag in ap_wps_per_station_psk
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen 68e9b8cb16 tests: Prepare ap_wps_per_station_psk for the new wps=1 tag in PSK file
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen 4c0af8ad6c tests: Check SAE capability in build more consistently
Use a helper function for this and add checks for number of test cases
that were missing this. This gets rid of undesired FAIL results
(converts them to SKIP) for test runs where the station do not support
SAE.

Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen 754cd71bf4 tests: WPS Application Extension attribute
Signed-off-by: Jouni Malinen <j@w1.fi>
4 years ago
Jouni Malinen cc7f85ca72 tests: Make ap_wps_conf_pin_* 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>
4 years ago
Jouni Malinen 4153243932 tests: Make wps_reg() test cases 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>
4 years ago
Brian Norris e6d3aca9cf WPS: Add prefixes to public event_* functions
openssl engines may dynamically load external libraries. Our event_*()
functions happen to be named very generically, such that event_add()
collides with the libevent library (https://libevent.org/). This can
have disastrous effects (esp. when using CONFIG_WPA_TRACE, which enables
partial linking) when our SSL engines call into the WPS event_add()
instead of their intended libevent event_add().

Resolve this by providing a more unique prefix to these functions.

Rename performed via:

  sed -i -E \
    's:\<event_(add|delete_all|send_all_later|send_stop_all)\>:wps_upnp_event_\1:g' \
     $(git grep -l event_)

Tested via (among other things) hwsim '-f ap_wps' module.

Signed-off-by: Brian Norris <briannorris@chromium.org>
5 years ago
Mikael Kanstrup 97d2d7ac1a tests: WPS MAC address change
Verify that MAC address of WPS M1 message use correct address
after address change.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sony.com>
5 years ago
Masashi Honma cb5f7f552f tests: Fix ap_wps_conf_5ghz false negative by using common finalizer
ap_wps_conf_5ghz fails with this message:

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

hostap commit 91b6eba773
'Move MAC address randomization enable/disable to helper functions'.

wireless-testing commit 66c112cbd1d44d05322bb4eef908c82a68adbb5e
tag: wt-2019-06-26.

This patch fixes the issue.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years ago
Masashi Honma 207fe29dc7 tests: Fix ap_wps_conf_chan14 false negative by using common finalizer
ap_wps_conf_chan14 fails with this message.

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

This patch fixes the issue.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years ago
Jouni Malinen 0a9ff3810b tests: Addition WPS local error case coverage
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years ago
Jouni Malinen 96ad141e6c tests: Fix WPS with SAE test cases to reset sae_groups setting
These test cases did not clear a possibly modified sae_groups value from
a prior test case and could fail if the previously set group was not
supported by the AP.

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 8b944cf779 tests: Clear scan results from dev5 in WPS testing
Test case sequence "ap_wps_ap_scan_2 ap_wps_pbc_2ap" resulted in a
failure due to a scan entry being left behind from the first test case
and the second one ending up using that obsolete result during WPS_PBC
processing. Fix this by clearing the scan results explicitly on dev5.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years ago
Jouni Malinen dc0f727c99 tests: WPS with PSK+SAE
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
5 years ago
Masashi Honma 4aa2336ed5 tests: Use binary mode for writing WPS attributes
This is needed for python3.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years ago
Masashi Honma 59aecb1c42 tests: Decode StreamRequestHandler read for python3
WPSAPHTTPServer class needs to explicitly decode the read value from
a bytes object to a str object.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years ago
Masashi Honma 732b76139a tests: Decode upnp_soap_action() response for python3
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years ago
Masashi Honma 69f58282bc tests: ElementTree string representation in python3 compatible manner
Use ET.tostring() to avoid implicit bytes/str conversion issues within
ET implementation. Add XML declaration separately to match previous
behavior.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years ago
Masashi Honma 308ecbc16e tests: urlopen() compatibility for python3
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years ago
Jouni Malinen b7da11fd95 tests: Extend build_wsc_attr() to accept both bytes and str objects
This is needed for python3.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years ago
Jouni Malinen 786ce912ce tests: Fix struct.unpack() call for a single octet with python3
python3 needs this to be a bytes object, not the first octet of that
object.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years ago
Masashi Honma c4e333fa43 tests: Encode/decode base64 operations for python3
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years ago
Jouni Malinen 236bbda8e4 tests: Use floor division (//) to avoid issues with python3
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years ago
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>
5 years ago
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>
5 years ago
Masashi Honma f94df3c0b0 tests: Explicitly encode str to bytes when needed for python3
Avoid implicit conversion errors when constructing bytes objects or
passing a str object to a function that needs a bytes object.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years ago
Masashi Honma cc02ce96cf tests: Explicit str/bytes conversion for socket operations for python3
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years ago
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>
5 years ago
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>
5 years ago
Masashi Honma 9c06eda01c tests: Use python3 compatible libraries
This patch is made by using 2to3 command with some modifications.

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

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
5 years ago