s3 selftest: Fix the WINBINDD_GETDCNAMEe test.
authorKai Blin <kai@samba.org>
Wed, 13 Jan 2010 13:49:26 +0000 (14:49 +0100)
committerKai Blin <kai@samba.org>
Thu, 14 Jan 2010 14:18:34 +0000 (15:18 +0100)
The WINBINDD_GETDCNAME test expected an NSS_STATUS_SUCCESS return from all
calls. However, this does not apply for BUILTIN and the DC's own domain.
Make the test work again by skipping those two.

source4/torture/winbind/struct_based.c

index de1507a67c9b32475154822e521c89eacc923231..d1ae1e5667b3b40d7f9d66a3429c62abde0d31cb 100644 (file)
@@ -473,6 +473,9 @@ static bool torture_winbind_struct_getdcname(struct torture_context *torture)
 {
        bool ok;
        bool strict = torture_setting_bool(torture, "strict mode", false);
+       const char *domain_name = torture_setting_string(torture,
+                                       "winbindd netbios domain",
+                                       lp_workgroup(torture->lp_ctx));
        struct torture_trust_domain *listd = NULL;
        uint32_t i, count = 0;
 
@@ -485,6 +488,13 @@ static bool torture_winbind_struct_getdcname(struct torture_context *torture)
                struct winbindd_request req;
                struct winbindd_response rep;
 
+               /* getdcname is not expected to work on "BUILTIN" or our own
+                * domain */
+               if (strequal(listd[i].netbios_name, "BUILTIN") ||
+                   strequal(listd[i].netbios_name, domain_name)) {
+                       continue;
+               }
+
                ZERO_STRUCT(req);
                ZERO_STRUCT(rep);