summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2010-03-02 23:53:16 -0500
committerStephen Gallagher <sgallagh@redhat.com>2010-04-12 09:22:14 -0400
commited80c73efa51780a39dfc9c72821cf88e95d264c (patch)
tree918cb30beb00df29f20e232fc630d0a91028c83d /src/tests
parent16ef1ec0d10d24703351d02bbd7d0c2255da4359 (diff)
downloadsssd-ed80c73efa51780a39dfc9c72821cf88e95d264c.tar.gz
sssd-ed80c73efa51780a39dfc9c72821cf88e95d264c.tar.xz
sssd-ed80c73efa51780a39dfc9c72821cf88e95d264c.zip
sysdb: convert sysdb_delete_user
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/sysdb-tests.c45
1 files changed, 4 insertions, 41 deletions
diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c
index 320e6f291..b01404ffe 100644
--- a/src/tests/sysdb-tests.c
+++ b/src/tests/sysdb-tests.c
@@ -290,12 +290,9 @@ static void test_remove_user(struct tevent_req *req)
return test_return(data, ret);
}
-static void test_remove_user_by_uid_done(struct tevent_req *subreq);
-
static void test_remove_user_by_uid(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);
@@ -303,24 +300,8 @@ static void test_remove_user_by_uid(struct tevent_req *req)
return test_return(data, ret);
}
- subreq = sysdb_delete_user_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_user_by_uid_done, data);
-}
-
-static void test_remove_user_by_uid_done(struct tevent_req *subreq)
-{
- struct test_data *data = tevent_req_callback_data(subreq,
- struct test_data);
- int ret;
-
- ret = sysdb_delete_user_recv(subreq);
- if (ret == ENOENT) ret = EOK;
- talloc_zfree(subreq);
+ ret = sysdb_delete_user(data, data->handle->ctx,
+ data->ctx->domain, NULL, data->uid);
return test_return(data, ret);
}
@@ -359,12 +340,9 @@ static void test_remove_nonexistent_group_done(struct tevent_req *subreq)
return test_return(data, ret);
}
-static void test_remove_nonexistent_user_done(struct tevent_req *subreq);
-
static void test_remove_nonexistent_user(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);
@@ -372,23 +350,8 @@ static void test_remove_nonexistent_user(struct tevent_req *req)
return test_return(data, ret);
}
- subreq = sysdb_delete_user_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_user_done, data);
-}
-
-static void test_remove_nonexistent_user_done(struct tevent_req *subreq)
-{
- struct test_data *data = tevent_req_callback_data(subreq,
- struct test_data);
- int ret;
-
- ret = sysdb_delete_user_recv(subreq);
- talloc_zfree(subreq);
+ ret = sysdb_delete_user(data, data->handle->ctx,
+ data->ctx->domain, NULL, data->uid);
return test_return(data, ret);
}