summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Fix running tests when builddir != srcdir.Thiago Macieira2009-07-161-1/+1
| | | | | This script is not deployed to the builddir, so it cannot be run with relative paths.
* Bug 21161 - Update the FSF addressTobias Mueller2009-07-102-2/+2
| | | | | | No comment. Signed-off-by: Colin Walters <walters@verbum.org>
* Add missing include for unistd.h in test-service.cColin Walters2009-07-101-0/+1
| | | | We use usleep here.
* Add tests for pending call timeoutsScott James Remnant2009-05-285-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>
* Bug 19502 - Sparse warning cleanupsKjartan Maraas2009-04-212-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>
* Clean up and clarify default system policyColin Walters2008-12-181-24/+27
| | | | | The former was too reliant on old bugs and was generally unclear. This one makes explicit exactly what is allowed and not.
* Add syslog of security denials and configuration file reloadsColin Walters2008-12-121-0/+2
| | | | | We need to start logging denials so that they become more easily trackable and debuggable.
* Bug 18229: Allow signalsColin Walters2008-12-094-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.
* Infrastructure for testing a "system like" bus in test suiteColin Walters2008-12-053-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.
* Bug 16839: Fix bus names in test case so it actually works.Scott James Remnant2008-07-242-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.
* Bug 15571: Clean up GUID-less connections correctly (Scott James Remnant)Colin Walters2008-05-301-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.
* Bug 15570: Reset initialized state on dbus_shutdown (Scott James Remnant)Colin Walters2008-05-301-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.
* Add "PrivServer" test which exercises DBusServer and dbus_shutdownColin Walters2008-05-305-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.
* Add noinst convenience test library, add a test-shutdownColin Walters2008-05-305-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.
* Add test library functions for using DBusServerColin Walters2008-05-302-0/+158
| | | | | | * test/test-utils.h, test/test-utils.c: Add functions which hook up a DBusServer to a DBusLoop, useful for test cases.
* make shell script more portable (FDO Bug #11667)John (J5) Palmieri2008-01-151-5/+6
| | | | | | 2008-01-15 John (J5) Palmieri <johnp@redhat.com> * tests/name-test/run-test.sh: make more portable (FDO Bug #11667)
* Bring .gitignore files up to date; add *.o, *~ etc. to top-level .gitignoreSimon McVittie2007-10-105-6/+6
| | | | | 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-135-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-26 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-07-261-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.
* fix whitespaceHavoc Pennington2007-07-261-121/+121
|
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-2416-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-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-07-142-2/+2
| | | | * Add indent-tabs-mode: nil to all file headers.
* * 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-18 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-184-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-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
* 2007-06-09 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-091-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
* tools/.cvsignore: Ignore all currently built files.Simon McVittie2007-05-211-0/+7
| | | | test/name-test/.cvsignore: New file, ditto.
* * configure.in, cmake/ConfigureChecks.cmake: added check for setrlimit.Ralf Habacker2007-03-081-3/+2
| | | | * test/test-segfault.c: only include setrlimit stuff only when available.
* * test/test-segfault.c: unix compile fix.Ralf Habacker2007-03-071-0/+5
| | | | * dbus-win.patch: removed obsolate patch.
* * bus/activation.c: win32 compile fix.Ralf Habacker2007-03-071-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
* * dbus/dbus-spawn.c,dbus/dbus-spawn.h (_dbus_spawn_async_with_babysitter):Ralf Habacker2007-03-041-1/+1
| | | | | | added environment pointer as function parameter,used on win32. * test/spawn-test.c: fixed call to above mentioned function.
* * configure.in,test/test-sleep-forever.c,test/test-names.c:Ralf Habacker2007-03-042-1/+7
| | | | added configure check for unistd.h.
* * test/Makefile.am: fixed test data copy problem inRalf Habacker2007-03-041-3/+3
| | | | out of source build, when sources came from svn or cvs.
* * dbus/dbus-threads.h: fix DBUS_THREAD_FUNCTIONS_ALL_MASK to haveJohn (J5) Palmieri2006-11-141-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
* * 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
* * configure.in, dbus-1.pc.in: Check to see if thread methodsJohn (J5) Palmieri2006-10-261-3/+3
| | | | | are in glibc or libpthread and add -lpthread to the link stage if it is the latter
* * test/name-test/Makefile.am: don't link against both libdbus andJohn (J5) Palmieri2006-10-111-3/+3
| | | | libdbus-convenience
* 2006-10-01 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-012-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-01 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-014-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
* * doc/TODO:John (J5) Palmieri2006-09-063-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-29 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-08-301-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.
* * test/Makefile.am: change find to use syntax that works with nonJohn (J5) Palmieri2006-08-251-1/+1
| | | | gnu versions of find
* * configure.in, dbus/Makefile.am, test/name-test/run-test.sh,John (J5) Palmieri2006-08-252-4/+2
| | | | | | test/name-test/Makefile.am: Fixed some issues with getting get dbus to build with builddir != srcdir (Taken from a patch by Bernard Leak <bernard at brenda-arkle dot demon dot co dot uk>)
* * dbus/dbus-threads.c: Add static DBusList *uninitialized_mutex_list andJohn (J5) Palmieri2006-08-163-2/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | static DBusList *uninitialized_condvar_list to support new late initialization threading model. In this model threads can be initialized even after the D-Bus API has been used but still needs to be initialized before the second thread has been started. Mutexes and condvar addresses are stored in the two static lists and are replaced with actuall locks when threads are initalized. (_dbus_mutex_new_at_location): New method for creating a mutex and placing the location into the static list (_dbus_mutex_free_at_location): New method for removing a mutex location from the static list and freeing the mutex (_dbus_condvar_new_at_location): New method for creating a conditional variable and placing the location into the static list (_dbus_condvar_free_at_location): New method for removing a conditional variable location from the static list and freeing the conditional variable (init_uninitialized_locks): Atomic method which goes through the static lists of mutex and condvar location and updates them with actuall locks (init_global_locks): changed to init_locks * dbus/dbus-connection.c: (_dbus_connection_test_get_locks): New method for tests to check connections (_dbus_connection_new_for_transport): Use the new at_location mutex and condvar API (dbus_connection_allocate_data_slot): Pass in the global lock address to _dbus_data_slot_allocator_alloc * dbus/dbus-dataslot.c: (_dbus_data_slot_allocator_alloc): Use the address of the mutex instead of the mutex itself * dbus/dbus-message.c: (dbus_message_allocate_data_slot): Pass in the global lock address to _dbus_data_slot_allocator_alloc * dbus/dbus-pending-call.c: (dbus_pending_call_allocate_data_slot): Pass in the global lock address to _dbus_data_slot_allocator_alloc * dbus/dbus-server.c: (_dbus_server_init_base): Use the new at_location mutex API (dbus_server_allocate_data_slot): Pass in the global lock address to _dbus_data_slot_allocator_alloc * test/name-test/test-threads-init.c: New test case for late thread initialization
* Patches by Kjartan Maraas <kmaraas at gnome dot org>John (J5) Palmieri2006-08-146-25/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bus/services.c (bus_service_list_queued_owners): Add a pointer cast to fix compiler warning * dbus/dbus-dataslot.c (_dbus_data_slot_list_get): return a NULL instead of FALSE since the return type is not expecting a boolean * dbus/dbus-marshal-basic.c (_dbus_marshal_test): Remove unused variable * dbus/dbus-marshal-recursive-util.c (node_new): return a NULL instead of FALSE since the return type is not expecting a boolean * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new): Send a NULL into _dbus_transport_new_for_fd instead of a FALSE because we are expecting a pointer not a boolean * dbus/dbus-sysdeps-util.c (_dbus_get_tmpdir): add void as the parameter so some compilers don't complain * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket, _dbus_transport_new_for_tcp_socket): Send a NULL into _dbus_transport_new_for_fd instead of a FALSE because we are expecting a pointer not a boolean * test/shell-test.c (test_command_line): cast the second argument to _dbus_list_append to avoid compiler warnings * test/test-names.c (main): remove unused variable * test/test-service.c (check_hello_from_self_reply): Initialize echo_message and echo_reply to NULL * test/test-shell-service.c (handle_echo): Remove unused variable and cast the third parameter passed to dbus_connection_get_object_path_data to avoid compiler warrnings * test/name-test/test-names.c (clear_message_queue): Remove unused function * test/name-test/test-pending-call-dispatch.c: Fix format string in printf
* * dbus/dbus-bus.c:John (J5) Palmieri2006-08-141-10/+8
| | | | | | | * test/name-test/test-names.c: Remove test method dbus_bus_connection_get_unique_name because we already have public method dbus_bus_get_unique_name that does the exact same thing
* * tools/run-with-tmp-session-bus.sh:John (J5) Palmieri2006-08-101-2/+2
| | | | | | * test/name-test/run-test.sh: Remove bashisms (patch from Julio M. Merino Vidal <jmmv at NetBSD dot org>)
* * dbus/dbus-sysdeps.c:John (J5) Palmieri2006-08-101-1/+2
| | | | | | | | * dbus/dbus-address.c: * bus/activation.c: * test/shell-test.c: don't hardcode tmp directory (patch from Dave Meikle <dmk at davemeikle dot co dot uk>)
* * Remove all bindingsJohn (J5) Palmieri2006-07-1429-7734/+2
|
* * test/qt/*: Update the testcases, including testing the newThiago Macieira2006-06-1110-133/+738
| | | | | | functionality of sending null QByteArray and QString over the bus. Add new headertest test and restore the old qdbusxmlparser test.