diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2014-05-30 10:33:43 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-06-03 15:49:01 +0200 |
commit | ba0d168d93ece03f4d446685cdb505b7ee038c35 (patch) | |
tree | c9246a05b09e788bbf6f1c91744426d60f1db713 | |
parent | 5b0f20d8cb31edc5d46afc915cb72bfcc4129218 (diff) | |
download | sssd-ba0d168d93ece03f4d446685cdb505b7ee038c35.tar.gz sssd-ba0d168d93ece03f4d446685cdb505b7ee038c35.tar.xz sssd-ba0d168d93ece03f4d446685cdb505b7ee038c35.zip |
BUILD: Disable dbus tests when running distcheck
https://fedorahosted.org/sssd/ticket/2291
The dbus tests that mock an sbus server were failing when make distcheck
was ran by a user logged in through the SSSD.
The reason was that the libtool wrapper around the test library alters
the LD_LIBRARY_PATH and as a consequence, the standard getpwuid_r() calls
the dbus server performs would load the in-tree NSS library and not the
system one. The-in tree library would then attempt to talk to an in-tree
NSS socket, fail, which would fail the getpwuid_r call with an error such as:
"""
Could not get password database information for UID of current process:
User "???" unknown or no memory to allocate password entry
"""
This patch adds a new configure-time option called --enable-dbus-tests
that is enabled by default and disabled during distcheck. When the
option is disabled, the tests that require a mocked dbus server are not
compiled at all.
(cherry picked from commit 4bd20c075f0f187db0181dc53d00ab6cd47fdb4d)
Conflicts:
Makefile.am
src/conf_macros.m4
-rw-r--r-- | Makefile.am | 17 | ||||
-rw-r--r-- | src/conf_macros.m4 | 7 |
2 files changed, 20 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am index 7f44a52c1..66150e4db 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,6 +4,7 @@ if HAVE_DEVSHM endif AM_DISTCHECK_CONFIGURE_FLAGS = --with-ldb-lib-dir="$$dc_install_base"/lib/ldb \ + --disable-dbus-tests \ --enable-all-experimental-features \ $(extra_distcheck_flags) @@ -138,15 +139,19 @@ if HAVE_CHECK debug-tests \ ipa_hbac-tests \ sss_idmap-tests \ - responder_socket_access-tests \ - sbus_tests \ - sbus_codegen_tests + responder_socket_access-tests if BUILD_SSH non_interactive_check_based_tests += sysdb_ssh-tests endif -endif +if BUILD_DBUS_TESTS + non_interactive_check_based_tests += \ + sbus_tests \ + sbus_codegen_tests +endif # BUILD_DBUS_TESTS + +endif # HAVE_CHECK if HAVE_CMOCKA non_interactive_cmocka_based_tests = \ @@ -1346,6 +1351,8 @@ krb5_child_test_LDADD = \ $(SSSD_INTERNAL_LTLIBS) \ libsss_test_common.la +if BUILD_DBUS_TESTS + sbus_tests_SOURCES = \ src/tests/common_dbus.c \ src/tests/sbus_tests.c @@ -1368,6 +1375,8 @@ sbus_codegen_tests_LDADD = \ $(SSSD_LIBS) \ $(CHECK_LIBS) +endif # BUILD_DBUS_TESTS + if HAVE_CMOCKA TEST_MOCK_RESP_OBJ = \ diff --git a/src/conf_macros.m4 b/src/conf_macros.m4 index c12175f22..96e6ae70f 100644 --- a/src/conf_macros.m4 +++ b/src/conf_macros.m4 @@ -624,3 +624,10 @@ AC_DEFUN([WITH_IFP], fi AM_CONDITIONAL([BUILD_IFP], [test x"$with_infopipe" = xyes]) ]) + +AC_ARG_ENABLE([dbus-tests], + [AS_HELP_STRING([--enable-dbus-tests], + [enable running tests using a dbus server instance [default=yes]])], + [build_dbus_tests=$enableval], + [build_dbus_tests=yes]) +AM_CONDITIONAL([BUILD_DBUS_TESTS], [test x$build_dbus_tests = xyes]) |