torture: Cope with WINBINDD_SHOW_SEQUENCE failure for fake trusts
authorAndrew Bartlett <abartlet@samba.org>
Mon, 28 May 2018 10:35:20 +0000 (22:35 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 29 May 2018 00:31:40 +0000 (02:31 +0200)
This test has been flapping and we should not be checking the
sequence number of remote trusts in a loop like this.  We can write
a test against the trusts we specifically set up if we want to check
remote sequence numbers (and connectivity) against actually working
domains.

When flapping the previous version of the test gave:

 WARNING!: ../source4/torture/winbind/struct_based.c:812: WINBINDD_SHOW_SEQUENCE returned 0, expected 1: WINBINDD_SHOW_SEQUENCE
 WARNING!: WINBINDD_SHOW_SEQUENCE on domain torturedom failed

 Trust list for WINBINDD_SHOW_SEQUENCE was:
 BUILTIN
 S4MEMBER
 SAMBADOMAIN
 torturedom

 WARNING!: ../source4/torture/winbind/struct_based.c:812: WINBINDD_SHOW_SEQUENCE returned 0, expected 1: WINBINDD_SHOW_SEQUENCE
 WARNING!: WINBINDD_SHOW_SEQUENCE on domain TORTURE302 failed

 Trust list for WINBINDD_SHOW_SEQUENCE was:
 BUILTIN
 S4MEMBER
 SAMBADOMAIN
 TORTURE302
 TORTURE306

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue May 29 02:31:40 CEST 2018 on sn-devel-144

source4/torture/winbind/struct_based.c

index 7ea5aa785ae9cc0dd9c45fbc00e72fcd918684e0..9745b621ca96d92cc2d76013b12d05e9eda22eef 100644 (file)
@@ -816,11 +816,27 @@ static bool torture_winbind_struct_show_sequence(struct torture_context *torture
                                        "domain %s failed\n",
                                        req.domain_name);
 
+                       /*
+                        * Only fail for the first two domain that we
+                        * check specially below, otherwise we fail on
+                        * trusts generated by the LSA torture test
+                        * that do not really exist.
+                        */
+                       if (i > 1) {
+                               /*
+                                * Do not confirm the sequence numbers
+                                * below
+                                */
+                               return true;
+                       }
+
                        torture_comment(torture,
-                                       "Trust list for "
-                                       "WINBINDD_SHOW_SEQUENCE was:\n");
+                                       "Full trust list for "
+                                       "WINBINDD_SHOW_SEQUENCE "
+                                       "test was:\n");
                        for (i=0; domlist[i].netbios_name; i++) {
-                               torture_comment(torture, "%s\n",
+                               torture_comment(torture,
+                                               "%s\n",
                                                domlist[i].netbios_name);
                        }