summaryrefslogtreecommitdiff
path: root/nsswitch/libwbclient/tests
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2010-10-12 06:13:57 +0200
committerKai Blin <kai@samba.org>2010-10-12 07:05:31 +0000
commit5ad0ed21814e721cc36b72bf2ed13d9b37c4b7d2 (patch)
treec9ef54beba624838e501630b6aee38431187498e /nsswitch/libwbclient/tests
parentf768b32e37788e6722217148b0a73e54c04bc03a (diff)
downloadsamba-5ad0ed21814e721cc36b72bf2ed13d9b37c4b7d2.tar.gz
samba-5ad0ed21814e721cc36b72bf2ed13d9b37c4b7d2.tar.bz2
samba-5ad0ed21814e721cc36b72bf2ed13d9b37c4b7d2.zip
libwbclient: Remove half-finished async implementation
The old approach on doing async libwbclient was never really finished. Go ahead and remove this implementation. Autobuild-User: Kai Blin <kai@samba.org> Autobuild-Date: Tue Oct 12 07:05:31 UTC 2010 on sn-devel-104
Diffstat (limited to 'nsswitch/libwbclient/tests')
-rw-r--r--nsswitch/libwbclient/tests/wbclient.c103
1 files changed, 0 insertions, 103 deletions
diff --git a/nsswitch/libwbclient/tests/wbclient.c b/nsswitch/libwbclient/tests/wbclient.c
index 948081bb1a..200805e892 100644
--- a/nsswitch/libwbclient/tests/wbclient.c
+++ b/nsswitch/libwbclient/tests/wbclient.c
@@ -23,7 +23,6 @@
#include "lib/util/data_blob.h"
#include "lib/util/time.h"
#include "nsswitch/libwbclient/wbclient.h"
-#include "nsswitch/libwbclient/wbc_async.h"
#include "torture/smbtorture.h"
#include "torture/winbind/proto.h"
#include "lib/util/util_net.h"
@@ -46,17 +45,6 @@
#define torture_assert_wbc_ok(torture_ctx,expr,cmt) \
torture_assert_wbc_equal(torture_ctx,expr,WBC_ERR_SUCCESS,cmt)
-
-static void wbc_debug_torture(void *private_data, enum wbcDebugLevel level,
- const char *fmt, va_list ap) PRINTF_ATTRIBUTE(3,0);
-static void wbc_debug_torture(void *private_data, enum wbcDebugLevel level,
- const char *fmt, va_list ap)
-{
- struct torture_context *tctx = talloc_get_type_abort(private_data,
- struct torture_context);
- torture_comment(tctx, "%s", talloc_vasprintf(tctx, fmt, ap));
-}
-
static bool test_wbc_ping(struct torture_context *tctx)
{
torture_assert_wbc_ok(tctx, wbcPing(),
@@ -65,24 +53,6 @@ static bool test_wbc_ping(struct torture_context *tctx)
return true;
}
-static bool test_wbc_ping_async(struct torture_context *tctx)
-{
- struct wb_context *wb_ctx;
- struct tevent_req *req;
-
- wb_ctx = wb_context_init(tctx, NULL);
-
- req = wbcPing_send(tctx, tctx->ev, wb_ctx);
- torture_assert(tctx, req, "wbcPing_send failed");
-
- if(!tevent_req_poll(req, tctx->ev)) {
- return false;
- }
- torture_assert_wbc_ok(tctx, wbcPing_recv(req), "wbcPing_recv failed");
- return true;
-}
-
-
static bool test_wbc_pingdc(struct torture_context *tctx)
{
torture_assert_wbc_equal(tctx, wbcPingDc("random_string", NULL), WBC_ERR_NOT_IMPLEMENTED,
@@ -253,77 +223,6 @@ static bool test_wbc_users(struct torture_context *tctx)
return true;
}
-static bool test_wbc_users_async(struct torture_context *tctx)
-{
- struct wb_context *wb_ctx;
- struct tevent_req *req;
- const char *domain_name = NULL;
- uint32_t num_users;
- const char **users;
- int i;
- struct wbcInterfaceDetails *details;
-
- wb_ctx = wb_context_init(tctx, NULL);
- wbcSetDebug(wb_ctx, wbc_debug_torture, tctx);
-
- req = wbcInterfaceDetails_send(tctx, tctx->ev, wb_ctx);
- torture_assert(tctx, req, "wbcInterfaceDetails_send failed");
-
- if(!tevent_req_poll(req, tctx->ev)) {
- return false;
- }
- torture_assert_wbc_ok(tctx,
- wbcInterfaceDetails_recv(req, tctx, &details),
- "wbcInterfaceDetails_recv failed");
-
- domain_name = talloc_strdup(tctx, details->netbios_domain);
- wbcFreeMemory(details);
-
- /* No async implementation of this yet. */
- torture_assert_wbc_ok(tctx, wbcListUsers(domain_name, &num_users, &users),
- "wbcListUsers failed");
- torture_assert(tctx, !(num_users > 0 && !users),
- "wbcListUsers returned invalid results");
-
- for (i=0; i < MIN(num_users,100); i++) {
-
- struct wbcDomainSid sid, *sids;
- enum wbcSidType name_type;
- char *domain;
- char *name;
- uint32_t num_sids;
-
- req = wbcLookupName_send(tctx, tctx->ev, wb_ctx, domain_name,
- users[i]);
- torture_assert(tctx, req, "wbcLookupName_send failed");
-
- if(!tevent_req_poll(req, tctx->ev)) {
- return false;
- }
-
- torture_assert_wbc_ok(tctx,
- wbcLookupName_recv(req, &sid, &name_type),
- "wbcLookupName_recv failed");
-
- torture_assert_int_equal(tctx, name_type, WBC_SID_NAME_USER,
- "wbcLookupName expected WBC_SID_NAME_USER");
- torture_assert_wbc_ok(tctx, wbcLookupSid(&sid, &domain, &name, &name_type),
- "wbcLookupSid failed");
- torture_assert_int_equal(tctx, name_type, WBC_SID_NAME_USER,
- "wbcLookupSid expected WBC_SID_NAME_USER");
- torture_assert(tctx, name,
- "wbcLookupSid returned no name");
- wbcFreeMemory(domain);
- wbcFreeMemory(name);
- torture_assert_wbc_ok(tctx, wbcLookupUserSids(&sid, true, &num_sids, &sids),
- "wbcLookupUserSids failed");
- wbcFreeMemory(sids);
- }
- wbcFreeMemory(users);
-
- return true;
-}
-
static bool test_wbc_groups(struct torture_context *tctx)
{
const char *domain_name = NULL;
@@ -782,7 +681,6 @@ struct torture_suite *torture_wbclient(void)
struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "WBCLIENT");
torture_suite_add_simple_test(suite, "wbcPing", test_wbc_ping);
- torture_suite_add_simple_test(suite, "wbcPing_async", test_wbc_ping_async);
torture_suite_add_simple_test(suite, "wbcPingDc", test_wbc_pingdc);
torture_suite_add_simple_test(suite, "wbcLibraryDetails", test_wbc_library_details);
torture_suite_add_simple_test(suite, "wbcInterfaceDetails", test_wbc_interface_details);
@@ -791,7 +689,6 @@ struct torture_suite *torture_wbclient(void)
torture_suite_add_simple_test(suite, "wbcGuidToString", test_wbc_guidtostring);
torture_suite_add_simple_test(suite, "wbcDomainInfo", test_wbc_domain_info);
torture_suite_add_simple_test(suite, "wbcListUsers", test_wbc_users);
- torture_suite_add_simple_test(suite, "wbcListUsers_async", test_wbc_users_async);
torture_suite_add_simple_test(suite, "wbcListGroups", test_wbc_groups);
torture_suite_add_simple_test(suite, "wbcListTrusts", test_wbc_trusts);
torture_suite_add_simple_test(suite, "wbcLookupDomainController", test_wbc_lookupdc);