mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
r2107: added a SAMR async test - this one seems to work
(This used to be commit 306eb848654e0cadb0ebe10c29420fc0c30a64c4)
This commit is contained in:
parent
2de9ce9499
commit
1fc55db733
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user