From b1ffacb43736c2a2366fbcb0039384b7b8d1683e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 27 Sep 2010 08:13:50 +0200 Subject: [PATCH] LDAP-BASIC: test AbandonRequest metze --- source4/torture/ldap/basic.c | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/source4/torture/ldap/basic.c b/source4/torture/ldap/basic.c index a8e12dd8a3..1efdc06a8c 100644 --- a/source4/torture/ldap/basic.c +++ b/source4/torture/ldap/basic.c @@ -792,6 +792,43 @@ static bool test_referrals(struct torture_context *tctx, TALLOC_CTX *mem_ctx, return true; } +static bool test_abandom_request(struct torture_context *tctx, + struct ldap_connection *conn, const char *basedn) +{ + struct ldap_message *msg; + struct ldap_request *req; + NTSTATUS status; + + printf("Testing the AbandonRequest with an old message id!\n"); + + if (!basedn) { + return false; + } + + msg = new_ldap_message(conn); + if (!msg) { + return false; + } + + printf(" Try a AbandonRequest for an old message id\n"); + + msg->type = LDAP_TAG_AbandonRequest; + msg->r.AbandonRequest.messageid = 1; + + req = ldap_request_send(conn, msg); + if (!req) { + return false; + } + + status = ldap_request_wait(req); + if (!NT_STATUS_IS_OK(status)) { + printf("error in ldap abandon request - %s\n", nt_errstr(status)); + return false; + } + + return true; +} + bool torture_ldap_basic(struct torture_context *torture) { @@ -845,6 +882,10 @@ bool torture_ldap_basic(struct torture_context *torture) ret = false; } + if (!test_abandom_request(torture, conn, basedn)) { + ret = false; + } + /* if there are no more tests we are closing */ torture_ldap_close(conn); talloc_free(mem_ctx); -- 2.34.1