mirror of
https://github.com/samba-team/samba.git
synced 2025-07-31 20:22:15 +03:00
KCC: unconnected graph test
Uses a unconnected 5 DC single site database to test Douglas Bagnalls patch which corrected a mix up between a str and an object which caused infinite recursion and a method call on a None type. This test patch originally triggered an edge case bug. This bug is triggered by code to create additional edges which normally never ran. In normal cases, the leftover connections made during a join would prevent these additional edges from being created. Signed-off-by: Clive Ferreira <cliveferreira@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
This commit is contained in:
committed by
Andrew Bartlett
parent
1a5445ca4e
commit
70b9f8308d
@ -41,6 +41,12 @@ unix_now = int(time.time())
|
||||
MULTISITE_LDIF = os.path.join(os.environ['SRCDIR_ABS'],
|
||||
"testdata/ldif-utils-test-multisite.ldif")
|
||||
|
||||
|
||||
# UNCONNECTED_LDIF is a single site, unconnected 5DC database that was
|
||||
# created using samba-tool domain join in testenv.
|
||||
UNCONNECTED_LDIF = os.path.join(os.environ['SRCDIR_ABS'],
|
||||
"testdata/unconnected-intrasite.ldif")
|
||||
|
||||
MULTISITE_LDIF_DSAS = (
|
||||
("CN=WIN08,CN=Servers,CN=Site-4,CN=Sites,CN=Configuration,DC=ad,DC=samba,DC=example,DC=com",
|
||||
"Site-4"),
|
||||
@ -192,6 +198,24 @@ class KCCMultisiteLdifTests(samba.tests.TestCaseInTempDir):
|
||||
attempt_live_connections=False)
|
||||
self.remove_files(tmpdb)
|
||||
|
||||
def test_unconnected_db(self):
|
||||
"""Check that the KCC generates errors on a unconnected db
|
||||
"""
|
||||
my_kcc = self._get_kcc('test-verify', verify=True)
|
||||
tmpdb = os.path.join(self.tempdir, 'verify-tmpdb')
|
||||
my_kcc.import_ldif(tmpdb, self.lp, UNCONNECTED_LDIF)
|
||||
|
||||
try:
|
||||
my_kcc.run(None,
|
||||
self.lp, self.creds,
|
||||
attempt_live_connections=False)
|
||||
except samba.kcc.graph_utils.GraphError:
|
||||
pass
|
||||
except Exception:
|
||||
self.fail("Did not expect this error.")
|
||||
finally:
|
||||
self.remove_files(tmpdb)
|
||||
|
||||
def test_dotfiles(self):
|
||||
"""Check that KCC writes dot_files when asked.
|
||||
"""
|
||||
|
Reference in New Issue
Block a user