Commit graph

14 commits

Author SHA1 Message Date
Ralf Habacker
6d4639a333 Use separate bus configuration files for executing test cases with a temporary session bus
Instead of the previous adaptation of the existing template
for the session bus, a separate template is now used, which
can be more easily adapted to the requirements of the test
applications.

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/57
2018-10-18 20:06:43 +02:00
Simon McVittie
c7f3df0271 Replace $DBUS_USE_TEST_BINARY with $DBUS_TEST_DBUS_LAUNCH
Instead of using $DBUS_USE_TEST_BINARY to control whether to use the
hard-coded test binary TEST_BUS_LAUNCH_BINARY, we can just use
$DBUS_TEST_DBUS_LAUNCH to control what we launch directly, as we
were already doing for $DBUS_TEST_DAEMON.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2016-02-12 15:26:23 +00:00
Simon McVittie
9d80d46a79 run-with-tmp-session-bus.sh: create a unique temporary file per process
This makes the regression tests OK to run in parallel.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2013-09-05 12:35:11 +01:00
Simon McVittie
9760bdf393 massively simplify run-with-tmp-session-bus.sh by using dbus-run-session
It turns out that if you don't second-guess the system by catching
SIGINT, the right things happen: it's received by every program in the
foreground process group, including dbus-run-session and dbus-daemon.
Neither of those catch SIGINT (unlike dbus-launch) so they'll exit
gracefully without the wrapper script needing to do anything special.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39196
Reviewed-by: Colin Walters <walters@verbum.org>
2013-06-05 17:58:52 +01:00
Simon McVittie
638a742a38 Use #!/bin/sh for run-with-tmp-session-bus.sh
It doesn't seem to have any bashisms, and bash isn't in /bin on *BSD.

Suggested by Timothy Redaelli.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35880
2011-06-01 18:36:23 +01:00
Colin Walters
4a436c3554 Infrastructure for testing a "system like" bus in test suite
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-05 11:30:50 -05:00
Colin Walters
892c0a0053 Bug 16838: Use bash instead of sh to avoid breaking on Ubuntu 2008-07-24 16:37:25 -04:00
John (J5) Palmieri
1ca4b10e30 Fix env exports for better portability (#9280) 2007-10-09 15:50:08 -04:00
John (J5) Palmieri
b7bb0d6a43 * tools/run-with-tmp-session-bus.sh: fixed script to replace the
<standard_session_servicedirs> tag with a <sevicedir> tag that
  points to the test service directory
2006-11-02 19:28:11 +00:00
John (J5) Palmieri
a107da8489 * tools/dbus-launch.c (main): run the dbus-daemon in the builddir
if tests are enabled and the DBUS_USE_TEST_BINARY env variable is set

* tools/run-with-tmp-session-bus.sh: set DBUS_USE_TEST_BINARY
  before we run dbus-launch

* configure.in: define TEST_BUS_BINARY to be the full path to
  dbus-daemon in the build root
2006-10-26 15:55:44 +00:00
Havoc Pennington
d8155bf51b 2006-09-30 Havoc Pennington <hp@redhat.com>
* configure.in (LT_CURRENT, LT_AGE): increment current and age to
	reflect addition of interfaces.

	* doc/dbus-specification.xml: describe a new
	org.freedesktop.DBus.Peer.GetMachineId method

	* dbus/dbus-string.c (_dbus_string_skip_white_reverse): new function
	(_dbus_string_skip_white, _dbus_string_skip_blank): use new
	DBUS_IS_ASCII_BLANK, DBUS_IS_ASCII_WHITE macros and fix assertion
	at end of skip_white
	(_dbus_string_chop_white): new function

	* bus/connection.c (bus_connections_setup_connection): call
	dbus_connection_set_route_peer_messages.

	* dbus/dbus-connection.c
	(_dbus_connection_peer_filter_unlocked_no_update): modify to
	support a GetMachineId method.

	Also, support a new flag to let the bus pass peer methods through
	to apps on the bus, which can be set with
	dbus_connection_set_route_peer_messages.

	Finally, handle and return an error for anything unknown on the
	Peer interface, which will allow us to extend the Peer interface
	in the future without fear that we're now intercepting something
	apps were wanting to see.

	* tools/dbus-uuidgen.c: a thin wrapper around the functions in
	dbus/dbus-uuidgen.c

	* dbus/dbus-uuidgen.c: implement the bulk of the dbus-uuidgen
	binary here, since most of the code is already in libdbus

	* dbus/dbus-sysdeps.c (_dbus_read_local_machine_uuid): read the
	uuid from the system config file

	* dbus/dbus-internals.c (_dbus_generate_uuid, _dbus_uuid_encode)
	(_dbus_read_uuid_file_without_creating)
	(_dbus_create_uuid_file_exclusively, _dbus_read_uuid_file): new
	uuid-related functions, partly factored out from dbus-server.c

	* dbus/dbus-sysdeps.c (_dbus_error_from_errno): convert EEXIST to
	DBUS_ERROR_FILE_EXISTS instead of EEXIST

	* dbus/dbus-protocol.h (DBUS_ERROR_FILE_EXISTS): add file exists error

	* tools/dbus-cleanup-sockets.1: explain what the point of this
	thing is a bit more

	* autogen.sh (run_configure): add --config-cache to default
	configure args

	* dbus/dbus-internals.h (_DBUS_ASSERT_ERROR_IS_SET): disable the
	error set/clear assertions when DBUS_DISABLE_CHECKS is defined

	* tools/dbus-launch.c (main): if xdisplay hasn't been opened,
	don't try to save address, fixes crash in make check
2006-10-01 03:18:47 +00:00
John (J5) Palmieri
47ec532cf2 * tools/run-with-tmp-session-bus.sh:
* test/name-test/run-test.sh:
  Remove bashisms (patch from Julio M. Merino Vidal
  <jmmv at NetBSD dot org>)
2006-08-10 21:44:00 +00:00
John (J5) Palmieri
553bd86345 * tools/run-with-tmp-session-bus.sh: use #!/bin/sh instead of
#!/bin/bash
2006-08-08 22:38:32 +00:00
Colin Walters
a65587676f 2005-03-17 Colin Walters <walters@verbum.org>
* bus/print-introspect.c: Move to tools/.
	* bus/run-with-tmp-session-bus.sh: Ditto.

	* glib/Makefile.am (dbus-glib-bindings.h): Move
	generation to tools/Makefile.am.

	* test/glib/run-test.sh: Update to handle move
	of run-with-tmp-session-bus.sh.

	* test/glib/test-service-glib.c: Update to handle
	move of dbus-glib-bindings.h.

	* tools/print-introspect.c: Moved here
	from bus/, and ported to GLib bindings.

	* tools/run-with-tmp-session-bus.sh: Moved here
	from bus/.

	* tools/Makefile.am: Generate dbus-glib-bindings.h
	and dbus-bus-introspect.xml here.

	* tools/.cvsignore, glib/.cvsignore, bus/.cvsignore:
	Update.
2005-03-17 17:48:29 +00:00
Renamed from bus/run-with-tmp-session-bus.sh (Browse further)