Commit graph

73 commits

Author SHA1 Message Date
Jouni Malinen
c37ef330d0 tests: MAC address ASCII string generation in python3 compatible manner
Use struct.unpack() to get a list of int and then generate a list of
hexstr octets from it for ':'.join() to get consistent behavior for both
python2 and python3.

Signed-off-by: Jouni Malinen <j@w1.fi>
2019-02-04 12:26:35 +02:00
Masashi Honma
b723b25926 tests: Replace dict.has_key() with the in operator for python3
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2019-02-04 12:26:35 +02:00
Jouni Malinen
5c9ba3412d tests: python3 compatible way of importing gobject for D-Bus testing
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-02-04 12:26:34 +02:00
Masashi Honma
e1810300c9 tests: Replace str.decode('hex') with binascii.unhexlify() 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
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
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
6a94fdf21a tests: D-Bus P2P peer information - VSIE
Signed-off-by: Jouni Malinen <j@w1.fi>
2019-01-02 13:00:57 +02:00
Jouni Malinen
345d8b5e91 tests: AP mode and D-Bus StationAdded/StationRemoved signals
Signed-off-by: Jouni Malinen <j@w1.fi>
2018-12-23 17:25:11 +02:00
Jouni Malinen
a21eadcf58 tests: D-Bus introspection with busctl
Signed-off-by: Jouni Malinen <j@w1.fi>
2018-11-24 18:30:41 +02:00
Lubomir Rintel
8b67f6496e tests: D-Bus Get/Set Pmf
Based on Jouni Malinen's [76055b4c6 "tests: D-Bus Get/Set Pmf"], modified
to use the correct "s" signature for the "Pmf" property.

Removed the negative test cases, because the synthesized property doens't
seem to do error checking upon being set.

Signed-off-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
2018-11-24 18:04:20 +02:00
Lubomir Rintel
b8d8928f6c Revert "tests: D-Bus Get/Set Pmf"
This is wrong. The Pmf property has a "s" signature.

This reverts commit 76055b4c61.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
2018-11-24 18:03:55 +02:00
Jouni Malinen
79467d74fd tests: Fix dbus_tdls_channel_switch with missing kernel support
Check driver capabilities in the D-Bus TDLS case similarly to the
non-D-Bus cases.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2018-05-15 00:38:13 +03:00
Jouni Malinen
e51e49fccc tests: Fix dbus_set_global_properties failure if run twice
Clear the model_name parameter back to the default (empty string) at the
beginning and the end of dbus_set_global_properties to avoid failures if
the test case is run multiple times.

Signed-off-by: Jouni Malinen <j@w1.fi>
2018-02-17 17:41:57 +02:00
Jouni Malinen
50d7cdedae tests: Make dbus_p2p_discovery more robust
Ignore any unexpected deviceLost event before the peer devices has been
discovered. This works around issues where the previous test case
terminates before the D-Bus events have been fully delivered. This could
happen, e.g., when running dbus_p2p_discovery twice in a row.

Signed-off-by: Jouni Malinen <j@w1.fi>
2018-02-17 17:21:05 +02:00
Jouni Malinen
f41f04d04c tests: Make dbus_scan_abort more robust
There was a race condition on the sequence where iface.AbortScan() is
immediately followed by iface.Scan(). If the driver event
(NL80211_CMD_SCAN_ABORTED) arrived after the following new scan request,
the D-Bus operation failed. This is not what this test case is trying to
check, so wait for an indication of the previous scan having terminated
properly before issuing the next scan.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2017-09-20 15:37:58 +03:00
Jouni Malinen
504c7ffd69 tests: D-Bus mesh signals and properties
Signed-off-by: Jouni Malinen <j@w1.fi>
2017-09-10 01:39:37 +03:00
Jouni Malinen
82aea622e8 tests: D-Bus methods for setting TDLS channel switching
Signed-off-by: Jouni Malinen <j@w1.fi>
2017-05-07 22:08:43 +03:00
Jouni Malinen
0238e8ba4c tests: D-Bus scan trigger and abort
Signed-off-by: Jouni Malinen <j@w1.fi>
2017-05-07 22:08:43 +03:00
Jouni Malinen
76055b4c61 tests: D-Bus Get/Set Pmf
Signed-off-by: Jouni Malinen <j@w1.fi>
2017-01-14 17:28:25 +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
4e6bd66744 tests: Additional D-Bus WPS Get/Set properties
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-12-23 21:28:43 +02:00
Jouni Malinen
6c44d97b04 tests: D-Bus P2P discovery on a specific non-social channel
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-12-19 13:18:05 +02:00
Jouni Malinen
3301e925b7 tests: Make dbus_p2p_go_neg_init more robust
It was apparently possible to get a propertiesChanged event from an
earlier test case with an empty Groups property. That ended up this case
exiting immediately before running through the steps and consequently,
failing due to missed operations. Make this less likely to happen by
accepting the Groups property emptying event only after a group has been
added for a peer first.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-12-13 20:07:52 +02:00
Jouni Malinen
afe280539b tests: D-Bus P2P and IP address parameters
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2016-11-21 14:45:13 +02:00
Jouni Malinen
73ece491c1 tests: D-Bus GetAll wpa_config_get_all() OOM
This is a regression test for a crash on wpa_config_get_all() error
path.

Signed-off-by: Jouni Malinen <j@w1.fi>
2016-07-04 17:49:56 +03: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
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
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
Janusz Dziedzic
afc26df29c tests: Pass full apdev to add_ap() function (4)
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 (4) converts the cases that call hostapd.add_ap() from a
helper function that got apdev[i] as an argument.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2016-04-03 22:46:12 +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
dbd183c717 tests: D-Bus AssocStatusCode
Signed-off-by: Jouni Malinen <j@w1.fi>
2016-03-06 20:54:16 +02:00
Jouni Malinen
be90370bd5 tests: Fix wpas_ctrl_country and dbus_country with valid db.txt
init=CORE was previously used due to invalid db.txt data for 00. For
now, allow both it and the new init=USER after fixed db.txt.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-12-12 12:45:30 +02:00
Jouni Malinen
1d32bc2c1c tests: Make dbus_wps_oom more robust
It was possible for the BSSs object property change signal to be
generated during the OOM test case for Get(). If that happened, the
signal was not sent out, but the following Get(BSSs) operation succeeded
unexpectedly which resulted in a test failure. Make this less likely to
happen by waiting 50 ms between the scan and Get(BSSs) operation. This
should be sufficient to cover most cases since wpa_supplicant uses 5 ms
timeout for D-Bus property changed updates.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-12-06 17:10:06 +02:00
Jouni Malinen
ce96e65cb7 tests: D-Bus vendor element operations
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-12-06 12:50:41 +02:00
Jouni Malinen
089e7ca372 tests: Skip dbus_connect_eap if altsubject_match is not supported
This test case fails with the current internal TLS client implementation
since the needed altsubject_match parameter is not yet supported.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-11-29 20:57:26 +02:00
Jouni Malinen
845d48c133 tests: Make dbus_p2p_group_idle_timeout more robust
This test case was failing if a PropertiesChanged signal for P2P peer
gets delivered from a previous test case. Avoid that by waiting for the
new group to be formed before processing any PropertiesChanged signals.

This failure was triggered by the following test case sequence:
dbus_p2p_two_groups dbus_p2p_group_idle_timeout

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-11-22 21:28:49 +02:00
Jouni Malinen
89a79ca2b9 tests: Force hw capability re-fetch at the end of dbus_connect_oom
This is needed since the forced OOM may have forced the cached
information to be invalid or dropped. This issue was hit with the
following hwsim test case sequence:
ap_interworking_scan_filtering fst_sta_config_llt_large dbus_connect_oom
wpas_ctrl_enable_disable_network

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-11-17 19:50:34 +02:00
Jouni Malinen
1992af115a tests: D-Bus P2P and InvitationReceived
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-11-17 19:50:34 +02:00
Jouni Malinen
2299b54383 tests: D-Bus SaveConfig
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-11-15 19:08:05 +02:00
Dan Williams
f0ef68892e tests: Add testcases for interface global properties
Signed-off-by: Dan Williams <dcbw@redhat.com>
2015-10-28 23:41:33 +02:00
Jouni Malinen
d679ab74a5 tests: D-Bus ExpectDisconnect
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-10-12 18:14:21 +03:00
Jouni Malinen
7966674d73 tests: Fix dbus_interface to restore P2P channel list to default
It was possible for the dbus_interface test case to leave the P2P
channel lists with 5 GHz channels enabled due to the special driver=none
case. This could make the following P2P test case fail due to selecting
an unexpected channel. Fix this by forcing P2P channel list update at
the end of the dbus_interface test case.

This was triggering with the following hwsim test case sequence:
dbus_interface p2ps_connect_adv_go_p2ps_method_group_iface.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-10-12 15:36:46 +03:00
Jouni Malinen
084780f1ca tests: D-Bus GroupFormationFailure signal
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-09-05 23:01:20 +03:00
Jouni Malinen
5a233fbdf0 tests: Regression test for D-Bus setting scan_freq and freq_list
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-08-28 00:20:30 +03:00
Jouni Malinen
035efb2c43 tests: Trigger failure on exceptions in the dbus_p2p_autogo thread
This makes the test case more robust in reporting failures.

Signed-off-by: Jouni Malinen <j@w1.fi>
2015-08-17 00:18:32 +03:00
Jouni Malinen
708ec753bc tests: ap_scan=2 AP mode operation and scan failure
Signed-off-by: Jouni Malinen <j@w1.fi>
2015-08-11 21:48:55 +03:00
Jouni Malinen
6fad40df9e tests: Make dbus_p2p_group_termination_by_go more robust
Set peer_group_removed only if peer_group_added has already been set.
This fixes an issue where a propertiesChanged event triggered by an
earlier test case was able to get dbus_p2p_group_termination_by_go
terminated too early. This happened, e.g., with sequence
"dbus_p2p_two_groups dbus_p2p_group_termination_by_go".

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-08-03 18:52:10 +03:00
Jouni Malinen
5a21764994 tests: Avoid exception in dbus_p2p_two_groups
Only run peerJoined() steps once to avoid trying to use GetAll() on an
already removed group and double-removal of a group. This did not make
the test case fail, but the exception is printed out in pretty confusing
way to stdout, so better get rid of it.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
2015-08-03 18:44:53 +03:00