Commit graph

46 commits

Author SHA1 Message Date
Avraham Stern
a302384148 tests: Call remove_group() after other cleanup is done
The call to remove_group() may fail, in which case all following
cleanup is skipped. This may result in failing many tests since
cleanup did not complete successfully.

Fix this by calling remove_group() after other cleanup is done so
even it fails it will not affect the following tests.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
2018-11-26 01:00:00 +02:00
Jouni Malinen
db98b58736 tests: Remove trailing whitespace
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-12-28 14:31:42 +02:00
Jouni Malinen
a1a60635a8 tests: Make p2ps_wildcard_p2ps more robust
The final check in this test case was issuing a new P2P_FIND command
immediately after the P2P_SERVICE_DEL command on the peer. It looked
like it was possible for the scan timing to go in a sequence that made
the new P2P_FIND operation eventually accept a cfg80211 BSS entry from
the very end of the previous P2P_FIND. This resulted in unexpected
P2P-DEVICE-FOUND event even though there was no new Probe Response frame
from the peer at that point in time.

Make this less likely to show unrelated failures by waiting a bit before
starting a new P2P_FIND operation after having changes peer
configuration.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-12-10 00:33:33 +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
Jouni Malinen
a68a749322 tests: P2P group formation using P2PS method without specifying PIN
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-05-20 23:37:51 +03:00
Jouni Malinen
0663ae22ff tests: Do not use tabs for indentation
Be more consistent with indentation (always uses spaces in Python
files).

Signed-off-by: Jouni Malinen <j@w1.fi>
2016-04-25 00:19:40 +03:00
Ilan Peer
12de787527 tests: Fix error message in test_p2ps_connect_p2ps_method_4()
This fixes commit 2f0f69a9ec ('tests: Use
p2ps_provision() and p2ps_connect_pd() in p2ps_connect_p2ps_method()').

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2016-04-24 23:00:44 +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
a6d48805f5 tests: P2PS connection with cfg80211 P2P Device
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-02-27 19:44:11 +02:00
Jouni Malinen
dd4feaad2a tests: Make P2PS join-a-group cases more robust
Use the group SSID (if known) when requesting a join operation. This
makes some of the P2PS test cases more robust in cases where previously
executed tests have added older groups into the cached scan results with
the same MAC addresses and an incorrect BSS could have been picked
previously.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-12-30 19:14:40 +02:00
Jouni Malinen
5549bead85 Revert "tests: Dynamic hwsim p2ps_channel_active_go_and_station_different_mcc"
This reverts commit 78fdab307e. This test
case needs MCC support on two stations, so the earlier attempt to handle
this with one dynamic interface is not sufficient.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-11-30 19:58:07 +02:00
Jouni Malinen
78fdab307e tests: Dynamic hwsim p2ps_channel_active_go_and_station_different_mcc
Convert p2ps_channel_active_go_and_station_different_mcc to use a
dynamically added HWSimRadio to allow the MCC case to be covered with a
single test run with the mac80211_hwsim default radios disabling MCC.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-11-27 19:01:10 +02:00
Jouni Malinen
9cd8859ed6 tests: Fix scan flush in p2ps_channel_both_connected_same
Need to do this before associating with the AP and with the correct
devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-10-26 00:59:07 +02:00
Jouni Malinen
9cb3413090 tests: Move P2P helper functions to a separate file
This makes it easier to import these into the P2P test scripts.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-10-25 19:37:17 +02:00
Jouni Malinen
4150c7c97c tests: Fix p2ps_channel_both_connected_same
I modified this test case for commit
eabf083984 ('tests: P2PS channel
handling') to use dev[2] instead of dev[0], but forgot to update the
p2ps_connect_p2ps_method() dev list to match that. Fix this to actually
use a concurrent connection.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-10-13 18:57:20 +03:00
Jouni Malinen
fd8f443247 tests: Dynamic radio in p2ps_channel_sta_connected_disallow_freq_mcc
Use a dynamic HWSimRadio in p2ps_channel_sta_connected_disallow_freq_mcc
to allow MCC test case to be executed in default setting (MCC disabled
for the default radios).

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-10-11 21:42:03 +03:00
Jouni Malinen
3392503eb0 tests: Speed up P2PS test cases using join-a-group
Figure out GO operating frequency and use a single channel scan with
P2P_CONNECT-join.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-10-11 21:42:03 +03:00
Jouni Malinen
0033eea533 tests: Speed up p2ps_active_go_seeker by using a single-channel scan
There is no test coverage benefit from using all-channels scan in
P2P_CONNECT-join here.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-10-11 21:42:03 +03:00
Jouni Malinen
7dd55f2486 tests: Speed up p2ps_connect_adv_go_persistent
Stop the pending P2P_LISTEN operation priot to issuing P2P_GROUP_ADD to
start a GO. This avoids excessively long wait for the previous Listen
step to complete before being able to start the GO. This makes
p2ps_connect_adv_go_persistent take significantly less time.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-10-11 21:42:03 +03:00
Jouni Malinen
85ceafd39a tests: Make P2PS tests less likely to fail in P2PS-PROV-DONE timeouts
The combination of starting P2P extended listen and issuing
P2P_ASP_PROVISION_RESP almost immediately after that while in P2P_LISTEN
state resulted in caes where the advertiser could end up going back to a
long listen state while trying to retransmit PD Request. This resulted
in p2ps_provision() timing out while waiting for P2PS-PROV-DONE
especially in p2ps_feature_capability_* test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-10-11 21:42:03 +03:00
Ilan Peer
eabf083984 tests: P2PS channel handling
Add tests to verify proper handling of channel considerations in P2PS
PD.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-10-11 21:42:03 +03:00
Jouni Malinen
f56478ab88 tests: P2PS advertisement as GO having persistent group (no peer entry)
This is a regression test case for the dev NULL pointer dereference in
p2p_build_prov_disc_resp().

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-10-11 12:31:30 +03:00
Max Stepanov
8cc4b06f75 tests: P2PS follow-on PD Request with status 11
Add a test case verifying deferred P2PS provision discovery when an
advertiser sends the status 11 (Fail: reject by user) in the follow-on
PD Request.

Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
2015-10-07 17:07:21 +03:00
Andrei Otcheretianski
9773ea38cf tests: Put seeker into extended listen when deferred PD is expected
Not doing so may result in a deferred PD flow failure (currently the
hwsim tests succeeded because seeker never stopped find, spending enough
time listening, so the follow-on PD would succeed).

Fix this by calling p2p_ext_listen when the seeker receives a deferred
PD failure event. Cancel extended listening when PD is done and also
stop find when seek is done.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2015-10-07 17:07:21 +03:00
Jouni Malinen
133716a722 tests: P2PS with group interface and intended iface addr in PD
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-08-06 20:47:25 +03:00
Max Stepanov
dbc21b1a81 tests: Add P2PS PD feature capability CPT tests
Add tests verifying a Coordination Protocol Transport exchange and
selection during P2PS provision discovery.

Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
Reviewed-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
2015-08-06 20:47:25 +03:00
Andrei Otcheretianski
3c72383e03 tests: Re-factor PD and connection flows in P2PS tests
Reuse p2ps_provision() and p2ps_connect_pd() methods, and
remove the previous PD helper functions which are no longer used.

This fixes the previously "broken"
p2ps_connect_keypad_method_nonautoaccept and
p2ps_connect_display_method_nonautoaccept.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Max Stepanov <Max.Stepanov@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
2015-08-06 20:47:19 +03:00
Andrei Otcheretianski
2f0f69a9ec tests: Use p2ps_provision() and p2ps_connect_pd() in p2ps_connect_p2ps_method()
Re-factor p2ps_connect_p2ps_method() so it reuses generic P2PS provision
and connection flows.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
2015-08-06 20:45:15 +03:00
Max Stepanov
aff4b2c139 tests: Add CPT parameters to p2ps_provision()
Add adv_cpt and seeker_cpt parameters to p2ps_provision() function.
The seeker_cpt is used in P2P_ASP_PROVISION command by a seeker, the
adv_cpt parameter is in P2P_ASP_PROVISION_RESP by an advertiser.

Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
Reviewed-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
2015-07-27 00:47:20 +03:00
Max Stepanov
5e9d05115f tests: Add CPT parameter to p2ps_advertise()
Add an optional parameter to p2ps_advertise() function allowing to
specify CPT priority values.

Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
Reviewed-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
2015-07-27 00:47:20 +03:00
Andrei Otcheretianski
e999e56c2c tests: Add p2ps_connect_pd() method
Add p2ps_connect_pd() helper method which strictly validates the PD
results and establishes the connection between peers accordingly.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Max Stepanov <Max.Stepanov@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
2015-07-26 21:45:35 +03:00
Andrei Otcheretianski
4796021088 tests: Add p2ps_provision() method
Add generic provision method. This method receives a seeker and an
advertiser devices, advertisement id, method, and a flag which indicates
whether deferred flow is expected. The method returns P2PS-PROV-DONE
events and the pin (if keypad or display method is used).

This method is needed to simplify the P2PS provision flows in the tests.
This method complies to the P2PS specification regarding the expected
order of the show and display PIN events.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Max Stepanov <Max.Stepanov@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
2015-07-26 21:45:35 +03:00
Andrei Otcheretianski
1ee6dd2671 tests: Few trivial cleanups to P2PS tests
Remove unused variables and replace split(" ") with just split().

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
2015-07-08 16:52:42 +03:00
Jouni Malinen
7242b3df37 tests: P2PS with large number of services in Probe Request/Response
This verifies capability to split the response into multiple P2P
elements.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-06-18 18:14:04 +03:00
Jouni Malinen
3d7d9f18db tests: Extend P2PS service seek test to cover multiple services
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-06-18 18:14:04 +03:00
Max Stepanov
5a2c379736 tests: P2PS wildcard SD probe
Verify that advertiser returns 'org.wi-fi.wfds' wildcard in a Probe
Response frame if at least one P2PS advertisement is present.

Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
2015-06-18 18:14:04 +03:00
Andrei Otcheretianski
a4c4c1d0e4 tests: Add p2ps_cli_probe and p2ps_go_probe tests
Test P2PS GO and CLI discoverability on group operating channel.
In order to implement these tests, refactor p2ps_connect_p2ps_method
and test_p2ps_connect_adv_go_pin_method to reuse the code for
connection establishment. Also change p2ps_exact_seek so it will
allow getting Probe Response frames from several peers.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
2015-06-14 23:16:55 +03:00
Andrei Otcheretianski
d134a2868e tests: Fix inconsistent indentation
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
2015-06-14 23:16:55 +03:00
Andrei Otcheretianski
ce394d33e7 tests: Fix p2ps_connect_adv_go_pin_method case
test_p2ps_connect_adv_go_pin_method() expects that
p2ps_provision_keypad_method() returns P2PS-PROV-DONE with details
needed for a connection. However, this event was overridden which
resulted in an incorrect test flow skipping the connection
establishement. The test would pass, however, without really trying to
connect. Fix this by returning the correct event.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
2015-06-14 23:16:55 +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
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
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
c4f34de90d tests: P2PS and persistent group
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-03 17:00:56 +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