summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-10-15 15:09:58 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-10-18 13:12:04 -0400
commit8059574092a96396dea64dae13696a7f95b423b1 (patch)
treec69fc5f4647e423446de5b0fa0196e5e3b236145 /src/tests
parent55769ee01eac9ce8ce55b29222f14e1c4362fc3c (diff)
downloadsssd-8059574092a96396dea64dae13696a7f95b423b1.tar.gz
sssd-8059574092a96396dea64dae13696a7f95b423b1.tar.xz
sssd-8059574092a96396dea64dae13696a7f95b423b1.zip
Modify sysdb_[add|remove]_group_member to accept users and groups
Previously, it assumed that all members were users. This changes the interface so that either a user or a group can be specified. Also, it eliminates the need for a memory context to be passed, since the internal memory should be self-contained.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/sysdb-tests.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c
index b874544c0..dd76d97af 100644
--- a/src/tests/sysdb-tests.c
+++ b/src/tests/sysdb-tests.c
@@ -326,9 +326,10 @@ static int test_add_group_member(struct test_data *data)
return ENOMEM;
}
- ret = sysdb_add_group_member(data, data->ctx->sysdb,
+ ret = sysdb_add_group_member(data->ctx->sysdb,
data->ctx->domain,
- data->groupname, username);
+ data->groupname, username,
+ SYSDB_MEMBER_USER);
return ret;
}
@@ -342,9 +343,10 @@ static int test_remove_group_member(struct test_data *data)
return ENOMEM;
}
- ret = sysdb_remove_group_member(data, data->ctx->sysdb,
+ ret = sysdb_remove_group_member(data->ctx->sysdb,
data->ctx->domain,
- data->groupname, username);
+ data->groupname, username,
+ SYSDB_MEMBER_USER);
return ret;
}
@@ -2217,6 +2219,7 @@ START_TEST (test_sysdb_update_members)
add_groups[2] = NULL;
ret = sysdb_update_members(test_ctx->sysdb, test_ctx->domain, user,
+ SYSDB_MEMBER_USER,
(const char **)add_groups, NULL);
fail_unless(ret == EOK, "Could not add groups");
talloc_zfree(add_groups);
@@ -2230,6 +2233,7 @@ START_TEST (test_sysdb_update_members)
add_groups[1] = NULL;
ret = sysdb_update_members(test_ctx->sysdb, test_ctx->domain, user,
+ SYSDB_MEMBER_USER,
(const char **)add_groups,
(const char **)del_groups);
fail_unless(ret == EOK, "Group replace failed");
@@ -2243,7 +2247,8 @@ START_TEST (test_sysdb_update_members)
del_groups[2] = NULL;
ret = sysdb_update_members(test_ctx->sysdb, test_ctx->domain,
- user, NULL,
+ user, SYSDB_MEMBER_USER,
+ NULL,
(const char **)del_groups);
fail_unless(ret == EOK, "Could not remove groups");