Commit graph

5658 commits

Author SHA1 Message Date
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
Simon McVittie
d79986db28 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>
2018-12-14 12:52:15 +00:00
Simon McVittie
9984e6ebed 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>
2018-12-14 12:42:22 +00:00
Simon McVittie
27d69a8899 .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>
2018-12-14 12:40:22 +00:00
Simon McVittie
932638b18d 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>
2018-12-14 12:38:07 +00:00
Simon McVittie
78d1cf2e7f Merge branch 'all-helpers-in-test' into 'master'
test-privserver: Move helper executable out of name-test/

See merge request dbus/dbus!67
2018-12-14 12:17:14 +00: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
Simon McVittie
9a5c750ae7 Merge branch 'basic-value-align' into 'master'
Don't cast user-supplied pointers to DBusBasicValue *

See merge request dbus/dbus!69

Reviewed-by: thiago
2018-12-12 12:00:03 +00:00
Simon McVittie
eb837e6fd7 ci: Apply AddressSanitizer to Linux "debug" builds
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-11 12:47:22 +00:00
Simon McVittie
0c9f943277 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>
2018-12-11 12:47:22 +00:00
Simon McVittie
64f94d3f5b 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>
2018-12-11 12:47:22 +00:00
Simon McVittie
c3d15a9ead 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>
2018-12-11 12:47:22 +00:00
Simon McVittie
3cdabeb0ed Merge branch 'privserver-leak' into 'master'
test-privserver: Don't leak the DBusServer

See merge request dbus/dbus!68
2018-12-11 12:38:59 +00:00
Simon McVittie
26d5d97d5b 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>
2018-12-11 12:23:06 +00:00
Simon McVittie
552ad905f4 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>
2018-12-11 12:21:49 +00:00
Ralf Habacker
d9de6ab213 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>
2018-12-11 10:41:07 +00:00
Ralf Habacker
a7d1e275e7 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>
2018-12-11 10:39:26 +00:00
Ralf Habacker
5a3dd741fb 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>
2018-12-11 10:39:02 +00:00
Simon McVittie
4dac09a0e4 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
2018-12-06 16:42:09 +00:00
Ralf Habacker
0f5f95ab6e 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.
2018-12-06 17:08:29 +01:00
Simon McVittie
4a9a003904 Merge branch 'fix-cmake-wine-support' into 'master'
Fix cmake wine support

See merge request dbus/dbus!60

Reviewed-by: smcv
2018-12-06 12:24:37 +00:00
Ralf Habacker
56171457fb 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.
2018-12-06 09:18:27 +01:00
Simon McVittie
533ec58c9a Merge branch 'fix-cmake-tests' into 'master'
Fix cmake tests

See merge request dbus/dbus!59

Reviewed-by: smcv
2018-12-05 16:06:05 +00:00
Simon McVittie
a688cee856 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-05 15:02:42 +00:00
Ralf Habacker
0c0e7361ae 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'
2018-12-05 15:58:48 +01:00
Ralf Habacker
ffcaede257 Drop cmake variable DBUS_WIN_FIXME 2018-12-05 15:58:48 +01:00
Ralf Habacker
02bb1c2cfa Avoid memory leaks on running check_shell_service_success_auto_start on Windows 2018-12-05 15:58:48 +01:00
Simon McVittie
78efbb6c0d CI: Install yelp-tools, for yelp-build, in recent distros
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-05 14:54:24 +00:00
Simon McVittie
52fcc82379 CI: Make adduser properly non-interactive
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-05 14:54:24 +00:00
Simon McVittie
cb6abc6391 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>
2018-12-05 14:54:24 +00:00
Ralf Habacker
6e16afd0c1 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
2018-12-05 14:32:53 +00:00
Simon McVittie
7db891482f 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
2018-12-05 15:30:47 +01:00
Ralf Habacker
7f5eee6dca Merge branch 'syslog-test-newlines' into 'master'
syslog test: Don't assert that we see plain LF newlines

Closes #243

See merge request dbus/dbus!62
2018-12-05 14:28:36 +00:00
Simon McVittie
815fc62178 syslog test: Don't assert that we see plain LF newlines
In at least some build configurations that target Windows, we see CRLF
newlines in the stderr of the subprocess. Leave the newlines unspecified
and let "*" match them.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: https://gitlab.freedesktop.org/dbus/dbus/issues/243
2018-12-05 15:27:43 +01:00
Simon McVittie
def9d2d051 Merge branch 'unprivileged-container' into 'master'
dbus-daemon test: Don't test fd limits if in an unprivileged container

See merge request dbus/dbus!58

Reviewed-by: pwithnall
2018-12-05 14:09:19 +00:00
Simon McVittie
a59eb6e944 Merge branch 'unpythonize' into 'master'
Translate Python-based tests to C

See merge request dbus/dbus!37

Reviewed-by: pwithnall
2018-12-05 14:09:00 +00:00
Simon McVittie
9d721e57ed Merge branch 'hash-assertion' into 'master'
DBusHash: Recalculate bucket used if the table is rebuilt

See merge request dbus/dbus!44
2018-12-05 14:07:55 +00:00
Ralf Habacker
83bdfea8a9 Fix test-shutdown bail out on Windows
test-shutdown expects a GUID in the bus address by default,
which is not available under Windows, because on this platform
an autolaunch address is provided by dbus-run-session and is
not returned by dbus-daemon.

Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/59
Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-12-05 10:55:28 +00:00
Simon McVittie
c1e39d414f Start working on dbus 1.13.10
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-04 17:25:20 +00:00
Simon McVittie
ca1eafbb7f 1.13.8
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-04 12:27:32 +00:00
Simon McVittie
c890c0ed5d NEWS: Note new weak dependency on xsltproc for CMake
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-04 12:26:03 +00:00
Simon McVittie
3d380a3e93 dbus-daemon test: Don't test fd limits if in an unprivileged container
In an unprivileged container, uid 0 doesn't have CAP_SYS_RESOURCE, so
we can't expect the dbus-daemon to be able to escalate its fd limit.

This can be reproduced using bubblewrap:

    sudo bwrap \
        --cap-drop CAP_SYS_RESOURCE \
        --ro-bind / / \
        --dev /dev \
    env \
        DBUS_TEST_DAEMON=.../bus/dbus-daemon \
        DBUS_TEST_DATA=.../test/data \
    .../test/test-dbus-daemon \
        -p /fd-limit \
        --verbose

Bug-Debian: https://bugs.debian.org/908092
2018-12-04 12:18:19 +00:00
Simon McVittie
bcc34caa43 CI: Exercise maintainer-only documentation build
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-04 11:48:53 +00:00
Simon McVittie
e0a1bfb26a CI: Remove unimplemented --with-glib option
dbus has never actually had this option.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-04 11:41:23 +00:00
Simon McVittie
d71049799a CI: List attributes, sizes etc. of installed files, not just names
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-04 11:41:23 +00:00
Simon McVittie
f134e2d2c7 doc: Remove obsolete message about man2html
We no longer run man2html.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-04 11:41:23 +00:00
Simon McVittie
21db07e18d doc: Don't include ChangeLog in dbus-docs.tar.xz
Signed-off-by: Simon McVittie <smcv@collabora.com>
Fixes: e93b421137
2018-12-04 11:18:39 +00:00