]> git.ipfire.org Git - thirdparty/dbus.git/log
thirdparty/dbus.git
6 years agodbus-marshal-*-util: Remove all trailing whitespace
Simon McVittie [Mon, 17 Dec 2018 11:34:41 +0000 (11:34 +0000)] 
dbus-marshal-*-util: Remove all trailing whitespace

This is in preparation for moving the files: our commit hook would
object to the delete + add otherwise.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Move dbus-message-factory and most of dbus-message-util into test/
Simon McVittie [Fri, 28 Sep 2018 15:32:03 +0000 (16:32 +0100)] 
test: Move dbus-message-factory and most of dbus-message-util into test/

As with previous moves, I've tried to extract the possible copyright
holders from the git history.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodbus-message-factory: Remove all trailing whitespace
Simon McVittie [Mon, 17 Dec 2018 11:31:17 +0000 (11:31 +0000)] 
dbus-message-factory: Remove all trailing whitespace

This is in preparation for moving the files: our commit hook would
object to the delete + add otherwise.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Move auth, credentials tests from libdbus-internal into test/
Simon McVittie [Fri, 28 Sep 2018 15:27:42 +0000 (16:27 +0100)] 
test: Move auth, credentials tests from libdbus-internal into test/

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodbus-credentials-util: Remove all trailing whitespace
Simon McVittie [Mon, 17 Dec 2018 11:30:23 +0000 (11:30 +0000)] 
dbus-credentials-util: Remove all trailing whitespace

This is in preparation for moving the file: our commit hook would
object to the delete + add otherwise.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodbus-auth-util: Remove all trailing whitespace
Simon McVittie [Mon, 17 Dec 2018 11:30:00 +0000 (11:30 +0000)] 
dbus-auth-util: Remove all trailing whitespace

This is in preparation for moving the file: our commit hook would
object to the delete + add otherwise.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodbus-auth-script: Remove all trailing whitespace
Simon McVittie [Mon, 17 Dec 2018 11:29:29 +0000 (11:29 +0000)] 
dbus-auth-script: Remove all trailing whitespace

This is in preparation for moving the file: our commit hook would
object to the delete + add otherwise.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Unembed hash test from libdbus and move it into test/
Simon McVittie [Mon, 17 Dec 2018 11:18:35 +0000 (11:18 +0000)] 
test: Unembed hash test from libdbus and move it into test/

This required exposing one additional internal symbol:
_dbus_hash_table_ref(). I think that's a reasonable trade-off for not
compiling this test into the library.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodbus-hash: Attempt to update copyright holders from git history
Simon McVittie [Mon, 17 Dec 2018 11:17:59 +0000 (11:17 +0000)] 
dbus-hash: Attempt to update copyright holders from git history

This is in preparation for splitting the file, tests vs. non-tests.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Split slow parts of the former test-dbus into their own executables
Simon McVittie [Thu, 15 Nov 2018 15:48:26 +0000 (15:48 +0000)] 
test: Split slow parts of the former test-dbus into their own executables

This makes it easier for a developer to run just the fast parts while
debugging some issue reproduced by the faster tests.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years ago_dbus_test_main: Move to test-utils
Simon McVittie [Thu, 15 Nov 2018 14:08:03 +0000 (14:08 +0000)] 
_dbus_test_main: Move to test-utils

Now that there is no code outside test/ that calls into this, we can
move it into test/, reducing the size of libdbus.

dbus-test-tap.[ch] still need to stay in dbus/ as long as there is
code in dbus/ or bus/ relying on them, and also need to be linked into
libdbus as long as there is other code in libdbus relying on them,
so they stay where they are for now. Similarly, dbus-tests.h lists
the tests that are still embedded in libdbus, and must stay where
it is for the moment.

With this move, various tests now need to be linked to the dbus-testutils
convenience library.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Move dbus-daemon-launch-helper-test here, and rename
Simon McVittie [Wed, 3 Oct 2018 18:01:42 +0000 (19:01 +0100)] 
test: Move dbus-daemon-launch-helper-test here, and rename

The -test suffix does not indicate that this is a test, but rather that
it is for tests (similar to the -unix and -win suffixes on modules like
dbus-sysdeps). This seems unnecessarily confusing, so rename it to end
with -for-tests.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Move libdbus embedded tests from dbus/ to test/
Simon McVittie [Wed, 3 Oct 2018 18:15:38 +0000 (19:15 +0100)] 
test: Move libdbus embedded tests from dbus/ to test/

This groups them with the rest of the tests, and enables parts of
the test code to be unembedded from libdbus and moved to test/ too.

Rename the executable to test-misc-internals, not test-dbus. The name
test-dbus made some sense as "the executable that contains the code in
dbus/", but makes a lot less sense in test/: dbus is the name of the
entire project, so this test has no particular special claim to that
name. test-libdbus doesn't seem right either, because all the tests
exercise libdbus one way or another.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Break out the slow parts of test-bus into their own executables
Simon McVittie [Mon, 3 Sep 2018 23:57:10 +0000 (16:57 -0700)] 
test: Break out the slow parts of test-bus into their own executables

This makes it more convenient to re-run the rest of test-bus as
required when debugging.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Move dbus-daemon and d-d-launch-helper tests from bus/
Simon McVittie [Wed, 3 Oct 2018 17:49:56 +0000 (18:49 +0100)] 
test: Move dbus-daemon and d-d-launch-helper tests from bus/

This groups them with the other tests, and avoids having them influence
the test coverage stats in bus/.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agobus tests: Collect possible copyright holders from git history
Simon McVittie [Mon, 17 Dec 2018 11:11:34 +0000 (11:11 +0000)] 
bus tests: Collect possible copyright holders from git history

This is in preparation to move some of this code into the test/
directory. I've ignored changes that appear to be trivial.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoConvert spawn test into a standalone test executable
Simon McVittie [Fri, 28 Sep 2018 14:53:40 +0000 (15:53 +0100)] 
Convert spawn test into a standalone test executable

This test is sufficiently well-separated that there's no real need
to embed it in libdbus. Move it into the test directory instead.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agobuild: Compile most bus/ files into static libraries
Simon McVittie [Mon, 3 Sep 2018 22:27:29 +0000 (15:27 -0700)] 
build: Compile most bus/ files into static libraries

This means we can share them between tests without having to compile
the same file repeatedly, and makes them easier to share between
directories when we move test executables into test/.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest-utils: Add copyright and licensing
Simon McVittie [Mon, 3 Sep 2018 21:37:55 +0000 (14:37 -0700)] 
test-utils: Add copyright and licensing

As far as I can tell, the only significant contributions have been
from Red Hat and Collabora, both of which have given permission to
relicense their parts of the dbus codebase to MIT/X11; so let's go
with that.

I'm assuming here that tree-wide changes from
_DBUS_GNUC_WARN_UNUSED_RESULT to _DBUS_WARN_UNUSED_RESULT, and tree-wide
changes to how we include config.h, are not significant for copyright
purposes.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'fix-ctest-runtime-path-issue' into 'master'
Simon McVittie [Thu, 10 Jan 2019 21:45:55 +0000 (21:45 +0000)] 
Merge branch 'fix-ctest-runtime-path-issue' into 'master'

Make sure ctest on Windows uses the currently built dbus library

See merge request dbus/dbus!83

6 years agoMake sure ctest on Windows uses the currently built dbus library
Ralf Habacker [Thu, 10 Jan 2019 14:29:59 +0000 (15:29 +0100)] 
Make sure ctest on Windows uses the currently built dbus library

The ctest application is usually not installed in the dbus build
directory. If an older dbus library is contained in this path, it will
be used instead of the currently built one, which can lead to runtime
errors (e.g.: c0000139) if the internal dbus API differs.

6 years agoMerge branch 'rename-dbus-socket-set' into 'master'
Ralf Habacker [Wed, 9 Jan 2019 17:54:07 +0000 (17:54 +0000)] 
Merge branch 'rename-dbus-socket-set' into 'master'

Rename structure DBusSocketSet to DBusPollableSet and adjust the corresponding functions/files

See merge request dbus/dbus!81

Reviewed-by: Simon McVittie
6 years agoRename structure DBusSocketSet to DBusPollableSet and adjust the corresponding functi...
Ralf Habacker [Mon, 7 Jan 2019 12:07:12 +0000 (13:07 +0100)] 
Rename structure DBusSocketSet to DBusPollableSet and adjust the corresponding functions/files

Because the implementation of DBusSocketSet already supports non-socket
pollables like pipes and inotify fd on Unix, DBusPollableSet is a better
name.

6 years agoMerge branch 'windows-spawn-cleanup' into 'master'
Simon McVittie [Mon, 7 Jan 2019 11:06:16 +0000 (11:06 +0000)] 
Merge branch 'windows-spawn-cleanup' into 'master'

Windows spawn cleanup

See merge request dbus/dbus!80

6 years agoMerge branch 'glib-2.38-support' into 'master'
Ralf Habacker [Mon, 7 Jan 2019 09:27:55 +0000 (09:27 +0000)] 
Merge branch 'glib-2.38-support' into 'master'

Add glib 2.38 support

See merge request dbus/dbus!79

Reviewed-by: Philip Withnall
Reviewed-by: Simon McVittie
6 years agoAdd glib 2.38 support
Ralf Habacker [Thu, 3 Jan 2019 22:54:56 +0000 (23:54 +0100)] 
Add glib 2.38 support

6 years agodbus-spawn-win.c: Simplify logic of return value from call to _dbus_spawn_program()
Ralf Habacker [Fri, 21 Dec 2018 16:55:29 +0000 (17:55 +0100)] 
dbus-spawn-win.c: Simplify logic of return value from call to _dbus_spawn_program()

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agodbus-spawn-win.c: Return valid error if child could not be spawned
Ralf Habacker [Fri, 21 Dec 2018 16:54:16 +0000 (17:54 +0100)] 
dbus-spawn-win.c: Return valid error if child could not be spawned

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agodbus-spawn-win.c: Don't wait for babysitter thread to start
Ralf Habacker [Fri, 21 Dec 2018 16:03:27 +0000 (17:03 +0100)] 
dbus-spawn-win.c: Don't wait for babysitter thread to start

Now that we start the spawned program from the main thread, there
is no need to wait for it before dereferencing `sitter->child_handle`.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agodbus-spawn-win.c: Move out argv copy from DBusSitter struct
Ralf Habacker [Fri, 21 Dec 2018 15:38:02 +0000 (16:38 +0100)] 
dbus-spawn-win.c: Move out argv copy from DBusSitter struct

Since the child program is started in the main thread, there is no
need to pass a copy of argv to the thread waiting for the child's
termination.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agodbus-spawn: Don't take ownership of envp
Simon McVittie [Thu, 20 Dec 2018 15:27:03 +0000 (15:27 +0000)] 
dbus-spawn: Don't take ownership of envp

It's unexpected for a function to take ownership of its arguments
without indicating that in its name, or at least documenting it.

The only caller with envp != NULL is in
bus_activation_activate_service(), which has been updated.

Based on part of a larger commit by Ralf Habacker.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodbus-spawn-win: Move _dbus_spawn_program() to main thread
Simon McVittie [Thu, 20 Dec 2018 15:17:13 +0000 (15:17 +0000)] 
dbus-spawn-win: Move _dbus_spawn_program() to main thread

We would like to stop taking ownership of envp, but we can't do that
without a deep copy if a different thread might still be using it
(asynchronously) after the main thread has returned from
_dbus_spawn_async_with_babysitter().

Originally part of a larger commit by Ralf Habacker.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'cmake-custom-install-dirs' into 'master'
Simon McVittie [Fri, 4 Jan 2019 18:27:50 +0000 (18:27 +0000)] 
Merge branch 'cmake-custom-install-dirs' into 'master'

In cmake use variables provided from GNUInstallDirs consequently

See merge request dbus/dbus!77

6 years agoIn cmake use variables provided from GNUInstallDirs consequently
Ralf Habacker [Fri, 21 Dec 2018 18:36:37 +0000 (19:36 +0100)] 
In cmake use variables provided from GNUInstallDirs consequently

This is required to support a custom installation layout, e.g. the
KDE binary factory.

6 years agoMerge branch 'test-defend-getenv' into 'master'
Simon McVittie [Thu, 20 Dec 2018 13:28:42 +0000 (13:28 +0000)] 
Merge branch 'test-defend-getenv' into 'master'

test-wrappers: Copy strings that might come from getenv()

Closes #240

See merge request dbus/dbus!74

Reviewed-by: Philip Withnall
6 years agoMerge branch 'test-main-boilerplate' into 'master'
Simon McVittie [Thu, 20 Dec 2018 13:27:42 +0000 (13:27 +0000)] 
Merge branch 'test-main-boilerplate' into 'master'

Consolidate boilerplate from embedded tests' main()

See merge request dbus/dbus!73

Reviewed-by: Ralf Habacker
6 years agoMerge branch 'deprecate-packaged-xml-in-sysconfdir' into 'master'
Simon McVittie [Thu, 20 Dec 2018 13:25:21 +0000 (13:25 +0000)] 
Merge branch 'deprecate-packaged-xml-in-sysconfdir' into 'master'

Deprecate packaged XML policies in ${sysconfdir}

See merge request dbus/dbus!76

Reviewed-by: Tom Gundersen
6 years agodbus-daemon(1): Give more comprehensive examples of how to add services
Simon McVittie [Wed, 19 Dec 2018 17:29:11 +0000 (17:29 +0000)] 
dbus-daemon(1): Give more comprehensive examples of how to add services

While writing the wording to deprecate XML policy installed by packages
into ${sysconfdir}, I realised we didn't give a typical example of
what packages *should* do.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoOfficially deprecate package-supplied dbus-daemon policy in ${sysconfdir}
Simon McVittie [Wed, 19 Dec 2018 17:27:15 +0000 (17:27 +0000)] 
Officially deprecate package-supplied dbus-daemon policy in ${sysconfdir}

Now that dbus 1.10 has become widely available, we should start to
treat ${sysconfdir} as reserved for the sysadmin, and encourage
third-party software packages to install their integration files into
${datadir}.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch '135-session-test-support-windows' into 'master'
Ralf Habacker [Tue, 18 Dec 2018 07:15:01 +0000 (07:15 +0000)] 
Merge branch '135-session-test-support-windows' into 'master'

name-test: Run most tests in CMake, via dbus-run-session

See merge request dbus/dbus!23

6 years agoFix multi-configuration generator support
Ralf Habacker [Mon, 17 Dec 2018 15:37:16 +0000 (16:37 +0100)] 
Fix multi-configuration generator support

Multi-configuration generators (VS, Xcode) append a per-configuration
subdirectory to the specified CMAKE_xxx_OUTPUT_DIRECTORY} directory.

To use the real output paths in test applications, this subdirectory
must be added to the corresponding cmake variables.

6 years agoAdd cmake support for session based test executables
Ralf Habacker [Mon, 17 Dec 2018 15:36:32 +0000 (16:36 +0100)] 
Add cmake support for session based test executables

This patch introduces a new cmake macro add_session_test_executable,
which uses dbus-run-session to start a dbus-daemon process with a
temporary session bus in the background and the desired client file.

add_session_test_executable requires additional environment variables
defined in the top level CMakeLists.txt.

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/135
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agoAdd cmake support for session based test executables
Ralf Habacker [Mon, 17 Dec 2018 15:13:00 +0000 (16:13 +0100)] 
Add cmake support for session based test executables

This patch introduces a new cmake macro add_session_test_executable,
which uses dbus-run-session to start a dbus-daemon process with a
temporary session bus in the background and the desired client file.

add_session_test_executable requires additional environment variables
defined in the top level CMakeLists.txt.

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/135
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agoUse prefined variables to setup environment in cmake macro add_test_executable
Ralf Habacker [Mon, 17 Dec 2018 15:12:33 +0000 (16:12 +0100)] 
Use prefined variables to setup environment in cmake macro add_test_executable

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/135

6 years agoAdd missing extension to TEST_LAUNCH_HELPER_BINARY in cmake
Ralf Habacker [Mon, 17 Dec 2018 15:11:48 +0000 (16:11 +0100)] 
Add missing extension to TEST_LAUNCH_HELPER_BINARY in cmake

6 years agoFix setup of build time output paths in cmake
Ralf Habacker [Sat, 15 Dec 2018 09:54:47 +0000 (10:54 +0100)] 
Fix setup of build time output paths in cmake

Instead of the variables EXECUTABLE_OUTPUT_PATH and
LIBRARY_OUTPUT_PATH, which have become obsolete since
cmake 3.x, CMAKE_xxx_OUTPUT_PATH is now used to define
output paths in the build directory.

6 years agotest-wrappers: Copy strings that might come from getenv()
Simon McVittie [Fri, 14 Dec 2018 20:31:31 +0000 (20:31 +0000)] 
test-wrappers: Copy strings that might come from getenv()

It is not safe to assume that the result of getenv() is not invalidated
by a subsequent call to setenv(), and dbus#240 demonstrates that this
can be a problem in practice when running Windows code under Wine.

Closes: https://gitlab.freedesktop.org/dbus/dbus/issues/240
Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotests: Collect common code from embedded-test main executables
Simon McVittie [Mon, 3 Sep 2018 21:53:24 +0000 (14:53 -0700)] 
tests: Collect common code from embedded-test main executables

This all seems to have been written by Red Hat or by Collabora, so we
have permission to relicense it under the MIT/X11 license, and we
might as well do so.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agobus tests: Skip unsupported fd-passing test internally, not from main()
Simon McVittie [Mon, 3 Sep 2018 21:13:45 +0000 (14:13 -0700)] 
bus tests: Skip unsupported fd-passing test internally, not from main()

This results in one less special case in test-main, which will be
significant when we want to make the tests more data-driven.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoembedded tests: Time how long each test takes
Simon McVittie [Mon, 3 Sep 2018 19:46:25 +0000 (12:46 -0700)] 
embedded tests: Time how long each test takes

This will help to split them up into modules that each take a
reasonable time.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoembedded tests: Conform to the same API for all tests
Simon McVittie [Mon, 3 Sep 2018 19:18:39 +0000 (12:18 -0700)] 
embedded tests: Conform to the same API for all tests

This will make it possible to unify the wrapper code that runs them.

I'm using a plain C string rather than a DBusString to make it
more straightforward to carve out tests into their own executables.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodbus-marshal-validate.h: Make self-contained
Simon McVittie [Mon, 3 Sep 2018 21:59:02 +0000 (14:59 -0700)] 
dbus-marshal-validate.h: Make self-contained

This header mentions DBusString, so it had better include dbus-string.h.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'copyright-whitespace' into 'master'
Simon McVittie [Mon, 17 Dec 2018 12:13:12 +0000 (12:13 +0000)] 
Merge branch 'copyright-whitespace' into 'master'

trivial: Remove trailing whitespace from copyright notices

See merge request dbus/dbus!75

Reviewed-by: pwithnall
6 years agotrivial: Remove trailing whitespace from copyright notices
Simon McVittie [Mon, 17 Dec 2018 10:56:38 +0000 (10:56 +0000)] 
trivial: Remove trailing whitespace from copyright notices

We don't usually mass-remove trailing whitespace from the actual source
code because it would complicate cherry-picking bug fixes to older
branches, but that reasoning doesn't really apply to the comments
containing copyright and licensing notices.

Removing trailing whitespace makes it much easier to move code around:
we have a commit hook that rejects commits containing trailing
whitespace, but that commit hook counts moving a file as a delete + add
pair, so it objects to moving code that contains trailing whitespace.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'remove-threads-init-debug' into 'master'
Simon McVittie [Mon, 17 Dec 2018 10:28:07 +0000 (10:28 +0000)] 
Merge branch 'remove-threads-init-debug' into 'master'

_dbus_threads_init_debug: Remove

See merge request dbus/dbus!72

6 years ago_dbus_threads_init_debug: Remove
Simon McVittie [Fri, 14 Dec 2018 20:06:02 +0000 (20:06 +0000)] 
_dbus_threads_init_debug: Remove

libdbus has been thread-safe by default since 1.7.6 (2013):
dbus_threads_init_default() is called on a just-in-time basis
whenever needed, and _dbus_thread_init_debug() is equivalent to that.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'gitignore' into 'master'
Simon McVittie [Fri, 14 Dec 2018 15:11:51 +0000 (15:11 +0000)] 
Merge branch 'gitignore' into 'master'

trivial: Clean up .gitignore files

See merge request dbus/dbus!70

Reviewed-by: pwithnall
6 years ago.gitignore: Ignore many more generated files
Simon McVittie [Fri, 14 Dec 2018 13:28:50 +0000 (13:28 +0000)] 
.gitignore: Ignore many more generated files

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'reduce-test-refs-run-time' into 'master'
Simon McVittie [Fri, 14 Dec 2018 13:08:01 +0000 (13:08 +0000)] 
Merge branch 'reduce-test-refs-run-time' into 'master'

Decrease the runtime of test-refs under Windows

Closes #244

See merge request dbus/dbus!65

6 years ago.gitignore: Normalize into LC_ALL=C sort order
Simon McVittie [Fri, 14 Dec 2018 12:51:51 +0000 (12:51 +0000)] 
.gitignore: Normalize into LC_ALL=C sort order

If lists are in a completely arbitrary order, sorting them consistently
means that there is only one correct place to insert a new entry, avoiding
the merge conflicts that would occur if we always append new entries.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years ago.gitignore: Make match patterns more specific
Simon McVittie [Fri, 14 Dec 2018 12:50:25 +0000 (12:50 +0000)] 
.gitignore: Make match patterns more specific

In subdirectories we mostly only want to match at the current level,
not in nested subdirectories.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agovalid-config-files-system .gitignore: Don't ignore many-rules.conf
Simon McVittie [Fri, 14 Dec 2018 12:48:41 +0000 (12:48 +0000)] 
valid-config-files-system .gitignore: Don't ignore many-rules.conf

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years ago.gitignore: Remove obsolete patterns
Simon McVittie [Fri, 14 Dec 2018 12:48:08 +0000 (12:48 +0000)] 
.gitignore: Remove obsolete patterns

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years ago.gitignore: Consolidate generic patterns at top level
Simon McVittie [Fri, 14 Dec 2018 12:46:35 +0000 (12:46 +0000)] 
.gitignore: Consolidate generic patterns at top level

Patterns in the top-level .gitignore match in all subdirectories, so
there's no need to repeat ourselves quite so much for generic
C, Autotools and gcov patterns.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoTop level .gitignore: Sort anchored patterns in LC_ALL=C sort order
Simon McVittie [Fri, 14 Dec 2018 12:42:52 +0000 (12:42 +0000)] 
Top level .gitignore: Sort anchored patterns in LC_ALL=C sort order

If lists are in a completely arbitrary order, sorting them consistently
means that there is only one correct place to insert a new entry, avoiding
the merge conflicts that would occur if we always append new entries.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoTop level .gitignore: Group anchored and unanchored patterns
Simon McVittie [Fri, 14 Dec 2018 12:42:22 +0000 (12:42 +0000)] 
Top level .gitignore: Group anchored and unanchored patterns

The anchored patterns match only in the top directory; the unanchored
patterns match in any subdirectory. While I'm moving the unanchored
patterns around anyway, sort them in lexicographical (LC_ALL=C sort)
order.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years ago.gitignore: Anchor patterns for files that are only at top level
Simon McVittie [Fri, 14 Dec 2018 12:39:33 +0000 (12:39 +0000)] 
.gitignore: Anchor patterns for files that are only at top level

There shouldn't be an aclocal.m4 in any subdirectory, for instance,
so there's no need to ignore it.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoTop level .gitignore: Remove files that now live in build-aux/
Simon McVittie [Fri, 14 Dec 2018 12:37:48 +0000 (12:37 +0000)] 
Top level .gitignore: Remove files that now live in build-aux/

We put these in build-aux/ since 15e6b4f5, and we ignore all of
build-aux/, so we don't need to ignore them separately.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'all-helpers-in-test' into 'master'
Simon McVittie [Fri, 14 Dec 2018 12:17:14 +0000 (12:17 +0000)] 
Merge branch 'all-helpers-in-test' into 'master'

test-privserver: Move helper executable out of name-test/

See merge request dbus/dbus!67

6 years agoIncrease the number of references/threads to be tested under Windows by default to...
Ralf Habacker [Fri, 14 Dec 2018 09:54:31 +0000 (10:54 +0100)] 
Increase the number of references/threads to be tested under Windows by default to detect errors

6 years agoDecrease the runtime of test refs under Windows by default
Ralf Habacker [Fri, 7 Dec 2018 16:52:58 +0000 (17:52 +0100)] 
Decrease the runtime of test refs under Windows by default

If the environment variable DBUS_TEST_SLOW is not set or is 0
fewer iterations are performed in test-refs enough to demonstrate
that it works, rather than seriously trying to reproduce race
conditions.

This solves the long runtime that Wine 3.x (4 times longer than
native Windows 7) or Windows 7 as a VirtualBox 5.22 guest (10
times longer) is to be seen.

Fixes #244

6 years agotest-privserver: Move helper executable out of name-test/
Simon McVittie [Tue, 11 Dec 2018 11:52:38 +0000 (11:52 +0000)] 
test-privserver: Move helper executable out of name-test/

This means we don't need to distinguish between DBUS_NAME_TEST_EXEC and
DBUS_TEST_EXEC any more, because all test helper executables are in the
same place, both during build and when installed (we don't install
test-privserver since no installed test requires it yet, but in
principle we could).

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest-privserver: Add copyright and licensing information
Simon McVittie [Thu, 13 Dec 2018 13:07:20 +0000 (13:07 +0000)] 
test-privserver: Add copyright and licensing information

I've assumed that trivial changes from Scott James Remnant (correcting
some bus names) and Marcus Brinkmann (adding a <config.h> include
tree-wide) are not significant here. All the other potential copyright
holders from the git log are listed, and all have given permission to
relicense their dbus contributions under the MIT/X11 license.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest-privserver: Remove all trailing whitespace
Simon McVittie [Thu, 13 Dec 2018 12:42:11 +0000 (12:42 +0000)] 
test-privserver: Remove all trailing whitespace

Otherwise the commit hook would forbid commits that move it to a new
location.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'wip/asan' into 'master'
Simon McVittie [Wed, 12 Dec 2018 12:01:40 +0000 (12:01 +0000)] 
Merge branch 'wip/asan' into 'master'

Add AddressSanitizer and UBSan support

See merge request dbus/dbus!57

Reviewed-by: pwithnall
6 years agoMerge branch 'basic-value-align' into 'master'
Simon McVittie [Wed, 12 Dec 2018 12:00:03 +0000 (12:00 +0000)] 
Merge branch 'basic-value-align' into 'master'

Don't cast user-supplied pointers to DBusBasicValue *

See merge request dbus/dbus!69

Reviewed-by: thiago
6 years agoci: Apply AddressSanitizer to Linux "debug" builds
Simon McVittie [Mon, 3 Dec 2018 17:48:45 +0000 (17:48 +0000)] 
ci: Apply AddressSanitizer to Linux "debug" builds

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agobuild: Add a way to set CFLAGS for AddressSanitizer etc.
Simon McVittie [Wed, 29 Aug 2018 19:06:00 +0000 (20:06 +0100)] 
build: Add a way to set CFLAGS for AddressSanitizer etc.

We don't want to set these globally via the normal CFLAGS, because if
we did, AddressSanitizer would catch test-segfault deliberately
segfaulting, and "helpfully" turn it into exit status 1, which in turn
makes our test fail because it asserts that the segfault is reported
as a segfault.

A typical use with gcc as compiler, on a reasonably recent Debian,
would be:

    ./configure SANITIZE_CFLAGS="-fsanitize=address -fsanitize=undefined -fPIE -pie"

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMove _dbus_disable_crash_handling() back into test/ directory
Simon McVittie [Mon, 3 Dec 2018 16:04:56 +0000 (16:04 +0000)] 
Move _dbus_disable_crash_handling() back into test/ directory

It's only used in test code. We have to put it in its own translation
unit with no non-libc dependencies so that we can compile a copy of it
without AddressSanitizer support, because in a subsequent commit we will
special-case test-segfault to be compiled without using AddressSanitizer,
which would make linking to an AddressSanitizer-instrumented libdbus fail.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotests: Allow timeout to be multiplied by an arbitrary factor
Simon McVittie [Fri, 17 Aug 2018 14:48:50 +0000 (15:48 +0100)] 
tests: Allow timeout to be multiplied by an arbitrary factor

Running tests under instrumentation (libasan) or emulation (qemu)
is not fast.

Inspired by the --timeout-factor option in
<https://salsa.debian.org/ci-team/autopkgtest>.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'privserver-leak' into 'master'
Simon McVittie [Tue, 11 Dec 2018 12:38:59 +0000 (12:38 +0000)] 
Merge branch 'privserver-leak' into 'master'

test-privserver: Don't leak the DBusServer

See merge request dbus/dbus!68

6 years agoDon't cast user-supplied pointers to DBusBasicValue *
Simon McVittie [Thu, 6 Dec 2018 13:49:56 +0000 (13:49 +0000)] 
Don't cast user-supplied pointers to DBusBasicValue *

If we cast a user-supplied pointer to DBusBasicValue *, that's like
promising that the pointer is to an object at least as strictly aligned
as a DBusBasicValue. In practice, it often isn't: for example, when
we marshal a dbus_uint32_t, a pointer to it is only guaranteed to be
32-bit-aligned, whereas DBusBasicValue typically requires 64-bit
alignment.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest-privserver: Don't leak the DBusServer
Simon McVittie [Tue, 11 Dec 2018 10:04:18 +0000 (10:04 +0000)] 
test-privserver: Don't leak the DBusServer

This results in (harmless) leak reports when running under the
AddressSanitizer, which could make real leaks harder to find.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoAdd build system variable DBUS_NAME_TEST_EXEC to cover differences in executable...
Ralf Habacker [Tue, 20 Nov 2018 15:33:57 +0000 (16:33 +0100)] 
Add build system variable DBUS_NAME_TEST_EXEC to cover differences in executable paths

Autotools creates executable applications in the respective
subdirectory of the build directory, while cmake creates
them in <build-root>/bin.

This leads to different paths in the file created
from org.freedesktop.DBus.TestSuite.PrivServer.service.in,
which are fixed by the new variable.

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/135
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Simon McVittie <smcv@collabora.com>
6 years agoRefer to correct bus in test-ids error message
Ralf Habacker [Fri, 7 Dec 2018 18:06:35 +0000 (19:06 +0100)] 
Refer to correct bus in test-ids error message

The test tries to connect to the session bus, not system bus.

Reviewed-by: Simon McVittie <smcv@collabora.com>
6 years agorun-session: Fix warning 'array subscript 3 is above array bounds of 'char *[3]'...
Ralf Habacker [Fri, 7 Dec 2018 18:02:14 +0000 (19:02 +0100)] 
run-session: Fix warning 'array subscript 3 is above array bounds of 'char *[3]' on Windows

After the merge request !22 was created, this bug was fixed in !23,
the associated branch was used for local tests, but the fix was not
transferred to !22. After merging !22 into the master branch and
rebasing !23 to the master, this fix was lost.

Reviewed-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'skip-server-oom-test' into 'master'
Simon McVittie [Thu, 6 Dec 2018 16:42:09 +0000 (16:42 +0000)] 
Merge branch 'skip-server-oom-test' into 'master'

Skip server oom wildcard test on Windows to avoid firewall exception request

See merge request dbus/dbus!64

Reviewed-by: smcv
6 years agoSkip server oom wildcard test on Windows to avoid firewall exception request
Ralf Habacker [Thu, 6 Dec 2018 16:08:29 +0000 (17:08 +0100)] 
Skip server oom wildcard test on Windows to avoid firewall exception request

After starting the test on Windows 10, whether the local user is an
administrator or not, a dialog box appears with a warning that some
features of the app have been blocked by the firewall and prompts for
credentials for an administrator account while the test continues to
run and pass.

If this request is aborted, the dialog disappears; no restrictions are
visible for the test case. When the test is restarted, the dialog is also
no longer displayed.

In the firewall configuration you can then see that test-server-oom.exe
has been added (but not enabled) for public networks, although no
confirmation has been received from an administrator account.

6 years agoMerge branch 'fix-cmake-wine-support' into 'master'
Simon McVittie [Thu, 6 Dec 2018 12:24:37 +0000 (12:24 +0000)] 
Merge branch 'fix-cmake-wine-support' into 'master'

Fix cmake wine support

See merge request dbus/dbus!60

Reviewed-by: smcv
6 years agoAdd new cmake configure option DBUS_USE_WINE
Ralf Habacker [Wed, 5 Dec 2018 07:30:17 +0000 (08:30 +0100)] 
Add new cmake configure option DBUS_USE_WINE

If this variable is set, ctest uses wine to run cross compiled
test applications. Otherwise, they are assumed to run on a native
Windows operating system.

The new cmake variables Z_DRIVE_IF_WINE and TEST_WRAPPER have been
added to support this function.

6 years agoMerge branch 'fix-cmake-tests' into 'master'
Simon McVittie [Wed, 5 Dec 2018 16:06:05 +0000 (16:06 +0000)] 
Merge branch 'fix-cmake-tests' into 'master'

Fix cmake tests

See merge request dbus/dbus!59

Reviewed-by: smcv
6 years agoUpdate NEWS
Simon McVittie [Wed, 5 Dec 2018 15:02:42 +0000 (15:02 +0000)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoAdds uac manifest to all executable test files to prevent the Windows 740 error when...
Ralf Habacker [Wed, 5 Dec 2018 06:56:22 +0000 (07:56 +0100)] 
Adds uac manifest to all executable test files to prevent the Windows 740 error when running

The case occurred during test-pending-call-dispatch. To avoid further
applications being affected in the future, the manifest is added to
all test applications.

Windows Error 740 is defined as 'The Requested Operation Requires Elevation'

6 years agoDrop cmake variable DBUS_WIN_FIXME
Ralf Habacker [Wed, 5 Dec 2018 13:59:17 +0000 (14:59 +0100)] 
Drop cmake variable DBUS_WIN_FIXME

6 years agoAvoid memory leaks on running check_shell_service_success_auto_start on Windows
Ralf Habacker [Mon, 26 Nov 2018 11:09:48 +0000 (12:09 +0100)] 
Avoid memory leaks on running check_shell_service_success_auto_start on Windows

6 years agoCI: Install yelp-tools, for yelp-build, in recent distros
Simon McVittie [Wed, 5 Dec 2018 13:17:17 +0000 (13:17 +0000)] 
CI: Install yelp-tools, for yelp-build, in recent distros

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoCI: Make adduser properly non-interactive
Simon McVittie [Wed, 5 Dec 2018 13:52:12 +0000 (13:52 +0000)] 
CI: Make adduser properly non-interactive

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoCI: Don't install weak dependencies (Recommends)
Simon McVittie [Wed, 5 Dec 2018 13:16:10 +0000 (13:16 +0000)] 
CI: Don't install weak dependencies (Recommends)

In particular this avoids installing the TeX toolchain.

However, this also means we don't install dbus, which broke some tests
in minimal containers where dbus wasn't already installed, because the
messagebus user wouldn't have been created. Make sure that user exists,
using the same adduser call as the Debian dbus package.

CMake really wants to find a C++ compiler (even though we only use C++
when compiling for Windows), so explicitly install the default
version of the GNU C++ compiler, g++.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'sysdeps-test-wait' into 'master'
Ralf Habacker [Wed, 5 Dec 2018 14:32:53 +0000 (14:32 +0000)] 
Merge branch 'sysdeps-test-wait' into 'master'

sysdeps test: Wait for spawned process to exit

Closes #238
See merge request dbus/dbus!61
Reviewed-by: rhabacker
6 years agosysdeps test: Wait for spawned process to exit
Simon McVittie [Wed, 5 Dec 2018 12:58:22 +0000 (12:58 +0000)] 
sysdeps test: Wait for spawned process to exit

On Windows, the "out" parameter for the process handle isn't set
unless we specify G_SPAWN_FLAGS_DO_NOT_REAP_CHILD. That means we
can't terminate it, and the child process is leaked. When running the
test individually, the leaked process is harmless apart from its
resource cost, but when running under CTest, it holds a file descriptor
open (or something) which causes CTest to not exit.

If we *do* specify G_SPAWN_FLAGS_DO_NOT_REAP_CHILD, we become
responsible for "reaping" the child process by waiting for its exit
status, which is an OS-specific action.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: https://gitlab.freedesktop.org/dbus/dbus/issues/238