1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-27 07:42:04 +03:00

samba-tool visualize: use correct DC in graph label

We have been using a random DC (depending to hash order, which was not
random enough on Python 2.7 to affect the tests).

Reported-by: Noel Power <noel.power@suse.com>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <noel.power@suse.com>
This commit is contained in:
Douglas Bagnall
2018-04-20 10:52:31 +12:00
committed by Noel Power
parent a23d805475
commit f477a7585b
2 changed files with 13 additions and 8 deletions

View File

@ -205,12 +205,14 @@ class SambaToolVisualizeLdif(SambaToolCmdTest):
self.assertTrue(c not in ascii, 'ASCII should not contain %s' % c)
def test_forced_local_dsa(self):
# the forced_local_dsa shouldn't make any difference
# the forced_local_dsa shouldn't make any difference, except
# for the title line.
result, target, err = self.runsubcmd("visualize", "ntdsconn",
'-H', self.dburl,
'--color=no', '-S')
self.assertCmdSuccess(result, target, err)
files = []
target = target.strip().split('\n', 1)[1]
for cn, site in MULTISITE_LDIF_DSAS:
dsa = DN_TEMPLATE % (cn, site)
samdb, dbfile = samdb_from_ldif(MULTISITE_LDIF,
@ -222,7 +224,10 @@ class SambaToolVisualizeLdif(SambaToolCmdTest):
'-H', 'tdb://' + dbfile,
'--color=no', '-S')
self.assertCmdSuccess(result, out, err)
self.assertStringsEqual(target, out)
# Separate out the title line, which will differ in the DN.
title, body = out.strip().split('\n', 1)
self.assertStringsEqual(target, body)
self.assertIn(cn, title)
files.append(dbfile)
self.remove_files(*files)
@ -342,7 +347,7 @@ class SambaToolVisualizeLdif(SambaToolCmdTest):
EXPECTED_DOT_MULTISITE_NO_KEY = r"""/* generated by samba */
digraph A_samba_tool_production {
label="NTDS Connections known to CN=WIN07,CN=Servers,CN=Site-4,CN=Sites,CN=Configuration,DC=ad,DC=samba,DC=example,DC=com";
label="NTDS Connections known to CN=WIN01,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=ad,DC=samba,DC=example,DC=com";
fontsize=10;
node[fontname=Helvetica; fontsize=10];
@ -382,7 +387,7 @@ node[fontname=Helvetica; fontsize=10];
EXPECTED_DOT_NTDSCONN_DISCONNECTED = r"""/* generated by samba */
digraph A_samba_tool_production {
label="NTDS Connections known to CN=SERVER2,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=samba,DC=example,DC=com";
label="NTDS Connections known to CN=LOCALDC,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=samba,DC=example,DC=com";
fontsize=10;
node[fontname=Helvetica; fontsize=10];
@ -435,7 +440,7 @@ key_0__label -> elision0 [style=invis; weight=9]
"""
EXPECTED_DISTANCE_GRAPH_WITH_KEY = """
NTDS Connections known to CN=SERVER2,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=samba,DC=example,DC=com
NTDS Connections known to CN=LOCALDC,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=samba,DC=example,DC=com
destination
,-------- *,CN=CLIENT+
|,------- *,CN=LOCALDC+