summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2010-01-29 11:22:14 +0100
committerKai Blin <kai@samba.org>2010-02-11 23:56:32 +0100
commit1ca727420a0d2f3d0f4a14b06c1a8d1ea6c40339 (patch)
treeef3f7d4fbb84df8703c064c951264f1706bbb188
parent3204113efe0eccbb502914699cb5a4ddcf4efdfa (diff)
downloadsamba-1ca727420a0d2f3d0f4a14b06c1a8d1ea6c40339.tar.gz
samba-1ca727420a0d2f3d0f4a14b06c1a8d1ea6c40339.tar.bz2
samba-1ca727420a0d2f3d0f4a14b06c1a8d1ea6c40339.zip
libwbclient: torture-test wbcPing async functions.
-rw-r--r--nsswitch/libwbclient/tests/wbclient.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/nsswitch/libwbclient/tests/wbclient.c b/nsswitch/libwbclient/tests/wbclient.c
index 9e4c348cb6..83d8dacbcf 100644
--- a/nsswitch/libwbclient/tests/wbclient.c
+++ b/nsswitch/libwbclient/tests/wbclient.c
@@ -19,6 +19,7 @@
#include "includes.h"
#include "nsswitch/libwbclient/wbclient.h"
+#include "nsswitch/libwbclient/wbc_async.h"
#include "torture/smbtorture.h"
#include "torture/winbind/proto.h"
@@ -43,6 +44,24 @@ 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,
@@ -353,6 +372,7 @@ 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);