1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

Adjust the expectations of the struct based winbind test.

These expectations (such as what happens when we have no trusted
domains) were incorrect, compared with Samba3 (which is the reference
for this protocol).

Andrew Bartlett
(This used to be commit 29d5de9e8f)
This commit is contained in:
Andrew Bartlett 2008-04-16 17:33:58 +02:00
parent 9586462b8f
commit 80ad7025cf
2 changed files with 15 additions and 8 deletions

View File

@ -301,7 +301,7 @@ for t in $NBT_TESTS; do
plansmbtorturetest "$t" dc //\$SERVER/_none_ -U\$USERNAME%\$PASSWORD
done
WB_OPTS="--option=\"torture:strict mode=yes\""
WB_OPTS="--option=\"torture:strict mode=no\""
WB_OPTS="${WB_OPTS} --option=\"torture:timelimit=1\""
WB_OPTS="${WB_OPTS} --option=\"torture:winbindd separator=/\""
WB_OPTS="${WB_OPTS} --option=\"torture:winbindd private pipe dir=\$WINBINDD_PRIV_PIPE_DIR\""

View File

@ -295,6 +295,10 @@ static bool get_trusted_domains(struct torture_context *torture,
DO_STRUCT_REQ_REP(WINBINDD_LIST_TRUSTDOM, &req, &rep);
extra_data = (char *)rep.extra_data.data;
if (!extra_data) {
return true;
}
torture_assert(torture, extra_data, "NULL trust list");
while (next_token(&extra_data, line, "\n", sizeof(fstring))) {
@ -356,7 +360,6 @@ static bool torture_winbind_struct_list_trustdom(struct torture_context *torture
DO_STRUCT_REQ_REP(WINBINDD_LIST_TRUSTDOM, &req, &rep);
list1 = (char *)rep.extra_data.data;
torture_assert(torture, list1, "NULL trust list");
torture_comment(torture, "%s\n", list1);
@ -368,7 +371,6 @@ static bool torture_winbind_struct_list_trustdom(struct torture_context *torture
DO_STRUCT_REQ_REP(WINBINDD_LIST_TRUSTDOM, &req, &rep);
list2 = (char *)rep.extra_data.data;
torture_assert(torture, list2, "NULL trust list");
/*
* The list_all_domains parameter should be ignored
@ -381,7 +383,7 @@ static bool torture_winbind_struct_list_trustdom(struct torture_context *torture
ok = get_trusted_domains(torture, &listd);
torture_assert(torture, ok, "failed to get trust list");
for (i=0; listd[i].netbios_name; i++) {
for (i=0; listd && listd[i].netbios_name; i++) {
if (i == 0) {
struct dom_sid *builtin_sid;
@ -424,7 +426,7 @@ static bool torture_winbind_struct_domain_info(struct torture_context *torture)
ok = get_trusted_domains(torture, &listd);
torture_assert(torture, ok, "failed to get trust list");
for (i=0; listd[i].netbios_name; i++) {
for (i=0; listd && listd[i].netbios_name; i++) {
struct winbindd_request req;
struct winbindd_response rep;
struct dom_sid *sid;
@ -485,14 +487,14 @@ static bool torture_winbind_struct_getdcname(struct torture_context *torture)
bool ok;
bool strict = torture_setting_bool(torture, "strict mode", false);
struct torture_trust_domain *listd = NULL;
uint32_t i;
uint32_t i, count = 0;
torture_comment(torture, "Running WINBINDD_GETDCNAME (struct based)\n");
ok = get_trusted_domains(torture, &listd);
torture_assert(torture, ok, "failed to get trust list");
for (i=0; listd[i].netbios_name; i++) {
for (i=0; listd && listd[i].netbios_name; i++) {
struct winbindd_request req;
struct winbindd_response rep;
@ -512,8 +514,13 @@ static bool torture_winbind_struct_getdcname(struct torture_context *torture)
/* TODO: check rep.data.dc_name; */
torture_comment(torture, "DOMAIN '%s' => DCNAME '%s'\n",
req.domain_name, rep.data.dc_name);
count++;
}
if (strict) {
torture_assert(torture, count > 0,
"WiNBINDD_GETDCNAME was not tested");
}
return true;
}
@ -530,7 +537,7 @@ static bool torture_winbind_struct_dsgetdcname(struct torture_context *torture)
ok = get_trusted_domains(torture, &listd);
torture_assert(torture, ok, "failed to get trust list");
for (i=0; listd[i].netbios_name; i++) {
for (i=0; listd && listd[i].netbios_name; i++) {
struct winbindd_request req;
struct winbindd_response rep;