summaryrefslogtreecommitdiffstats
path: root/src/tests/cmocka/test_nested_groups.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2014-03-11 17:39:31 +0100
committerJakub Hrozek <jhrozek@redhat.com>2014-07-23 21:28:31 +0200
commit8a8618717c99b7331125fa736b45d9155da797d3 (patch)
tree8127472cbdf092d4ae417a03589324d18e48f41e /src/tests/cmocka/test_nested_groups.c
parente3c994b7b779e6d6d6d125ee28d30bd139590f49 (diff)
downloadsssd-8a8618717c99b7331125fa736b45d9155da797d3.tar.gz
sssd-8a8618717c99b7331125fa736b45d9155da797d3.tar.xz
sssd-8a8618717c99b7331125fa736b45d9155da797d3.zip
Only check GID if ID-mapping
Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src/tests/cmocka/test_nested_groups.c')
-rw-r--r--src/tests/cmocka/test_nested_groups.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/tests/cmocka/test_nested_groups.c b/src/tests/cmocka/test_nested_groups.c
index 0c1a53b0e..b64d67d3c 100644
--- a/src/tests/cmocka/test_nested_groups.c
+++ b/src/tests/cmocka/test_nested_groups.c
@@ -26,7 +26,9 @@
#include "tests/cmocka/common_mock.h"
#include "tests/cmocka/common_mock_sdap.h"
#include "tests/cmocka/common_mock_sysdb_objects.h"
+#include "providers/ldap/ldap_common.h"
#include "providers/ldap/sdap.h"
+#include "providers/ldap/sdap_idmap.h"
#include "providers/ldap/sdap_async_private.h"
#define TESTS_PATH "tests_ldap_nested_groups"
@@ -55,6 +57,8 @@ struct nested_groups_test_ctx {
struct sdap_options *sdap_opts;
struct sdap_handle *sdap_handle;
struct sdap_domain *sdap_domain;
+ struct sdap_idmap_ctx *idmap_ctx;
+ struct sdap_id_ctx *sdap_id_ctx;
struct sysdb_attrs **users;
struct sysdb_attrs **groups;
@@ -391,6 +395,7 @@ static void nested_groups_test_one_group_dup_group_members(void **state)
void nested_groups_test_setup(void **state)
{
+ errno_t ret;
struct nested_groups_test_ctx *test_ctx = NULL;
static struct sss_test_conf_param params[] = {
{ "ldap_schema", "rfc2307bis" }, /* enable nested groups */
@@ -419,6 +424,21 @@ void nested_groups_test_setup(void **state)
test_ctx->sdap_domain = test_ctx->sdap_opts->sdom;
test_ctx->sdap_handle = mock_sdap_handle(test_ctx);
assert_non_null(test_ctx->sdap_handle);
+
+ test_ctx->sdap_id_ctx = talloc_zero(test_ctx,
+ struct sdap_id_ctx);
+ assert_non_null(test_ctx->sdap_id_ctx);
+
+ test_ctx->sdap_id_ctx->be = talloc_zero(test_ctx->sdap_id_ctx,
+ struct be_ctx);
+ assert_non_null(test_ctx->sdap_id_ctx->be);
+
+ test_ctx->sdap_id_ctx->opts = test_ctx->sdap_opts;
+ test_ctx->sdap_id_ctx->be->domain = test_ctx->tctx->dom;
+
+ ret = sdap_idmap_init(test_ctx, test_ctx->sdap_id_ctx, &test_ctx->idmap_ctx);
+ assert_int_equal(ret, EOK);
+ test_ctx->sdap_opts->idmap_ctx = test_ctx->idmap_ctx;
}
void nested_groups_test_teardown(void **state)