diff options
author | Andrew Bartlett <abartlet@samba.org> | 2008-04-16 17:33:58 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-04-16 17:33:58 +0200 |
commit | 80ad7025cfb3cd7ec13da461125515fdb10fa94f (patch) | |
tree | 4b688284e5d2c41f9e78ad3c45a7c1b605bbcc89 /source4 | |
parent | 9586462b8f61f4e37b34f45e58293b143de63cb0 (diff) | |
download | samba-80ad7025cfb3cd7ec13da461125515fdb10fa94f.tar.gz samba-80ad7025cfb3cd7ec13da461125515fdb10fa94f.tar.bz2 samba-80ad7025cfb3cd7ec13da461125515fdb10fa94f.zip |
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 29d5de9e8fb69346e29a95c6fcaefabd018c9447)
Diffstat (limited to 'source4')
-rwxr-xr-x | source4/selftest/samba4_tests.sh | 2 | ||||
-rw-r--r-- | source4/torture/winbind/struct_based.c | 21 |
2 files changed, 15 insertions, 8 deletions
diff --git a/source4/selftest/samba4_tests.sh b/source4/selftest/samba4_tests.sh index a021fff892..730846dae3 100755 --- a/source4/selftest/samba4_tests.sh +++ b/source4/selftest/samba4_tests.sh @@ -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\"" diff --git a/source4/torture/winbind/struct_based.c b/source4/torture/winbind/struct_based.c index f9e4e148c3..87378aadb8 100644 --- a/source4/torture/winbind/struct_based.c +++ b/source4/torture/winbind/struct_based.c @@ -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; |