e8ab291
From 21f28bdbab10881b9fb0b890dfa15af429326606 Mon Sep 17 00:00:00 2001
e8ab291
From: Sumit Bose <sbose@redhat.com>
e8ab291
Date: Fri, 11 Feb 2011 12:57:30 +0100
e8ab291
Subject: [PATCH 2/2] Make 'make check' look nice again
e8ab291
e8ab291
With current libldb releases 'make check' will print a lot of 'unable to
e8ab291
dlopen' messages although the test will succeed. This patch place the
e8ab291
memberof module into a directory of its own to avoid these messages.
e8ab291
e8ab291
Additionally this patch introduces TESTS_ENVIRONMENT which allows us to
e8ab291
remove the SYSDB_TEST preprocessor definition.
e8ab291
---
e8ab291
 Makefile.am    |   11 ++++++++---
e8ab291
 src/db/sysdb.c |    8 --------
e8ab291
 2 files changed, 8 insertions(+), 11 deletions(-)
e8ab291
e8ab291
diff --git a/Makefile.am b/Makefile.am
e8ab291
index cc78d04..b445f9c 100644
e8ab291
--- a/Makefile.am
e8ab291
+++ b/Makefile.am
e8ab291
@@ -478,6 +478,12 @@ sss_groupshow_LDADD = \
e8ab291
 #################
e8ab291
 # Feature Tests #
e8ab291
 #################
e8ab291
+TESTS_ENVIRONMENT = LDB_MODULES_PATH=$(abs_top_builddir)/ldb_mod_test_dir
e8ab291
+
e8ab291
+ldb_mod_test_dir: memberof.la
e8ab291
+	mkdir -p $(builddir)/ldb_mod_test_dir
e8ab291
+	cp $(builddir)/.libs/memberof.so $(builddir)/ldb_mod_test_dir
e8ab291
+
e8ab291
 noinst_LTLIBRARIES += \
e8ab291
     libsss_test_common.la
e8ab291
 
e8ab291
@@ -494,7 +500,6 @@ sysdb_tests_SOURCES = \
e8ab291
     src/tests/sysdb-tests.c \
e8ab291
     $(SSSD_UTIL_OBJ)
e8ab291
 sysdb_tests_CFLAGS = \
e8ab291
-    -DSYSDB_TEST \
e8ab291
     $(AM_CFLAGS) \
e8ab291
     $(CHECK_CFLAGS)
e8ab291
 sysdb_tests_LDADD = \
e8ab291
@@ -637,7 +642,6 @@ auth_tests_SOURCES = \
e8ab291
     $(SSSD_UTIL_OBJ)
e8ab291
 auth_tests_CFLAGS = \
e8ab291
     $(AM_CFLAGS) \
e8ab291
-    -DSYSDB_TEST \
e8ab291
     $(CHECK_CFLAGS)
e8ab291
 auth_tests_LDADD = \
e8ab291
     $(SSSD_LIBS) \
e8ab291
@@ -1023,7 +1027,7 @@ docs:
e8ab291
 	@exit 1
e8ab291
 endif
e8ab291
 
e8ab291
-all-local:
e8ab291
+all-local: ldb_mod_test_dir
e8ab291
 if BUILD_PYTHON_BINDINGS
e8ab291
 	cd $(srcdir)/src/config; $(PYTHON) setup.py build --build-base $(abs_builddir)/src/config
e8ab291
 endif
e8ab291
@@ -1055,6 +1059,7 @@ if BUILD_PYTHON_BINDINGS
e8ab291
 	cd $(srcdir)/src/config; $(PYTHON) setup.py build --build-base $(abs_builddir)/src/config clean --all
e8ab291
 endif
e8ab291
 	rm -Rf doc
e8ab291
+	rm -Rf ldb_mod_test_dir
e8ab291
 
e8ab291
 CLEANFILES = *.X */*.X */*/*.X
e8ab291
 
e8ab291
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
e8ab291
index 1409149..694ce54 100644
e8ab291
--- a/src/db/sysdb.c
e8ab291
+++ b/src/db/sysdb.c
e8ab291
@@ -889,10 +889,6 @@ static int sysdb_check_upgrade_02(TALLOC_CTX *mem_ctx,
e8ab291
         goto exit;
e8ab291
     }
e8ab291
 
e8ab291
-#ifdef SYSDB_TEST
e8ab291
-    ldb_set_modules_dir(ctx->ldb, ABS_BUILD_DIR"/.libs");
e8ab291
-#endif
e8ab291
-
e8ab291
     ret = ldb_connect(ldb, ldb_file, 0, NULL);
e8ab291
     if (ret != LDB_SUCCESS) {
e8ab291
         ret = EIO;
e8ab291
@@ -1563,10 +1559,6 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
e8ab291
         return EIO;
e8ab291
     }
e8ab291
 
e8ab291
-#ifdef SYSDB_TEST
e8ab291
-    ldb_set_modules_dir(ctx->ldb, ABS_BUILD_DIR"/.libs");
e8ab291
-#endif
e8ab291
-
e8ab291
     ret = ldb_connect(ctx->ldb, ctx->ldb_file, 0, NULL);
e8ab291
     if (ret != LDB_SUCCESS) {
e8ab291
         return EIO;
e8ab291
-- 
e8ab291
1.7.4
e8ab291