Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
dbus
dbus
Commits
8dab7546
Commit
8dab7546
authored
Jul 25, 2016
by
Simon McVittie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dbus-1.10-ci' into dbus-1.10
parents
2a5dccf0
b5bef9dc
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
322 additions
and
20 deletions
+322
-20
.travis.yml
.travis.yml
+50
-0
bus/activation.c
bus/activation.c
+31
-12
bus/selinux.c
bus/selinux.c
+2
-0
bus/test-launch-helper.c
bus/test-launch-helper.c
+1
-1
bus/test-main.c
bus/test-main.c
+1
-1
bus/test-system.c
bus/test-system.c
+1
-1
cmake/i686-w64-mingw32.cmake
cmake/i686-w64-mingw32.cmake
+20
-0
cmake/modules/Macros.cmake
cmake/modules/Macros.cmake
+2
-2
cmake/test/CMakeLists.txt
cmake/test/CMakeLists.txt
+2
-1
dbus/dbus-internals.c
dbus/dbus-internals.c
+6
-0
dbus/dbus-test-main.c
dbus/dbus-test-main.c
+1
-1
test/Makefile.am
test/Makefile.am
+1
-1
tools/ci-build.sh
tools/ci-build.sh
+204
-0
No files found.
.travis.yml
0 → 100644
View file @
8dab7546
sudo
:
required
dist
:
trusty
language
:
c
install
:
# travis-ci has a sources list for Chrome which doesn't support i386
-
"
:
|
sudo
tee
/etc/apt/sources.list.d/google-chrome.list"
-
test "$dbus_ci_host" != mingw || sudo dpkg --add-architecture i386
-
sudo apt-get -qq -y update
-
sudo apt-get -qq -y build-dep dbus
-
>
sudo apt-get -qq -y install
automake
autotools-dev
debhelper
dh-autoreconf
doxygen
dpkg-dev
gnome-desktop-testing
libapparmor-dev
libaudit-dev
libcap-ng-dev
libexpat-dev
libglib2.0-dev
libselinux1-dev
libx11-dev
python
python-dbus
python-gi
valgrind
xmlto
xsltproc
-
>
test "$dbus_ci_host" != mingw || sudo apt-get -qq -y install
binutils-mingw-w64-i686 g++-mingw-w64-i686 wine:i386
script
:
# python-dbus and python-gi aren't available to Travis's version of
# Python in /opt, which it uses as a default
-
PYTHON=/usr/bin/python dbus_ci_parallel=2 dbus_ci_sudo=yes ./tools/ci-build.sh
env
:
-
dbus_ci_variant=release
-
dbus_ci_variant=debug
-
dbus_ci_variant=reduced
-
dbus_ci_variant=legacy
-
dbus_ci_buildsys=cmake
-
dbus_ci_host=mingw
-
dbus_ci_host=mingw dbus_ci_variant=debug
-
dbus_ci_host=mingw dbus_ci_buildsys=cmake
# vim:set sw=2 sts=2 et:
bus/activation.c
View file @
8dab7546
...
...
@@ -1418,7 +1418,8 @@ pending_activation_finished_cb (DBusBabysitter *babysitter,
{
BusPendingActivation
*
p
=
_dbus_hash_iter_get_value
(
&
iter
);
if
(
p
!=
pending_activation
&&
strcmp
(
p
->
exec
,
pending_activation
->
exec
)
==
0
)
if
(
p
!=
pending_activation
&&
p
->
exec
!=
NULL
&&
strcmp
(
p
->
exec
,
pending_activation
->
exec
)
==
0
)
pending_activation_failed
(
p
,
&
error
);
}
...
...
@@ -1744,9 +1745,19 @@ bus_activation_activate_service (BusActivation *activation,
return
FALSE
;
}
entry
=
activation_find_entry
(
activation
,
service_name
,
error
);
if
(
!
entry
)
return
FALSE
;
if
(
bus_context_get_systemd_activation
(
activation
->
context
)
&&
strcmp
(
service_name
,
"org.freedesktop.systemd1"
)
==
0
)
{
/* if we're doing systemd activation, we assume systemd will connect
* eventually, and it does not need a .service file */
entry
=
NULL
;
}
else
{
entry
=
activation_find_entry
(
activation
,
service_name
,
error
);
if
(
!
entry
)
return
FALSE
;
}
/* Bypass the registry lookup if we're auto-activating, bus_dispatch would not
* call us if the service is already active.
...
...
@@ -1853,17 +1864,20 @@ bus_activation_activate_service (BusActivation *activation,
return
FALSE
;
}
pending_activation
->
exec
=
_dbus_strdup
(
entry
->
exec
);
if
(
!
pending_activation
->
exec
)
if
(
entry
!=
NULL
)
{
_dbus_verbose
(
"Failed to copy service exec for pending activation
\n
"
);
BUS_SET_OOM
(
error
);
bus_pending_activation_unref
(
pending_activation
);
bus_pending_activation_entry_free
(
pending_activation_entry
);
return
FALSE
;
pending_activation
->
exec
=
_dbus_strdup
(
entry
->
exec
);
if
(
!
pending_activation
->
exec
)
{
_dbus_verbose
(
"Failed to copy service exec for pending activation
\n
"
);
BUS_SET_OOM
(
error
);
bus_pending_activation_unref
(
pending_activation
);
bus_pending_activation_entry_free
(
pending_activation_entry
);
return
FALSE
;
}
}
if
(
entry
->
systemd_service
)
if
(
entry
!=
NULL
&&
entry
->
systemd_service
!=
NULL
)
{
pending_activation
->
systemd_service
=
_dbus_strdup
(
entry
->
systemd_service
);
if
(
!
pending_activation
->
systemd_service
)
...
...
@@ -2055,6 +2069,11 @@ bus_activation_activate_service (BusActivation *activation,
proceed with traditional activation. */
}
/* If entry was NULL, it would be because we were doing systemd activation
* and activating systemd itself; but we already handled that case with
* an early-return */
_dbus_assert
(
entry
!=
NULL
);
/* use command as system and session different */
if
(
!
_dbus_string_init
(
&
command
))
{
...
...
bus/selinux.c
View file @
8dab7546
...
...
@@ -146,7 +146,9 @@ log_callback (const char *fmt, ...)
vsyslog
(
LOG_USER
|
LOG_INFO
,
fmt
,
ap
);
#ifdef HAVE_LIBAUDIT
out:
#endif
va_end
(
ap
);
}
...
...
bus/test-launch-helper.c
View file @
8dab7546
...
...
@@ -102,7 +102,7 @@ main (int argc, char **argv)
const
char
*
dir
;
DBusString
config_file
;
if
(
argc
>
1
)
if
(
argc
>
1
&&
strcmp
(
argv
[
1
],
"--tap"
)
!=
0
)
dir
=
argv
[
1
];
else
dir
=
_dbus_getenv
(
"DBUS_TEST_DATA"
);
...
...
bus/test-main.c
View file @
8dab7546
...
...
@@ -95,7 +95,7 @@ main (int argc, char **argv)
progname
=
argv
[
0
];
if
(
argc
>
1
)
if
(
argc
>
1
&&
strcmp
(
argv
[
1
],
"--tap"
)
!=
0
)
dir
=
argv
[
1
];
else
dir
=
_dbus_getenv
(
"DBUS_TEST_DATA"
);
...
...
bus/test-system.c
View file @
8dab7546
...
...
@@ -73,7 +73,7 @@ main (int argc, char **argv)
progname
=
argv
[
0
];
if
(
argc
>
1
)
if
(
argc
>
1
&&
strcmp
(
argv
[
1
],
"--tap"
)
!=
0
)
dir
=
argv
[
1
];
else
dir
=
_dbus_getenv
(
"DBUS_TEST_DATA"
);
...
...
cmake/i686-w64-mingw32.cmake
0 → 100644
View file @
8dab7546
# Toolchain for mingw-w64 32-bit compilers, as shipped in Debian/Ubuntu.
set
(
GNU_HOST i686-w64-mingw32
)
set
(
CMAKE_SYSTEM_PROCESSOR
"i686"
)
set
(
COMPILER_PREFIX
"
${
GNU_HOST
}
-"
)
set
(
CMAKE_SYSTEM_NAME
"Windows"
)
set
(
CMAKE_CROSSCOMPILING TRUE
)
set
(
WIN32 TRUE
)
set
(
MINGW TRUE
)
include
(
CMakeForceCompiler
)
cmake_force_c_compiler
(
${
COMPILER_PREFIX
}
gcc GNU
)
cmake_force_cxx_compiler
(
${
COMPILER_PREFIX
}
g++ GNU
)
set
(
CMAKE_RC_COMPILER
${
COMPILER_PREFIX
}
windres
)
set
(
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER
)
set
(
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY
)
set
(
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY
)
cmake/modules/Macros.cmake
View file @
8dab7546
...
...
@@ -43,11 +43,11 @@ macro(add_test_executable _target _source)
# run tests with binfmt_misc
set
(
PREFIX
"z:"
)
set
(
_env
"DBUS_TEST_DAEMON=
${
PREFIX
}${
CMAKE_BINARY_DIR
}
/bin/dbus-daemon
${
EXEEXT
}
"
)
add_test
(
NAME
${
_target
}
COMMAND $<TARGET_FILE:
${
_target
}
>
)
add_test
(
NAME
${
_target
}
COMMAND $<TARGET_FILE:
${
_target
}
>
--tap
)
else
()
set
(
PREFIX
)
set
(
_env
"DBUS_TEST_DAEMON=
${
CMAKE_BINARY_DIR
}
/bin/dbus-daemon
${
EXEEXT
}
"
)
add_test
(
NAME
${
_target
}
COMMAND $<TARGET_FILE:
${
_target
}
>
)
add_test
(
NAME
${
_target
}
COMMAND $<TARGET_FILE:
${
_target
}
>
--tap
)
endif
()
list
(
APPEND _env
"DBUS_SESSION_BUS_ADDRESS="
)
list
(
APPEND _env
"DBUS_FATAL_WARNINGS=1"
)
...
...
cmake/test/CMakeLists.txt
View file @
8dab7546
...
...
@@ -72,7 +72,7 @@ add_helper_executable(test-spawn ${test-spawn_SOURCES} ${DBUS_INTERNAL_LIBRARIES
add_helper_executable
(
test-exit
${
test-exit_SOURCES
}
${
DBUS_INTERNAL_LIBRARIES
}
)
add_helper_executable
(
test-segfault
${
test-segfault_SOURCES
}
${
DBUS_INTERNAL_LIBRARIES
}
)
add_helper_executable
(
test-sleep-forever
${
test-sleep-forever_SOURCES
}
${
DBUS_INTERNAL_LIBRARIES
}
)
add_
test
_executable
(
manual-tcp
${
manual-tcp_SOURCES
}
${
DBUS_INTERNAL_LIBRARIES
}
)
add_
helper
_executable
(
manual-tcp
${
manual-tcp_SOURCES
}
${
DBUS_INTERNAL_LIBRARIES
}
)
if
(
WIN32
)
add_helper_executable
(
manual-paths
${
manual-paths_SOURCES
}
${
DBUS_INTERNAL_LIBRARIES
}
)
endif
()
...
...
@@ -119,6 +119,7 @@ set (TESTDIRS
test/data/incomplete-messages
test/data/auth
test/data/sha-1
test/data/systemd-activation
test/data/valid-config-files
test/data/valid-config-files/basic.d
test/data/valid-config-files/session.d
...
...
dbus/dbus-internals.c
View file @
8dab7546
...
...
@@ -1066,6 +1066,12 @@ _dbus_test_oom_handling (const char *description,
max_failures_to_try
=
4
;
}
if
(
max_failures_to_try
<
1
)
{
_dbus_verbose
(
"not testing OOM handling
\n
"
);
return
TRUE
;
}
i
=
setting
?
max_failures_to_try
-
1
:
1
;
while
(
i
<
max_failures_to_try
)
{
...
...
dbus/dbus-test-main.c
View file @
8dab7546
...
...
@@ -51,7 +51,7 @@ main (int argc,
setlocale
(
LC_ALL
,
""
);
#endif
if
(
argc
>
1
)
if
(
argc
>
1
&&
strcmp
(
argv
[
1
],
"--tap"
)
!=
0
)
test_data_dir
=
argv
[
1
];
else
test_data_dir
=
NULL
;
...
...
test/Makefile.am
View file @
8dab7546
...
...
@@ -294,7 +294,7 @@ if DBUS_ENABLE_INSTALLED_TESTS
$(installcheck_environment)
\
$(srcdir)/dbus-test-runner
\
$(testexecdir)
\
$(
testexec_PROGRAMS)
}
$(
installable_tests);
}
endif
DBUS_ENABLE_INSTALLED_TESTS
in_data
=
\
...
...
tools/ci-build.sh
0 → 100755
View file @
8dab7546
#!/bin/sh
set
-e
set
-x
if
[
-z
"
$dbus_ci_variant
"
]
;
then
dbus_ci_variant
=
release
fi
if
[
-z
"
$dbus_ci_host
"
]
;
then
dbus_ci_host
=
native
fi
if
[
-z
"
$dbus_ci_buildsys
"
]
;
then
dbus_ci_buildsys
=
autotools
fi
if
[
-z
"
$dbus_ci_parallel
"
]
;
then
dbus_ci_parallel
=
1
fi
dbus_test
=
yes
dbus_test_fatal
=
yes
NOCONFIGURE
=
1 ./autogen.sh
srcdir
=
"
$(
pwd
)
"
mkdir
ci-build-
${
dbus_ci_variant
}
-
${
dbus_ci_host
}
cd
ci-build-
${
dbus_ci_variant
}
-
${
dbus_ci_host
}
make
=
"make -j
${
dbus_ci_parallel
}
V=1 VERBOSE=1"
case
"
$dbus_ci_host
"
in
(
mingw
)
mirror
=
http://sourceforge.net/projects/msys2/files/REPOS/MINGW/i686/
mingw
=
"
$(
pwd
)
/mingw32"
install
-d
"
${
mingw
}
"
export
PKG_CONFIG_LIBDIR
=
"
${
mingw
}
/lib/pkgconfig"
export
PKG_CONFIG_PATH
=
export
PKG_CONFIG
=
"pkg-config --define-variable=prefix=
${
mingw
}
"
unset
CC
unset
CXX
for
pkg
in
\
expat-2.1.0-6
\
gcc-libs-5.2.0-4
\
gettext-0.19.6-1
\
glib2-2.46.1-1
\
libffi-3.2.1-3
\
zlib-1.2.8-9
\
;
do
wget
${
mirror
}
/mingw-w64-i686-
${
pkg
}
-any
.pkg.tar.xz
tar
-xvf
mingw-w64-i686-
${
pkg
}
-any
.pkg.tar.xz
done
export
TMPDIR
=
/tmp
;;
esac
case
"
$dbus_ci_buildsys
"
in
(
autotools
)
case
"
$dbus_ci_variant
"
in
(
debug
)
# Full developer/debug build.
set
_
"
$@
"
set
"
$@
"
--enable-developer
--enable-tests
shift
# The test coverage for OOM-safety is too
# verbose to be useful on travis-ci.
export
DBUS_TEST_MALLOC_FAILURES
=
0
;;
(
reduced
)
# A smaller configuration than normal, with
# various features disabled; this emulates
# an older system or one that does not have
# all the optional libraries.
set
_
"
$@
"
# No LSMs (the release build has both)
set
"
$@
"
--disable-selinux
--disable-apparmor
# No inotify (we will use dnotify)
set
"
$@
"
--disable-inotify
# No epoll or kqueue (we will use poll)
set
"
$@
"
--disable-epoll
--disable-kqueue
# No special init system support
set
"
$@
"
--disable-launchd
--disable-systemd
# No libaudit or valgrind
set
"
$@
"
--disable-libaudit
--without-valgrind
shift
;;
(
legacy
)
# An unrealistically cut-down configuration,
# to check that it compiles and works.
set
_
"
$@
"
# Disable native atomic operations on Unix
# (armv4, as used as the baseline for Debian
# armel, is one architecture that really
# doesn't have them)
set
"
$@
"
dbus_cv_sync_sub_and_fetch
=
no
# No epoll, kqueue or poll (we will fall back
# to select, even on Unix where we would
# usually at least have poll)
set
"
$@
"
--disable-epoll
--disable-kqueue
set
"
$@
"
CPPFLAGS
=
-DBROKEN_POLL
=
1
# Enable SELinux and AppArmor but not
# libaudit - that configuration has sometimes
# failed
set
"
$@
"
--enable-selinux
--enable-apparmor
set
"
$@
"
--disable-libaudit
--without-valgrind
# No directory monitoring at all
set
"
$@
"
--disable-inotify
--disable-dnotify
# No special init system support
set
"
$@
"
--disable-launchd
--disable-systemd
# No X11 autolaunching
set
"
$@
"
--disable-x11-autolaunch
shift
;;
(
*
)
;;
esac
case
"
$dbus_ci_host
"
in
(
mingw
)
set
_
"
$@
"
set
"
$@
"
--build
=
"
$(
config.guess
)
"
set
"
$@
"
--host
=
i686-w64-mingw32
set
"
$@
"
LDFLAGS
=
-L
"
${
mingw
}
/lib"
set
"
$@
"
CPPFLAGS
=
-I
"
${
mingw
}
/include"
set
"
$@
"
CFLAGS
=
-static-libgcc
set
"
$@
"
CXXFLAGS
=
-static-libgcc
# don't run tests yet, Wine needs Xvfb and
# more msys2 libraries
dbus_test
=
# don't "make install" system-wide
dbus_ci_sudo
=
shift
;;
esac
../configure
\
--enable-installed-tests
\
--enable-maintainer-mode
\
--enable-modular-tests
\
--with-glib
\
"
$@
"
${
make
}
[
-z
"
$dbus_test
"
]
||
${
make
}
check
||
[
-z
"
$dbus_test_fatal
"
]
cat test
/test-suite.log
||
:
[
-z
"
$dbus_test
"
]
||
${
make
}
distcheck
||
\
[
-z
"
$dbus_test_fatal
"
]
${
make
}
install
DESTDIR
=
$(
pwd
)
/DESTDIR
(
cd
DESTDIR
&&
find
.
)
if
[
-n
"
$dbus_ci_sudo
"
]
&&
[
-n
"
$dbus_test
"
]
;
then
sudo
${
make
}
install
LD_LIBRARY_PATH
=
/usr/local/lib
${
make
}
installcheck
||
\
[
-z
"
$dbus_test_fatal
"
]
cat test
/test-suite.log
||
:
# re-run them with gnome-desktop-testing
env
LD_LIBRARY_PATH
=
/usr/local/lib
\
gnome-desktop-testing-runner
-d
/usr/local/share dbus/
||
\
[
-z
"
$dbus_test_fatal
"
]
# these tests benefit from being re-run as root
sudo env
LD_LIBRARY_PATH
=
/usr/local/lib
\
gnome-desktop-testing-runner
-d
/usr/local/share
\
dbus/test-uid-permissions_with_config.test
||
\
[
-z
"
$dbus_test_fatal
"
]
fi
;;
(
cmake
)
case
"
$dbus_ci_host
"
in
(
mingw
)
set
_
"
$@
"
set
"
$@
"
-D
CMAKE_TOOLCHAIN_FILE
=
"
${
srcdir
}
/cmake/i686-w64-mingw32.cmake"
set
"
$@
"
-D
CMAKE_PREFIX_PATH
=
"
${
mingw
}
"
set
"
$@
"
-D
CMAKE_INCLUDE_PATH
=
"
${
mingw
}
/include"
set
"
$@
"
-D
CMAKE_LIBRARY_PATH
=
"
${
mingw
}
/lib"
set
"
$@
"
-D
EXPAT_LIBRARY
=
"
${
mingw
}
/lib/libexpat.dll.a"
set
"
$@
"
-D
GLIB2_LIBRARIES
=
"
${
mingw
}
/lib/libglib-2.0.dll.a"
set
"
$@
"
-D
GOBJECT_LIBRARIES
=
"
${
mingw
}
/lib/libgobject-2.0.dll.a"
set
"
$@
"
-D
GIO_LIBRARIES
=
"
${
mingw
}
/lib/libgio-2.0.dll.a"
shift
# don't run tests yet, Wine needs Xvfb and more
# msys2 libraries
dbus_test
=
;;
esac
cmake
"
$@
"
../cmake
${
make
}
# The test coverage for OOM-safety is too verbose to be useful on
# travis-ci.
export
DBUS_TEST_MALLOC_FAILURES
=
0
[
-z
"
$dbus_test
"
]
||
ctest
-VV
||
[
-z
"
$dbus_test_fatal
"
]
${
make
}
install
DESTDIR
=
$(
pwd
)
/DESTDIR
(
cd
DESTDIR
&&
find
.
)
;;
esac
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment