Commit Graph

81 Commits

Author SHA1 Message Date
Jouni Malinen 7e88ed8e2d tests: Use function decorator to clean up --long processing
Signed-off-by: Jouni Malinen <j@w1.fi>
2020-04-18 11:35:32 +03:00
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>
2020-02-24 20:04:21 +02:00
Jouni Malinen 3a88b7e6e9 tests: Split event wait in grpform_cred_ready_timeout
The long wait for the monitor socket events resulted in another socket
running out of TX buffer space. Split the wait into smaller segments and
clear the other socket in each iteration.

Signed-off-by: Jouni Malinen <j@w1.fi>
2019-03-17 16:08:53 +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 236bbda8e4 tests: Use floor division (//) to avoid issues with python3
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-02-04 12:26:34 +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
Jouni Malinen 9b8e1f9044 tests: P2P group formation with random interface addresses
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-01-12 19:18:02 +02: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
Janusz Dziedzic 1728a2e73c tests: Replace HostapdGlobal() + remove() with hostapd.remove_bss()
This can be used to work with remote hosts.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 19:25:12 +03:00
Jouni Malinen 4a37c98fae tests: P2P_GROUP_MEMBER
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-04-19 00:43:01 +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 d75fcb9760 tests: Use full prefix of the P2P-GO-NEG-FAILURE
Couple of waits for this event used the "GO-NEG-FAILURE" string instead
of the full event prefix. While this worked in the tests due to a
substring matching, it is better to use the full event prefix here.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-12-31 22:41:21 +02:00
Jouni Malinen ce43836965 tests: GO Negotiation stopped after TX start
This verifies that P2P_STOP_FIND stops a pending offchannel TX wait in
the kernel by checking that a listen operation can be started in less
than a second after stopping a pending Action frame TX. This verifies
that the optimization introduced in the previous commit works properly.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-12-31 00:06:06 +02:00
Jouni Malinen 49d51a0dcb tests: Clear p2p_pref_chan explicitly in test cases where it is used
This parameter is used only in couple of test cases and there is no need
to maintain the code to reset it in WpaSupplicant::reset().

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-12-28 17:43:46 +02:00
Jouni Malinen cf3a9d8f06 tests: Clear p2p_add_cli_chan explicitly in test cases where it is used
This parameter is used only in couple of test cases and there is no need
to maintain the code to reset it in WpaSupplicant::reset().

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-12-28 17:33:17 +02:00
Jouni Malinen 721ec02da5 tests: Clear p2p_no_go_freq explicitly in test cases where it is used
This parameter is used only in couple of test cases and there is no need
to maintain the code to reset it in WpaSupplicant::reset().

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-12-28 17:33:09 +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 faee294f1e tests: P2P GO Negotiation special cases
These test cases verify behavior with parallel scan operations while
going through GO Negotiation and duplicated GO Negotiation Request frame
RX with not-yet-ready sequence in GO Negotiation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-10-15 21:31:40 +03:00
Jouni Malinen 24b7f2822e tests: More WPS/HTTP test coverage
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-08-31 17:25:20 +03:00
Jouni Malinen 6e9220160c tests: P2P group formation response during p2p_find
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-08-15 00:15:57 +03:00
Jouni Malinen a0e117c684 tests: P2P extended listen timing operations
This verifies P2P extended listen timing operations by confirming that a
peer is not discoverable during the provisioning step and that the peer
becomes discoverable after having removed the group during such
provisioning step. The latter case was broken until the 'P2P: Cancel
group formation when deleting a group during group formation' commit.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-08-02 21:37:10 +03:00
Avraham Stern 99b83d0abd tests: Fix grpform_wait_peer group removal in P2P Device case
Get the P2P group interface name so it will be used for group removal to
support configurations that use a dedicated P2P Device interface.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
2015-06-19 11:28:20 +03:00
Jouni Malinen ec1c483de0 tests: Not ready for GO Negotiation (listen/search)
These test cases verify that P2P_FIND and P2P_LISTEN operation continues
after having replied to GO Negotiation Request frame for which we are
not yet ready (i.e., GO Negotiation Response with status=1).

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-03-01 22:36:52 +02:00
Jouni Malinen dcd378ed2e tests: Make grpform_no_wsc_done more robust
It was possible for this test case to start a new group formation on
dev[1] while the first round was still going through the process of
processing group termination indication. That could result in the second
round failing unexpectedly.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-02-28 16:57:03 +02:00
Jouni Malinen c62bd5e44d tests: Remove forgotten debug print from grpform_pbc_overlap
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-02-07 15:38:29 +02:00
Ilan Peer 5270b2fbb7 tests: Use the global control interface in test_p2p_grpform
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-05 13:48:35 +02:00
Ilan Peer c282b9b40e tests: Use global_request for SET commands in test_p2p_grpform
When the 'SET' command is used to configure parameters related to P2P
operation use the global control interface and not the per interface one
as otherwise the setting will only have effect on the interface and will
work if a dedicated P2P_DEVICE is used.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2015-02-05 13:38:10 +02:00
Jouni Malinen 12a793a606 tests: Increase grpform_ext_listen coverage
Include actual extended listen period in the test and confirm that the
device was available on a social channel during such period by using
non-social operating channel.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-02-03 16:43:02 +02:00
Jouni Malinen 1f53fe0310 tests: P2P group formation using PBC multiple times in a row
This verifies that PBC session overlap detection does not get indicated
when forming the group with the same peer multiple times.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-01-22 20:53:03 +02:00
Jouni Malinen 81e787b750 tests: Convert test skipping to use exception
Instead of returning "skip" from the test function, raise the new
HwsimSkip exception to indicate a test case was skipped.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-01-08 22:43:47 +02:00
Jouni Malinen a69d0cdc72 tests: Merge grpform_cred_ready_timeout test cases into a single one
These test cases had a long 120 seconds wait for the GO Negotiation
initiator to time out. This can be done using two devices in parallel to
save two minutes from total test execution time.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-22 15:54:30 +02:00
Jouni Malinen 5f35a5e27f tests: Add wait_connected() and wait_disconnected() helpers
Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-20 13:10:09 +02:00
Jouni Malinen 1eaeb7fbaa tests: P2P_UNAUTHORIZE to unauthorize a peer
Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-14 02:28:03 +02:00
Jouni Malinen 7387532549 tests: Additional coverage for P2P_EXT_LISTEN
Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-11 15:18:11 +02:00
Jouni Malinen edd1dfb2bd tests: Invalid P2P_REJECT command
Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-08 21:15:26 +02:00
Jouni Malinen 450e584f04 tests: Additional P2P_CONNECT coverage
Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-08 18:21:48 +02:00
Jouni Malinen 061c55a232 tests: Check STATUS mode field during P2P group formation
Signed-off-by: Jouni Malinen <j@w1.fi>
2014-12-08 11:07:56 +02:00
Jouni Malinen 243dcc4ae4 tests: Add a helper function for clearing scan cache
This makes it more convenient and consistent to clear the cached scan
results from cfg80211 and wpa_supplicant.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2014-12-01 12:20:53 +02:00
Jouni Malinen 3e473674f7 tests: P2P_FIND continuing after GO Negotiation failure
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2014-11-19 16:59:11 +02:00
Jouni Malinen 0ee41e866c tests: GO Negotiation and timeout while waiting for peer
grpform_cred_ready_timeout2 is similar to the grpform_cred_ready_timeout
test case with the difference being in initiating a P2P_FIND operation
during the wait.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2014-10-29 12:52:51 +02:00
Jouni Malinen 42a4ba2865 tests: Group formation wait for peer with driver increasing ROC duration
Signed-off-by: Jouni Malinen <j@w1.fi>
2014-10-25 21:46:39 +03:00
Jouni Malinen fbb79f94eb tests: Allow time for go_neg_pbc() GO Neg Resp to go out
It was possible for the not-pre-authorized GO Negotiation case to end up
starting new GO Negotiation before the GO Negotiation Response frame
with status=1 was transmitted. While this works for group formation, it
could reduce test coverage for the common case where that response is
received. At a small sleep to make it less likely for this unexpected
sequence to happen during testing.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2014-10-23 16:33:25 +03:00
Jouni Malinen b43ac5d5ab tests: P2P group formation with WSC_Done missing
This verifies that GO is able to complete group formation even if the
P2P Client does not send WSC_Done message (or that message is dropped
for any reason) in case the P2P Client completes 4-way handshake
successfully.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2014-10-10 18:40:57 +03:00
Jouni Malinen 3051c9866b tests: Verify P2P GO Negotiation wait-for-ready timeout
This verifies that the wait for peer to be ready for GO Negotiation is
timed out properly at no less than 120 seconds. Since this is a long
test case, it is disabled by default without the --long option.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2014-05-15 23:58:10 +03:00
Jouni Malinen 16dffef1e6 tests: Work around grpform_pbc_overlap robustness issues
Since P2P Client scan case is now optimzied to use a specific SSID, the
WPS AP will not reply to that and the scan after GO Negotiation can
quite likely miss the AP due to dwell time being short enoguh to miss
the Beaco frame. This has made the test case somewhat pointless, but
keep it here for now with an additional scan to confirm that PBC
detection works if there is a BSS entry for a overlapping AP.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-05-15 16:56:49 +03:00
Jouni Malinen 80abf06244 tests: P2P group interface removed due to GO Negotiation failure
Signed-off-by: Jouni Malinen <j@w1.fi>
2014-04-13 10:26:53 +03:00
Jouni Malinen 28cd90091e tests: P2P group idle timeout on GO
Signed-off-by: Jouni Malinen <j@w1.fi>
2014-04-13 10:26:53 +03:00
Jouni Malinen d7d7843430 tests: Prevent grpform_pbc_overlap_group_iface failures
Do not report missing PBC overlap detection as an issue in this test
case since the sequence can miss the overlap due to per-SSID scan used
during group formation. In addition, increase AP beaconing frequency to
make it more likely for a Beacon frame to be seen during the optimized
scan.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-03-30 20:57:40 +03:00
Jouni Malinen b2036fed9d tests: Make grpform_pbc_overlap* more likely to clear state
The PBC overlap state could remain for the next test case and result in
unexpected failure reports.

Signed-off-by: Jouni Malinen <j@w1.fi>
2014-03-30 18:21:58 +03:00
Jouni Malinen 095ded5dd5 tests: Verify PBC overlap detection during P2P group formation
Signed-off-by: Jouni Malinen <j@w1.fi>
2014-03-28 23:02:45 +02:00