summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Fix NO_REPLY test for Python 3Simon McVittie2019-09-021-1/+2
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Configure test bus to allow unrequested repliesSimon McVittie2019-09-021-0/+2
| | | | | | | This lets us catch them in the test code. Fixes: e9f658d9d57b97395545c5ed2eaf9a85436f135d Signed-off-by: Simon McVittie <smcv@collabora.com>
* Add a test for NO_REPLY method callsSimon McVittie2019-09-022-0/+80
| | | | | | See https://gitlab.freedesktop.org/dbus/dbus-python/issues/26 Signed-off-by: Simon McVittie <smcv@collabora.com>
* test-p2p: Add test coverage for sending and receiving fdsSimon McVittie2019-09-022-0/+33
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Add basic test coverage for UnixFdSimon McVittie2019-09-021-0/+31
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Silence -Wcast-function-type with gcc 8Simon McVittie2019-07-231-1/+1
| | | | | | | | | Casting via void (*)(void) is the documented way to suppress this warning. This is required because the CPython API treats function pointers as generic, with flags to indicate different calling conventions. Signed-off-by: Simon McVittie <smcv@collabora.com>
* with-session-bus.sh: Remove unused scriptSimon McVittie2019-07-151-106/+0
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Add clearer licensing information in SPDX formatSimon McVittie2019-07-1517-1/+35
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Remove remaining support for Ubuntu 14.04 'trusty'Simon McVittie2019-07-151-1/+2
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* cross-test-server: Avoid a race condition in the clientSimon McVittie2018-05-091-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a race condition here between these chains of events, which as far as I can tell has existed for at least 10 years: * server receives Tests.Trigger() and schedules SignalTests.Triggered * server returns to main loop * server emits SignalTests.Triggered * client receives SignalTests.Triggered and * server receives Tests.Trigger() and replies with success * client receives success and emits SignalTests.Trigger * server receives SignalTests.Trigger and calls CallbackTests.Response() * client receives CallbackTests.Response() and calls Tests.Exit() * server receives Tests.Exit() and replies with success * client quits its main loop If we don't reply to Tests.Trigger() until after the SignalTests.Triggered signal has been sent, because the client called Tests.Trigger() asynchronously, messages are not re-ordered and the reply arrives after the signal; so the whole chain of events leading up to "client receives SignalTests.Triggered" happens before "client receives success and emits SignalTests.Trigger" and there is no race condition. Bug-Debian: https://bugs.debian.org/898158
* cross-test-client: Wait until default method timeout for Exit()Simon McVittie2018-05-091-2/+0
| | | | | | | | On a slow machine under load, communication might legitimately take time. After the default method-call timeout (25 seconds) we'll go into quit_error_handler() and exit anyway. Bug-Debian: https://bugs.debian.org/898158
* Avoid using async keywordSimon McVittie2018-01-292-5/+5
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Revert "test/import-repeatedly: skip on Python 3.6 for now"Simon McVittie2017-11-011-11/+0
| | | | | | | | Python 3.6.0a4 is meant to have fixed this. This reverts commit 1013581fef91c9be087d6264084cec34c2ca6e9a. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Drop support for Python 2.6, along with several workaroundsSimon McVittie2016-08-111-32/+14
| | | | | | It hasn't had security support for about 3 years. Signed-off-by: Simon McVittie <smcv@debian.org>
* test/import-repeatedly: skip on Python 3.6 for nowSimon McVittie2016-08-111-0/+11
| | | | | | This is a workaround for <http://bugs.python.org/issue27736>. Signed-off-by: Simon McVittie <smcv@debian.org>
* import-repeatedly: detect exceptionsSimon McVittie2016-08-111-1/+4
| | | | Signed-off-by: Simon McVittie <smcv@debian.org>
* Use TAP syntax for all directly-run testsSimon McVittie2016-08-119-58/+130
| | | | | | | For now this means that skipped tests will be reported as passed. This will be corrected in the next commit. Signed-off-by: Simon McVittie <smcv@debian.org>
* unicode test: cope with Python 2.6 as provided on travis-ciSimon McVittie2016-03-061-1/+4
| | | | | | Python 2.6 didn't allow struct.pack(u'...', ...). Signed-off-by: Simon McVittie <smcv@debian.org>
* run-test: avoid "test: =: unary operator expected"Simon McVittie2016-03-051-2/+3
| | | | Signed-off-by: Simon McVittie <smcv@debian.org>
* Fix Unicode tests on narrow Python buildsSimon McVittie2016-03-051-10/+29
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=57140 Signed-off-by: Simon McVittie <smcv@debian.org>
* Add a regression test for the version numberingSimon McVittie2016-03-051-0/+14
| | | | | | | Now that dbus.__version__ and dbus.version exist even in uninstalled builds, we can do this. Signed-off-by: Simon McVittie <smcv@debian.org>
* Move dbus-python.h to a dbus subdirectorySimon McVittie2016-03-051-1/+1
| | | | | | | This means we can consistently #include <dbus/dbus-python.h>, either in-tree or out-of-tree. Signed-off-by: Simon McVittie <smcv@debian.org>
* Make all test scripts properly executableSimon McVittie2016-02-227-0/+4
| | | | Signed-off-by: Simon McVittie <smcv@debian.org>
* Use gi instead of gobject, everywhere except dbus.gobject_serviceSimon McVittie2016-01-201-2/+2
|
* Replace hard-coded sleep with a wait for the D-Bus name to appearSimon McVittie2016-01-202-6/+70
|
* Use non-recursive make for tests, and make them into installed-testsSimon McVittie2016-01-2010-225/+93
|
* Use non-recursive make for everything except testsSimon McVittie2016-01-201-1/+1
|
* Simplify testing by using dbus-run-session and Automake "log compiler"Simon McVittie2015-12-064-167/+167
| | | | | | | Fall back to Telepathy's old with-session-bus.sh script if dbus doesn't have dbus-run-session (versions < 1.8). Also run most of the tests individually, instead of under run-test.sh.
* Use AX_COMPILER_FLAGSSimon McVittie2015-12-061-7/+19
|
* Update build system for Automake 1.13 (parallel test driver)Simon McVittie2015-12-051-7/+9
|
* distribute new testsdbus-python-1.2.0Simon McVittie2013-05-081-0/+2
|
* Add support for skipping tests, and use itSimon McVittie2013-05-087-15/+62
| | | | | Now that Python 2.6 isn't a supported version in Debian, it doesn't get a gi module, but we can still get some minimal test coverage.
* utf8 test: pass when used with dbus 1.6.10, 1.7.2Simon McVittie2013-05-081-16/+25
| | | | We used to reject noncharacters, but now we accept them.
* Unset DBUS_STARTER_ADDRESS, DBUS_STARTER_BUS_TYPESimon McVittie2013-04-221-0/+2
| | | | See <https://bugs.freedesktop.org/show_bug.cgi?id=63119>.
* Slightly better test coverageSimon McVittie2012-10-161-0/+4
|
* Use a form of assertRaises() that works in Python 2.6Simon McVittie2012-10-161-3/+2
|
* Skip test_dbus_exception_convert_str_fail under unusual default encodingsSimon McVittie2012-10-161-3/+8
| | | | | This would actually work fine if the default encoding was UTF-8 or Latin-1 or something.
* Support unicode messages for DBusException in Python 2Michael Vogt2012-10-163-0/+95
| | | | | | [commit message amended -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55899 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* run-test.sh: don't go via make to run the cross-testSimon McVittie2012-07-041-2/+2
| | | | | | Based on a patch from Christoph Höger. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=51725
* fd.o #40817: validate UTF-8 according to the same rules as libdbusdbus-python-1.1.1Simon McVittie2012-06-251-1/+58
|
* Py3: correctly guess the signature of ObjectPath(...) and Signature(...)Simon McVittie2012-06-051-0/+2
| | | | | | | | | | | | Under Python 2, ObjectPath and Signature are subtypes of str (= bytes), and the existing type-guessing worked. The type-guessing code assumed that all unicode objects were just strings, but that assumption became false in the Python 3 port: ObjectPath and Signature are still subtypes of str, but str now means unicode, not bytes. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=50740
* Rename gobject_service (PyGI version) to gi_serviceSimon McVittie2012-05-021-5/+5
| | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48904
* Put sockets for the regression tests in /tmp, not ${builddir}Simon McVittie2012-02-291-1/+1
| | | | | | | | | Some automated build systems (naming no Portage) have really long build directories, which can cause dbus-python to hit the length limit for Unix sockets' names. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46747 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Test behaviour of various Message methodsSimon McVittie2012-01-111-0/+54
|
* Do not allow Byte(unicode(x)) (i.e. Byte(str(x)) in Python 3)Simon McVittie2012-01-112-16/+40
| | | | | Unicode strings aren't bytestrings, so there's no obvious meaning for the byte value of a Unicode string of length 1.
* Quash a few more deprecations.Barry Warsaw2011-12-172-6/+6
|
* More Python 3 porting, this time primarily to get test-client.py working.Barry Warsaw2011-12-163-124/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | Changes include: - DBusException.get_dbus_message(): In Python 3, the str of the exception will already be a unicode, so don't try to decode it unless it's a bytes object (a.k.a. 8-bit str in Python 2). - gobject_service.py: Switch to pygi and rewrite the metaclass instantiation code to be portable between Python 2 and Python 3. - run-test.sh: echo a few more useful environment variables - test-client.py: - Globally replace deprecated assertEquals with assertEqual - Globally replace deprecated assert_ with assertTrue - Use bytes objects for both 'ay' signatured methods on the server - AcceptUnicodeString will return a native unicode, i.e. a str in Python 3 and a unicode in Python 2. Python 3 has no `unicode` built-in. - Reformat some long lines for debugging. - test-service.py: - Open the log file in 'a' mode for easier tailing. - AcceptUnicodeString will return a native unicode, i.e. a str in Python 3 and a unicode in Python 2. Python 3 has no `unicode` built-in. - reformat some long lines for debugging. - Put module-scope code into a main() function and add a bunch of logger output for better debugging. `session_bus` must still be global though. Wrap main() in a bit try/except to log all top-level exceptions.
* Re-enable the other tests, even though these still fail for me (b.f.o #43303).Barry Warsaw2011-12-162-9/+9
| | | | Fix another except syntax problem.
* Re-enable previously disabled test.Barry Warsaw2011-12-151-1/+2
|
* Fix the match rule semantics so that a match rule of "arg0='/'" does not matchBarry Warsaw2011-12-151-0/+19
| | | | object paths in Python3, as per Simon's review comments.