summaryrefslogtreecommitdiff
path: root/test/Makefile.am
Commit message (Collapse)AuthorAgeFilesLines
* tests: simplify Makefile.am now that libdbus is always dynamically linkedSimon McVittie2015-02-231-25/+11
| | | | | | | | | | | | | testutils_shared_if_possible_cppflags is now just a copy of AM_CPPFLAGS, which is the default and does not need to be given explicitly, so those lines can be removed. Similarly, testutils_shared_if_possible_libs is just the libdbus-testutils.la convenience library, so expand it and remove the unnecessary variable. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83115 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* Fix static linking with mingwSimon McVittie2015-02-201-0/+1
| | | | | | | | | | Now that we're normally linking libdbus-1 dynamically, we need to use DBUS_STATIC_BUILD_CPPFLAGS in every Makefile that would normally link it dynamically, but might link it statically if we are only building static libraries. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83115 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* Link dbus-daemon and dbus-daemon-lauch-helper against libdbusBertrand SIMONNET2015-02-201-28/+3
| | | | | | | | | | | | | | The shared can be used by dbus-daemon and dbus-daemon-launch-helper by exporting the private symbols needed, reducing the size of dbus by about 500k. The private symbols are exposed under the version LIBDBUS_PRIVATE_@VERSION_NUMBER@. [Altered by Simon McVittie and Ralf Habacker to clear up some problematic linking.] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83115 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* tests: always use libdbus-internal for main loop, never dbus-glibSimon McVittie2015-02-201-30/+11
| | | | | | | | | | This gets rid of a potential circular dependency, which is annoying when bootstrapping. It is nice to have the regression tests use the shared libdbus, but we're about to make it possible to do that anyway, even though some of them use internal symbols. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83115 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* Add manual-paths test to the Autotools (mingw) build tooSimon McVittie2015-02-161-0/+8
| | | | | As in CMake, it is restricted to Windows builds, since the functionality that it tests is not present in Unix builds.
* Add test-fdpass to the build, and make it compile againSimon McVittie2015-02-051-0/+12
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88998 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
* tests: make installable metadata Windows-friendly by using EXEEXTSimon McVittie2015-02-051-2/+2
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88980 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* tests: make sure to specify CPPFLAGS where neededSimon McVittie2015-02-051-0/+2
| | | | | | | | | test-marshal and test-syntax need the $(testutils_shared_if_possible_cppflags), so that they will get the $(static_cflags) when we are not linking to dbus-glib. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88980 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* Add a common test_init() for GLib tests which prevents hanging foreverSimon McVittie2015-02-041-2/+2
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
* Add a regression test for being a new-style monitorSimon McVittie2015-02-041-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes most of the situations I could think of: * method call on dbus-daemon and response * NameOwnerChanged * NameAcquired, NameLost (although I'm not 100% sure these should get captured, since they're redundant with NameOwnerChanged) * unicast message is allowed through * unicast message is rejected by no-sending or no-receiving policy * broadcast is allowed through * broadcast is rejected by no-sending policy (the error reply is also captured) * broadcast is rejected by no-receiving policy (there is no error reply) * message causing service activation, and the message telling systemd to do the actual activation * systemd reporting that activation failed It does not cover: * sending a message to dbus-daemon, then provoking a reply, then dbus-daemon does not allow itself to send the reply due to its own security policy This is such an obscure corner case that I'm not even convinced it's testable without dropping down into lower-level socket manipulation: dbus-daemon's replies are always assumed to be requested replies, and replies contain so little other metadata that I think we can only forbid them by forbidding all method replies. If we do that, the reply to Hello() won't arrive and the client-side connection will not become active. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
* Add a regression test for systemd activationSimon McVittie2015-02-031-0/+15
| | | | | | | 4.5 years after it was implemented, here is the regression test. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=57952 Reviewed-by: Philip Withnall
* Add a test for uid-controlled permissionsSimon McVittie2015-02-031-0/+11
| | | | | | | | This is technical debt from mitigating CVE-2014-8148, which should really have had a regression test at the time. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
* test: implement GLib-style "installed tests"Simon McVittie2015-02-031-6/+33
| | | | | | | | | | | | | We run each test twice: * once with the system's session.conf, as an integration test (test-cases that need a special configuration are automatically skipped) * once with our special test configuration files, which provide better coverage Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
* Generate test configuration files via build-time sed, not configureSimon McVittie2015-02-031-6/+64
| | | | | | | | This means we can generate a version that works when installed, from the same source files. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
* Factor out some utility functions from test/dbus-daemon*Simon McVittie2015-02-031-6/+13
| | | | | | | | | | | In the process, make test_kill_pid() safer: do not try to terminate more than one pid, or the NULL handle. Also stop leaking the address_fd in spawn_dbus_daemon, a pre-existing bug that was spotted by Philip Withnall during review. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
* Add manual tcp test case.Ralf Habacker2015-01-301-1/+6
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=87999 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Use a better NoReply message for disconnection with reply pendingSimon McVittie2014-10-291-0/+1
| | | | | | | | | | As an implementation detail, dbus-daemon handles this situation by artificially triggering a timeout (even if its configured timeout for method calls is in fact infinite). However, using the same debug message for both is misleading, and can lead people who are debugging a service crash to blame dbus-daemon instead, wasting their time. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=76112
* Make various system-bus-related things Unix-onlySimon McVittie2014-09-151-1/+1
| | | | | | | | There is no system bus on Windows, and there won't be until/unless it can be secure. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83583 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* Add directory test application 'manual-dir-iter' to cmake and autotools ↵Ralf Habacker2014-09-081-0/+5
| | | | | | | build system. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=57272 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Rename bus-test-launch-helper to test-bus-launch_helper to match common test ↵Ralf Habacker2014-01-171-1/+1
| | | | | | | application naming scheme. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Rename bus-test-system to test-bus-system to match common test application ↵Ralf Habacker2014-01-171-1/+1
| | | | | | | naming scheme. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Rename bus-test to test-bus to match common test application naming scheme.Ralf Habacker2014-01-171-1/+1
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73495 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Rename spawn-test to test-spawn to match common test application naming scheme.Ralf Habacker2014-01-171-3/+4
| | | | | | | [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>
* Rename shell-test to test-shell to match common test application naming scheme.Ralf Habacker2014-01-171-3/+4
| | | | | | | | [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>
* Rename dbus-test to test-dbus to match common test application naming scheme.Ralf Habacker2014-01-171-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>
* tests: don't block and wait for a debugger on abortSimon McVittie2014-01-101-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>
* Make sure tests run with a temporary XDG_RUNTIME_DIRSimon McVittie2014-01-061-1/+3
| | | | | | | | | | | 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>
* $(in_data) is meant to contain the .in filesSimon McVittie2013-10-101-1/+1
| | | | Reviewed-by: Colin Walters
* test: Update build for previous commitColin Walters2013-10-101-1/+1
| | | | It should now be in in_data so we find it in $(srcdir).
* Use GNU make features to reduce repetitionSimon McVittie2013-09-051-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>
* Add CPPFLAGS to "shared if possible" test binariesSimon McVittie2013-09-051-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>
* Tests: allow dbus-glib to be replaced with use of libdbus-internalSimon McVittie2013-09-031-28/+56
| | | | | | | | | | | | | | | | | | | | | | 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>
* Define DBUS_COMPILATION externally for all tests that use internal stuffSimon McVittie2013-09-031-0/+1
| | | | | | | 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>
* Manual rebase fix.Ralf Habacker2013-08-231-1/+1
|
* Add a simple manual test for authentication/authorization.Simon McVittie2013-08-231-2/+12
| | | | | Bug: http://bugs.freedesktop.org/show_bug.cgi?id=39720 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* tests to embedded tests: replaced in automake filesChengwei Yang2013-06-281-3/+3
| | | | | | 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
* Add a test-case for CVE-2013-2168Simon McVittie2013-06-121-0/+5
| | | | | Reviewed-by: Thiago Macieira <thiago@kde.org> [build system adjusted to compile it even if we don't have GLib -smcv]
* When not producing a dynamic library, define DBUS_STATIC_BUILDSimon McVittie2012-06-151-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>
* Fix distcheck: remove potentially-read-only files from builddirSimon McVittie2012-06-051-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>
* Merge branch 'dbus-1.4'Simon McVittie2012-04-251-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
| * use cp and mkdir -p instead of install within source treeAntoine Jacoutot2012-04-251-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>
* | Merge branch 'dbus-1.4'Simon McVittie2012-03-121-83/+131
|\ \ | |/
| * Enumerate data files used in the build rather than using find(1)Simon McVittie2012-03-121-83/+130
| | | | | | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33840 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
| * Revert all changes since a36d4918a6f646e085Simon McVittie2012-01-041-46/+60
| | | | | | | | | | | | | | 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.
| * Merge branch 'dbus-1.4' of ssh://git.freedesktop.org/git/dbus/dbus into dbus-1.4Ralf Habacker2011-12-211-0/+1
| |\
* | | Add a regression test for validating various string types with the public APISimon McVittie2012-02-241-0/+5
| | | | | | | | | | | | | | | | | | 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>
* | | Mark shell-test as modular and installableSimon McVittie2012-02-211-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>
* | | Allow a reduced set of installable tests (none yet) to be built without GLibSimon McVittie2012-02-211-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>
* | | Merge branch 'dbus-1.4'Simon McVittie2011-11-021-0/+1
|\ \ \ | |/ / |/| / | |/
| * Set DBUS_TEST_HOMEDIR when running installcheckSimon McVittie2011-11-021-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>