1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

r5651: A bit more code in userinfo test and hook up test function to

main torture binary.

rafal
(This used to be commit 94955e5325)
This commit is contained in:
Rafal Szczesniak 2005-03-04 00:24:21 +00:00 committed by Gerald (Jerry) Carter
parent 3a55299221
commit b55b885f1b
2 changed files with 22 additions and 3 deletions

View File

@ -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;

View File

@ -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}};