diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-09-27 08:13:50 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-09-27 08:24:36 +0200 |
commit | b1ffacb43736c2a2366fbcb0039384b7b8d1683e (patch) | |
tree | 635821724273370d4cf33b6c1aef4b7e28d74ec4 /source4 | |
parent | b65a164f3e05a53c08998dc86eb6a899278f687a (diff) | |
download | samba-b1ffacb43736c2a2366fbcb0039384b7b8d1683e.tar.gz samba-b1ffacb43736c2a2366fbcb0039384b7b8d1683e.tar.bz2 samba-b1ffacb43736c2a2366fbcb0039384b7b8d1683e.zip |
LDAP-BASIC: test AbandonRequest
metze
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/ldap/basic.c | 41 |
1 files changed, 41 insertions, 0 deletions
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); |