summaryrefslogtreecommitdiff
path: root/test/data
Commit message (Collapse)AuthorAgeFilesLines
* Add a unit test for the dbus-daemon resetting its fd limitSimon McVittie2018-02-201-0/+28
| | | | | | | | Reviewed-by: David King <dking@redhat.com> [smcv: Fix typo in cmake macro name] Signed-off-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105165 (cherry picked from commit 49ca421997d91d3e01626b2c92a826e6a5db0b2f)
* build: Remove various unused files from build systemSimon McVittie2017-10-231-93/+0
| | | | | | | | | | | | These were in git but not distributed in source tarballs, and in fact not hooked up to the Autotools build system at all. test/data/valid-introspection-files was mentioned in the CMake build system (copied from the source directory to the build directory), but according to `git grep` is not used for anything. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103420
* test/data: Test impossible send_broadcast/send_destination pairSimon McVittie2017-09-251-0/+6
| | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/92853 Reviewed-by: Philip Withnall <withnall@endlessm.com>
* test: Exercise min_fds, max_fdsSimon McVittie2017-07-281-0/+22
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Add a regression test for applying bus policy to broadcasts/unicastsSimon McVittie2017-07-281-0/+10
| | | | | | | | | | | This test-case is actually in the test for monitoring the bus, because it's easier to see what's going on there - the error reply to a rejected broadcast is not visible unless you are monitoring. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Reviewed-by: Thiago Macieira <thiago@kde.org> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92853
* Add a test-case for combining receive_type and send_destinationSimon McVittie2017-07-281-0/+6
| | | | | | | | | Until the previous commit, this would have worked. Now it correctly fails with "send and receive attributes cannot be combined". Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Thiago Macieira <thiago@kde.org> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92853
* AppArmor test: Allow writing to our temporary XDG_RUNTIME_DIRSimon McVittie2017-04-181-0/+1
| | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100686
* sd-activation test: Exercise transient servicesSimon McVittie2017-02-211-0/+2
| | | | | | | | | | To do this, we have to use the <standard_session_servicedirs/>. A previous commit ensured that those don't provide any service files we don't expect. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* config-parser test: Exercise the full config-parserSimon McVittie2017-02-201-0/+8
| | | | | | | | | Don't just exercise _dbus_get_standard_session_servicedirs(), but also its integration into the BusConfigParser. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Activation test: exercise what happens with nonexistent AppArmor labelsSimon McVittie2016-11-284-4/+16
| | | | | | Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98666
* Add an integration test for AppArmor mediating activationSimon McVittie2016-11-284-0/+108
| | | | | | | | | This requires libapparmor 2.10, for aa_features_new_from_kernel() and related functions. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98666
* Add tests for activation when message send/receive is deniedSimon McVittie2016-11-283-0/+14
| | | | | | Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98666
* dbus-daemon test: exercise pending fd timeout testSimon McVittie2016-08-161-0/+20
| | | | Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-daemon test: exercise max_names_per_connection limitSimon McVittie2016-08-161-0/+18
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=86442 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-daemon test: exercise maximum match rules per connectionSimon McVittie2016-08-161-0/+18
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=86442 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-daemon test: exercise maximum replies per connectionSimon McVittie2016-08-161-0/+18
| | | | | | | This time we're doing so deliberately. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=86442 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-daemon test: avoid reaching pending reply limitSimon McVittie2016-08-161-0/+3
| | | | | | | | | We were not actually doing what was intended (flooding the bus with 10k or 100k messages for the other side) because the bus was limiting the sender to 128 parallel method calls. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=86442 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-daemon test: exercise maximum connection countsSimon McVittie2016-08-162-0/+36
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=86442 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Test system bus config files on Unix onlyRalf Habacker2015-11-034-9/+64
| | | | | | | | | | | | | | | | | | Previously, we didn't consistently test parsing of every file in valid-config-files-system/ everywhere that we tested valid-config-files/. We now test it on Unix. The system bus is not supported on Windows, so we do not test valid-config-files-system/ there. valid-config-files/many-rules.conf contains <user> and <group> rules which are not applicable to Windows. Copy the original many-rules.conf to valid-config-files-system/ so that it will be tested on Unix, and remove the non-portable rules from valid-config-files/many-rules.conf. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> [rh:base patch came from Simon]
* Add a regression test for connecting to XDG_RUNTIME_DIR/bus by defaultSimon McVittie2015-02-241-0/+11
| | | | | | | This test requires the unix:runtime=yes sub-transport from Bug #61303. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61301 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
* Add a regression test for being a new-style monitorSimon McVittie2015-02-041-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-035-0/+26
| | | | | | | 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/+15
| | | | | | | | 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
* Update .gitignore filesLukasz Skalski2015-02-031-0/+1
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88943 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Use a better NoReply message for disconnection with reply pendingSimon McVittie2014-10-291-0/+19
| | | | | | | | | | 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
* .gitignore: ignore incoming-limit.conf fileLukasz Skalski2014-06-111-0/+1
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=78977 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Use TEST_LISTEN in incoming-listen.conf.in instead of unix only hardcoded ↵Ralf Habacker2013-10-101-1/+1
| | | | | | | address Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68506 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Revert "Enable anonymous authorization for tests"Simon McVittie2013-08-231-2/+1
| | | | This reverts commit 22fc03d274f186a788efbdbe6b6dfcff1ad474df.
* Enable anonymous authorization for testsCosimo Alfarano2013-08-231-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>
* test: enforce own_prefix policy rulesAlban Crequy2012-03-221-0/+14
| | | | | | | After parsing [allow|deny] rules with own_prefix, check they are enforced correctly. https://bugs.freedesktop.org/show_bug.cgi?id=46886
* test: parse own_prefix policy rulesAlban Crequy2012-03-221-0/+2
| | | | | | Just check that the parser accept [allow|deny] rules with own_prefix https://bugs.freedesktop.org/show_bug.cgi?id=46886
* Merge tests' cmake and autotools bus configurationSimon McVittie2011-09-288-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
* Simplify substitution of test executables to use fewer variablesSimon McVittie2011-09-2812-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
* Simplify generation of bus configuration filesSimon McVittie2011-09-288-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
* Add a regression test that can reproduce fd.o #34393Simon McVittie2011-07-281-0/+18
| | | | | | | | | The number of messages is arbitrary; the more messages, the more likely the crash is. 2000 messages seem to cause it reliably on this laptop, but I've set it to 10000 to be safe. Reviewed-by: Colin Walters <walters@verbum.org> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34393
* policy tests: Use bin rather than nogroup, wheel, or rootWill Thompson2010-12-171-2/+2
| | | | | This group seems to exist on all of Debian, Fedora and Mac OS X. (I mistakenly believed that nogroup exists on Fedora.)
* policy tests: Use 'nogroup' rather than 'wheel' or 'root'Will Thompson2010-12-151-2/+2
| | | | | | | | | 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' …)
* Fix test failures on OSX.Mike McQuaid2010-12-041-2/+2
|
* Cmake support for cross plattform usable test files.Ralf Habacker2010-04-112-0/+32
| | | | | | | | | | | | 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.
* Ignore exit code zero from activated servicesColin Walters2009-12-151-0/+3
| | | | | | | | | | | | | | | A variety of system components have migrated from legacy init into DBus service activation. Many of these system components "daemonize", which involves forking. The DBus activation system treated an exit as an activation failure, assuming that the child process which grabbed the DBus name didn't run first. While we're in here, also differentiate in this code path between the servicehelper (system) versus direct activation (session) paths. In the session activation path our error message mentioned a helper process which was confusing, since none was involved. Based on a patch and debugging research from Ray Strode <rstrode@redhat.com>
* readded test files required for windowsRalf Habacker2009-12-012-0/+29
|
* Add "PrivServer" test which exercises DBusServer and dbus_shutdownColin Walters2008-05-301-0/+4
| | | | | | | | | | | | | | * test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service.in: New service file for PrivServer. * configure.in: Generate it. * test/name-test/Makefile.am: Build test-privserver and test-privserver-client. * test/name-test/test-privserver.c: Use DBusServer to serve a private connection. * test/name-test/test-privserver-client.c: Connect via session bus and get address of private server, exercise dbus_shutdown(). * test/name-test/run-test.sh: Run it.
* Bring .gitignore files up to date; add *.o, *~ etc. to top-level .gitignoreSimon McVittie2007-10-104-6/+4
| | | | | CVS ignores these automatically, so they weren't in the .cvsignore when Ryan converted the repository.
* migrate from cvs to git (cvs2svn -> git-svnimport).Ryan Lortie2007-09-132-0/+0
| | | | | | | | | | | 2007-09-13 Ryan Lortie <desrt@desrt.ca> migrate from cvs to git (cvs2svn -> git-svnimport). * HACKING: update release/branch/tag instructions * */.cvsignore: rename to .gitignore also, clean up tags and branch names to conform to HACKING
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-2415-2/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.in: * test/Makefile.am: * test/data/invalid-service-files-system/org.freedesktop.DBus.TestS uiteNoExec.service.in: * test/data/invalid-service-files-system/org.freedesktop.DBus.TestS uiteNoService.service.in: * test/data/invalid-service-files-system/org.freedesktop.DBus.TestS uiteNoUser.service.in: * test/data/valid-config-files-system/debug-allow-all-fail.conf.in: * test/data/valid-config-files-system/debug-allow-all-pass.conf.in: * test/data/valid-config-files/debug-allow-all-sha1.conf.in: * test/data/valid-config-files/debug-allow-all.conf.in: * test/data/valid-service-files-system/org.freedesktop.DBus.TestSui teEchoService.service.in: * test/data/valid-service-files-system/org.freedesktop.DBus.TestSui teSegfaultService.service.in: * test/data/valid-service-files-system/org.freedesktop.DBus.TestSui teShellEchoServiceFail.service.in: * test/data/valid-service-files-system/org.freedesktop.DBus.TestSui teShellEchoServiceSuccess.service.in: * test/data/valid-service-files/debug-echo.service.in: * test/data/valid-service-files/debug-segfault.service.in: * test/data/valid-service-files/debug-shell-echo-fail.service.in: * test/data/valid-service-files/debug-shell-echo-success.service.in: * test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoS ervice.service.in: * test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfa ultService.service.in: * test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShell EchoServiceFail.service.in: * test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShell EchoServiceSuccess.service.in: Add the data files needed by the system activation unit checks.
* * dbus/dbus-auth-script.c (_dbus_auth_script_run): added UNIX_ONLY and ↵Ralf Habacker2007-06-231-1/+1
| | | | | | WIN_ONLY commands for auth scripts * test/data/auth/external-root.auth-script: limit execution to unix
* 2007-06-09 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-106-4/+44
| | | | | | | | | | | | | | | | | * dbus/dbus-string.c (_dbus_string_pop_line): fix this not to think an empty line is the end of the file. Also, fix some whitespace. * dbus/dbus-string-util.c: add more tests for _dbus_string_pop_line() revealing that it thinks an empty line is the end of the file, which broke dbus-auth-script.c so it didn't really run the scripts * dbus/dbus-auth.c: add ANONYMOUS mechanism * dbus/dbus-auth-script.c (_dbus_auth_script_run): fix to detect an empty/no-op auth script; add commands to check that we have or don't have the expected credentials
* * configure.in: expose DBUS_DATADIRJohn (J5) Palmieri2006-11-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * bus/config-parser.c: add the standard_session_servicedirs element to the parser (bus_config_parser_content): process the standard_session_servicedirs element by getting the standard directories from sysdeps and merging them into the service directory list (test_default_session_servicedirs): make sure we get what we expect * bus/session.conf.in: replace the servicedir tag with the standard_session_servicedirs tag * dbus/dbus-list.h: remove the typedef of DBusList and place it in dbus-sysdeps.h to avoid circular header dependencies * dbus/dbus-sysdeps.h: add the typedef of DBusList * dbus/dbus-sysdeps-unix.c (split_paths_and_append): utility function which takes a string of directories delimited by colons, parses them out, appends a suffix and puts them in a list ignoring empty elements (_dbus_get_standard_session_servicedirs): returns the standard directories for a session bus to look for service activation files on Unix which includes the XDG_DATA_HOME, XDG_DATA_DIRS and DBUS_DATADIR directories * test/data/valid-config-files/many-rules.conf: add the standard_session_servicedirs tag to the valid config file tests
* * Remove all bindingsJohn (J5) Palmieri2006-07-142-6/+0
|
* 2005-10-24 Robert McQueen <robot101@debian.org>Robert McQueen2005-10-241-1/+2
| | | | | | | | | | | | | | * python/dbus_bindings.pyx (String, MessageIter): make D-Bus strings derive from unicode instead of str, and encode/decode UTF-8 when marshalling/unmarshalling bus messages * python/introspect_parser.py: encode introspection data as UTF-8 before passing the buffer into libxml2 * test/python/test-client.py: add unicode test strings * test/data/valid-service-files/.cvsignore, test/python/.cvsignore: ignore generated python test files