diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-08-30 13:05:03 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:58:25 -0500 |
commit | 1fc55db7339fc6425d6c8e1abdddcdd56bf33733 (patch) | |
tree | 7548b174dfa74d33319761baa8d5ede6a200fb2e /source4/torture/rpc | |
parent | 2de9ce9499803bac73ae9f49ce1fa7b57762c389 (diff) | |
download | samba-1fc55db7339fc6425d6c8e1abdddcdd56bf33733.tar.gz samba-1fc55db7339fc6425d6c8e1abdddcdd56bf33733.tar.xz samba-1fc55db7339fc6425d6c8e1abdddcdd56bf33733.zip |
r2107: added a SAMR async test - this one seems to work
(This used to be commit 306eb848654e0cadb0ebe10c29420fc0c30a64c4)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r-- | source4/torture/rpc/samr.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index 1a48aaa944..cf354d469e 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -1990,6 +1990,45 @@ static BOOL test_EnumDomainUsers(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return ret; } +/* + try blasting the server with a bunch of sync requests +*/ +static BOOL test_EnumDomainUsers_async(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, + struct policy_handle *handle) +{ + NTSTATUS status; + struct samr_EnumDomainUsers r; + uint32_t resume_handle=0; + int i; +#define ASYNC_COUNT 100 + struct rpc_request *req[ASYNC_COUNT]; + + printf("Testing EnumDomainUsers_async\n"); + + r.in.handle = handle; + r.in.resume_handle = &resume_handle; + r.in.acct_flags = 0; + r.in.max_size = (uint32_t)-1; + r.out.resume_handle = &resume_handle; + + for (i=0;i<ASYNC_COUNT;i++) { + req[i] = dcerpc_samr_EnumDomainUsers_send(p, mem_ctx, &r); + } + + for (i=0;i<ASYNC_COUNT;i++) { + status = dcerpc_ndr_request_recv(req[i]); + if (!NT_STATUS_IS_OK(status)) { + printf("EnumDomainUsers[%d] failed - %s\n", + i, nt_errstr(status)); + return False; + } + } + + printf("%d async requests OK\n", i); + + return True; +} + static BOOL test_EnumDomainGroups(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle) { @@ -2732,6 +2771,10 @@ static BOOL test_OpenDomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, ret = False; } + if (!test_EnumDomainUsers_async(p, mem_ctx, &domain_handle)) { + ret = False; + } + if (!test_EnumDomainGroups(p, mem_ctx, &domain_handle)) { ret = False; } |