summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichal Zidek <mzidek@redhat.com>2013-03-18 12:47:35 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-03-20 13:04:10 +0100
commitdfe84158c49e44f2207b94d25e61ab4f3fe38366 (patch)
tree57275ec15303d6a31937911f01dcc5097edb7eb6 /src
parentaa7202c8ae677becd6c91d6a27a607fe0f3995ee (diff)
downloadsssd-dfe84158c49e44f2207b94d25e61ab4f3fe38366.tar.gz
sssd-dfe84158c49e44f2207b94d25e61ab4f3fe38366.tar.bz2
sssd-dfe84158c49e44f2207b94d25e61ab4f3fe38366.zip
tests: Print warning if LDB_MODULES_PATH is not set
Print warning if sysdb-tests or sysdb-ssh test are run individually and LDB_MODULES_PATH was not set. https://fedorahosted.org/sssd/ticket/1820
Diffstat (limited to 'src')
-rw-r--r--src/tests/common.c9
-rw-r--r--src/tests/common.h2
-rw-r--r--src/tests/sysdb-tests.c5
-rw-r--r--src/tests/sysdb_ssh-tests.c5
4 files changed, 21 insertions, 0 deletions
diff --git a/src/tests/common.c b/src/tests/common.c
index 65e69558..54c93e28 100644
--- a/src/tests/common.c
+++ b/src/tests/common.c
@@ -101,3 +101,12 @@ compare_sdap_attr_maps(struct sdap_attr_map *map1, size_t size1,
return EOK;
}
+
+bool ldb_modules_path_is_set(void)
+{
+ if (getenv("LDB_MODULES_PATH")) {
+ return true;
+ }
+
+ return false;
+}
diff --git a/src/tests/common.h b/src/tests/common.h
index b7eee46e..61dcbf41 100644
--- a/src/tests/common.h
+++ b/src/tests/common.h
@@ -95,4 +95,6 @@ errno_t test_request_recv(struct tevent_req *req);
int test_ev_loop(struct sss_test_ctx *tctx);
+bool ldb_modules_path_is_set(void);
+
#endif /* !__TESTS_COMMON_H__ */
diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c
index ada0ccc5..d0e64e20 100644
--- a/src/tests/sysdb-tests.c
+++ b/src/tests/sysdb-tests.c
@@ -5268,6 +5268,11 @@ int main(int argc, const char *argv[]) {
DEBUG_INIT(debug_level);
+ if (!ldb_modules_path_is_set()) {
+ fprintf(stderr, "Warning: LDB_MODULES_PATH is not set, "
+ "will use LDB plugins installed in system paths.\n");
+ }
+
tests_set_cwd();
ret = unlink(TESTS_PATH"/"LOCAL_SYSDB_FILE);
diff --git a/src/tests/sysdb_ssh-tests.c b/src/tests/sysdb_ssh-tests.c
index c6990163..95c57a7e 100644
--- a/src/tests/sysdb_ssh-tests.c
+++ b/src/tests/sysdb_ssh-tests.c
@@ -405,6 +405,11 @@ int main(int argc, const char *argv[])
DEBUG_INIT(debug_level);
+ if (!ldb_modules_path_is_set()) {
+ fprintf(stderr, "Warning: LDB_MODULES_PATH is not set, "
+ "will use LDB plugins installed in system paths.\n");
+ }
+
tests_set_cwd();
s = create_sysdb_ssh_suite();