Commit graph

2290 commits

Author SHA1 Message Date
Jouni Malinen b47a743942 tests: MBO BSS transition request MBO IE parsing
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-07-01 01:13:54 +03:00
Jouni Malinen 0073f453ff tests: MBO failure cases
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-30 12:53:05 +03:00
Jouni Malinen 3e3f1602b5 tests: MBO WNM token wrap around
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-30 12:53:05 +03:00
Jouni Malinen bbd41e4d2b tests: Invalid MBO non_pref_chan values
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-30 01:13:16 +03:00
Jouni Malinen b9dca2a954 tests: MBO mbo_cell_capa duplicate update
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-30 00:34:48 +03:00
Jouni Malinen b136894fb0 tests: MPM protocol testing - CLS_ACPT event in OPN_SNT
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-29 01:56:26 +03:00
Jouni Malinen 434f8f7f82 tests: MPM protocol testing - CLS_ACPT event in CNF_RCVD
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-29 01:49:42 +03:00
Jouni Malinen 68f326d5fc tests: Mesh MPM FSM and HOLDING state event OPN_ACPT
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-29 01:43:50 +03:00
Jouni Malinen 09d554d1a6 tests: Secure mesh network connectivity failure
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-28 20:52:21 +03:00
Jouni Malinen c3456015fd tests: Mesh peering management protocol testing for peer addition
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-28 20:52:04 +03:00
Jouni Malinen d80d8c6ffc tests: Open mesh network connectivity, no_auto on both peers
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-28 20:44:58 +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 5aa751eaf3 tests: Add general filter for remote tests execution
Add a new function decorator for the test functions so that they can be
marked as remote compatible tests. Add a general filter to the remote
tests execution script to only execute tests that are remote compatible.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-06-27 21:47:37 +03:00
Jonathan Afek bb04a9a9a3 tests: Use general cmd_execute() for bridge setup commands
The hwsim tests used to execute shell commands in the tests using the
subprocess python module. Use the cmd_execute() general function for
executing shell commands to setup bridge so that this would also work on
remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-06-27 21:47:37 +03:00
Jonathan Afek 12129dda8e tests: Use cmd_execute() for iw connect command
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 connect ..." commands 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
Jonathan Afek 10e09d8316 tests: Use cmd_execute() for ip link set up/down commands
The hwsim tests used to execute shell commands in the tests using the
subprocess python module. Use the cmd_execute() general function for
executing "ip link set up/down" commands 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
Jonathan Afek 137fd05099 tests: Use cmd_execute() for iw station get command
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 ... station get" commands 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
Jonathan Afek 525f8293e5 tests: Use cmd_execute() in find_wpas_process()
The hwsim tests used to execute shell commands in the tests using the
subprocess python module. Use the cmd_execute() general function for
executing "ps ax" 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
Jonathan Afek 40c62e6e8d tests: Use cmd_execute() for ip addr add/del
The hwsim tests used to execute shell commands in the tests using the
subprocess python module. Use the cmd_execute() general function for
executing "ip addr add/del .." 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
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
Jonathan Afek a548c37bad tests: Use cmd_execute() for iw reg set 00
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 reg set 00" 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
Jonathan Afek fb120f1652 tests: Remove unused import subprocess
Number of files imported subprocess without using anything from subprocess.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-06-27 21:10:35 +03:00
Jonathan Afek cbd4e92ba1 tests: Add the forgotten wlantest_setup() call to a TDLS test
One TDLS test case was using wlantest without doing the setup first.
This makes the test not work on real hardware. Fix the issue by adding
the wlantest setup to the test.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-06-27 21:10:35 +03:00
Jonathan Afek f11005812a tests: Use cmd_execute() in set_powersave()
hwsim_utils.set_powersace() used to do file operations locally in
python. Start using the cmd_execute() general function for file
operations 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 f9442f2967 tests: Wait for CTRL-EVENT-CHANNEL-SWITCH event in ap_csa tests
This verifies that the channel switch is reported by the station and
replaces the fixed sleep before a traffic test by wait for the actual
switch operation to complete.

Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-27 21:10:35 +03:00
Jouni Malinen e9f2d54f44 tests: Use shell in local cmd_execute() only if needed
The generic cmd_execute() function was introduced in a manner that
converted the argument array to a string and used shell to run the
command unconditionally. This is not really desirable, so move back to
using the command array by default and use the single command string
with a shell only when really needed.

Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-27 21:10:35 +03:00
Jonathan Afek 31209e1434 tests: Use cmd_execute() in ap_ht clear_scan_cache()
The ap_ht tests used to execute shell commands in the tests using the
subprocess python module. Complete the move to using the cmd_execute()
general function for executing shell commands 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
Jonathan Afek 3e3cbbd031 tests: Use cmd_execute() function in ap_ht40_scan_not_affected
The ap_ht tests used to execute shell commands in the tests using the
subprocess python module. Start using the cmd_execute() general function
for executing shell commands 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
Jonathan Afek 113b8a1a3c tests: Use the cmd_execute() function in ap_ht for iw reg set
The ap_ht tests used to execute iw reg set command using the subprocess
python module. Start using the cmd_execute() general function for
executing shell commands 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
Jonathan Afek 6b4300d0c6 tests: Use apdev[0] more consistently in ap_ht
The test cases ap_ht40_5ghz_invalid_pair and ap_ht40_5ghz_disabled_sec
mixed use of apdev[0] and apdev[1] while only needing a single AP. This
works when both the devices are on the same host (e.g., with
mac80211_hwsim), but not when using separate remote hosts. Fix this by
using apdev[0] more consistently in these test cases.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-06-27 21:10:35 +03:00
Jonathan Afek ebc6587d40 tests: Remove trailing whitespace
Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-06-27 21:10:35 +03:00
Jonathan Afek cb3c0d96f4 tests: Pass full apdev to clear_scan_cache()
This is a step towards enabling the needed commands to be run on a
remote host.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-06-27 21:10:29 +03:00
Jonathan Afek f8b9e61ef0 tests: Initialize hapd variable before try-finally uses
Some TDLS and WPS test cases reference the hapd variable in the finally
block even if the test failed before assigning the value to this
variable. This makes the code in the finally block to fail on
referencing this variable. Assign None to the hapd variable before
starting the tests to avoid this.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-06-27 19:04:15 +03:00
Jouni Malinen 643be15d41 tests: GAS failure cases
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-27 18:44:55 +03:00
Jouni Malinen 37a6765967 tests: GAS/ANQP query protected vs. not protected
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-27 18:33:13 +03:00
Jouni Malinen 1ad6f0d5e6 tests: GAS query deleted at deinit
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-27 16:30:08 +03:00
Jouni Malinen e7d454bb76 tests: D-Bus DeviceFoundProperties signal
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-24 19:02:59 +03:00
Jouni Malinen e18d170848 tests: wpa_state == COMPLETED in mesh
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-24 19:02:58 +03:00
Jouni Malinen d1bc3ec85e tests: wpa_supplicant AP mode - WPS operations with fragmentation
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-24 19:02:58 +03:00
Jonathan Afek f885b8e97c tests: ap_ciphers tests start using general cmd_execute() function
The ap_ciphers tests used to do file operations locally in python. Start
using the cmd_execute() general function for file operations so that
this would also work on remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-06-19 23:48:07 +03:00
Jonathan Afek 7fd9fbc27d tests: Add functions to execute shell commands on interface host
Add the feature to execute shell commands on each wpa_supplicant/hostapd
interface host. When executing remote tests the interfaces are not all
on a single host so when executing shell commands the test needs to
execute the command on the host which the interface relevant for the
command is on. This patch enables tests to execute the command on the
relevant host.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-06-19 23:48:07 +03:00
Jouni Malinen 51435515fb tests: mesh_scan_oom to support partial BSS result reporting
The next commit modifies the BSS command behavior to report partial
results for a BSS, so mesh_scan_oom needs to allow a BSS entry to be
returned as long as it does not include the mesh information.

Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-19 23:48:07 +03:00
Jouni Malinen 2833743d4c tests: WPA2-Enterprise connection using EAP-GPSK and wildcard SSID
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-19 22:41:23 +03:00
Jouni Malinen 1f7cd73ca6 tests: More wpa_supplicant AP mode coverage
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-19 22:00:20 +03:00
Jouni Malinen 94e8fe90c2 tests: Mesh with various pairwise and group ciphers
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-19 20:18:09 +03:00
Jouni Malinen 074f72849f tests: Secure mesh network connectivity with PMF enabled
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-18 12:20:50 +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 4425b1ed71 tests: WPS and wpa_supplicant BSS entry limit
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-06-17 14:01:57 +03:00
Jouni Malinen 7309e804cf tests: Make mesh_missing_mic more robust
Check for MESH-PEER-CONNECTED from dev[1] before reporting MGMT-RX
timeout errors from dev[0]. This avoids false failures in case the short
0.01 s timeout at the end of the loop was not long enough to catch the
message.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-06-17 02:05:10 +03:00
Jouni Malinen 0b1b2044cc tests: Add sniffer check to wpas_mesh_max_peering
This verifies that the Accepting Additional Mesh Peerings field is being
cleared properly when the maximum peer links count is reached.

Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-13 00:04:47 +03:00
Jouni Malinen a3bd53273e tests: Additional coverage in mesh_sae_groups_invalid
Additional coverage in mesh_rsn_sae_group() with non-zero
wpa_s->mesh_rsn->sae_group_index.

Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-12 17:56:02 +03:00
Jouni Malinen 61854f16ec tests: GAS/ANQP query and Address 3 value selection
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-06-10 22:30:29 +03:00
Jouni Malinen 739fd20cc3 tests: Mesh peering management protocol testing
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-05 11:43:37 +03:00
Jouni Malinen 81d6e230e3 tests: Secure mesh network and PMKID mismatch
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-05 11:17:00 +03:00
Jouni Malinen 66bb7d97dd tests: Secure mesh network and missing MIC
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-05 01:20:28 +03:00
Jouni Malinen 98628b7f07 tests: Mesh and failure to derive random nonce
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-05 00:24:47 +03:00
Jouni Malinen 044d739bdd tests: Secure mesh network and PMKSA caching failing due to OOM
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-05 00:20:06 +03:00
Jouni Malinen e8739be842 tests: Mesh scan element parse error
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-05 00:13:40 +03:00
Jouni Malinen 699074d30c tests: Mesh network setup failing due to driver command failure
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-05 00:13:40 +03:00
Jouni Malinen 521a98a8f6 tests: Mesh and default beacon interval
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-04 21:47:22 +03:00
Jouni Malinen ec87430ba1 tests: Extend coverage for mesh OOM testing
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-04 21:44:19 +03:00
Jouni Malinen 56d62fc3dd tests: Open mesh network on VHT 160 MHz channel
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-04 21:31:51 +03:00
Jouni Malinen 2cf6341e64 tests: Mesh and invalid frequency configuration
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-04 20:59:39 +03:00
Jouni Malinen a64476403d tests: Mesh and local failures
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-04 00:40:38 +03:00
Jouni Malinen b0ec3d772a tests: Mesh and local SAE failures
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-04 00:30:49 +03:00
Jouni Malinen f0ee4535d2 tests: Mesh with invalid SAE group configuration
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-06-04 00:08:16 +03:00
Jouni Malinen 9ec916e9f4 tests: wpa_supplicant secure MESH and SAE group negotiation
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-05-30 21:15:30 +03:00
Jouni Malinen 582841689f tests: Secure mesh network setup local failure
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-05-30 21:10:58 +03:00
Jouni Malinen 4d4cdc3bb2 tests: wpa_supplicant mesh scan results and OOM
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-05-30 20:03:32 +03:00
Jonathan Afek d28cfc2a25 tests: Support P2P group interfaces in hwsim remote tests
Start using the wpa_supplicant remote UDP interface for the control and
monitor sockets for P2P group interfaces so that P2P tests would work on
real hardware. Also have the group requests and events show in the test
log with the hostname and the interface name of the group interface.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-05-30 17:56:43 +03:00
Jouni Malinen aa59370b34 tests: wpa_supplicant mesh with dynamic interface addition failing
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-05-30 01:50:09 +03:00
Jouni Malinen b15acadcfd tests: Mesh network setup failing due to OOM
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-05-30 01:05:16 +03:00
Jouni Malinen 8f5abdb874 tests: More coverage in ap_reassociation_to_same_bss
The extra wait forces the special reattach-scan case to be reached in
wpa_supplicant_scan().

Signed-off-by: Jouni Malinen <j@w1.fi>
2016-05-28 23:28:15 +03:00
Jouni Malinen 3d53cd50ab tests: More coverage in wpas_ctrl_sched_scan_plans
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-05-28 23:00:42 +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 9f83f6a944 tests/remote: Fix a typo in a comment
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-05-28 16:34:58 +03:00
Jonathan Afek 483053b9d8 tests/remote: Fix execution of setup_hw
The code contained some places that used an additional argument for
setup_hw after -R and also contained places where setup_hw cmdline was
passed as a string instead of an argument list. It also contained places
where the ifname was only treated as a single interface and disregarded
the possiblity of multiple interfaces. This commit fixes these issues
and executes setup_hw from a single function for all cases.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-05-28 16:34:19 +03:00
Jonathan Afek 8efc83d4e7 tests: Add support for wlantest for remote hwsim tests
Use a monitor interface given in the command line that is not also a
station or an AP as a monitor running wlantest on the channel used by
the test. This makes all the tests that use wlantest available for
execution on real hardware on remote hosts.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-05-28 16:34:09 +03:00
Jonathan Afek 0335ff7f69 tests/remote: Fix usage of a non existing variable
In monitor.py in the remote tests code there is fucntion create() that
creates standalone monitor interfaces. In this function there is an
iteration of the ifaces of the host by using the ifaces variable but
this variable is non-existing. This patch creates this variable before
its usage.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-05-28 16:34:09 +03:00
Jonathan Afek 5b45f478c2 tests/remote: Fix style and typos
Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-05-28 16:34:02 +03:00
Jonathan Afek a73cdd69c7 tests/remote: Extend get_monitor_params() to support P2P interfaces
This function is used for remote tests when a monitor interface is
needed on the channel on which the AP operates. This change enables us
to also query P2P interfaces for the channel information to use for
monitor interfaces.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-05-28 16:33:56 +03:00
Jonathan Afek 04fd8ea1ba tests/remote: Use a function to add a log file to a remote host
Instead of accessing the logs list member of the remote host directly,
use a function to add logs to the remote host to be collected after the
test. This enables us to later have different implementation of remote
hosts or logs collection without requiring to have this list as the
implementation.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-05-28 16:33:48 +03:00
Jonathan Afek e2f3f0232f tests: Use 10 retries for over-the-air broadcast connectivity
The regular hwsim tests use both unicast and broadcast frames to test
the connectivity between 2 interfaces. For real hardware (remote hwsim
tests) the broadcast frames will sometimes not be seen by all connected
stations since they can be in low power mode during DTIM or because
broadcast frames are not ACKed. Use 10 retries for broadcast
connectivity tests for real hardware so that the test will pass if we
successfully received at least one of them.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
2016-05-28 16:33:41 +03:00
Jouni Malinen 90b4c73fdf tests: Fix ap_wpa2_eap_fast_prf_oom with the updated PRF implementation
This is needed to work with the tls_openssl.c changes that renamed the
function that is used for deriving the EAP-FAST keys.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-05-23 20:40:14 +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 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 f260ce4be8 tests: wpa_supplicant AP mode - WPS disabled
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-05-14 19:43:30 +03:00
Jouni Malinen 50d06776c6 tests: Fix WEXT testing
Commit afb2e8b891 ('tests: Store P2P
Device ifname in class WpaSupplicant') did not take into account the
possibility of capa.flags not existing in get_driver_status() and broke
WEXT test cases. Fix this by checking that capa.flags is present before
looking at its value.

Signed-off-by: Jouni Malinen <j@w1.fi>
2016-05-14 18:59:47 +03:00
Janusz Dziedzic a185e9b10b tests/remote: Add hwsim wrapper
This allow to run hwsim test cases.

duts go to apdev while refs go to dev

For now I tested:
./run-tests.py -d hwsim0 -r hwsim1 -h ap_open -h dfs
./run-tests.py -r hwsim0 -r hwsim1 -h ibss_open -v
./run-tests.py -r hwsim0 -r hwsim1 -r hwsim2 -d hwsim3 -d hwsim4 -h ap_vht80 -v
./run-tests.py -r hwsim0 -r hwsim1 -r hwsim2 -d hwsim3 -d hwsim4 -h all -k ap -k vht

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-05-14 17:56:37 +03:00
Janusz Dziedzic ff9bb8a210 tests/remote: Add test_example.py
This is simple example how to write a simple test case.

modprobe mac80211_hwsim radios=4
run example:
./run-tests.py -d hwsim0 -r hwsim1 -t example

run example with monitors:
./run-tests.py -d hwsim0 -r hwsim1 -t example -m all -m hwsim2

run example with trace record:
./run-tests.py -d hwsim0 -r hwsim1 -t example -T

run example with trace and perf:
./run-tests.py -d hwsim0 -r hwsim1 -t example -T -P

restart hw before test case run:
./run-tests.py -d hwsim0 -r hwsim1 -t example -R

run example verbose
./run-tests.py -d hwsim0 -r hwsim1 -t example -v

For perf/trace you need to write own hw specyfic scripts:
trace_start.sh, trace_stop.sh
perf_start.sh, perf_stop.sh

In any case you will find logs in the logs/current/ directory.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-05-14 17:56:37 +03:00
Janusz Dziedzic a73fa13be2 tests/remote: Add utils file
Add rutils.py for remote tests.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-05-14 17:56:37 +03:00
Janusz Dziedzic ede4719718 tests/remote: Add monitor.py
Add monitor support. This supports monitors added to the current
interfaces. This also support standalone monitor with multi interfaces
support. This allows to get logs from different channels at the same
time to one pcap file.

Example of t3-monitor added to config.py file.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-05-14 17:56:37 +03:00
Janusz Dziedzic 5865186e31 tests: Add remote directory to tests
Add tests/remote directory and files:
config.py - handle devices/setup_params table
run-tests.py - run test cases
test_devices.py - run basic configuration tests

You can add own configuration file, by default this is cfg.py, and put
there devices and setup_params definition in format you can find in
config.py file. You can use -c option or just create cfg.py file.

Print available devices/test_cases:
./run-tests.py

Check devices (ssh connection, authorized_keys, interfaces):
./run-test.py -t devices

Run sanity tests (test_sanity_*):
./run-test.py -d <dut_name> -t sanity

Run all tests:
./run-tests.py -d <dut_name> -t all

Run test_A and test_B:
./run-tests.py -d <dut_name> -t "test_A, test_B"

Set reference device, and run sanity tests:
./run-tests.py -d <dut_name> -r <ref_name> -t sanity

Multiple duts/refs/monitors could be setup:
e.g.
./run-tests.py -d <dut_name> -r <ref1_name> -r <ref2_name> -t sanity

Monitor could be set like this:
./run-tests.py -d <dut_name> -t sanity -m all -m <standalone_monitor>

You can also add filters to tests you would like to run
./run-tests.py -d <dut_name> -t all -k wep -k g_only
./run-tests.py -d <dut_name> -t all -k VHT80

./run-test.py doesn't start/terminate wpa_supplicant or hostpad,
test cases are resposible for that, while we don't know test
case requirements.

Restart (-R) trace (-T) and perf (-P) options available.
This request trace/perf logs from the hosts (if possible).

As parameters each test case get:
- devices - table of available devices
- setup_params
- duts - names of DUTs should be tested
- refs - names of reference devices should be used
- monitors - names of monitors list

Each test could return append_text.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-05-14 17:56:35 +03:00
Janusz Dziedzic 6a003eb2a6 tests: remotehost.py use join
Use join instead of for.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-05-14 17:19:59 +03:00
Jouni Malinen df49b90e35 tests: Secure mesh and the first plink Open dropped
This is a regression test case to verify that MTK is calculated properly
also in this unexpected sequence.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-05-13 20:54:51 +03:00
Jouni Malinen 9524e7e5a4 tests: Open network connection with pmf=2
This verifies that pmf=2 is ignored for a non-RSN network while a
network profile specific ieee80211w=2 is enforced.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-05-06 00:35:08 +03:00
Jouni Malinen 2dc754e170 tests: wpa_supplicant config file parsing of arbitrary global values
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-05-02 11:08:25 +03:00
Jouni Malinen 596a3fef83 tests: Use \t instead of \n in discovery_ctrl_char_in_devname
This is needed to allow the SET command to be modified to reject newline
characters.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-05-02 11:08:25 +03:00
Jouni Malinen 8721af54e4 tests: wpa_supplicant config parsing of arbitrary cred values
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-05-02 11:08:25 +03:00
Jouni Malinen 5594df44c7 tests: wpa_supplicant config file writing with arbitrary PSK value
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-05-02 11:08:25 +03:00
Jouni Malinen f529c0d908 tests: wpa_supplicant config file parsing/writing with WPS
This verifies that a WPA2PSK passphrase with control characters gets
rejected in a WPS Credential and that control characters in SSID get
written as a hexdump.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-05-02 11:08:25 +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
Andrei Otcheretianski a274b1bcbb tests: Test configuration propagation to group interface
When a dedicated P2P Device interface is used, its configuration should
be cloned to the group interface. Add a test that covers this both when
a separate group interface is used and not.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2016-04-25 00:15:35 +03:00
Andrei Otcheretianski 597cbc0075 tests: Fix persistent_group_peer_dropped tests
Use the global control interface to remove P2P network blocks, to
support cases when a dedicated P2P Device interface is used.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2016-04-25 00:06:20 +03:00
Andrei Otcheretianski aa713e71e9 tests: Don't use proxy in urllib.urlopen()
Some environments define default system wide HTTP proxy. Using default
system configuration may result in a failure to open some HTTP URLs. Fix
this by ensuring that no proxies are used.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2016-04-25 00:05:34 +03:00
Andrei Otcheretianski fc30cc10ac tests: Use global control interface for P2P configurations
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2016-04-25 00:03:40 +03:00
Ilan Peer 9c01d6a965 tests: Use global control interface to set p2p_no_group_iface
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2016-04-24 23:47:29 +03:00
Ilan Peer 463b7f3511 tests: Parse group results in a couple of p2p_channel tests
In p2p_channel_vht80_autogo and p2p_channel_vht80p80_autogo, parse the
P2P-GROUP-STARTED event prior to calling the group_request() method, as
otherwise the group ifname is not set.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2016-04-24 23:45:57 +03:00
Avraham Stern af93c61450 tests: Modify use of GET command to support P2P Device interface
Support configurations that use a dedicated P2P Device interface by
using the global control interface and specifying the interface name for
the GET commands fetching the ip_addr_go parameter.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
2016-04-24 23:45:19 +03:00
Avraham Stern 5e65346ade tests: persistent_group_profile_add to support P2P Device interface
Modify the persistent_group_profile_add test to support configurations
that use a dedicated P2P Device interface by sending the ADD_NETWORK and
SET_NETWORK commands on the global control interface and specifying the
P2P Device interface name.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
2016-04-24 23:45:16 +03:00
Avraham Stern afb2e8b891 tests: Store P2P Device ifname in class WpaSupplicant
Add an attribute to class WpaSupplicant with the name of the
P2P Device interface. If a separate interface is not used for
P2P Device, this attribute will hold the name of the only used
interface (with functions also as the P2P Device management
interface).

This attribute will be used to direct P2P related commands to the
P2P Device interface, which is needed for configurations that use
a separate interface for the P2P Device.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
2016-04-24 23:24:06 +03:00
Avraham Stern d43fc7c6b0 tests: Modify p2p_msg_long_ssid to support P2P Device interface
Waiting for the P2P-DEVICE-FOUND event should be done on the global
control interface to support configurations that use a dedicated P2P
Device interface.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
2016-04-24 23:13:14 +03:00
Avraham Stern a7efe6c386 tests: Modify autogo_scan to support P2P Device interface
Support configurations that use a dedicated P2P Device interface by
sending the P2P_CONNECT command on the global control interface.

In addition, when a dedicated P2P Device interface is used, there is no
need to manually respond to the Provision Discovery Request since the
request is processed by the P2P Device interface and this interface was
not set for external RX management frames handling.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
2016-04-24 23:11:13 +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
Ilan Peer fed0a9f519 tests: Add couple of roam failure tests
1. Fail roaming to an AP which exceeded its number of allowed stations.
2. Fail roaming due to passphrase mismatch.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2016-04-24 22:56:39 +03:00
Jouni Malinen b3a27c8a30 tests: Remove unused eap_connect import
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-04-24 20:16:30 +03:00
Jouni Malinen 5a766accee tests: Convert Host() class to use list of arguments instead of string
It is better to use a list of command line arguments for the local
execution case and convert that to a space-separated string for the
remote case.

Signed-off-by: Jouni Malinen <j@w1.fi>
2016-04-24 20:16:30 +03:00
Janusz Dziedzic 2147b3a7f8 tests: Print traceback if test fails
This is useful in case we hit a problem in test code.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 20:16:30 +03:00
Janusz Dziedzic 5148b392ab tests: Use hapd from hostapd.add_bss()
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 20:16:30 +03:00
Janusz Dziedzic 6f334bf7a0 tests: Use hapd from hostapd.add_ap()
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 20:16:29 +03:00
Janusz Dziedzic 4063590525 tests: Use hapd from hostapd.add_ap() in start_ap_er()
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 20:16:29 +03:00
Janusz Dziedzic 63e6e62f23 tests: Use hapd from hostapd.add_ap() in TDLS
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 20:16:29 +03:00
Janusz Dziedzic c8ef2f6ef4 tests: Pass apdev to HostapdGlobal() in ap_add_with_driver
This is needed for running the test with a remote host.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 20:16:29 +03:00
Janusz Dziedzic 3b3e26875a tests: Use hapd from hostapd.add_ap() in eap_connect()
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 20:06:17 +03:00
Janusz Dziedzic 50e49cd240 tests: Use hapd from hostapd.add_iface()
Since add_iface() now returns the correct hapd, just use it.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 19:26:25 +03:00
Janusz Dziedzic dc6342de92 tests: Pass apdev to HostapdGlobal()
This can be used to work with remote hosts.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 19:26:11 +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
Janusz Dziedzic b29c46beb9 tests: Use hostapd.add_ap() instead of HostapdGlobal() (DFS)
This makes the DFS test cases that use start_dfs_ap() more usable for
testing with remote hosts.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 19:25:06 +03:00
Janusz Dziedzic 01703a9f2f tests: Use hostapd.remove_bss() instead of HostapdGlobal() (WPS)
This makes ap_wps_twice more usable for testing with remote hosts.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 19:24:55 +03:00
Janusz Dziedzic 84f3f3a5e6 tests: Use hostapd.add_ap() instead of HostapdGlobal() (PSK)
This makes ap_cli_order more usable for testing with remote hosts.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 19:24:49 +03:00
Janusz Dziedzic a3d3525442 tests: Remove HostapdGlobal() use from invalid_ap()
Pass apdev to instead of HostapdGlobal() to invalid_ap() to make the
dynamic AP test cases more useful for testing with remove hosts.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 19:24:44 +03:00
Janusz Dziedzic 4193b89750 tests: Remove direct HostapdGlobal() use
Use hostapd.add_ap() and hostapd.remove_bss() to avoid direct
HostapdGlobal() use in some of the dynamic AP test cases to make them
more usable for testing with remote hosts.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 19:23:22 +03:00
Janusz Dziedzic fb1a7dccbf tests: Return hapd when add_bss() and add_iface() are used
Return hapd from add_bss() and add_iface() while we can next use it.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 16:18:50 +03:00
Janusz Dziedzic 625bf74436 tests: Pass apdev param to HostapdGlobal()
Pass apdev param to HostapdGlobal() to support operating with a remote
test host.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 16:18:49 +03:00
Janusz Dziedzic 9cd6f4c015 tests: Pass apdev to hostapd.add_bss()
Pass apdev param to hostapd.add_bss(). Kill hardcoded phy param and get
phy base on apdev. These are needed to support operation with a remote
test host.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 16:18:46 +03:00
Janusz Dziedzic 29444a0863 tests: Pass apdev to hostapd.add_iface()
Pass apdev param to hostapd.add_iface() to support operation with a
remote test host.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 11:58:55 +03:00
Janusz Dziedzic 369f712a40 tests: Pass apdev to hostapd.terminate()
Pass apdev dictionary to hostapd.terminate() to support operation with a
remote test host.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 11:51:06 +03:00
Janusz Dziedzic c92ee957ca tests: Pass apdev to remove_bss()
We need this for remote host support. From apdev we can get
apdev['hostname'] and apdev['port'].

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-24 11:47:03 +03:00
Jouni Malinen 49ae6ddbca tests: hostapd assocresp_elements
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-04-20 13:22:32 +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
David Spinadel 51269b386a tests: Add RRM tests
1. Add tests for hostapd neighbor database and neighbor report and
   request. Remove the partial neighbor report request test from
   test_wpas_ctrl.py since they are now covered more completely in
   test_rrm.py.
2. Add LCI request test.
3. Add FTM range request signaling test. This covers only the control
   interface commands and measurement request/response exchange for now.
   Full end-to-end functionality requires support of station reporting
   RRM capability.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
2016-04-17 18:32:18 +03:00
David Spinadel bf767ac136 tests: Replace radio_measurements with rrm_neighbor_report
This moves neighbor report testing to use the new hostapd.conf
parameter.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
2016-04-16 21:05:40 +03:00
David Spinadel 56de6fe4fe tests: Update NEIGHBOR_REP_REQUEST format
Use quotation marks to match the new SSID encoding format in the
NEIGHBOR_REP_REQUEST command. In this specific test case, the exact SSID
value did not make any difference for behavior. The previous version
ended up getting decoded as a hexstring after the NEIGHBOR_REP_REQUEST
format change. The new version goes back to the ASCII string version of
"abcdef".

Signed-off-by: David Spinadel <david.spinadel@intel.com>
2016-04-16 21:05:39 +03:00
Jouni Malinen cb285151a9 tests: AP with open mode and STA poll
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-04-09 00:30:49 +03:00
Jouni Malinen 36533aff3c tests: hostapd disconnecting STA without transmitting Deauth/Disassoc
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-04-09 00:30:49 +03:00
Jouni Malinen 6545398aaa tests: AP with open mode and STA statistics
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-04-09 00:30:49 +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
Ilan Peer 235c56e708 tests: Modify test_hs20_filter
Modify the test cases to tests the Hotspot 2.0 filtering functionality
in wpa_supplicant, instead of testing only the kernel interface.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2016-04-08 15:44:10 +03:00