From cb5873f36d5f67b51afd9327df114ff7c1b529d0 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 15 Apr 2008 16:31:08 +0200 Subject: Fix some of the winbind tests. Some of the test expectations were incorrect. Andrew Bartlett (This used to be commit bc0e94360edb99e967dac01a3ecff42de0c1c222) --- source4/torture/winbind/struct_based.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/torture/winbind/struct_based.c') diff --git a/source4/torture/winbind/struct_based.c b/source4/torture/winbind/struct_based.c index 0fe2148b75..51ac0e622a 100644 --- a/source4/torture/winbind/struct_based.c +++ b/source4/torture/winbind/struct_based.c @@ -181,7 +181,8 @@ static bool torture_winbind_struct_netbios_name(struct torture_context *torture) expected = torture_setting_string(torture, "winbindd netbios name", lp_netbios_name(torture->lp_ctx)); - + expected = strupper_talloc(torture, expected); + torture_assert_str_equal(torture, rep.data.netbios_name, expected, "winbindd's netbios name doesn't match"); -- cgit From a58df2f54c5847a6a3dddad51465c319f1c387f5 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 16 Apr 2008 16:11:17 +0200 Subject: Fix struct_based winbind test for 'check machine account'. The problem here was that we did not fill in the error strings in the success case, and the testsuite checked against the incorrect 'freindly' error string. Andrew Bartlett (This used to be commit df05f118831245bdb19573711545bdb1b01a0c50) --- source4/torture/winbind/struct_based.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/winbind/struct_based.c') diff --git a/source4/torture/winbind/struct_based.c b/source4/torture/winbind/struct_based.c index 51ac0e622a..f9e4e148c3 100644 --- a/source4/torture/winbind/struct_based.c +++ b/source4/torture/winbind/struct_based.c @@ -262,7 +262,7 @@ static bool torture_winbind_struct_check_machacc(struct torture_context *torture torture_assert_str_equal(torture, rep.data.auth.error_string, - nt_errstr(NT_STATUS_OK), + get_friendly_nt_error_msg(NT_STATUS_OK), "WINBINDD_CHECK_MACHACC ok: error_string"); torture_assert_int_equal(torture, -- cgit From 80ad7025cfb3cd7ec13da461125515fdb10fa94f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 16 Apr 2008 17:33:58 +0200 Subject: 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) --- source4/torture/winbind/struct_based.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'source4/torture/winbind/struct_based.c') 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; -- cgit