Commit graph

825 commits

Author SHA1 Message Date
Simon McVittie
88c6b7ac73 fix installable tests to not install if unwanted 2011-06-10 21:52:39 +01:00
Simon McVittie
c83287898c Merge branch 'dbus-1.4' 2011-06-10 18:52:07 +01:00
Simon McVittie
1250da8f7b Fix copyright dates
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:33:22 +01:00
Simon McVittie
6ace0a5cbd Use DBUS_TIMEOUT_INFINITE in dbus-daemon.c
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:33:20 +01:00
Simon McVittie
0fa7d26c8e Test that a message with the byte order mangled causes disconnection but no crash
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38120
2011-06-10 18:32:58 +01:00
Simon McVittie
b92612945a marshal test: test dbus_message_demarshal_bytes_needed
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38120
2011-06-10 18:32:49 +01:00
Simon McVittie
bf421f5a30 Add a test for marshalling and endian-swapping
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38120
2011-06-10 18:32:43 +01:00
Simon McVittie
983fd36264 installcheck: don't run installed tests against installed library if in a DESTDIR
That probably won't work, because it'll find the system-wide library
which might be older.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:32:40 +01:00
Simon McVittie
715fa5c0d5 Alter test-dbus-daemon so it tests the installed dbus-daemon by default
For installcheck, adjust it to use things from DESTDIR.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:32:37 +01:00
Simon McVittie
a2f3b17504 Add support for installing most of the modular tests
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:32:35 +01:00
Simon McVittie
f43d76a83b new test for being disconnected by a corrupt message stream
This was meant to reproduce fd.o #15578, but doesn't; the cause of that
bug isn't this simple.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:32:27 +01:00
Simon McVittie
da6b4d0426 Test nonce-tcp transport
Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=34569

Reviewed-by: David Zeuthen <davidz@redhat.com>
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:32:10 +01:00
Simon McVittie
ae5524d632 dbus-daemon test: sanity-check the just-installed config file when using DESTDIR
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:32:06 +01:00
Simon McVittie
ba9c274f33 Add a simple integration test for dbus-daemon
This just pushes 2000 messages (or 100000 in performance-testing mode)
through the dbus-daemon, to an echo service and back.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:32:02 +01:00
Simon McVittie
7f25b33f1f Run integration tests on the installed dbus binaries during installcheck
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:31:57 +01:00
Simon McVittie
1c485fc7be Give the tests DBUS_TEST_DAEMON and DBUS_TEST_DATA in their environment
This will allow modular tests to spawn a dbus-daemon with a specified
config file; nothing uses this just yet.

Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:31:51 +01:00
Simon McVittie
841352a73a Attempt to reproduce fd.o #34393 via another regression test
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:31:47 +01:00
Simon McVittie
65de5fd80a loopback test: unref messages after use
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:31:46 +01:00
Simon McVittie
163d3b2154 Add an end-to-end sanity check for TCP and Unix DBusServer/DBusConnection
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
2011-06-10 18:31:42 +01:00
Simon McVittie
fd99c3a1c1 Merge branch 'dbus-1.4' 2011-05-25 17:39:34 +01:00
Simon McVittie
cea055514a Check for X even if X11 autolaunching is disabled
DBUS_ENABLE_X11_AUTOLAUNCH obviously requires DBUS_BUILD_X11. However,
the converse is not true.

If DBUS_BUILD_X11 is defined, dbus-launch will be able to connect to
the X server to determine when the session ends; most distributors will
want this, but it can be disabled with the standard Autoconf option
--without-x.

If DBUS_ENABLE_X11_AUTOLAUNCH is *also* defined, dbus-launch and libdbus
will be willing to perform autolaunch. Again, most distributors will want
this, but it can be disabled with --disable-x11-autolaunch.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=19997
Reviewed-by: Colin Walters <walters@verbum.org>
2011-05-25 17:38:44 +01:00
Simon McVittie
2bfac1b73d test-autolaunch: don't expect autolaunching to work if X11 is disabled
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=19997
Reviewed-by: Colin Walters <walters@verbum.org>
2011-05-25 17:38:21 +01:00
Simon McVittie
2adf484fb3 Revert merge of master (dbus-1.5) into dbus-1.4
This reverts commits d1d395774435..09c9d6406b75f, keeping Lennart's
addition of UnknownInterface etc.
2011-03-14 11:53:09 +00:00
Simon McVittie
09c9d6406b Make dbus_type_is_valid into public API
This is just as useful for bindings as dbus_signature_validate, and I
think it's a good design principle to say that anything checked in a
_dbus_return_if_fail should be something the caller could check
for themselves.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=20496
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-03-10 19:14:55 +00:00
Simon McVittie
9a97f82079 Import compiler.m4 and lcov.am from telepathy-glib, and use them to replace gcov
Reviewed-by: Colin Walters <walters@verbum.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=10887
2011-02-17 17:07:12 +00:00
Simon McVittie
a0e8ae3b77 Merge branch 'dist-30285' into dbus-1.4
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-02-02 15:15:02 +00:00
Simon McVittie
9fee6d735e Merge branch 'serverdata-33277' into dbus-1.4
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-02-02 15:14:31 +00:00
Simon McVittie
27f29026c2 Don't distribute generated files that embed our builddir
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30285
2011-02-01 18:04:21 +00:00
Simon McVittie
a431ced679 test/name-test: remove dangling references to test-names.c, which is absent
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-01-25 13:18:03 +00:00
Simon McVittie
4fa3a89d32 test-privserver-client: wait for server to die between iterations
This fixes a race condition: the server exits while the client continues
to the next iteration. If the server wins, the test passes. If the client
wins, it sends a message to the dying service, never gets a reply, and the
test fails.

My branch to refactor the main loop for fd.o #23194 seems to make the
client more likely to win this race, resulting in intermittent test
failures.

This is an instance of the general problem described by fd.o #11454.
2011-01-21 14:22:39 +00:00
Simon McVittie
a9327eba3c test_server_shutdown: disconnect the server before causing it to be freed
Otherwise we die with an assertion failure.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33277
2011-01-21 14:22:39 +00:00
Simon McVittie
e529c4bcdb test_server_setup: allocate two server-data blobs, for watches and timeouts
This is similar to how ConnectionData works. Without this change, we
deserve to segfault: when the first set of callbacks (either watches or
timeouts) is cleaned up, we unref the server and loop, and free sd;
when the second set of callbacks is cleaned up, we use-after-free sd,
the server and the loop, then double-free sd.

However, due to fd.o #33277 we don't even get that far, because we've
already died with an assertion failure.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33277
2011-01-21 14:22:39 +00:00
Simon McVittie
c894f62f2c test_server_setup: on OOM while setting up watch/timeout, don't leak sd
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33128
Reviwed-by: Colin Walters <walters@verbum.org>
2011-01-21 13:28:08 +00:00
Simon McVittie
e870df7b82 Add autolaunch test to .gitignore 2011-01-06 17:35:35 +00:00
Will Thompson
f2905def7b policy tests: Use bin rather than nogroup, wheel, or root
This group seems to exist on all of Debian, Fedora and Mac OS X. (I
mistakenly believed that nogroup exists on Fedora.)
2010-12-17 18:42:13 +00:00
Will Thompson
c3a94b57c8 Revert "test-autolaunch is only known to work in launchd environments."
This reverts commit 4626b40560.
test-autolaunch works fine in non-launchd environments (and non-X11
environments, based on a quick test passing enable_x11=no to configure).
On the contrary: this commit *broke* the build on non-launchd
environments, because test/name-test/run-test.sh still tried to run this
test even if it hadn't been built.
2010-12-15 09:43:17 +01:00
Will Thompson
844134faee policy tests: Use 'nogroup' rather than 'wheel' or 'root'
The excellently-titled commit 197bef8 “Fix test failures on OSX.” broke
the tests on Linux, since there's no wheel group on this side of the
tracks. So here's a group everyone should enjoy.

(If anyone comes along and tells me that DragonflyBSD doesn't have
'nogroup' …)
2010-12-15 09:42:55 +01:00
Mike McQuaid
197bef8277 Fix test failures on OSX. 2010-12-04 23:49:39 +01:00
Mike McQuaid
4626b40560 test-autolaunch is only known to work in launchd environments. 2010-12-04 23:47:35 +01:00
Colin Walters
aff6263561 Added a test-autolaunch.
* test/name-test/test-autolaunch.c: New file,
	unsets DBUS_SESSION_BUS_ADDRESS so we should
	fall back to autolaunch:.
	* test/name-test/run-test.sh: Run it.
	* test/name-test/Makefile.am: Build it.
2010-12-04 23:03:13 +01:00
Will Thompson
92ac7113d3 Update a load of .gitignores 2010-10-05 11:45:48 +01:00
Will Thompson
4d8c0c3074 Silence silent build a bit more. 2010-10-05 11:45:48 +01:00
Colin Walters
45d53565bc Make dbus-uuidgen atomic
A Red Hat QA engineer hit in practice a race condition in dbus-uuidgen
where it could leave an empty file.

dbus-uuidgen (_dbus_create_uuid_file_exclusively) formerly created an
empty file in the path to the uuid, then filled it in.  At some point,
the internal libdbus _dbus_string_save_to_file became atomic on Unix
at least (doing the save to temp file, fsync(), rename() dance).

So _dbus_create_uuid_file_exclusively doesn't need to create the file
beforehand anymore.  However, it *does* need the file to be
world-readable, unlike all other consumers of
_dbus_string_save_to_file.  So add a "world_readable" argument.
2010-09-03 14:29:53 -04:00
Yaakov Selkowitz
aec82e2edd Applied patches from cygwin port. 2010-08-10 08:25:24 +02:00
Ralf Habacker
ec18f1fc89 Port test-privserver to windows by using the TEST_LISTEN bus address. 2010-04-13 21:15:41 +02:00
Ralf Habacker
0ed7d779b7 Cmake support for cross plattform usable test files.
Recent test configuration files contains 'unix:...'
bus adresses which do not work on windows.
For cross plattform usable test files the whole
listen tag entry has to be set by the build system,
which is available with a new build system variable
named TEST_LISTEN.
To have the client client side definition in sync,
TEST_CONNECTION has been moved from c file into cmake
build system.
2010-04-11 11:49:46 +02:00
Ralf Habacker
ca7b8112c9 Renamed libdbus-convenience to libdbus-internal for automake (to stay in sync with cmake). 2010-03-23 09:21:48 +01:00
Marcus Brinkmann
1de6b09fbd Update dll export for autoconf (to stay in sync with cmake). 2010-03-23 09:10:39 +01:00
Colin Walters
df89cfeb38 Merge branch 'dbus-1.2'
Conflicts:
	bus/dispatch.c
	configure.in
	test/name-test/test-names.c
2010-03-22 14:39:56 -04:00
Marcus Brinkmann
01d9d169f3 Make more signal and locale interface use conditional. 2010-03-22 17:28:55 +01:00