diff options
author | Simo Sorce <ssorce@redhat.com> | 2010-02-27 19:13:02 -0500 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-04-12 09:22:12 -0400 |
commit | 0995e4cc173577122bea5a1d4698262fd0e9c200 (patch) | |
tree | eb55bc828d63bb01e7992495a6d0bf753a76030f /src/tests | |
parent | 79c090e8c25ac13454b9f12f4d6dc635029a0c9d (diff) | |
download | sssd-0995e4cc173577122bea5a1d4698262fd0e9c200.tar.gz sssd-0995e4cc173577122bea5a1d4698262fd0e9c200.tar.bz2 sssd-0995e4cc173577122bea5a1d4698262fd0e9c200.zip |
sysdb: convert sysdb_search_entry and sysdb_delete_recursive
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/sysdb-tests.c | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c index efd9d92e..d5e2e771 100644 --- a/src/tests/sysdb-tests.c +++ b/src/tests/sysdb-tests.c @@ -886,7 +886,6 @@ static void test_delete_custom(struct tevent_req *subreq) return test_return(data, ret); } -static void test_search_all_users_done(struct tevent_req *subreq); static void test_search_all_users(struct tevent_req *subreq) { struct test_data *data = tevent_req_callback_data(subreq, @@ -906,29 +905,13 @@ static void test_search_all_users(struct tevent_req *subreq) return test_return(data, ENOMEM); } - subreq = sysdb_search_entry_send(data, data->ev, data->handle, - base_dn, LDB_SCOPE_SUBTREE, - "objectClass=user", data->attrlist); - if (!subreq) { - return test_return(data, ENOMEM); - } - tevent_req_set_callback(subreq, test_search_all_users_done, data); -} - -static void test_search_all_users_done(struct tevent_req *subreq) -{ - struct test_data *data = tevent_req_callback_data(subreq, struct test_data); - int ret; - - ret = sysdb_search_entry_recv(subreq, data, &data->msgs_count, &data->msgs); - talloc_zfree(subreq); + ret = sysdb_search_entry(data, data->ctx->sysdb, base_dn, + LDB_SCOPE_SUBTREE, "objectClass=user", + data->attrlist, &data->msgs_count, &data->msgs); - test_return(data, ret); - return; + return test_return(data, ret); } -static void test_delete_recursive_done(struct tevent_req *subreq); - static void test_delete_recursive(struct tevent_req *subreq) { struct test_data *data = tevent_req_callback_data(subreq, @@ -948,22 +931,8 @@ static void test_delete_recursive(struct tevent_req *subreq) return test_return(data, ENOMEM); } - subreq = sysdb_delete_recursive_send(data, data->ev, data->handle, dn, - false); - if (!subreq) { - return test_return(data, ENOMEM); - } - tevent_req_set_callback(subreq, test_delete_recursive_done, data); -} - -static void test_delete_recursive_done(struct tevent_req *subreq) -{ - struct test_data *data = tevent_req_callback_data(subreq, struct test_data); - int ret; - - ret = sysdb_delete_recursive_recv(subreq); - talloc_zfree(subreq); - fail_unless(ret == EOK, "sysdb_delete_recursive_recv returned [%d]", ret); + ret = sysdb_delete_recursive(data, data->ctx->sysdb, dn, false); + fail_unless(ret == EOK, "sysdb_delete_recursive returned [%d]", ret); return test_return(data, ret); } |