1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

KCC: rename "fully_connected" check, "complete"

We also change some of the graphs to do only the relevent validations.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall 2015-03-12 12:00:03 +13:00 committed by Andrew Bartlett
parent 2a01bcec90
commit 0b17932682
2 changed files with 14 additions and 14 deletions

View File

@ -2377,7 +2377,7 @@ def write_dot_file(basename, edge_list, vertices=None, label=None, destdir=None,
class KCCGraphError(Exception):
pass
def verify_graph_fully_connected(edges, vertices, edge_vertices):
def verify_graph_complete(edges, vertices, edge_vertices):
"""The graph is complete, which is to say there is an edge between
every pair of nodes."""
for v in vertices:
@ -2598,7 +2598,7 @@ def verify_and_dot(basename, edges, vertices=None, label=None, destdir=None,
debug=debug)
if dot_files:
write_dot_file(basename, edges, vertices=vertices, label=label, destdir=destdir,
reformat_labels=reformat_labels, directed=directed)
reformat_labels=reformat_labels, directed=directed, debug=debug)
def list_verify_tests():
for k, v in sorted(globals().items()):

View File

@ -1677,7 +1677,7 @@ class KCC(object):
for a, b in itertools.chain(*(itertools.combinations(edge.vertices, 2)
for edge in e_set.edges))]
graph_nodes = [v.site.site_dnstr for v in graph.vertices]
verify_properties = ('fully_connected', 'connected', 'multi_edge_forest', 'forest',
verify_properties = ('complete', 'connected', 'multi_edge_forest', 'forest',
'directed_double_ring')
if opts.dot_files:
@ -1709,7 +1709,8 @@ class KCC(object):
if opts.verify or opts.dot_files:
graph_edges = [(e.v1.site.site_dnstr, e.v2.site.site_dnstr) for e in internal_edges]
graph_nodes = [v.site.site_dnstr for v in graph.vertices]
verify_properties = ('fully_connected', 'connected', 'multi_edge_forest', 'forest')
verify_properties = ('complete', 'connected', 'multi_edge_forest', 'forest',
'directed_double_ring')
verify_and_dot('prekruskal', graph_edges, graph_nodes, label=label,
properties=verify_properties, debug=DEBUG, verify=opts.verify,
dot_files=opts.dot_files)
@ -1731,7 +1732,7 @@ class KCC(object):
if opts.verify or opts.dot_files:
graph_edges = [(e.v1.site.site_dnstr, e.v2.site.site_dnstr) for e in internal_edges]
graph_nodes = [v.site.site_dnstr for v in graph.vertices]
verify_properties = ('fully_connected', 'connected', 'multi_edge_forest', 'forest')
verify_properties = ('complete', 'connected', 'multi_edge_forest', 'forest', 'directed_double_ring')
verify_and_dot('postkruskal', graph_edges, graph_nodes, label=label,
properties=verify_properties, debug=DEBUG, verify=opts.verify,
dot_files=opts.dot_files)
@ -2153,10 +2154,10 @@ class KCC(object):
dot_edges.append((v2, v1.dsa_dnstr))
dot_vertices.add(v2)
verify_properties = ('fully_connected', 'connected', 'multi_edge_forest', 'forest')
verify_properties = ('connected', 'directed_double_ring')
verify_and_dot('intrasite_pre_ntdscon', dot_edges, dot_vertices, label=site_local.site_dnstr,
properties=verify_properties, debug=DEBUG, verify=opts.verify,
dot_files=opts.dot_files)
dot_files=opts.dot_files, directed=True)
@ -2228,7 +2229,7 @@ class KCC(object):
dot_edges.append((v2, v1.dsa_dnstr))
dot_vertices.add(v2)
verify_properties = ('fully_connected', 'connected', 'multi_edge_forest', 'forest')
verify_properties = ('complete', 'connected', 'multi_edge_forest', 'forest', 'directed_double_ring')
verify_and_dot('intrasite_post_ntdscon', dot_edges, dot_vertices, label=site_local.site_dnstr,
properties=verify_properties, debug=DEBUG, verify=opts.verify,
dot_files=opts.dot_files)
@ -2340,9 +2341,8 @@ class KCC(object):
for dsa in site.dsa_table.values():
for con in dsa.connect_table.values():
dot_edges.append((dsa.dsa_dnstr, con.from_dnstr))
verify_properties = ('fully_connected', 'connected', 'multi_edge_forest', 'forest')
verify_and_dot('dsa_initial', dot_edges, label=self.my_dsa_dnstr,
properties=verify_properties, debug=DEBUG, verify=opts.verify,
properties=(), debug=DEBUG, verify=opts.verify,
dot_files=opts.dot_files)
dot_edges = []
@ -2355,7 +2355,7 @@ class KCC(object):
dot_edges.append((c_rep.rep_dsa_dnstr, x.nc_dnstr))
verify_and_dot('config_repsFrom_initial', dot_edges, directed=True, label=self.my_dsa_dnstr,
properties=verify_properties, debug=DEBUG, verify=opts.verify,
properties=(), debug=DEBUG, verify=opts.verify,
dot_files=opts.dot_files)
dot_edges = []
@ -2365,14 +2365,14 @@ class KCC(object):
dot_edges.append((dsa.dsa_dnstr, x))
verify_and_dot('dsa_repsFrom_initial', dot_edges, directed=True, label=self.my_dsa_dnstr,
properties=verify_properties, debug=DEBUG, verify=opts.verify,
properties=(), debug=DEBUG, verify=opts.verify,
dot_files=opts.dot_files)
dot_edges = []
for link in self.sitelink_table.values():
for a, b in itertools.combinations(link.site_list, 2):
dot_edges.append((str(a), str(b)))
verify_properties = ('connected',)
verify_and_dot('dsa_sitelink_initial', dot_edges, directed=False, label=self.my_dsa_dnstr,
properties=verify_properties, debug=DEBUG, verify=opts.verify,
dot_files=opts.dot_files)
@ -2410,7 +2410,7 @@ class KCC(object):
for dsa in site.dsa_table.values():
for con in dsa.connect_table.values():
dot_edges.append((dsa.dsa_dnstr, con.from_dnstr))
verify_properties = ('fully_connected', 'connected', 'multi_edge_forest', 'forest')
verify_properties = ('complete', 'connected', 'multi_edge_forest', 'forest', 'directed_double_ring')
verify_and_dot('dsa_final', dot_edges, label=self.my_dsa_dnstr,
properties=verify_properties, debug=DEBUG, verify=opts.verify,
dot_files=opts.dot_files)