summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2010-03-03 15:29:39 -0500
committerStephen Gallagher <sgallagh@redhat.com>2010-04-12 09:22:14 -0400
commit3b3dc1a8ad19100951d19abe4038791f01faa0b7 (patch)
tree17b006f23b47701fa4e90da5df3bd4963602b9b7 /src/tests
parented80c73efa51780a39dfc9c72821cf88e95d264c (diff)
downloadsssd-3b3dc1a8ad19100951d19abe4038791f01faa0b7.tar.gz
sssd-3b3dc1a8ad19100951d19abe4038791f01faa0b7.tar.xz
sssd-3b3dc1a8ad19100951d19abe4038791f01faa0b7.zip
sysdb: delete sysdb_delete_group
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/sysdb-tests.c47
1 files changed, 7 insertions, 40 deletions
diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c
index b01404ffe..9b935d13a 100644
--- a/src/tests/sysdb-tests.c
+++ b/src/tests/sysdb-tests.c
@@ -306,12 +306,9 @@ static void test_remove_user_by_uid(struct tevent_req *req)
return test_return(data, ret);
}
-static void test_remove_nonexistent_group_done(struct tevent_req *subreq);
-
static void test_remove_nonexistent_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);
@@ -319,23 +316,8 @@ static void test_remove_nonexistent_group(struct tevent_req *req)
return test_return(data, ret);
}
- subreq = sysdb_delete_group_send(data, data->ev,
- NULL, data->handle,
- data->ctx->domain,
- NULL, data->uid);
- if (!subreq) return test_return(data, ENOMEM);
-
- tevent_req_set_callback(subreq, test_remove_nonexistent_group_done, data);
-}
-
-static void test_remove_nonexistent_group_done(struct tevent_req *subreq)
-{
- struct test_data *data = tevent_req_callback_data(subreq,
- struct test_data);
- int ret;
-
- ret = sysdb_delete_group_recv(subreq);
- talloc_zfree(subreq);
+ ret = sysdb_delete_group(data, data->handle->ctx,
+ data->ctx->domain, NULL, data->uid);
return test_return(data, ret);
}
@@ -409,11 +391,9 @@ static void test_remove_group(struct tevent_req *req)
return test_return(data, ret);
}
-static void test_remove_group_by_gid_done(struct tevent_req *subreq);
static void test_remove_group_by_gid(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);
@@ -421,24 +401,11 @@ static void test_remove_group_by_gid(struct tevent_req *req)
return test_return(data, ret);
}
- subreq = sysdb_delete_group_send(data, data->ev,
- NULL, data->handle,
- data->ctx->domain,
- NULL, data->gid);
- if (!subreq) return test_return(data, ENOMEM);
-
- tevent_req_set_callback(subreq, test_remove_group_by_gid_done, data);
-}
-
-static void test_remove_group_by_gid_done(struct tevent_req *subreq)
-{
- struct test_data *data = tevent_req_callback_data(subreq,
- struct test_data);
- int ret;
-
- ret = sysdb_delete_group_recv(subreq);
- if (ret == ENOENT) ret = EOK;
- talloc_zfree(subreq);
+ ret = sysdb_delete_group(data, data->handle->ctx,
+ data->ctx->domain, NULL, data->gid);
+ if (ret == ENOENT) {
+ ret = EOK;
+ }
return test_return(data, ret);
}