diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-04-17 09:36:09 +0200 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-04-17 09:36:09 +0200 |
commit | 30b9c37420100c98df1a538673d508e46517accf (patch) | |
tree | 33ccf13461371c1281a0fc707e66a814a3bc88e9 /source4/torture/winbind/struct_based.c | |
parent | 4bbaf36f6fd85c9d07a16320ad58d7a6ad43fd6c (diff) | |
parent | baad7a7e56e2b0f24885e01672cd9bdc6667a6a8 (diff) | |
download | samba-30b9c37420100c98df1a538673d508e46517accf.tar.gz samba-30b9c37420100c98df1a538673d508e46517accf.tar.bz2 samba-30b9c37420100c98df1a538673d508e46517accf.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
Conflicts:
source/ntvfs/ntvfs_generic.c
(This used to be commit a626a9c69cb2c07c8de69dcfe45361f86d6de58d)
Diffstat (limited to 'source4/torture/winbind/struct_based.c')
-rw-r--r-- | source4/torture/winbind/struct_based.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/source4/torture/winbind/struct_based.c b/source4/torture/winbind/struct_based.c index 0fe2148b75..87378aadb8 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"); @@ -261,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, @@ -294,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))) { @@ -355,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); @@ -367,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 @@ -380,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; @@ -423,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; @@ -484,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; @@ -511,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; } @@ -529,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; |