Commit graph

870 commits

Author SHA1 Message Date
Simon McVittie
fd0c19d6d8 Merge branch 'disable-traditional-activation' into 'master'
Configure option to disable traditional activation

See merge request dbus/dbus!107
2019-04-17 13:33:06 +00:00
Simon McVittie
812678e595 test-dbus-daemon: Say why we don't check the value of LinuxSecurityLabel
Suggested on !105 by Matthijs van Duin.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-04-17 14:13:42 +01:00
Topi Miettinen
94b5b236aa
Configure option to disable traditional activation
Traditional activation could be disabled if all services use
SystemdService activation instead. Provide an example of a hardened
DBus systemd service drop-in file for such a setup.

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
2019-03-25 21:51:33 +02:00
Ralf Habacker
433d5c2471 test-spawn-oom: Separate single spawn tests from oom related
This makes it possible to run each test independent from oom condition.
2019-03-15 17:06:01 +00:00
Simon McVittie
47953c5d85 Merge branch 'nss-fds' into 'master'
_dbus_test_main: Exercise NSS modules before running tests

Closes #256

See merge request dbus/dbus!93

Reviewed-by: pwithnall
Tested-by: rhabacker
2019-01-28 11:18:16 +00:00
Simon McVittie
02e3c4fdfa _dbus_test_main: Exercise NSS modules before running tests
Some NSS modules like those for sssd and LDAP might allocate fds
on a one-per-process basis, for example a socket to talk to sssd.
Make sure those have already been allocated before we enter the code
under test, so that they don't show up as having been "leaked" by the
first module of code under test that happens to do a NSS lookup.

The call to _dbus_test_check_memleaks tears down libdbus' own memory
allocations, but not any hidden state in libc or NSS.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-25 11:49:56 +00:00
Ralf Habacker
6332f7d4b1 Fixes remaining indentations that are not covered by the cmake formatting script in CMakeLists.txt files 2019-01-24 09:08:15 +01:00
Ralf Habacker
2798e68776 Adjust indents of CMakeLists.txt files always to 4 spaces 2019-01-24 09:08:15 +01:00
Ralf Habacker
904fa97a1b Remove obsolete parameter in end... cmake keywords 2019-01-24 09:07:27 +01:00
Ralf Habacker
5972bbe382 Remove spaces between cmake command and opening bracket 2019-01-24 09:07:27 +01:00
Ralf Habacker
3927b1dd39 Use lower case cmake keywords in CMakeLists.txt files 2019-01-24 09:07:27 +01:00
Simon McVittie
6d8280ec93 Merge branch 'code-coverage' into 'master'
Adapt to API change in AX_CODE_COVERAGE version 28

Closes #249

See merge request dbus/dbus!88

Reviewed-by: @pwithnall
2019-01-23 20:45:32 +00:00
Ralf Habacker
3bf97922bd Move cmake related build system to top level
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2019-01-22 09:57:40 +01:00
Simon McVittie
83be61aa2d Consistently add CODE_COVERAGE_CPPFLAGS everywhere
We forgot this in a couple of places.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 18:46:07 +00:00
Simon McVittie
e0ea7a130c Consistently add CODE_COVERAGE_LIBS everywhere
We need to link the code coverage objects, directly or indirectly,
into every executable and every shared library. The rule I've followed
to make it clear that we do this, without too much repetition, is:
each executable, shared library or convenience library has
CODE_COVERAGE_LIBS in its LDADD or LIBADD, unless it is linked to a
convenience library in the same directory that has CODE_COVERAGE_LIBS
in *its* LIBADD.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 18:45:38 +00:00
Simon McVittie
2938c2125e Adapt to API change in AX_CODE_COVERAGE version 28
AX_CODE_COVERAGE recently changed the way it embedded its Makefile rules
in the output file: instead of using @CODE_COVERAGE_RULES@, users
are now meant to include aminclude_static.am.

The new AX_CODE_COVERAGE is only in the latest autoconf-archive release,
version 2019.01.06, which is inconveniently new, so bundle everything
we need for the moment.

This requires us to stop using the deprecated CODE_COVERAGE_LDFLAGS
(which we still used to support older versions of autoconf-archive)
and replace them with CODE_COVERAGE_LIBS.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 18:43:08 +00:00
Simon McVittie
1972390d42 test: Move _dbus_list_test() here
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:22:07 +00:00
Simon McVittie
0296c1fcbf test: Move _dbus_transport_unix_test() here
This requires exposing _dbus_connection_get_address() as an internal
symbol, but that seems worth it.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:22:07 +00:00
Simon McVittie
d9dfe4ee3e test: Move _dbus_server_test() here
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:22:07 +00:00
Simon McVittie
58fc8a0360 test: Move _dbus_misc_test() here
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:22:06 +00:00
Simon McVittie
0dd9853a37 test: Move _dbus_signature_test() here
This is all public API, so there's no need to embed it in the library.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:22:06 +00:00
Simon McVittie
cccb35dfef test: Move sysdeps tests here
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:22:05 +00:00
Simon McVittie
b1cfd892fc test: Move string tests (most of dbus-string-util.c) here
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:21:43 +00:00
Simon McVittie
8ead2011ac test: Move marshalling tests into test/
dbus-marshal-recursive-util.c contains utility functions used by the
other two, as well as tests. The others are purely test code.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:21:16 +00:00
Simon McVittie
f1f5294276 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>
2019-01-21 15:20:39 +00:00
Simon McVittie
9feeeaea9a test: Move auth, credentials tests from libdbus-internal into test/
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:20:22 +00:00
Simon McVittie
053a62122b 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>
2019-01-21 15:20:06 +00:00
Simon McVittie
24a1f3406a 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>
2019-01-21 15:20:04 +00:00
Simon McVittie
b7f11c17d1 _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>
2019-01-21 15:19:36 +00:00
Simon McVittie
e23bba929a 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>
2019-01-21 15:18:46 +00:00
Simon McVittie
b28e0886ed 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>
2019-01-21 15:18:18 +00:00
Simon McVittie
3b512610c0 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>
2019-01-21 15:17:36 +00:00
Simon McVittie
a15839da9b 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>
2019-01-21 15:16:51 +00:00
Simon McVittie
037d19a328 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>
2019-01-21 15:15:16 +00:00
Simon McVittie
651a82e685 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>
2019-01-21 15:14:29 +00:00
Ralf Habacker
602f4506a8 Add glib 2.38 support 2019-01-06 21:24:10 +01:00
Simon McVittie
c3f401a673 Merge branch 'gitignore' into 'master'
trivial: Clean up .gitignore files

See merge request dbus/dbus!70

Reviewed-by: pwithnall
2018-12-14 15:11:51 +00:00
Simon McVittie
fa63c16346 .gitignore: Ignore many more generated files
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-14 13:28:50 +00:00
Simon McVittie
5e66241c77 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
2018-12-14 13:08:01 +00:00
Simon McVittie
d3fffaa72f .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>
2018-12-14 12:53:08 +00:00
Simon McVittie
0c62a9a5f4 .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>
2018-12-14 12:53:08 +00:00
Simon McVittie
dfd09355ef valid-config-files-system .gitignore: Don't ignore many-rules.conf
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-14 12:53:08 +00:00
Simon McVittie
2fd386245b .gitignore: Remove obsolete patterns
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-14 12:53:08 +00:00
Simon McVittie
c95873e537 .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>
2018-12-14 12:53:08 +00:00
Ralf Habacker
48538357c6 Increase the number of references/threads to be tested under Windows by default to detect errors 2018-12-14 11:04:21 +01:00
Ralf Habacker
95171f4f1a 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
2018-12-14 10:54:52 +01:00
Simon McVittie
9490e954d0 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>
2018-12-13 13:08:00 +00:00
Simon McVittie
0d79fa68c0 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>
2018-12-13 13:07:20 +00:00
Simon McVittie
17e6b1484a 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>
2018-12-13 12:42:11 +00:00
Simon McVittie
e80ff14c2d Merge branch 'wip/asan' into 'master'
Add AddressSanitizer and UBSan support

See merge request dbus/dbus!57

Reviewed-by: pwithnall
2018-12-12 12:01:40 +00:00