diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2010-04-22 04:39:04 +0300 |
---|---|---|
committer | Kamen Mazdrashki <kamenim@samba.org> | 2010-04-29 04:54:05 +0300 |
commit | da127d44e31306b4865e682be362fd9672d8201f (patch) | |
tree | 05ee74bfc2ca0033f777bf3ab55f6241b3adfcb2 /source4/lib/ldb/tests/python | |
parent | 5bf12e101aa729619758c38af5c682b2cd06ea70 (diff) | |
download | samba-da127d44e31306b4865e682be362fd9672d8201f.tar.gz samba-da127d44e31306b4865e682be362fd9672d8201f.tar.bz2 samba-da127d44e31306b4865e682be362fd9672d8201f.zip |
s4/test: schemaInfo may not to be set yet
On newly provisioned Forest schemaInfo is not initially set.
It should be created after firs Schema modification
Diffstat (limited to 'source4/lib/ldb/tests/python')
-rwxr-xr-x | source4/lib/ldb/tests/python/dsdb_schema_info.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/source4/lib/ldb/tests/python/dsdb_schema_info.py b/source4/lib/ldb/tests/python/dsdb_schema_info.py index 5fd0ccb73a..f0c8c14d6d 100755 --- a/source4/lib/ldb/tests/python/dsdb_schema_info.py +++ b/source4/lib/ldb/tests/python/dsdb_schema_info.py @@ -62,18 +62,26 @@ class SchemaInfoTestCase(samba.tests.RpcInterfaceTestCase): # get DC invocation_id self.invocation_id = GUID(ldb.get_invocation_id()) + def tearDown(self): super(SchemaInfoTestCase, self).tearDown() def _getSchemaInfo(self): - schema_info_data = ldb.searchone(attribute="schemaInfo", - basedn=self.schema_dn, - expression="(objectClass=*)", - scope=SCOPE_BASE) - self.assertEqual(len(schema_info_data), 21) - schema_info = ndr_unpack(schemaInfoBlob, schema_info_data) - self.assertEqual(schema_info.marker, 0xFF) + try: + schema_info_data = ldb.searchone(attribute="schemaInfo", + basedn=self.schema_dn, + expression="(objectClass=*)", + scope=SCOPE_BASE) + self.assertEqual(len(schema_info_data), 21) + schema_info = ndr_unpack(schemaInfoBlob, schema_info_data) + self.assertEqual(schema_info.marker, 0xFF) + except KeyError: + # create default schemaInfo if + # attribute value is not created yet + schema_info = schemaInfoBlob() + schema_info.revision = 0 + schema_info.invocation_id = self.invocation_id return schema_info def _checkSchemaInfo(self, schi_before, schi_after): |