Bug 41250 - some tests in test/name-test/ fail under cmake `make test`
Summary: some tests in test/name-test/ fail under cmake `make test`
Status: RESOLVED MOVED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.5
Hardware: All All
: medium normal
Assignee: D-Bus Maintainers
QA Contact: D-Bus Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-27 03:43 UTC by Simon McVittie
Modified: 2018-10-12 21:12 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
cmake part for more customizable session.conf.in (1.79 KB, patch)
2011-10-31 07:57 UTC, Ralf Habacker
Details | Splinter Review

Description Simon McVittie 2011-09-27 03:43:57 UTC
While testing Bug #41222 I found that several tests in test/name-test/ failed under cmake. However, this wasn't a regression: they'd fail in dbus-1.4 too.

The reason is that those tests expect to be run under a dbus-daemon that has test/data/valid-service-files/ in its search path. The Automake build system achieves this by running them via run-test.sh and run-test-systemserver.sh, which in turn use run-with-tmp-session-bus.sh. That's needlessly complicated, but sort of works in an Automake environment, where you can guarantee to have a POSIX shell.

For these tests to work without a POSIX shell, I think the best solution is to have them implement an equivalent of tools/run-with-tmp-session-bus.sh internally, using a config file passed in via the environment (TESTS_ENVIRONMENT for the entire Makefile.am in Automake; the ENVIRONMENT property on each test in CMake). The "modular tests" tests that I've been adding recently use GLib to do that; we could either extend the optional GLib dependency so it's required for *all* tests, or use dbus-spawn to get similar functionality.

On Unix, this would be an ideal place to combine Bug #35230 with a "dbus-daemon --inetd" sort of thing, but I don't think having a child process inherit a socket from its parent is portable to Windows, sadly...
Comment 1 Ralf Habacker 2011-10-31 07:56:57 UTC
(In reply to comment #0)

> For these tests to work without a POSIX shell, I think the best solution is to
> have them implement an equivalent of tools/run-with-tmp-session-bus.sh
> internally, using a config file 

The config generating from the already processed template looks very complicated. 

Why not adding an additional build system var named @DBUS_SESSION_SERVICE_DIRS@ into session.conf.in and set the value in the build system part genering the session bus config files. 

The test related config file generating could be placed into tests/Makefile.am and cmake/tests/CMakeLists.
Comment 2 Ralf Habacker 2011-10-31 07:57:59 UTC
Created attachment 52955 [details] [review]
cmake part for more customizable session.conf.in
Comment 3 GitLab Migration User 2018-10-12 21:12:47 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/dbus/dbus/issues/57.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.