summaryrefslogtreecommitdiff
path: root/source4/torture/winbind
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-04-16 17:33:58 +0200
committerAndrew Bartlett <abartlet@samba.org>2008-04-16 17:33:58 +0200
commit80ad7025cfb3cd7ec13da461125515fdb10fa94f (patch)
tree4b688284e5d2c41f9e78ad3c45a7c1b605bbcc89 /source4/torture/winbind
parent9586462b8f61f4e37b34f45e58293b143de63cb0 (diff)
downloadsamba-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/torture/winbind')
-rw-r--r--source4/torture/winbind/struct_based.c21
1 files changed, 14 insertions, 7 deletions
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;