torture/drs: run repl_schema in vampire_2000_dc environment as well
authorBob Campbell <bobcampbell@catalyst.net.nz>
Thu, 2 Feb 2017 21:33:54 +0000 (10:33 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 14 Feb 2017 01:20:07 +0000 (02:20 +0100)
This will be necessary as linked attributes are handled differently in
Windows 2000.

We also only check msDS-IntId if we have a functional level of > Windows
2000, as this attribute is not present on lower domain function levels.

Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11139

source4/selftest/tests.py
source4/torture/drs/python/repl_schema.py

index 93635d947cd489c704b1f6b4d0218fa648203f40..dec26b418ab0d3499dd1821ce1f9d5ddc37214e0 100755 (executable)
@@ -688,11 +688,6 @@ for env in ['vampire_dc', 'promoted_dc']:
                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
                            environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
-    planoldpythontestsuite(env, "repl_schema",
-                           extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
-                           name="samba4.drs.repl_schema.python(%s)" % env,
-                           environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
-                           extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
     planoldpythontestsuite(env, "repl_move",
                            extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
                            name="samba4.drs.repl_move.python(%s)" % env,
@@ -709,6 +704,12 @@ for env in ['vampire_dc', 'promoted_dc']:
                            environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
                            extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
 
+for env in ['vampire_dc', 'promoted_dc', 'vampire_2000_dc']:
+    planoldpythontestsuite(env, "repl_schema",
+                           extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')],
+                           name="samba4.drs.repl_schema.python(%s)" % env,
+                           environ={'DC1': "$DC_SERVER", 'DC2': '$%s_SERVER' % env.upper()},
+                           extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
 
 planoldpythontestsuite("chgdcpass:local", "samba.tests.blackbox.samba_dnsupdate",
                        environ={'DNS_SERVER_IP': '$SERVER_IP'})
index 1387ec2a41c11cda2ab5205688d116acf4853207..cf02608a4ddda8259cccb9c90e9f91be67cb8eb1 100644 (file)
@@ -43,6 +43,7 @@ import ldb
 import drs_base
 from samba.dcerpc import drsuapi, misc
 from samba.drs_utils import drs_DsBind
+from samba import dsdb
 
 class DrsReplSchemaTestCase(drs_base.DrsBaseTestCase):
 
@@ -262,14 +263,19 @@ class DrsReplSchemaTestCase(drs_base.DrsBaseTestCase):
         self._check_object(c_dn)
         self._check_object(a_dn)
 
-        res = self.ldb_dc1.search(base=a_dn,
+        res = self.ldb_dc1.search(base="",
                                   scope=SCOPE_BASE,
-                                  attrs=["msDS-IntId"])
-        self.assertEqual(1, len(res))
-        self.assertTrue("msDS-IntId" in res[0])
-        int_id = int(res[0]["msDS-IntId"][0])
-        if int_id < 0:
-            int_id += (1 << 32)
+                                  attrs=["domainFunctionality"])
+
+        if int(res[0]["domainFunctionality"][0]) > dsdb.DS_DOMAIN_FUNCTION_2000:
+            res = self.ldb_dc1.search(base=a_dn,
+                                      scope=SCOPE_BASE,
+                                      attrs=["msDS-IntId"])
+            self.assertEqual(1, len(res))
+            self.assertTrue("msDS-IntId" in res[0])
+            int_id = int(res[0]["msDS-IntId"][0])
+            if int_id < 0:
+                int_id += (1 << 32)
 
         dc_guid_1 = self.ldb_dc1.get_invocation_id()