From 7b4f266ef059fbab5ed1cf50ca347fb9985f02dc Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 5 Oct 2014 16:00:47 +1300 Subject: torture: Reorder torture_winbind_struct_domain_info tests This tries to ensure we get enough information to debug this intermittent failure. I think this may be a real failure, but it is hard to tell without more info. This patch prints out the full details of what the domain returned before doing the assertions. Andrew Bartlett Signed-off-by: Andrew Bartlett Reviewed-by: Michael Adam --- source4/torture/winbind/struct_based.c | 37 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/winbind/struct_based.c b/source4/torture/winbind/struct_based.c index d47d068909f..ef27b057a28 100644 --- a/source4/torture/winbind/struct_based.c +++ b/source4/torture/winbind/struct_based.c @@ -428,22 +428,6 @@ static bool torture_winbind_struct_domain_info(struct torture_context *torture) DO_STRUCT_REQ_REP(WINBINDD_DOMAIN_INFO, &req, &rep); - torture_assert_str_equal(torture, - rep.data.domain_info.name, - listd[i].netbios_name, - "Netbios domain name doesn't match"); - - torture_assert_str_equal(torture, - rep.data.domain_info.alt_name, - listd[i].dns_name, - "DNS domain name doesn't match"); - - sid = dom_sid_parse_talloc(torture, rep.data.domain_info.sid); - torture_assert(torture, sid, "Failed to parse SID"); - - ok = dom_sid_equal(listd[i].sid, sid); - torture_assert(torture, ok, "SID's doesn't match"); - if (rep.data.domain_info.primary) { flagstr = talloc_strdup_append(flagstr, "PR "); } @@ -462,10 +446,27 @@ static bool torture_winbind_struct_domain_info(struct torture_context *torture) flagstr = talloc_strdup_append(flagstr, "NA "); } - torture_comment(torture, "DOMAIN '%s' => '%s' [%s]\n", + torture_comment(torture, "DOMAIN '%s' => '%s' [%s] [%s]\n", rep.data.domain_info.name, rep.data.domain_info.alt_name, - flagstr); + flagstr, + rep.data.domain_info.sid); + + sid = dom_sid_parse_talloc(torture, rep.data.domain_info.sid); + torture_assert(torture, sid, "Failed to parse SID"); + + ok = dom_sid_equal(listd[i].sid, sid); + torture_assert(torture, ok, "SID's doesn't match"); + + torture_assert_str_equal(torture, + rep.data.domain_info.name, + listd[i].netbios_name, + "Netbios domain name doesn't match"); + + torture_assert_str_equal(torture, + rep.data.domain_info.alt_name, + listd[i].dns_name, + "DNS domain name doesn't match"); } return true; -- cgit v1.2.1