summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2020-04-16Merge dbus-1.12.16 into tizenAdrian Szyndela73-1413/+5963
dbus 1.12.16
2019-06-09test: Add basic test coverage for DBUS_COOKIE_SHA1Simon McVittie3-0/+25
We don't actually complete successful authentication, because that would require us to generate a cookie and compute the correct SHA1, which is difficult to do in a deterministic authentication script. However, we do assert that dbus#269 (CVE-2019-12749) has been fixed. Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-04-18build: Don't assume we can set permissions on a directorySimon McVittie1-1/+4
MSYS2 has enough of a Unixish environment to run Autotools, but apparently not enough of a Unixish environment to have functional permissions. Closes: dbus#216 (cherry picked from commit 14f46d14a0526f137f81a3fff5d32f26733323cd)
2019-04-17Adapt to API change in AX_CODE_COVERAGE version 28Simon McVittie1-2/+2
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> (cherry picked from commit 2938c2125ebcd001e470aeac1ffac45b6b1ebe89) Closes: dbus#265
2019-01-17Fix missing dbus_message_unref() in error reply pathShin-ichi MORITA2-1/+120
The error message was leaked when blocking on a pending call after the connection was disconnected. Change-Id: Icc95bcef32b2fd1d2b4d4a7db3bdf2936579c52c Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: re-word commit message] Reviewed-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101481
2018-11-16dbus-daemon test: Allow much longer for pending fd timeoutSimon McVittie1-3/+7
The timeout we're using here is 0.5s (500ms), but the actual time taken is unbounded, because the OS scheduler might not schedule our process for an arbitrary length of time after we become runnable. We previously allowed up to 1 second, but in the CI jobs for dbus!9 and dbus!18 we've seen this take up to 3.4 seconds (presumably because other tests, or other jobs running on the same shared infrastructure, starved this process). Allow up to 10 seconds to guard against spurious failures. The timeout used in the production system.conf is 150 seconds (2½ minutes), and we're only using the shorter 500ms timeout here to make the test complete more quickly, so ±10 seconds is relatively insignificant: the main thing is that it's finite. Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 20e6eb7cd1f9c2ad941bd62c8f1f71712377a96e)
2018-11-15Do not auto-activate services if we could not send a messagesubmit/tizen/20181115.015729accepted/tizen/unified/20181115.151616Simon McVittie1-35/+3
We specifically do not check recipient policies, because the recipient policy is based on properties of the recipient process (in particular, its uid), which we do not necessarily know until we have already started it. In this initial implementation we do not check LSMs either, because we cannot know what LSM context the recipient process is going to have. However, LSM support will need to be added to make this feature useful, because StartServiceByName is normally allowed in non-LSM environments, and is more powerful than auto-activation anyway. The StartServiceByName method does not go through this check, because if access to that method has been granted, then it's somewhat obvious that you can start arbitrary services. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98666 Change-Id: I53ff4f6d02e631fcd09bf1c5c306b8828f075963
2018-11-15Add tests for activation when message send/receive is deniedSimon McVittie5-2/+207
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98666 Change-Id: I7339c1a6de69a751cbe0b9047c980c4aea53750b
2018-06-04test: Skip TCP tests if getaddrinfo doesn't workSimon McVittie7-3/+165
For example, this can be the case in bubblewrap or Debian pbuilder after unsharing the network namespace: bwrap \ --bind / / \ --dev-bind /dev /dev \ --bind /dev/shm /dev/shm \ --bind /dev/pts /dev/pts \ --unshare-net \ ${builddir}/test/test-loopback --tap ... ok 1 /connect/tcp # SKIP Name resolution does not work here: getaddrinfo("127.0.0.1", "0", {flags=ADDRCONFIG, family=INET, socktype=STREAM, protocol=TCP}): Name or service not known On some systems this can be circumvented by using nss_wrapper from <https://cwrap.org/nss_wrapper.html>: cat > hosts <<EOF 127.0.0.1 localhost EOF bwrap \ ... \ env \ LD_PRELOAD=libnss_wrapper.so \ NSS_WRAPPER_HOSTS=$(pwd)/hosts \ ${builddir}/test/test-loopback --tap ... # listening at tcp:host=127.0.0.1,port=39219,family=ipv4,guid=... but for systems where that does't work, we should be prepared to skip the affected tests. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106812 (cherry picked from commit f1faafd59bec67d347edb10447c4b9b18193458c)
2018-06-04server-oom test: Don't assume localhost is resolvableSimon McVittie1-4/+4
Pathological autobuilder environments might not list localhost in /etc/hosts. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106812 (cherry picked from commit 4cfc7de30de7111f589501e5b597063aeb96cf28)
2018-06-04test: Test the same things with unix: that we do with tcp:Simon McVittie5-7/+32
Minimal autobuilder environments don't always have working TCP, so we may need to skip TCP tests. Make sure we test the equivalent code paths via Unix sockets in those environments. One notable exception is test/fdpass.c, which uses TCP as a transport that is known not to be able to carry Unix fds; this needs to continue to use TCP. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106812 (cherry picked from commit cb7dd5bfccb2882d0e9951c41040ff6a97bb827d)
2018-06-04server-oom test: Parse the address instead of going directly to TCPSimon McVittie1-23/+7
This expands test coverage, and lets us reuse the test for other address schemes. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106812 (cherry picked from commit b19c9e2f265878801bc48866a7cc3152ca2ad45e)
2018-02-20Add a unit test for the dbus-daemon resetting its fd limitSimon McVittie3-12/+132
Reviewed-by: David King <dking@redhat.com> [smcv: Fix typo in cmake macro name] Signed-off-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105165 (cherry picked from commit 49ca421997d91d3e01626b2c92a826e6a5db0b2f)
2018-02-07Add new test for waiting on pending calls in threadsSimon McVittie2-0/+306
Based on code contributed by Manish Narang. This is not included in the automated test suite, because it isn't reliable on heavily-loaded automatic test infrastructure like Travis-CI. Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: Add the test to the CMake build system too, as requested] [smcv: Convert into a manual test] Signed-off-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102839 (cherry picked from commit 0b1e2928606e0cf138c38e75eb248d2ed19bff15)
2018-02-07Add a simplified backport of g_steal_pointer()Simon McVittie1-0/+15
This will be used in tests later in the branch. Sadly we can't use GLIB_VERSION_2_44 unless we are willing to have a hard dependency on GLib 2.44, which would force us to do all our Travis-CI builds in Docker containers rather than in ye olde base system, and that adds 50% to the time taken to do builds. Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: Rebase onto 1.13.x branch, fix minor conflicts] Signed-off-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354 (cherry picked from commit d5742550ca566317eaddea0ff7db04098f9f044f)
2018-02-06tests: Add the ability to multiply up test timeoutsSimon McVittie5-11/+12
Tests that brute-force OOM code paths can be rather slow. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100317 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 5c91d85f3ed462dac1e011aab216c9021e826773)
2018-02-06test_connect_to_bus: Allow skipping the use of a DBusLoopSimon McVittie1-1/+3
DBusLoop isn't thread-safe, so we can't use it to test multi-threaded situations. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102839 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> (cherry picked from commit f127c8e110faed76039f96dbc53a87f093fea312) [smcv: Adjust for older codebase]
2017-11-24Add a targeted test for OOM during _dbus_server_new_for_tcp_socket()Simon McVittie2-0/+152
This also covers _dbus_server_new_for_socket(), which is one of the worse places in terms of complexity of the error-unwinding path (3 labels). Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89104 (cherry picked from commit ac6c4d384d83c2e39a4f4156ef11cadcfbfa44f6)
2017-10-31build: Use $(MKDIR_P) syntax suitable for install-shilovezfs1-1/+1
This fixes the build when a GNU-compatible `mkdir -p` is not available. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103521 [smcv: Add commit message] Reviewed-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit c7d8b723eb53848f9a86f36d640ea5f564d34590)
2017-10-23build: Remove various unused files from build systemSimon McVittie3-1097/+0
These were in git but not distributed in source tarballs, and in fact not hooked up to the Autotools build system at all. test/data/valid-introspection-files was mentioned in the CMake build system (copied from the source directory to the build directory), but according to `git grep` is not used for anything. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103420
2017-10-23build: Distribute more test data in source tarballsSimon McVittie1-0/+2
test-bus exercises the parser by trying to parse every file in these directories. A couple of files were accidentally left out, meaning those parsing code paths are tested when we build from git, but not when we build from a tarball release. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103420
2017-09-27tests: In slower tests, make the timeout per-test-caseSimon McVittie5-5/+46
Some test-cases in the dbus-daemon and relay tests spam the bus with thousands of messages, which can take 25 seconds on slower CPUs like MIPS. Similarly, the refs test spams millions of refcount operations, which it appears might take more than a minute on PA-RISC (HPPA). To get an idea of how close we are to having a problem on other architectures, log a message and start a timer when we reset the timeout in setup(), and log the elapsed time when we reach teardown(). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103009 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com>
2017-09-27test-utils-glib: Try to emit TAP diagnostics before abortingSimon McVittie1-2/+14
We can't use normal I/O in a signal handler, so resort to write(). "Bail out!" is a special syntactic token in TAP. If I artifically force the tests to time out by reducing timeouts and increasing the number of operations, I get results like this: ERROR: test-sd-activation - Bail out! Test timed out (GLib main loop timeout callback reached) ERROR: test-refs - Bail out! Test timed out (SIGALRM received) which is a lot easier to understand than "Not enough tests run" or "nonzero exit status". The differing output is because test-sd-activation iterates the main loop, whereas test-refs just blocks (it is joining a series of worker threads, each of which is spamming refcount operations). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103009 Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: Use STDOUT_FILENO as per Philip's review] Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-09-25test/data: Test impossible send_broadcast/send_destination pairSimon McVittie2-0/+7
Signed-off-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/92853 Reviewed-by: Philip Withnall <withnall@endlessm.com>
2017-07-30tests: Use dbus_clear_connection etc. in a couple of testsSimon McVittie2-117/+82
This is just enough to demonstrate that they work - I'm deliberately not doing a mass change throughout all tests, and we should definitely not rush to introduce these into production code, because it would hinder cherry-picking and merging fixes between branches. However, new code on master can use them freely. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101895
2017-07-28userdb: Respect $HOME for the home directory of our own uidSimon McVittie1-0/+2
This lets cooperating processes with the same value of $HOME interoperate for DBUS_COOKIE_SHA1 by reading and writing $HOME, even if their $HOME differs from the uid's "official" home directory according to getpwuid(). Out of paranoia, we only do this if the uid and the euid are equal, since if they were unequal the correct thing to do would be ambiguous. In particular, Debian autobuilders run as a user whose "official" home directory in /etc/passwd is "/nonexistent", as a mechanism to detect non-deterministic build processes that rely on the contents of the home directory. Until now, this meant we couldn't run dbus' build-time tests, because every test that used DBUS_COOKIE_SHA1 would fail in this environment. In the tests, set HOME as well as DBUS_TEST_HOMEDIR. We keep DBUS_TEST_HOMEDIR too, because Windows doesn't use HOME, only HOMEDRIVE and HOMEPATH. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101960 Bug-Debian: https://bugs.debian.org/630152 Signed-off-by: Simon McVittie <smcv@debian.org> Reviewed-by: Philip Withnall <withnall@endlessm.com>
2017-07-28test: Exercise min_fds, max_fdsSimon McVittie3-0/+171
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-07-28Add a regression test for applying bus policy to broadcasts/unicastsSimon McVittie2-5/+203
This test-case is actually in the test for monitoring the bus, because it's easier to see what's going on there - the error reply to a rejected broadcast is not visible unless you are monitoring. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Reviewed-by: Thiago Macieira <thiago@kde.org> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92853
2017-07-28Add a test-case for combining receive_type and send_destinationSimon McVittie2-0/+7
Until the previous commit, this would have worked. Now it correctly fails with "send and receive attributes cannot be combined". Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Thiago Macieira <thiago@kde.org> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92853
2017-07-07Merge branch 'dbus-1.10'Simon McVittie2-7/+7
2017-07-07test/name-test: Be compatible with Python 3Simon McVittie2-7/+7
configure.ac will detect PYTHON=python3 if there is no python executable in the PATH. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101716 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-07-07Merge branch 'dbus-1.10'Simon McVittie3-0/+4
2017-07-07tests: Make tests fail if they try to connect to the real session busSimon McVittie2-1/+3
It is too easy for a developer working in an environment that has a session bus to write tests that pass locally, but fail in minimal environments. This is also risky because the tests might do destructive things on the developer's real session bus. We can avoid connecting to the session bus by consistently removing its address from the environment, and replacing it with something that will always fail. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101698
2017-07-07test/dbus-daemon: Unset DBUS_SESSION_BUS_ADDRESSSimon McVittie1-0/+1
When we intend to exercise the default behaviour in the absence of DBUS_SESSION_BUS_ADDRESS (but with an XDG_RUNTIME_DIR present), it would help if we unset DBUS_SESSION_BUS_ADDRESS. Otherwise we'll just connect to the real session bus, if there is one. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101698
2017-07-06name-test: Backport dbus-run-session wrapper from git masterSimon McVittie1-1/+21
test-pending-call-disconnected relies on being run under a session bus. On master, the TESTS in this directory all get that treatment, but in dbus-1.10 they do not. This caused test-pending-call-disconnected to fail in minimal environments like travis-ci where there is no developer-initiated session bus. Backport part of commit ec6b220 "name-test: run most C tests directly, not via run-test.sh" to wrap it in dbus-run-session. This is better than putting it in run-test.sh because this way, its TAP output is parsed directly by Automake. It also has the side benefit of exercising dbus-run-session in the automated tests. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101698
2017-07-05test-variant: Add a regression test for DBusVariantSimon McVittie2-0/+576
Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101568
2017-07-05Test dbus_message_iter_abandon_container_if_open under OOM conditionsSimon McVittie1-0/+75
Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101568
2017-07-05test/message: Add a targeted test for recently-fixed leaksSimon McVittie2-0/+246
Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101568
2017-07-05internals: Decouple logging an error from exiting unsuccessfullySimon McVittie1-21/+2
This lets _dbus_warn() and _dbus_warn_check_failed() fall through to flushing stderr and calling _dbus_abort(), meaning that failed checks and warnings can result in a core dump as intended. By renaming the FATAL severity to ERROR, we ensure that any code contributions that assumed the old semantics will fail to compile. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101568
2017-06-29test/loopback: Exercise unix:dir addressesSimon McVittie1-2/+15
Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101567
2017-06-29test/loopback: Assert that the connectable address makes senseSimon McVittie1-1/+74
When we listen on a tcp: address we should get a connectable tcp: address, and so on. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101567
2017-06-29test/loopback: Don't leak address stringsSimon McVittie1-4/+8
dbus_server_get_address() returns a copy. It isn't clear why. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101567
2017-06-27Fix missing dbus_message_unref() in error reply pathShin-ichi MORITA2-1/+120
The error message was leaked when blocking on a pending call after the connection was disconnected. Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: re-word commit message] Reviewed-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101481
2017-06-27Fix missing dbus_message_unref() in error reply pathShin-ichi MORITA2-1/+120
The error message was leaked when blocking on a pending call after the connection was disconnected. Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: re-word commit message] Reviewed-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101481
2017-06-27test-pending-call-dispatch: Add copyright and license grantSimon McVittie1-0/+23
According to git history, this test was written in 2006 by Red Hat employee John Palmieri and has received only trivial changes since then. Red Hat gave permission in 2007 for their contributions to be relicensed under the MIT/X11 license. We cannot take advantage of that permission to relicense the core library or the dbus-daemon from GPL-2+|AFL-2.0 to MIT/X11, because one early copyright holder (CodeFactory AB) could not be traced, but we might as well use a permissive license for simple test code that has not had CodeFactory AB contributions. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101481
2017-06-12test/internals/syslog: Switch to g_test_trap_subprocess()Simon McVittie1-20/+14
This re-executes the same binary with special command-line options instead of forking. As a result, it can work on Windows, and is less dependent on Unix libraries continuing to work across a fork(). (This has been confirmed to work in Windows binaries running under Wine.) Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101362
2017-06-12Bump GLib dependency for tests to 2.40Simon McVittie2-13/+0
This is quite old (it's the version in Ubuntu 14.04 LTS, and older than the version in Debian 8) but gives us g_test_skip(), g_test_trap_subprocess() and GVariantDict, all of which will be useful in the regression tests. Remove workarounds for old versions. After this commit we are still using the deprecated g_test_trap_fork(), which will be removed in a subsequent commit. Don't opt-in to the new deprecation warnings from 2.38 and 2.40 yet, because under our recommended settings for dbus developers (-Werror) they would break the build. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101362
2017-06-08test-autolaunch: Make recently-added message similar to the othersSimon McVittie1-1/+1
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-06-08Add dbus_try_get_local_machine_id()Simon McVittie1-17/+7
Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=13194
2017-06-08tests: Don't exercise GetMachineId() or autolaunch if no machine IDSimon McVittie4-0/+34
At the moment there is a hack in the implementation of GetMachineId() to stop tests from failing during "make check" on a system where dbus has never been installed, by silently generating a new unique fake "machine ID" for each process. I'm about to change that behaviour to report errors properly; skip affected test-cases if we can't read the real machine ID. The shell scripts to test dbus-launch are run both as "make check" tests (for which it is valid for dbus to be not correctly installed) and as installed-tests (for which that is not valid), so make them pass during "make check" but fail during installed testing. The tests in bus/ and test/name-test/ are only run during "make check" so they only have the code path where they are skipped. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=13194