diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-05-03 14:54:47 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:51:43 -0500 |
commit | af48da52bf39f8055b6f1640bcadeb27aeaead2d (patch) | |
tree | 948a0a860926773aca8539fa3e29caf9bd84279c /source4/torture/rpc | |
parent | 208e09747c242ab5bd59a658033db49efa8d8696 (diff) | |
download | samba-af48da52bf39f8055b6f1640bcadeb27aeaead2d.tar.gz samba-af48da52bf39f8055b6f1640bcadeb27aeaead2d.tar.bz2 samba-af48da52bf39f8055b6f1640bcadeb27aeaead2d.zip |
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)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r-- | source4/torture/rpc/samr.c | 28 |
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; } |