summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2009-07-14Bug 21161 - Update the FSF addressTobias Mueller2-2/+2
No comment. Signed-off-by: Colin Walters <walters@verbum.org> (cherry picked from commit 5baf2f856a9c6625993234855b07680da1c8916f)
2009-07-14Add missing include for unistd.h in test-service.cColin Walters1-0/+1
We use usleep here. (cherry picked from commit e5310abd6cbc4c2e1a9df54f097d6642ad0833c6)
2009-07-14Add tests for pending call timeoutsScott James Remnant5-1/+173
* test/test-service.c (handle_delay_echo, path_message_func): Add a variant of the Echo method which sleeps for a short time. * test/name-test/test-pending-call-timeout.c: Run tests with default, specified and infinite timeout to make sure we get the reply. * test/name-test/run-test.sh: Run the new test * test/name-test/Makefile.am: Build the new test Signed-off-by: Scott James Remnant <scott@ubuntu.com> (cherry picked from commit c1f165261afcc3bafa9b24ff916bb231628e3782)
2009-07-10Bug 21161 - Update the FSF addressTobias Mueller2-2/+2
No comment. Signed-off-by: Colin Walters <walters@verbum.org>
2009-07-10Add missing include for unistd.h in test-service.cColin Walters1-0/+1
We use usleep here.
2009-05-28Add tests for pending call timeoutsScott James Remnant5-1/+173
* test/test-service.c (handle_delay_echo, path_message_func): Add a variant of the Echo method which sleeps for a short time. * test/name-test/test-pending-call-timeout.c: Run tests with default, specified and infinite timeout to make sure we get the reply. * test/name-test/run-test.sh: Run the new test * test/name-test/Makefile.am: Build the new test Signed-off-by: Scott James Remnant <scott@ubuntu.com>
2009-05-06Bug 19502 - Sparse warning cleanupsKjartan Maraas2-2/+2
This patch makes various things that should be static static, corrects some "return FALSE" where it should be NULL, etc. Signed-off-by: Colin Walters <walters@verbum.org>
2009-04-21Bug 19502 - Sparse warning cleanupsKjartan Maraas2-2/+2
This patch makes various things that should be static static, corrects some "return FALSE" where it should be NULL, etc. Signed-off-by: Colin Walters <walters@verbum.org>
2008-12-18Clean up and clarify default system policyColin Walters1-24/+27
The former was too reliant on old bugs and was generally unclear. This one makes explicit exactly what is allowed and not.
2008-12-16Merge commit '3d6abf64d0abb2718e082e120f14f8f923a4af59' into dbus-1.2Colin Walters1-24/+27
2008-12-12Add syslog of security denials and configuration file reloadsColin Walters1-3/+1
We need to start logging denials so that they become more easily trackable and debuggable.
2008-12-12Clean up and clarify default system policyColin Walters1-24/+27
The former was too reliant on old bugs and was generally unclear. This one makes explicit exactly what is allowed and not.
2008-12-12Add syslog of security denials and configuration file reloadsColin Walters1-0/+2
We need to start logging denials so that they become more easily trackable and debuggable.
2008-12-09Bug 18229: Allow signalsColin Walters4-1/+58
Our previous fix went too far towards lockdown; many things rely on signals to work, and there's no really good reason to restrict which signals can be emitted on the bus because we can't tie them to a particular sender.
2008-12-09Bug 18229: Allow signalsColin Walters4-1/+58
Our previous fix went too far towards lockdown; many things rely on signals to work, and there's no really good reason to restrict which signals can be emitted on the bus because we can't tie them to a particular sender.
2008-12-05Infrastructure for testing a "system like" bus in test suiteColin Walters3-1/+121
The tmp-session-like-system.conf bus configuration has a security policy intended to mirror that of the system bus. This allows testing policy rules.
2008-12-05Infrastructure for testing a "system like" bus in test suiteColin Walters3-1/+121
The tmp-session-like-system.conf bus configuration has a security policy intended to mirror that of the system bus. This allows testing policy rules.
2008-07-24Bug 16839: Fix bus names in test case so it actually works.Scott James Remnant2-7/+7
* test/name-test/test-privserver.c (filter_session_message, main), * test/name-test/test-privserver-client.c (open_shutdown_private_connection): Replace TestServer with PrivServer to match the service definition files.
2008-05-30Bug 15571: Clean up GUID-less connections correctly (Scott James Remnant)Colin Walters1-5/+21
* dbus/dbus-connection.c (connection_forget_shared_unlocked): Remove shared connections which lack a GUID from the list that caches those, otherwise references to them will remain after they have been freed. * test/name-test/test-privserver-client.c: Update test to try GUID-less connections too.
2008-05-30Bug 15570: Reset initialized state on dbus_shutdown (Scott James Remnant)Colin Walters1-2/+0
* dbus/dbus-bus.c (addresses_shutdown_func): Reset initialized back to FALSE after cleaning up the address list so that it will be reinitialized again if D-Bus is used after dbus_shutdown() * test/name-test/test-privserver-client.c: Uncomment part of test which should now pass.
2008-05-30Add "PrivServer" test which exercises DBusServer and dbus_shutdownColin Walters5-1/+247
* 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.
2008-05-30Add noinst convenience test library, add a test-shutdownColin Walters5-17/+93
* test/Makefile.am: New convenience library libdbus_testutils_la. Reorder build so that test/ gets built before test/name-test so name-test files can depend on it. * test/name-test/test-shutdown.c: New file, exercises dbus_shutdown () a bit. * test/name-test/run-test.sh Run test-shutdown. * test/test-utils.h: In some cases we already have DBUS_COMPILATION defined, avoid double definition warning.
2008-05-30Add test library functions for using DBusServerColin Walters2-0/+158
* test/test-utils.h, test/test-utils.c: Add functions which hook up a DBusServer to a DBusLoop, useful for test cases.
2008-01-15make shell script more portable (FDO Bug #11667)John (J5) Palmieri1-5/+6
2008-01-15 John (J5) Palmieri <johnp@redhat.com> * tests/name-test/run-test.sh: make more portable (FDO Bug #11667)
2007-10-10Bring .gitignore files up to date; add *.o, *~ etc. to top-level .gitignoreSimon McVittie5-6/+6
CVS ignores these automatically, so they weren't in the .cvsignore when Ryan converted the repository.
2007-09-13migrate from cvs to git (cvs2svn -> git-svnimport).Ryan Lortie5-15/+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-262007-07-26 Havoc Pennington <hp@redhat.com>Havoc Pennington1-2/+8
* bus/config-parser-trivial.c (check_return_values): disable a test that hardcoded the bus user's name * bus/dispatch.c (bus_dispatch_test_conf): remove the "if (!use_launcher)" around the tests, they were only failing because we didn't pass through all the expected errors from the helper. * bus/activation-exit-codes.h (BUS_SPAWN_EXIT_CODE_CHILD_SIGNALED): add a code for child segfaulting (BUS_SPAWN_EXIT_CODE_GENERIC_FAILURE): make "1" be a generic failure code, so if a third party launch helper were written it could just always return 1 on failure.
2007-07-26fix whitespaceHavoc Pennington1-121/+121
2007-07-242007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes16-2/+75
* 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.
2007-07-142007-07-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2-2/+2
* Add indent-tabs-mode: nil to all file headers.
2007-06-23* dbus/dbus-auth-script.c (_dbus_auth_script_run): added UNIX_ONLY and ↵Ralf Habacker1-1/+1
WIN_ONLY commands for auth scripts * test/data/auth/external-root.auth-script: limit execution to unix
2007-06-182007-06-18 Havoc Pennington <hp@redhat.com>Havoc Pennington4-6/+74
* doc/dbus-specification.xml: document org.freedesktop.DBus.GetId() * bus/driver.c (bus_driver_handle_get_id): implement org.freedesktop.DBus.GetId() * bus/bus.c (bus_context_new): generate a unique ID for each bus context * dbus/dbus-connection.c (dbus_connection_get_server_id): new function * dbus/dbus-bus.c (dbus_bus_get_id): new function * dbus/dbus-server.c (dbus_server_get_id): new function
2007-06-102007-06-09 Havoc Pennington <hp@redhat.com>Havoc Pennington6-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
2007-06-092007-06-09 Havoc Pennington <hp@redhat.com>Havoc Pennington1-0/+1
* bus/dispatch.c (check_get_connection_unix_process_id): adapt since sysdeps-unix.h stuff isn't included anymore * bus/bus.c (bus_context_new): use more abstract functions to change user, so they can be no-ops on Windows * dbus/dbus-credentials.c, dbus/dbus-credentials.h, dbus/dbus-credentials-util.c: new files containing a fully opaque DBusCredentials data type to replace the old not opaque one. * configure.in (DBUS_UNIX): define DBUS_UNIX to match DBUS_WIN on windows * dbus/dbus-userdb.h: prohibit on Windows, next step is to clean up the uses of it in bus/*.c and factor out the parts of cookie auth that depend on it
2007-05-21tools/.cvsignore: Ignore all currently built files.Simon McVittie1-0/+7
test/name-test/.cvsignore: New file, ditto.
2007-03-08* configure.in, cmake/ConfigureChecks.cmake: added check for setrlimit.Ralf Habacker1-3/+2
* test/test-segfault.c: only include setrlimit stuff only when available.
2007-03-07* test/test-segfault.c: unix compile fix.Ralf Habacker1-0/+5
* dbus-win.patch: removed obsolate patch.
2007-03-07* bus/activation.c: win32 compile fix.Ralf Habacker1-4/+3
* test/test-segfault.c: win32 compile fix, rlimit isn't available on win32. * dbus-win.patch: removed some more patches, they are applied or obsolate
2007-03-04* dbus/dbus-spawn.c,dbus/dbus-spawn.h (_dbus_spawn_async_with_babysitter):Ralf Habacker1-1/+1
added environment pointer as function parameter,used on win32. * test/spawn-test.c: fixed call to above mentioned function.
2007-03-04* configure.in,test/test-sleep-forever.c,test/test-names.c:Ralf Habacker2-1/+7
added configure check for unistd.h.
2007-03-04* test/Makefile.am: fixed test data copy problem inRalf Habacker1-3/+3
out of source build, when sources came from svn or cvs.
2006-11-14* dbus/dbus-threads.h: fix DBUS_THREAD_FUNCTIONS_ALL_MASK to haveJohn (J5) Palmieri1-1/+1
the correct value so we don't assert when initalizing recursive threads * test/name-test/test-thread-init.c: call dbus_threads_init_default instead of _dbus_threads_init_debug since it is more of a real world test
2006-11-01* configure.in: expose DBUS_DATADIRJohn (J5) Palmieri1-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
2006-10-26* configure.in, dbus-1.pc.in: Check to see if thread methodsJohn (J5) Palmieri1-3/+3
are in glibc or libpthread and add -lpthread to the link stage if it is the latter
2006-10-11* test/name-test/Makefile.am: don't link against both libdbus andJohn (J5) Palmieri1-3/+3
libdbus-convenience
2006-10-012006-10-01 Havoc Pennington <hp@redhat.com>Havoc Pennington2-7/+5
* test/test-service.c (path_message_func): remove broken extra unref that was hidden by the bugs in dbus-connection.c/dbus-bus.c * test/test-shell-service.c (path_message_func): same fix * dbus/dbus-connection.c (_dbus_connection_get_dispatch_status_unlocked): break up the function a little for clarity and fix the notification of dbus-bus.c to not require dispatch to be complete * dbus/dbus-connection.c (dbus_connection_unref): improve the warning when you try to finalize an open connection.
2006-10-012006-10-01 Havoc Pennington <hp@redhat.com>Havoc Pennington4-8/+13
* dbus/dbus-connection.c (_dbus_connection_close_if_only_one_ref): Add a hack to make DBusNewConnectionFunction work right. * dbus/dbus-server-socket.c (handle_new_client_fd_and_unlock): use the hack here. Also, fix the todo about refcount leak. * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new): and use the hack here * dbus/dbus-connection.c: Kill the "shared" flag vs. the "shareable" flag; this was completely broken, since it meant dbus_connection_open() returned a connection of unknown shared-ness. Now, we always hold a ref on anything opened as shareable. Move the call to notify dbus-bus.c into connection_forget_shared_unlocked, so libdbus consistently forgets all its knowledge of a connection at once. This exposed numerous places where things were totally broken if we dropped a ref inside get_dispatch_status_unlocked where connection_forget_shared_unlocked was previously, so move connection_forget_shared_unlocked into _dbus_connection_update_dispatch_status_and_unlock. Also move the exit_on_disconnect here. (shared_connections_shutdown): this assumed weak refs to the shared connections; since we have strong refs now, the assertion was failing and stuff was left in the hash. Fix it to close still-open shared connections. * bus/dispatch.c: fixup to use dbus_connection_open_private on the debug pipe connections * dbus/dbus-connection.c (dbus_connection_dispatch): only notify dbus-bus.c if the closed connection is in fact shared (_dbus_connection_close_possibly_shared): rename from _dbus_connection_close_internal (dbus_connection_close, dbus_connection_open, dbus_connection_open_private): Improve docs to explain the deal with when you should close or unref or both * dbus/dbus-bus.c (_dbus_bus_notify_shared_connection_disconnected_unlocked): rename from _dbus_bus_check_connection_and_unref_unlocked and modify to loop over all connections * test/test-utils.c (test_connection_shutdown): don't try to close shared connections. * test/name-test/test-threads-init.c (main): fix warnings in here * dbus/dbus-sysdeps.c (_dbus_abort): support DBUS_BLOCK_ON_ABORT env variable to cause blocking waiting for gdb; drop DBUS_PRINT_BACKTRACE and just call _dbus_print_backtrace() unconditionally. * configure.in: add -export-dynamic to libtool flags if assertions enabled so _dbus_print_backtrace works. * dbus/dbus-sysdeps-unix.c (_dbus_print_backtrace): use fprintf instead of _dbus_verbose to print the backtrace, and diagnose lack of -rdynamic/-export-dynamic
2006-09-06* doc/TODO:John (J5) Palmieri3-4/+5
- Remove pending call locking todo item - dbus_connection_open now holds hard ref. Remove todo item - do proper locking on _dbus_bus_check_connection_and_unref and handle DBUS_BUS_STARTER. Remove todo item - Warn on closing of a shared connection. Remove todo item * bus/bus.c, bus/connection.c, bus/dispatch.c, dbus/dbus-bus.c, dbus/dbus-connection.c: Use the dbus_connection_close_internal so we don't get the warning when closing shared connections * test/test-service.c, test/test-shell-service.c: Applications don't close shared connections themselves so we unref instead of close * test/test-utils.c (test_connection_shutdown): Close the connection * dbus/dbus-bus.c (_dbus_bus_check_connection_and_unref): Changed to _dbus_bus_check_connection_and_unref_unlocked since we only call this method on a locked connection. Make sure we call _dbus_connection_unref_unlocked instead of dbus_connection_unref also. Handle DBUS_BUS_STARTER correctly * dbus/dbus-connection.c (connection_record_shared_unlocked): Mark as shared and hard ref the connection (connection_forget_shared_unlocked): Remove the hard ref from the connection (_dbus_connection_close_internal_and_unlock): New internal function which takes a locked connection and unlocks it after closing it (_dbus_connection_close_internal): New internal function which acts like the origonal dbus_connection_close method by grabbing a connection lock and calling _dbus_connection_close_internal_and_unlock (dbus_connection_close): Public close method, warns when the app trys to close a shared connection
2006-08-302006-08-29 Havoc Pennington <hp@redhat.com>Havoc Pennington1-0/+2
* test/test-service.c (path_message_func): fix lack of return value * dbus/dbus-sysdeps.c (_dbus_printf_string_upper_bound): fix formatting, remove #ifdef, and fix docs. #ifdef doesn't make any more sense than on anything else in this file. (_dbus_get_tmpdir): add const to return value, and keep the results of the various getenv around in a static variable.
2006-08-25* test/Makefile.am: change find to use syntax that works with nonJohn (J5) Palmieri1-1/+1
gnu versions of find