summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/torture/rpc/samr.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index a0b6a61c48..c7d55ad828 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -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;
}