From 75eedf85b1516f0b2370d23d6ff1058a70b093b0 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 8 Apr 2015 13:40:53 +1200 Subject: [PATCH] KCC: --test-all-reps-from uses same random seed for all DSAs Otherwise some of the links end up different for each KCC run. That is expected and proper, but it is confusing. Signed-off-by: Douglas Bagnall Reviewed-by: Garming Sam Reviewed-by: Andrew Bartlett --- source4/scripting/bin/samba_kcc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source4/scripting/bin/samba_kcc b/source4/scripting/bin/samba_kcc index 94ad025e320..13d29e5d9c1 100755 --- a/source4/scripting/bin/samba_kcc +++ b/source4/scripting/bin/samba_kcc @@ -3013,7 +3013,7 @@ def add_out_edge(graph, output_edges, e): v2.edges.append(ee) -def test_all_reps_from(lp, creds): +def test_all_reps_from(lp, creds, rng_seed=None): kcc = KCC() kcc.load_samdb(opts.dburl, lp, creds) dsas = kcc.list_dsas() @@ -3031,6 +3031,8 @@ def test_all_reps_from(lp, creds): vertex_colours = [] for dsa_dn in dsas: + if rng_seed: + random.seed(rng_seed) kcc = KCC() kcc.run(opts.dburl, lp, creds, forced_local_dsa=dsa_dn, forget_local_links=opts.forget_local_links, @@ -3232,7 +3234,8 @@ if opts.dburl is None: if opts.test_all_reps_from: opts.readonly = True - test_all_reps_from(lp, creds) + rng_seed = opts.seed or 0xACE5CA11 + test_all_reps_from(lp, creds, rng_seed=rng_seed) sys.exit() # Instantiate Knowledge Consistency Checker and perform run -- 2.11.4.GIT