diff options
author | Rafal Szczesniak <mimir@samba.org> | 2005-03-04 00:24:21 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:10:56 -0500 |
commit | b55b885f1b19bf7a6a25d6dad518045c7554e2da (patch) | |
tree | b4bab4ea75ffb944451c96bed2e12cd4cc279ce4 | |
parent | 3a5529922178fbc5e759da89ac1ab0fa3038ee15 (diff) | |
download | samba-b55b885f1b19bf7a6a25d6dad518045c7554e2da.tar.gz samba-b55b885f1b19bf7a6a25d6dad518045c7554e2da.tar.bz2 samba-b55b885f1b19bf7a6a25d6dad518045c7554e2da.zip |
r5651: A bit more code in userinfo test and hook up test function to
main torture binary.
rafal
(This used to be commit 94955e5325ceddd35673da74afb19d1676b5b23c)
-rw-r--r-- | source4/torture/libnet/userinfo.c | 22 | ||||
-rw-r--r-- | source4/torture/torture.c | 3 |
2 files changed, 22 insertions, 3 deletions
diff --git a/source4/torture/libnet/userinfo.c b/source4/torture/libnet/userinfo.c index 4a28079251..ca5d5ab428 100644 --- a/source4/torture/libnet/userinfo.c +++ b/source4/torture/libnet/userinfo.c @@ -47,6 +47,8 @@ static BOOL test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, r2.in.connect_handle = &h; r2.in.domain_name = domname; + printf("domain lookup\n"); + status = dcerpc_samr_LookupDomain(p, mem_ctx, &r2); if (!NT_STATUS_IS_OK(status)) { printf("LookupDomain failed - %s\n", nt_errstr(status)); @@ -58,6 +60,8 @@ static BOOL test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, r3.in.sid = r2.out.sid; r3.out.domain_handle = &domain_handle; + printf("opening domain\n"); + status = dcerpc_samr_OpenDomain(p, mem_ctx, &r3); if (!NT_STATUS_IS_OK(status)) { printf("OpenDomain failed - %s\n", nt_errstr(status)); @@ -71,14 +75,17 @@ static BOOL test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, BOOL torture_userinfo(void) { NTSTATUS status; + const char *binding; struct dcerpc_pipe *p; + struct dcerpc_binding b; TALLOC_CTX *mem_ctx; BOOL ret = True; struct policy_handle h; - struct samr_String name = { 4, 4, "TEST" }; + struct samr_String name; mem_ctx = talloc_init("test_userinfo"); - + binding = lp_parm_string(-1, "torture", "binding"); + status = torture_rpc_connection(&p, DCERPC_SAMR_NAME, DCERPC_SAMR_UUID, @@ -88,12 +95,21 @@ BOOL torture_userinfo(void) return False; } + status = dcerpc_parse_binding(mem_ctx, binding, &b); + if (!NT_STATUS_IS_OK(status)) { + printf("failed to parse dcerpc binding '%s'\n", binding); + talloc_free(mem_ctx); + ret = False; + goto done; + } + name.string = b.host; + if (!test_opendomain(p, mem_ctx, &h, &name)) { ret = False; } +done: talloc_free(mem_ctx); - torture_rpc_close(p); return ret; diff --git a/source4/torture/torture.c b/source4/torture/torture.c index b589902b66..09be1e1fe3 100644 --- a/source4/torture/torture.c +++ b/source4/torture/torture.c @@ -2426,6 +2426,9 @@ static struct { {"NBT-REGISTER", torture_nbt_register, 0}, {"NBT-WINS", torture_nbt_wins, 0}, {"NBT-WINSREPLICATION", torture_nbt_winsreplication, 0}, + + /* libnet tests */ + {"NET-USERINFO", torture_userinfo, 0}, {NULL, NULL, 0}}; |