summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2013-04-22Accept non-characters when validating UnicodeSimon McVittie1-2/+4
Unicode Corrigendum #9 clarifies that the non-characters U+nFFFE (for n in the range 0 to 0x10), U+nFFFF (for n in the same range), and U+FDD0..U+FDEF are valid for interchange, and their presence does not make a string ill-formed. GLib 2.36 made the corresponding change in its definition of UTF-8 as used by g_utf8_validate() and similar functions. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63072 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-06-15When not producing a dynamic library, define DBUS_STATIC_BUILDSimon McVittie1-0/+3
When targeting Windows, linking against the static library requires special effort to turn off DLL import/export processing. We normally link some things against the dynamic library, but if we're not building that, we'll have to link everything statically. Based on patches from 'william' on fd.o #46367. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33973 Tested-by: René Berber <Rene.Berber gmail com>
2012-06-05Fix distcheck: remove potentially-read-only files from builddirSimon McVittie1-0/+1
During distcheck, the srcdir is read-only. During "make all", cp may preserve the read-only status of the file copied from the srcdir, resulting in failure to overwrite it with an identical file during "make check" (which depends on all-local). Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-04-25Merge branch 'dbus-1.4'Simon McVittie1-7/+7
Conflicts: NEWS dbus/dbus-internals.c dbus/dbus-mainloop.c dbus/dbus-sysdeps-unix.c dbus/dbus-sysdeps-win.c dbus/dbus-sysdeps.c dbus/dbus-sysdeps.h
2012-04-25use cp and mkdir -p instead of install within source treeAntoine Jacoutot1-7/+7
$(INSTALL) and $(INSTALL_DATA) try to change ownerships to root:bin when copying tests to builddir. Presumably this is a difference in behaviour between GNU and BSD install(1): the one in GNU coreutils doesn't try-and-fail to change ownership if you're not root. [Commit message added by smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48127 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-04-12Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication methodDavid Zeuthen3-5/+5
When libdbus-1 moved to using monotonic time support for the DBUS_COOKIE_SHA1 authentication was broken, in particular interoperability with non-libdbus-1 implementations such as GDBus. The problem is that if monotonic clocks are available in the OS, _dbus_get_current_time() will not return the number of seconds since the Epoch so using it for DBUS_COOKIE_SHA1 will violate the D-Bus specification. If both peers are using libdbus-1 it's not a problem since both ends will use the wrong time and thus agree. However, if the other end is another implementation and following the spec it will not work. First, we change _dbus_get_current_time() back so it always returns time since the Epoch and we then rename it _dbus_get_real_time() to make this clear. We then introduce _dbus_get_monotonic_time() and carefully make all current users of _dbus_get_current_time() use it, if applicable. During this audit, one of the callers, _dbus_generate_uuid(), was currently using monotonic time but it was decided to make it use real time instead. Signed-off-by: David Zeuthen <davidz@redhat.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48580
2012-04-12Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication methodDavid Zeuthen3-5/+5
When libdbus-1 moved to using monotonic time support for the DBUS_COOKIE_SHA1 authentication was broken, in particular interoperability with non-libdbus-1 implementations such as GDBus. The problem is that if monotonic clocks are available in the OS, _dbus_get_current_time() will not return the number of seconds since the Epoch so using it for DBUS_COOKIE_SHA1 will violate the D-Bus specification. If both peers are using libdbus-1 it's not a problem since both ends will use the wrong time and thus agree. However, if the other end is another implementation and following the spec it will not work. First, we change _dbus_get_current_time() back so it always returns time since the Epoch and we then rename it _dbus_get_real_time() to make this clear. We then introduce _dbus_get_monotonic_time() and carefully make all current users of _dbus_get_current_time() use it, if applicable. During this audit, one of the callers, _dbus_generate_uuid(), was currently using monotonic time but it was decided to make it use real time instead. Signed-off-by: David Zeuthen <davidz@redhat.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48580
2012-03-27Merge remote-tracking branch 'alban/own_prefix2'Simon McVittie2-0/+16
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46273
2012-03-27Port to glib 2.31.x g_thread APIMartin Pitt1-41/+37
g_thread_init() is deprecated since glib 2.24, call g_type_init() instead. Bump glib requirement accordingly. g_thread_create is deprecated since 2.31, use g_thread_new() instead. When building with a glib earlier than 2.31, provide a backwards compatibility shim. [Added a comment about why we're using g_type_init() in a test that doesn't otherwise use GObject -smcv] [Applied to 1.4 despite just being a deprecation fix because it also fixes linking with GLib 2.32, in which gthread has been removed from gobject's Requires and moved to Requires.private, Debian #665665 -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=44413 Bug-Debian: http://bugs.debian.org/665665 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-03-22test: enforce own_prefix policy rulesAlban Crequy1-0/+14
After parsing [allow|deny] rules with own_prefix, check they are enforced correctly. https://bugs.freedesktop.org/show_bug.cgi?id=46886
2012-03-22test: parse own_prefix policy rulesAlban Crequy1-0/+2
Just check that the parser accept [allow|deny] rules with own_prefix https://bugs.freedesktop.org/show_bug.cgi?id=46886
2012-03-12Merge branch 'dbus-1.4'Simon McVittie1-83/+131
2012-03-12Enumerate data files used in the build rather than using find(1)Simon McVittie1-83/+130
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33840 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2012-02-24Add a regression test for validating various string types with the public APISimon McVittie2-0/+294
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39549 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2012-02-21Mark shell-test as modular and installableSimon McVittie1-9/+3
This test needs non-public API and so is statically linked, but is OK to install. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42811 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-02-21Allow a reduced set of installable tests (none yet) to be built without GLibSimon McVittie1-0/+5
--enable-modular-tests=auto will build as many as possible, perhaps excluding the GLib ones. --enable-modular-tests=yes or --enable-tests=yes will insist on having GLib, to be able to run everything. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42811 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-02-07Merge branch 'socket-set-33337'Simon McVittie1-7/+20
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33337
2012-01-23Port to glib 2.31.x g_thread APISimon McVittie1-41/+37
g_thread_init() is deprecated since glib 2.24, call g_type_init() instead. Bump glib requirement accordingly. g_thread_create is deprecated since 2.31, use g_thread_new() instead. When building with a glib earlier than 2.31, provide a backwards compatibility shim. [Added a comment about why we're using g_type_init() in a test that doesn't otherwise use GObject -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=44413 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-01-23Revert addition of files which were only meant to exist on master, tooSimon McVittie2-573/+0
This completes the reversion started in 5df8c3db12590edd68e968.
2012-01-04Revert all changes since a36d4918a6f646e085Simon McVittie30-166/+214
Someone seems to have merged part of master into 1.4. Again. Let's go back to the "last known good" point (the branch-point of some 1.4 branches I had locally), then we can cherry-pick the changes that should have gone in.
2011-12-21Merge branch 'dbus-1.4' of ssh://git.freedesktop.org/git/dbus/dbus into dbus-1.4Ralf Habacker2-23/+38
2011-11-02Merge branch 'dbus-1.4'Simon McVittie2-23/+38
2011-11-02corrupt test: compile successfully against older GLib (Debian stable)Simon McVittie1-23/+37
We don't really need g_socket_send_with_blocking here. Also, don't leak the GLib socket objects. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41219 Reviewed-by: Lennart Poettering <lennart@poettering.net>
2011-11-02Set DBUS_TEST_HOMEDIR when running installcheckSimon McVittie1-0/+1
This avoids spamming ~/.dbus and ~/.dbus-keyrings with filesystem activity while running the tests. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41218 Reviewed-by: Lennart Poettering <lennart@poettering.net>
2011-09-28Merge tests' cmake and autotools bus configurationSimon McVittie8-65/+4
In Unix, the tests listened on both debug-pipe (which is a socketpair, or a TCP emulation of socketpair on Windows) and a Unix socket. In the Windows port, the tests were hard-coded to listen on a particular port, which allowed the dispatch test to connect to that port, as long as no two tests ran simultaneously (which I don't think was ever guaranteed - make -j can violate this). That's valid out-of-process, and also fully-specified, so they only needed one <listen> directive, so the CMake input only had one. To make the tests work under CMake on Unix, there was a hack: the string substituted for the content of the <listen> directive contained </listen><listen> to get the other address in, which is pretty nasty. Instead of doing that, I've made both build systems, on both Unix and Windows, use both debug-pipe and a more normal transport (Unix or TCP). debug-pipe has a Windows implementation and it's used in dbus-spawn-win.c, so it'd better work. The use of debug-pipe is now hard-coded rather than being a configure parameter (there's no reason to vary it in different builds), and I used TEST_LISTEN as the name of the Unix/TCP address, because it's a "vague" address (no specific Unix path, no TCP port), that you can listen on but not connect to. This in turn means that we can merge the Autoconf .in and CMake .cmake files, similar to Bug #41033. You might wonder why I've kept debug-pipe. I did try to get rid of it, but it turns out that the tests in dispatch.c rely on dbus_connection_open_private() not blocking, and normal socket connections block on connect(). Until we fix that by adding an async version of dbus_connection_open_private(), it won't be safe to have a test like dispatch.c that "talks to itself", unless it uses a transport as trivial as debug-pipe in which neither end has to block on the other. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41222
2011-09-28Simplify substitution of test executables to use fewer variablesSimon McVittie12-15/+12
Also use EXEEXT in all the service files, even in the automake build system. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41222
2011-09-28Simplify generation of bus configuration filesSimon McVittie8-8/+8
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41222
2011-09-21refs test: fix unused variableSimon McVittie1-1/+0
This one was added since my more-unused-39231 branch.
2011-09-21Fix compilation of syslog test in masterSimon McVittie1-2/+2
2011-09-21Merge branch 'more-unused-39231'Simon McVittie1-4/+0
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21Merge branch 'dbus-1.4'Simon McVittie5-5/+115
Conflicts: NEWS
2011-09-21Check for Python; skip Python tests if not foundSimon McVittie3-4/+7
As with the optional test-dependencies on GLib and dbus-glib, we make this a hard dependency if --enable-tests[=yes], but not if --enable-tests=auto. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37847 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21Add a semi-automatic test for _dbus_system_logSimon McVittie2-0/+105
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39987 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-21Make "make -C test clean" idempotentSimon McVittie1-1/+3
Previously, it'd fail when done twice, because you can't rmdir a nonexistent directory. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40004 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-19Remove more never-used variablesSimon McVittie1-4/+0
2011-08-12dbus-daemon-eavesdrop test: apply the same Windows fixes as dbus-daemon testSimon McVittie1-2/+3
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40003
2011-08-12Fix linking of libdbus-testutils.la with Automake targeting WindowsSimon McVittie1-5/+7
This regressed in commit 9875480ed - libdbus-testutils.la needs static linking too.
2011-08-12Merge branch 'dbus-1.4'Simon McVittie1-2/+3
2011-08-12Fix compiler warnings when cross-compiling dbus-daemon test for mingw32Simon McVittie1-2/+3
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40003 Reviewed-by: Colin Walters <walters@verbum.org>
2011-08-05Merge branch 'dbus-1.4'Simon McVittie3-4/+626
Conflicts: bus/main.c
2011-08-05Add a regression test for fd.o #38005Simon McVittie2-0/+618
(The dbus-1.4 version.) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39836 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-08-05relay test: don't leak the server's addressSimon McVittie1-4/+8
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39836 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-08-05Remove various never-used variablesSimon McVittie3-4/+0
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-08-05test-service, test-shell-service: check what RequestName returnedSimon McVittie2-1/+15
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-07-29test, test/name-test: remove SOURCES where they can be inferred from the ↵Simon McVittie2-57/+0
name of the executable
2011-07-29test/name-test: remove useless CFLAGSSimon McVittie1-4/+0
2011-07-29test/name-test: use AM_CPPFLAGS instead of INCLUDESSimon McVittie1-2/+6
2011-07-29test: promote GLIB_CFLAGS, DBUS_GLIB_CFLAGS to top level and use AM_CPPFLAGSSimon McVittie1-6/+5
INCLUDES is a deprecated way to get the same effect as AM_CPPFLAGS. It's harmless to add extra -I directories to all the tests, even those that use neither GLib nor dbus-glib, so we can simplify by setting these AM_CPPFLAGS for the whole directory.
2011-07-29test: reverse assumption regarding static/dynamic linkingSimon McVittie1-3/+10
If we change the default assumption to be that new tests will be dynamically-linked to libdbus, those tests can be useful for installcheck or even for installation. Accordingly, explicitly use new variable $(static_cppflags) for all tests that need static linking.
2011-07-29Simplify linking for tests that use libdbus-testutilsSimon McVittie2-9/+15
This is the library used by tests that link libdbus-internal and DBusLoop. By linking libdbus-internal into it, we can avoid having to repeat that dependency all over the place - libtool and cmake both know how to follow recursive dependencies. In cmake, also use libdbus-testutils for more tests, in preference to repeating its source files.