summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2015-01-01Add a regression test for path-based UpdateActivationEnvironment hardeningSimon McVittie1-0/+87
Reviewed-by: Thiago Macieira <thiago@kde.org>
2014-09-15On Linux, call prctl to disable core dumpsSimon McVittie1-1/+17
Whenever I forget to turn off corekeeper, the regression tests take ages to record all test-segfault's crashes. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83772 Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
2014-04-30Handle 0x0d0a EOLs in spawn_dbus_daemon()Руслан Ижбулатов2-0/+4
On W32 dbus daemon will print output in text mode, with 0x0d0a EOLs instead of just 0x0a. Be able to handle that. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=75863 Reviewed-by: Simon McVittie
2014-03-06Update .gitignore filesLukasz Skalski1-0/+6
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=75833 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-17Rename bus-test-launch-helper to test-bus-launch_helper to match common test ↵Ralf Habacker1-1/+1
application naming scheme. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-17Rename bus-test-system to test-bus-system to match common test application ↵Ralf Habacker1-1/+1
naming scheme. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-17Rename bus-test to test-bus to match common test application naming scheme.Ralf Habacker2-2/+2
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-17Rename spawn-test to test-spawn to match common test application naming scheme.Ralf Habacker2-4/+5
[Same change as for shell-test in the previous commit. -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-17Rename shell-test to test-shell to match common test application naming scheme.Ralf Habacker2-4/+5
[Add its source file to SOURCES: this test was previously relying on the Automake feature that the default value of foo_bar_SOURCES is foo-bar.c. -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-17Rename dbus-test to test-dbus to match common test application naming scheme.Ralf Habacker1-1/+1
[reverted the dbus-specification part -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-10tests: don't block and wait for a debugger on abortSimon McVittie1-1/+0
In general, I think developers running the tests would expect them to terminate rather than hanging. Developers who want to debug such an abort by attaching a debugger to a live process can still set DBUS_BLOCK_ON_ABORT in the environment. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2014-01-07test/dbus-daemon, test/dbus-daemon-eavesdrop: allow external dbus-daemonSimon McVittie2-2/+24
It's easier to automate these tests if they launch their own dbus-daemon, but easier to debug them if they don't: you can launch a dbus-daemon separately, under gdb. However, tests that need a specially-configured dbus-daemon will have to be skipped. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2014-01-06Skip unix only syslog test.Ralf Habacker1-1/+2
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-06Make sure tests run with a temporary XDG_RUNTIME_DIRSimon McVittie4-1/+15
We don't want the regression tests' "session" getting mixed up in system-wide "sessions". This doesn't actually matter yet, but it is likely to matter in future. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61301 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com> [merged with earlier line-wrapping of TESTS_ENVIRONMENT -smcv] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-01DBusBabysitter: change executable to log_nameChengwei Yang1-1/+1
DBusBabysitter->executable is defined as executable name to use in error messages. However, if servicehelper used, then the executable name is servicehelper. It's not much help because we couldn't figure out which service we're trying to activated if error happens. In the following patch, we'll use service name to be activated as the child log identifier and add a parameter to _dbus_spawn_async_with_babysitter() to pass the log identifier. Since this is not the case in test, so executable changed to log_name. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68559 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-10-10$(in_data) is meant to contain the .in filesSimon McVittie1-1/+1
Reviewed-by: Colin Walters
2013-10-10test: Update build for previous commitColin Walters1-1/+1
It should now be in in_data so we find it in $(srcdir).
2013-10-10Use TEST_LISTEN in incoming-listen.conf.in instead of unix only hardcoded ↵Ralf Habacker1-1/+1
address Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68506 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-10-08Unify the way to find dbus-daemon test binaryChengwei Yang1-0/+1
There are two ways to find the dbus-daemon for testing. The first one is defined as string at compile stage and the second one is export it from test environment. The first way has limitation that after defined, it's static string, so it's impossible to run installable check. So let's unify to the second way. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37849 [added missing "}" -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-13Don't assume that X11 autolaunch will work if DISPLAY is unsetSimon McVittie1-3/+5
In practice, it won't; other forms of autolaunch (like Mac OS launchd) might, but we can't really assert either way. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40352 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com> [amended to reinstate use of dbus/dbus-sysdeps.h which was removed by 412538b3b9 -smcv] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-13Use test binaries in build dir to do testChengwei Yang1-1/+6
When do autolaunch testing, libdbus will try to start dbus-launch in installed direcotry, if fail then fall back to dbus-launch in $PATH. dbus-launch does a relative better thing to start dbus-daemon in build directory, however, in most of case, the build $prefix is different from the real prefix where dbus-daemon installed. So dbus-daemon will fail to start due to can't find its config file. And then dbus-launch will fall back to finally the installed dbus-daemon. This patch fix this behavior and will start dbus-launch and dbus-daemon in build directory in test environment. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37849
2013-09-13Remove DBUS_COMPILATION from test source codeChengwei Yang1-2/+0
DBUS_COMPILATION definition was moved to test/Makefile.am static_cppflags, so remove it from test source code. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-05Use GNU make features to reduce repetitionSimon McVittie1-5/+1
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48277 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
2013-09-05Add CPPFLAGS to "shared if possible" test binariesSimon McVittie1-8/+16
In principle we ought to define DBUS_STATIC_BUILD in anything that's using libdbus-internal.la (to avoid linking failures on statically-linked mingw builds), and DBUS_TEST_USE_INTERNAL in any test that's using the non-dbus-glib code paths of test-utils.[ch] (to avoid the GLib requirement, although in practice, everything "shared if possible" requires GLib at the moment anyway). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2013-09-05run-with-tmp-session-bus.sh: create a unique temporary file per processSimon McVittie1-1/+1
This makes the regression tests OK to run in parallel. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2013-09-03Tests: allow dbus-glib to be replaced with use of libdbus-internalSimon McVittie11-107/+262
We only use dbus-glib for its main loop; within dbus, DBusLoop is available as an alternative, although it isn't thread-safe and isn't public API. For tests that otherwise only use libdbus public API, it's desirable to be able to avoid DBusLoop, so we can run them against an installed libdbus as an integration test. However, if we don't have dbus-glib, we're going to have to use an in-tree main loop, which might as well be DBusLoop. The major disadvantage of using dbus-glib is that it isn't safe to link both dbus-1 and dbus-internal at the same time. This is awkward for a future test case that wants to use _dbus_getsid() in dbus-daemon.c, but only on Windows (fd.o #54445). If we use the same API wrapper around both dbus-glib and DBusLoop, we can compile that test against dbus-glib or against DBusLoop, depending on the platform. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2013-09-03Define DBUS_COMPILATION externally for all tests that use internal stuffSimon McVittie7-10/+2
It might as well go in the AM_CPPFLAGS rather than in the source code. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2013-09-03corrupt test: close connection before releasing GSocketSimon McVittie1-0/+16
GSocket takes responsibility for closing the fd, and there doesn't seem to be any way to tell it not to. When this test is adapted to run under DBusLoop as an alternative to dbus-glib, that becomes a problem, because DBusLoop/DBusSocketSetEpoll do not tolerate that. Work around it. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2013-08-23Export dbus_setenv() as a utility functionSimon McVittie1-2/+1
It's sufficiently portable that GLib has an equivalent, and I really don't want to have to either open-code it in dbus-run-session or link dbus-run-session statically. We have enough statically-linked rubbish already. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39196 Reviewed-by: Colin Walters <walters@verbum.org>
2013-08-23Revert "Enable anonymous authorization for tests"Simon McVittie1-2/+1
This reverts commit 22fc03d274f186a788efbdbe6b6dfcff1ad474df.
2013-08-23Manual rebase fix.Ralf Habacker1-1/+1
2013-08-23Add a test-case for trying to connect with the wrong GUIDSimon McVittie1-1/+67
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39720 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-08-23Add a simple manual test for authentication/authorization.Simon McVittie2-2/+417
Bug: http://bugs.freedesktop.org/show_bug.cgi?id=39720 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2013-08-23Enable anonymous authorization for testsCosimo Alfarano1-1/+2
Now that authorization is in SASL mechs, enable anonymous authorizations when we are testing anonymous mechs functionality Bug: http://bugs.freedesktop.org/show_bug.cgi?id=39720 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-08-22GetConnectionCredentials: addSimon McVittie1-0/+127
The initial set of credentials is just UnixUserID and ProcessID. The rest can follow when someone is sufficiently interested to actually test them. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54445 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> [rename a function that Ralf found unclear -smcv] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-07-24test/marshal: Ensure we use suitably aligned buffersColin Walters1-5/+22
This test was failing on s390; though it could fail on other platforms too. Basically we need to be sure we're passing at least word-aligned buffers to the demarshalling code. malloc() will do that for us. https://bugs.freedesktop.org/show_bug.cgi?id=67279
2013-06-28tests to embedded tests: replaced in automake filesChengwei Yang2-5/+5
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66291
2013-06-17Make taking a global lock automatically initialize locking if neededSimon McVittie1-5/+9
This lets them be thread-safe by default, at the cost that they can now fail. init_uninitialized_locks() and init_global_locks() must now both reimplement the equivalent of _dbus_register_shutdown_func(), by using _dbus_platform_rmutex_lock() on the same underlying mutex around a call to _dbus_register_shutdown_func_unlocked(). This is because if they used the usual _DBUS_LOCK() API (as _dbus_register_shutdown_func() does), it would automatically try to initialize global locking, leading to infinite recursion. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk> Reviewed-by: Anas Nashif <anas.nashif@intel.com>
2013-06-12Merge branch 'dbus-1.6'Simon McVittie2-0/+94
Conflicts: NEWS configure.ac
2013-06-12Add a test-case for CVE-2013-2168Simon McVittie2-0/+94
Reviewed-by: Thiago Macieira <thiago@kde.org> [build system adjusted to compile it even if we don't have GLib -smcv]
2013-04-22Merge branch 'dbus-1.6'Simon McVittie1-2/+4
Conflicts: NEWS
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>
2013-04-08Do not suppress syslog test's stderr just because init is systemdSimon McVittie1-3/+3
This causes the test to fail. The assumption implicitly being made was "if pid 1 is systemd, then every caller of _dbus_init_system_log() is a systemd service" which is not valid for the regression test. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63163 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Colin Walters <walters@verbum.org>
2013-02-22Include config.h as the first thing in every .c fileSimon McVittie2-0/+4
...except for CheckForAbstractSockets.c, which runs before config.h is generated, and sd-daemon.c, which is externally-maintained. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=59971 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Colin Walters <walters@verbum.org>
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