summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-11-29 11:39:09 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-12-19 17:42:05 +0100
commitd26b5b2526846f3c1d8ea54914bbea2cd0cb2826 (patch)
tree8e7a126b8b641a463de305bc78e0eeb9d48f1b7e /src/tests
parent97d3ef21d9f293f0b4bc0cc38b37f4e3d54d3572 (diff)
downloadsssd-d26b5b2526846f3c1d8ea54914bbea2cd0cb2826.tar.gz
sssd-d26b5b2526846f3c1d8ea54914bbea2cd0cb2826.tar.xz
sssd-d26b5b2526846f3c1d8ea54914bbea2cd0cb2826.zip
AD: Add a new option to turn off GC lookups
SSSD now defaults to using GC by default. For some environments, for instance those that don't or can't replicate the POSIX attributes to Global Catalog, this might not be desirable. This patch introduces a new option ad_enable_gc, that is enabled by default. Setting this option to false makes the SSSD contact only the LDAP port of AD DCs.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/cmocka/test_ad_common.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/tests/cmocka/test_ad_common.c b/src/tests/cmocka/test_ad_common.c
index 648b68f2d..07502b82d 100644
--- a/src/tests/cmocka/test_ad_common.c
+++ b/src/tests/cmocka/test_ad_common.c
@@ -159,6 +159,8 @@ void test_conn_list(void **state)
struct ad_common_test_ctx);
assert_non_null(test_ctx);
+ assert_true(dp_opt_get_bool(test_ctx->ad_ctx->ad_options->basic,
+ AD_ENABLE_GC));
conn_list = ad_gc_conn_list(test_ctx, test_ctx->ad_ctx, test_ctx->dom);
assert_non_null(conn_list);
@@ -177,6 +179,24 @@ void test_conn_list(void **state)
assert_false(conn_list[0]->ignore_mark_offline);
assert_null(conn_list[1]);
talloc_free(conn_list);
+
+ dp_opt_set_bool(test_ctx->ad_ctx->ad_options->basic, AD_ENABLE_GC, false);
+ assert_false(dp_opt_get_bool(test_ctx->ad_ctx->ad_options->basic,
+ AD_ENABLE_GC));
+
+ conn_list = ad_gc_conn_list(test_ctx, test_ctx->ad_ctx, test_ctx->dom);
+ assert_non_null(conn_list);
+
+ assert_true(conn_list[0] == test_ctx->ad_ctx->ldap_ctx);
+ assert_false(conn_list[0]->ignore_mark_offline);
+ assert_null(conn_list[1]);
+ talloc_free(conn_list);
+
+ conn_list = ad_gc_conn_list(test_ctx, test_ctx->ad_ctx, test_ctx->subdom);
+ assert_non_null(conn_list);
+
+ assert_null(conn_list[0]);
+ talloc_free(conn_list);
}
int main(int argc, const char *argv[])