From: Bob Campbell Date: Thu, 2 Feb 2017 21:33:54 +0000 (+1300) Subject: torture/drs: run repl_schema in vampire_2000_dc environment as well X-Git-Tag: talloc-2.1.9~196 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfe423a6607e2b80d1fd946bcaf303c0be2b757b;p=thirdparty%2Fsamba.git torture/drs: run repl_schema in vampire_2000_dc environment as well 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 Reviewed-by: Garming Sam Reviewed-by: Andrew Bartlett BUG: https://bugzilla.samba.org/show_bug.cgi?id=11139 --- diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index 93635d947cd..dec26b418ab 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -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'}) diff --git a/source4/torture/drs/python/repl_schema.py b/source4/torture/drs/python/repl_schema.py index 1387ec2a41c..cf02608a4dd 100644 --- a/source4/torture/drs/python/repl_schema.py +++ b/source4/torture/drs/python/repl_schema.py @@ -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()