diff options
author | Simo Sorce <ssorce@redhat.com> | 2010-02-28 17:12:34 -0500 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-04-12 09:22:13 -0400 |
commit | ace612f5998f619ba41828d2ba4b80d02a965162 (patch) | |
tree | 2de934a091c46e9aa1d2a065d1a9a163ccda300c /src/tests | |
parent | a6ecb562529430be5a4cd6e8cdd541a383c9a2e1 (diff) | |
download | sssd-ace612f5998f619ba41828d2ba4b80d02a965162.tar.gz sssd-ace612f5998f619ba41828d2ba4b80d02a965162.tar.xz sssd-ace612f5998f619ba41828d2ba4b80d02a965162.zip |
sysdb: convert sysdb_store/add(_basic)_group
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/sysdb-tests.c | 65 |
1 files changed, 9 insertions, 56 deletions
diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c index e75a415f0..061858daf 100644 --- a/src/tests/sysdb-tests.c +++ b/src/tests/sysdb-tests.c @@ -393,13 +393,10 @@ static void test_remove_nonexistent_user_done(struct tevent_req *subreq) return test_return(data, ret); } -static void test_add_group_done(struct tevent_req *subreq); - static void test_add_group(struct tevent_req *req) { struct test_data *data = tevent_req_callback_data(req, struct test_data); - struct tevent_req *subreq; int ret; ret = sysdb_transaction_recv(req, data, &data->handle); @@ -407,32 +404,16 @@ static void test_add_group(struct tevent_req *req) return test_return(data, ret); } - subreq = sysdb_add_group_send(data, data->ev, data->handle, - data->ctx->domain, data->groupname, - data->gid, NULL, 0); - if (!subreq) { - test_return(data, ret); - } - tevent_req_set_callback(subreq, test_add_group_done, data); -} - -static void test_add_group_done(struct tevent_req *subreq) -{ - struct test_data *data = tevent_req_callback_data(subreq, struct test_data); - int ret; - - ret = sysdb_add_group_recv(subreq); - talloc_zfree(subreq); + ret = sysdb_add_group(data, data->handle->ctx, + data->ctx->domain, data->groupname, + data->gid, NULL, 0); return test_return(data, ret); } -static void test_store_group_done(struct tevent_req *subreq); - static void test_store_group(struct tevent_req *req) { struct test_data *data = tevent_req_callback_data(req, struct test_data); - struct tevent_req *subreq; int ret; ret = sysdb_transaction_recv(req, data, &data->handle); @@ -440,22 +421,9 @@ static void test_store_group(struct tevent_req *req) return test_return(data, ret); } - subreq = sysdb_store_group_send(data, data->ev, data->handle, - data->ctx->domain, data->groupname, - data->gid, NULL, -1); - if (!subreq) { - test_return(data, ret); - } - tevent_req_set_callback(subreq, test_store_group_done, data); -} - -static void test_store_group_done(struct tevent_req *subreq) -{ - struct test_data *data = tevent_req_callback_data(subreq, struct test_data); - int ret; - - ret = sysdb_store_group_recv(subreq); - talloc_zfree(subreq); + ret = sysdb_store_group(data, data->handle->ctx, + data->ctx->domain, data->groupname, + data->gid, NULL, -1); return test_return(data, ret); } @@ -887,11 +855,9 @@ static void test_delete_recursive(struct tevent_req *subreq) return test_return(data, ret); } -static void test_memberof_store_group_done(struct tevent_req *subreq); static void test_memberof_store_group(struct tevent_req *req) { struct test_data *data = tevent_req_callback_data(req, struct test_data); - struct tevent_req *subreq; int ret; struct sysdb_attrs *attrs = NULL; char *member; @@ -918,22 +884,9 @@ static void test_memberof_store_group(struct tevent_req *req) } } - subreq = sysdb_store_group_send(data, data->ev, data->handle, - data->ctx->domain, data->groupname, - data->gid, attrs, -1); - if (!subreq) { - test_return(data, ret); - } - tevent_req_set_callback(subreq, test_memberof_store_group_done, data); -} - -static void test_memberof_store_group_done(struct tevent_req *subreq) -{ - struct test_data *data = tevent_req_callback_data(subreq, struct test_data); - int ret; - - ret = sysdb_store_group_recv(subreq); - talloc_zfree(subreq); + ret = sysdb_store_group(data, data->handle->ctx, + data->ctx->domain, data->groupname, + data->gid, attrs, -1); return test_return(data, ret); } |