summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2015-02-19Imported Upstream version 1.9.12upstream/1.9.12Simon McVittie6-31/+213
2015-02-18Add regression test for LinuxSecurityLabel credentialSimon McVittie1-1/+25
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89041 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-02-16Add manual-paths test to the Autotools (mingw) build tooSimon McVittie1-0/+8
As in CMake, it is restricted to Windows builds, since the functionality that it tests is not present in Unix builds.
2015-02-12Add manual-paths test executable with cmake build support.Ralf Habacker1-0/+73
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83539 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-02-11Reduce the number of fds the fdpass test usesSimon McVittie1-2/+23
It was relying on a higher-than-default fd limit; cut it down to more than 256 but rather less than 1024, since the default Linux limit is 1024 fds per user. Also automatically skip this test if our rlimit is too small. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88998 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-02-11Add test for windows sid.Ralf Habacker1-2/+22
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54445 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-02-09Imported Upstream version 1.9.10upstream/1.9.10Simon McVittie18-39/+2607
2015-02-09Add a regression test for making systemd activation appear to failSimon McVittie1-0/+31
2015-02-05Add test-fdpass to the build, and make it compile againSimon McVittie2-1/+13
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88998 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-02-05tests: make installable metadata Windows-friendly by using EXEEXTSimon McVittie1-2/+2
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88980 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2015-02-05tests: make sure to specify CPPFLAGS where neededSimon McVittie1-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>
2015-02-04Add a common test_init() for GLib tests which prevents hanging foreverSimon McVittie16-29/+53
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-02-04Add a regression test for being a new-style monitorSimon McVittie3-0/+1526
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>
2015-02-03Imported Upstream version 1.9.8upstream/1.9.8Simon McVittie4-35/+4
2015-02-03Treat root as a valid candidate for TEST_USER_MESimon McVittie2-15/+4
If spawn_dbus_daemon() can fail for TEST_USER_ME, then we'd have to go through all the tests adding the ability to skip tests after it fails, which is a fairly extensive change. The tests have historically all run as whatever uid is supplied, and if the tests are being run as root for some reason - perhaps in a CI framework for an embedded platform that doesn't have non-root users, or in an environment where you can be root or non-root but not both - there is no particular reason to skip them.
2015-02-03Imported Upstream version 1.9.8Simon McVittie22-502/+1697
2015-02-03Add a regression test for systemd activationSimon McVittie8-0/+363
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
2015-02-03bus driver: factor out bus_driver_check_caller_is_privileged, and allow rootSimon McVittie1-3/+3
Unlike the initial mitigation for CVE-2014-8148, we now allow uid 0 to call UpdateActivationEnvironment. There's no point in root doing that, but there's also no reason why it's particularly bad - if an attacker is uid 0 we've already lost - and it simplifies use of this function for future things that do want to be callable by root, like BecomeMonitor for #46787. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
2015-02-03Add a test for uid-controlled permissionsSimon McVittie5-0/+311
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
2015-02-03Add infrastructure to run bits of tests under an alternative uidSimon McVittie4-11/+142
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
2015-02-03test: implement GLib-style "installed tests"Simon McVittie1-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
2015-02-03Generate test configuration files via build-time sed, not configureSimon McVittie1-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
2015-02-03Factor out some utility functions from test/dbus-daemon*Simon McVittie7-350/+330
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
2015-02-03Bump required GLib version to 2.36Simon McVittie2-7/+0
This is for g_close(), which the next commit will use. It also lets us rely on g_type_init() being a no-op (since 2.32 the type system is always initialized by a global constructor). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
2015-02-03Update .gitignore filesLukasz Skalski2-0/+4
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88943 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-01-30Add manual tcp test case.Ralf Habacker2-1/+52
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=87999 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-01-27Use pygi instead of pygobject 2Simon McVittie2-6/+6
pygobject 2 is obsolete and unmaintained, and anyway this is for optional functionality (full regression test coverage) rather than anything that will be needed in production builds. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=85969
2015-01-02Imported Upstream version 1.9.6upstream/1.9.6Simon McVittie1-0/+87
2015-01-01Merge branch 'dbus-1.8' and prepare 1.9.6Simon McVittie1-0/+87
Conflicts: NEWS configure.ac test/dbus-daemon.c
2015-01-01Add a regression test for path-based UpdateActivationEnvironment hardeningSimon McVittie1-0/+87
Reviewed-by: Thiago Macieira <thiago@kde.org>
2014-11-24Imported Upstream version 1.9.4upstream/1.9.4Simon McVittie1-1/+3
2014-11-18DBusSystemLogSeverity: add DBUS_SYSTEM_LOG_WARNINGAlban Crequy1-1/+3
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=85105
2014-11-06Imported Upstream version 1.9.2upstream/1.9.2Simon McVittie6-13/+212
2014-11-06Add NetBSD to the list of platforms where credentials-passing a pid should workSimon McVittie1-1/+2
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69702 Reviewed-by: Patrick Welche <prlw1@cam.ac.uk> Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk> Tested-by: Patrick Welche <prlw1@cam.ac.uk>
2014-11-06test_processid: only assert that it works if we expect it to workSimon McVittie1-10/+22
Otherwise, this would fail on, for instance, QNX. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69702 Reviewed-by: Patrick Welche <prlw1@cam.ac.uk> Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk> Tested-by: Patrick Welche <prlw1@cam.ac.uk>
2014-11-06Implement NetBSD credentials-passing with LOCAL_PEEREIDPatrick Welche1-0/+55
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69702 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk> Tested-by: Patrick Welche <prlw1@cam.ac.uk>
2014-11-06dbus-daemon test: don't assert we pass uid/pid on unknown Unix platformsSimon McVittie1-1/+28
We know that Linux, FreeBSD and OpenBSD are "first class citizens" for credentials-passing, with NetBSD not far behind: people have turned up on the bug tracking system and told us that tests passed. On other Unixes, we can't really assert that it works, until someone who runs them tells us that it worked for them. Additions to these lists are welcome. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69702 Reviewed-by: Patrick Welche <prlw1@cam.ac.uk> Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk> Tested-by: Patrick Welche <prlw1@cam.ac.uk>
2014-10-29Stop asserting that we're not using the dummy lock implementationSimon McVittie1-10/+0
That implementation no longer exists, so neither 0xABCDEF nor 0xABCDEF2 has any special meaning any more. 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>
2014-10-29Use a better NoReply message for disconnection with reply pendingSimon McVittie3-2/+113
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
2014-10-01Imported Upstream version 1.9.0upstream/1.9.0Simon McVittie11-453/+1401
2014-09-17New test for fd-passingSimon McVittie1-0/+853
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83622 Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk> [add dbus-sysdeps-unix.h as required for close-on-exec in master -smcv]
2014-09-15Make various system-bus-related things Unix-onlySimon McVittie1-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>
2014-09-15Merge branch 'dbus-1.8'Simon McVittie1-1/+17
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-09-08Add directory test application 'manual-dir-iter' to cmake and autotools ↵Ralf Habacker2-0/+97
build system. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=57272 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-06-11.gitignore: ignore incoming-limit.conf fileLukasz Skalski1-0/+1
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=78977 Reviewed-by: Simon McVittie <simon.mcvittie@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>