summaryrefslogtreecommitdiff
path: root/selftest/target
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-08-28 01:30:09 +0300
committerKamen Mazdrashki <kamenim@samba.org>2010-08-28 23:38:58 +0300
commitd15a7d9099f4eef8e1a82d0935cca8cfab542e5c (patch)
tree643a73e462aefd623325977a60e654db1badad7a /selftest/target
parenta052497c7427ba7212fbc6a5d0053990dcf0c0dc (diff)
downloadsamba-d15a7d9099f4eef8e1a82d0935cca8cfab542e5c.tar.gz
samba-d15a7d9099f4eef8e1a82d0935cca8cfab542e5c.tar.bz2
samba-d15a7d9099f4eef8e1a82d0935cca8cfab542e5c.zip
s4-testenv: Synchronize DCs after 'net vampire'
During 'net vampire', vampired DC adds information in its own database, se we need to force replicate vampired_dc to the first DC to be sure everything is in sync prior starting tests
Diffstat (limited to 'selftest/target')
-rw-r--r--selftest/target/Samba4.pm24
1 files changed, 24 insertions, 0 deletions
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index f0da581002..4072524379 100644
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -1327,6 +1327,30 @@ sub setup_vampire_dc($$$)
$self->{vars}->{vampire_dc} = $env;
+ # force replicated DC to update repsTo/repsFrom
+ # for vampired partitions
+ my $net = $self->bindir_path("net");
+ my $cmd = "";
+ $cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$env->{SOCKET_WRAPPER_DEFAULT_IFACE}\"";
+ $cmd .= " KRB5_CONFIG=\"$env->{KRB5_CONFIG}\"";
+ $cmd .= " $net drs kcc $env->{DC_SERVER}";
+ $cmd .= " -U$dc_vars->{DC_USERNAME}\%$dc_vars->{DC_PASSWORD}";
+ system($cmd) == 0 or die("Failed to exec kcc\n$cmd");
+
+ # as 'vampired' dc may add data in its local replica
+ # we need to synchronize data between DCs
+ my $base_dn = "DC=".join(",DC=", split(/\./, $dc_vars->{REALM}));
+ $cmd = "SOCKET_WRAPPER_DEFAULT_IFACE=\"$env->{SOCKET_WRAPPER_DEFAULT_IFACE}\"";
+ $cmd .= " KRB5_CONFIG=\"$env->{KRB5_CONFIG}\"";
+ $cmd .= " $net drs replicate $env->{DC_SERVER} $env->{VAMPIRE_DC_SERVER}";
+ $cmd .= " -U$dc_vars->{DC_USERNAME}\%$dc_vars->{DC_PASSWORD}";
+ # replicate Configuration NC
+ my $cmd_repl = "$cmd \"CN=Configuration,$base_dn\"";
+ system($cmd_repl) == 0 or die("Failed to replicate\n$cmd_repl");
+ # replicate Default NC
+ $cmd_repl = "$cmd \"$base_dn\"";
+ system($cmd_repl) == 0 or die("Failed to replicate\n$cmd_repl");
+
return $env;
}