diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-02-02 14:51:27 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-02-02 06:09:53 +0100 |
commit | f19c1e37c7d56ad9037e98067ca041a18a479e78 (patch) | |
tree | 6f8cc6a51c56054926291c170ef83aef2aa54d40 | |
parent | 2e865bed0aa6d28d2543ca6ad0a9c3d73c7db53f (diff) | |
download | samba-f19c1e37c7d56ad9037e98067ca041a18a479e78.tar.gz samba-f19c1e37c7d56ad9037e98067ca041a18a479e78.tar.bz2 samba-f19c1e37c7d56ad9037e98067ca041a18a479e78.zip |
s4-dsdb Add tests to ensure we don't break the rootDSE function levels again
This both checks that the levels make sense, and they match what they
should be based on in the DB.
Andrew Bartlett
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Feb 2 06:09:53 CET 2011 on sn-devel-104
-rwxr-xr-x | source4/dsdb/tests/python/ldap.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py index 2b7e8fa4d1..d67ccc44a7 100755 --- a/source4/dsdb/tests/python/ldap.py +++ b/source4/dsdb/tests/python/ldap.py @@ -2641,6 +2641,39 @@ class BaseDnTests(unittest.TestCase): self.assertTrue("CN=Sites" in res[0]["serverName"][0]) self.assertFalse("CN=NTDS Settings" in res[0]["serverName"][0]) + def test_functionality(self): + """Testing the server paths in rootDSE""" + res = self.ldb.search("", scope=SCOPE_BASE, + attrs=["forestFunctionality", "domainFunctionality", "domainControllerFunctionality"]) + self.assertEquals(len(res), 1) + self.assertEquals(len(res[0]["forestFunctionality"]), 1) + self.assertEquals(len(res[0]["domainFunctionality"]), 1) + self.assertEquals(len(res[0]["domainControllerFunctionality"]), 1) + + self.assertTrue(int(res[0]["forestFunctionality"][0]) <= int(res[0]["domainFunctionality"][0])) + self.assertTrue(int(res[0]["domainControllerFunctionality"][0]) >= int(res[0]["domainFunctionality"][0])) + + res2 = self.ldb.search("", scope=SCOPE_BASE, + attrs=["dsServiceName", "serverName"]) + self.assertEquals(len(res2), 1) + self.assertEquals(len(res2[0]["dsServiceName"]), 1) + + res3 = self.ldb.search(res2[0]["dsServiceName"][0], scope=SCOPE_BASE, attrs=["msDS-Behavior-Version"]) + self.assertEquals(len(res3), 1) + print res3[0] + self.assertEquals(len(res3[0]["msDS-Behavior-Version"]), 1) + self.assertEquals(int(res[0]["domainControllerFunctionality"][0]), int(res3[0]["msDS-Behavior-Version"][0])) + + res4 = self.ldb.search(ldb.domain_dn(), scope=SCOPE_BASE, attrs=["msDS-Behavior-Version"]) + self.assertEquals(len(res4), 1) + self.assertEquals(len(res4[0]["msDS-Behavior-Version"]), 1) + self.assertEquals(int(res[0]["domainFunctionality"][0]), int(res4[0]["msDS-Behavior-Version"][0])) + + res5 = self.ldb.search("cn=partitions," + str(ldb.get_config_basedn()), scope=SCOPE_BASE, attrs=["msDS-Behavior-Version"]) + self.assertEquals(len(res5), 1) + self.assertEquals(len(res5[0]["msDS-Behavior-Version"]), 1) + self.assertEquals(int(res[0]["forestFunctionality"][0]), int(res5[0]["msDS-Behavior-Version"][0])) + def test_dnsHostname(self): """Testing the DNS hostname in rootDSE""" res = self.ldb.search("", scope=SCOPE_BASE, |