[SSSD] [PATCH] BUILD: Disable dbus tests when running distcheck

Jakub Hrozek jhrozek at redhat.com
Fri May 30 11:35:31 UTC 2014


On Fri, May 30, 2014 at 12:58:20PM +0200, Lukas Slebodnik wrote:
> >+AC_ARG_ENABLE([dbus-tests],
> >+              [AS_HELP_STRING([--enable-dbus-tests],
> >+                              [enable running tests using a dbus server
> >                                                instance [default=enabled]])],
>                                                            ^^^^^^^^^^^^^^^
>                                                            default is yes
> The help string will be consistent with other options.
>   --enable-shared[=PKGS]  build shared libraries [default=yes]
>   --enable-fast-install[=PKGS]
>                           optimize for fast installation [default=yes]
> 
> >+              [build_dbus_tests=$enableval],
> >+              [build_dbus_tests=yes])
> >+AM_CONDITIONAL([BUILD_DBUS_TESTS], [test x$build_dbus_tests = xyes])
> >-- 
> >1.9.0
> >
> 
> Otherwise, patch works fine.

OK, the yes/no seemed a bit odd to me if the option is
--enable/--disable, but I don't mind too much either.
-------------- next part --------------
>From 03c1f0bc50dcb88c74154a87f736d68adf006721 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Fri, 30 May 2014 10:33:43 +0200
Subject: [PATCH] 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.
---
 Makefile.am        | 17 +++++++++++++----
 src/conf_macros.m4 |  7 +++++++
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index ac466a329e2e2c3f0a9a99adadb308c97000cdd5..652cf67236b3b7020cc4afcbf46fa3456fcbfefd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,6 +8,7 @@ if WITH_JOURNALD
 endif
 
 AM_DISTCHECK_CONFIGURE_FLAGS = --with-ldb-lib-dir="$$dc_install_base"/lib/ldb \
+                               --disable-dbus-tests \
                                --enable-all-experimental-features \
                                $(extra_distcheck_flags)
 
@@ -147,9 +148,7 @@ if HAVE_CHECK
         ipa_hbac-tests \
         sss_idmap-tests \
         responder_socket_access-tests \
-        safe-format-tests \
-        sbus_tests \
-        sbus_codegen_tests
+        safe-format-tests
 
 if BUILD_SSH
     non_interactive_check_based_tests += sysdb_ssh-tests
@@ -161,7 +160,13 @@ if BUILD_CONFIG_LIB
 endif # BUILD_CONFIG_LIB
 endif # BUILD_IFP
 
-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 = \
@@ -1464,6 +1469,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
@@ -1486,6 +1493,8 @@ sbus_codegen_tests_LDADD = \
     $(SSSD_LIBS) \
     $(CHECK_LIBS)
 
+endif # BUILD_DBUS_TESTS
+
 if BUILD_IFP
 if BUILD_CONFIG_LIB
 sss_config_tests_SOURCES = \
diff --git a/src/conf_macros.m4 b/src/conf_macros.m4
index 2c834031958e261689a84db6662cd108eb1eada3..af0834a7503dddc49a2ebbd21f455215cdb136f3 100644
--- a/src/conf_macros.m4
+++ b/src/conf_macros.m4
@@ -667,3 +667,10 @@ AC_DEFUN([WITH_SAMBA],
     fi
     AM_CONDITIONAL([BUILD_SAMBA], [test x"$with_samba" = 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])
-- 
1.9.0



More information about the sssd-devel mailing list