From af48da52bf39f8055b6f1640bcadeb27aeaead2d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 3 May 2004 14:54:47 +0000 Subject: r457: added some more samr tests to help me work out the right error codes in our new samr server (This used to be commit 0f2503111498e809237e0155962db55dfde8cbfb) --- source4/torture/rpc/samr.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'source4') 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; } -- cgit