summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2010-03-01 12:11:50 -0500
committerStephen Gallagher <sgallagh@redhat.com>2010-04-12 09:22:13 -0400
commit02a9d8a40dc3a5fd671ede0e4fa7dac5178fbc75 (patch)
treee7fc415b7fcf466e9aa4d2f9022b6debb8fdf52d /src/tests
parentace612f5998f619ba41828d2ba4b80d02a965162 (diff)
downloadsssd-02a9d8a40dc3a5fd671ede0e4fa7dac5178fbc75.tar.gz
sssd-02a9d8a40dc3a5fd671ede0e4fa7dac5178fbc75.tar.bz2
sssd-02a9d8a40dc3a5fd671ede0e4fa7dac5178fbc75.zip
sysdb: convert sysdb_mod/add/remove_group_member
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/sysdb-tests.c42
1 files changed, 6 insertions, 36 deletions
diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c
index 061858da..14017963 100644
--- a/src/tests/sysdb-tests.c
+++ b/src/tests/sysdb-tests.c
@@ -662,12 +662,9 @@ static void test_get_user_attr(void *pvt, int error, struct ldb_result *res)
}
}
-static void test_add_group_member_done(struct tevent_req *subreq);
-
static void test_add_group_member(struct tevent_req *req)
{
struct test_data *data = tevent_req_callback_data(req, struct test_data);
- struct tevent_req *subreq;
const char *username;
int ret;
@@ -681,31 +678,16 @@ static void test_add_group_member(struct tevent_req *req)
test_return(data, ENOMEM);
}
- subreq = sysdb_add_group_member_send(data, data->ev,
- data->handle, data->ctx->domain,
- data->groupname, username);
- if (!subreq) {
- test_return(data, ENOMEM);
- }
-
- tevent_req_set_callback(subreq, test_add_group_member_done, data);
-}
-
-static void test_add_group_member_done(struct tevent_req *subreq)
-{
- struct test_data *data = tevent_req_callback_data(subreq,
- struct test_data);
- int ret = sysdb_add_group_member_recv(subreq);
+ ret = sysdb_add_group_member(data, data->handle->ctx,
+ data->ctx->domain,
+ data->groupname, username);
test_return(data, ret);
}
-static void test_remove_group_member_done(struct tevent_req *subreq);
-
static void test_remove_group_member(struct tevent_req *req)
{
struct test_data *data = tevent_req_callback_data(req, struct test_data);
- struct tevent_req *subreq;
const char *username;
int ret;
@@ -719,21 +701,9 @@ static void test_remove_group_member(struct tevent_req *req)
test_return(data, ENOMEM);
}
- subreq = sysdb_remove_group_member_send(data, data->ev,
- data->handle, data->ctx->domain,
- data->groupname, username);
- if (!subreq) {
- test_return(data, ENOMEM);
- }
-
- tevent_req_set_callback(subreq, test_remove_group_member_done, data);
-}
-
-static void test_remove_group_member_done(struct tevent_req *subreq)
-{
- struct test_data *data = tevent_req_callback_data(subreq,
- struct test_data);
- int ret = sysdb_remove_group_member_recv(subreq);
+ ret = sysdb_remove_group_member(data, data->handle->ctx,
+ data->ctx->domain,
+ data->groupname, username);
test_return(data, ret);
}