mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
r457: added some more samr tests to help me work out the right error codes
in our new samr server
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
cdd48e2b9b
commit
0f25031114
@ -2696,17 +2696,37 @@ static BOOL test_LookupDomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
|
||||
{
|
||||
NTSTATUS status;
|
||||
struct samr_LookupDomain r;
|
||||
struct samr_Name n2;
|
||||
BOOL ret = True;
|
||||
|
||||
printf("Testing LookupDomain(%s)\n", domain->name);
|
||||
|
||||
/* check for correct error codes */
|
||||
r.in.handle = handle;
|
||||
r.in.domain = &n2;
|
||||
n2.name = NULL;
|
||||
|
||||
status = dcerpc_samr_LookupDomain(p, mem_ctx, &r);
|
||||
if (!NT_STATUS_EQUAL(NT_STATUS_INVALID_PARAMETER, status)) {
|
||||
printf("failed: LookupDomain expected NT_STATUS_INVALID_PARAMETER - %s\n", nt_errstr(status));
|
||||
ret = False;
|
||||
}
|
||||
|
||||
n2.name = "xxNODOMAINxx";
|
||||
|
||||
status = dcerpc_samr_LookupDomain(p, mem_ctx, &r);
|
||||
if (!NT_STATUS_EQUAL(NT_STATUS_NO_SUCH_DOMAIN, status)) {
|
||||
printf("failed: LookupDomain expected NT_STATUS_NO_SUCH_DOMAIN - %s\n", nt_errstr(status));
|
||||
ret = False;
|
||||
}
|
||||
|
||||
r.in.handle = handle;
|
||||
r.in.domain = domain;
|
||||
|
||||
status = dcerpc_samr_LookupDomain(p, mem_ctx, &r);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("LookupDomain failed - %s\n", nt_errstr(status));
|
||||
return False;
|
||||
ret = False;
|
||||
}
|
||||
|
||||
if (!test_GetDomPwInfo(p, mem_ctx, domain)) {
|
||||
@ -2752,6 +2772,12 @@ static BOOL test_EnumDomains(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
}
|
||||
|
||||
status = dcerpc_samr_EnumDomains(p, mem_ctx, &r);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("EnumDomains failed - %s\n", nt_errstr(status));
|
||||
return False;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user