diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-09-21 10:43:21 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:07:04 -0500 |
commit | fc9262d57cfa2b912e7a81bb6499b3d9af22865d (patch) | |
tree | adbb7d495b0974fc7c870aa8d41bc994289346c7 /source4/torture/winbind | |
parent | 18d4608e4368b2369f320eb870ae01d1746876c7 (diff) | |
download | samba-fc9262d57cfa2b912e7a81bb6499b3d9af22865d.tar.gz samba-fc9262d57cfa2b912e7a81bb6499b3d9af22865d.tar.bz2 samba-fc9262d57cfa2b912e7a81bb6499b3d9af22865d.zip |
r25280: call WINBINDD_GETDCNAME for each domain returned from WINBINDD_LIST_TRUSTDOMS
metze
(This used to be commit c06e7aebc5998da0a3b1d1f2021e6f49c31071f5)
Diffstat (limited to 'source4/torture/winbind')
-rw-r--r-- | source4/torture/winbind/struct_based.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/source4/torture/winbind/struct_based.c b/source4/torture/winbind/struct_based.c index 5b6ce059a1..9cc7432816 100644 --- a/source4/torture/winbind/struct_based.c +++ b/source4/torture/winbind/struct_based.c @@ -219,21 +219,37 @@ static bool torture_winbind_struct_list_trustdom(struct torture_context *torture static bool torture_winbind_struct_getdcname(struct torture_context *torture) { - struct winbindd_request req; - struct winbindd_response rep; + bool ok; + bool strict = torture_setting_bool(torture, "strict mode", false); + struct torture_trust_domain *listd = NULL; + uint32_t i; torture_comment(torture, "Running WINBINDD_GETDCNAME (struct based)\n"); - ZERO_STRUCT(req); - ZERO_STRUCT(rep); + ok = get_trusted_domains(torture, &listd); + torture_assert(torture, ok, "failed to get trust list"); - fstrcpy(req.domain_name, lp_workgroup()); + for (i=0; listd[i].netbios_name; i++) { + struct winbindd_request req; + struct winbindd_response rep; - DO_STRUCT_REQ_REP(WINBINDD_GETDCNAME, &req, &rep); + ZERO_STRUCT(req); + ZERO_STRUCT(rep); - /* - * TODO: test all trusted domains - */ + fstrcpy(req.domain_name, listd[i].netbios_name); + + ok = true; + DO_STRUCT_REQ_REP_EXT(WINBINDD_GETDCNAME, &req, &rep, + NSS_STATUS_SUCCESS, + (i <2 || strict), ok = false, + talloc_asprintf(torture, "DOMAIN '%s'", + req.domain_name)); + if (!ok) continue; + + /* TODO: check rep.data.dc_name; */ + torture_comment(torture, "DOMAIN '%s' => DCNAME '%s'\n", + req.domain_name, rep.data.dc_name); + } return true; } |