diff options
author | Andrew Bartlett <abartlet@samba.org> | 2015-02-20 17:56:39 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2015-05-28 07:25:07 +0200 |
commit | 189f0404c692f34b8c0c15bb3bef64dbc93128ee (patch) | |
tree | 9098faa81549973dc2b19edf39f5db22b12abe82 /selftest | |
parent | cf57e61d7b5b16169ae4a61ba9c53e6f952f6d4d (diff) | |
download | samba-189f0404c692f34b8c0c15bb3bef64dbc93128ee.tar.gz |
selftest: Force the KCC to run and another replication at rodc startup
This shows that replication using the RODC username/password actually works
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'selftest')
-rwxr-xr-x | selftest/target/Samba4.pm | 61 |
1 files changed, 59 insertions, 2 deletions
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index 26f6ddaf9de..8d16cf67fb2 100755 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -2118,7 +2118,7 @@ sub setup_vampire_dc($$$) $cmd .= "RESOLV_WRAPPER_HOSTS=\"$env->{RESOLV_WRAPPER_HOSTS}\" "; } $cmd .= " KRB5_CONFIG=\"$env->{KRB5_CONFIG}\""; - $cmd .= " $samba_tool drs kcc $env->{DC_SERVER}"; + $cmd .= " $samba_tool drs kcc -k no $env->{DC_SERVER}"; $cmd .= " $env->{CONFIGURATION}"; $cmd .= " -U$dc_vars->{DC_USERNAME}\%$dc_vars->{DC_PASSWORD}"; unless (system($cmd) == 0) { @@ -2170,7 +2170,7 @@ sub setup_promoted_dc($$$) $self->{vars}->{promoted_dc} = $env; - # force replicated DC to update repsTo/repsFrom + # force source and replicated DC to update repsTo/repsFrom # for vampired partitions my $samba_tool = Samba::bindir_path($self, "samba-tool"); my $cmd = ""; @@ -2184,6 +2184,18 @@ sub setup_promoted_dc($$$) return undef; } + my $samba_tool = Samba::bindir_path($self, "samba-tool"); + my $cmd = ""; + $cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$env->{SOCKET_WRAPPER_DEFAULT_IFACE}\""; + $cmd .= " KRB5_CONFIG=\"$env->{KRB5_CONFIG}\""; + $cmd .= " $samba_tool drs kcc $env->{SERVER}"; + $cmd .= " $env->{CONFIGURATION}"; + $cmd .= " -U$dc_vars->{DC_USERNAME}\%$dc_vars->{DC_PASSWORD}"; + unless (system($cmd) == 0) { + warn("Failed to exec kcc\n$cmd"); + return undef; + } + # 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})); @@ -2276,6 +2288,51 @@ sub setup_rodc($$$) $self->wait_for_start($env); + # force source and replicated DC to update repsTo/repsFrom + # for vampired partitions + my $samba_tool = Samba::bindir_path($self, "samba-tool"); + my $cmd = ""; + $cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$env->{SOCKET_WRAPPER_DEFAULT_IFACE}\""; + $cmd .= " KRB5_CONFIG=\"$env->{KRB5_CONFIG}\""; + $cmd .= " $samba_tool drs kcc -k no $env->{DC_SERVER}"; + $cmd .= " $env->{CONFIGURATION}"; + $cmd .= " -U$dc_vars->{DC_USERNAME}\%$dc_vars->{DC_PASSWORD}"; + unless (system($cmd) == 0) { + warn("Failed to exec kcc\n$cmd"); + return undef; + } + + my $samba_tool = Samba::bindir_path($self, "samba-tool"); + my $cmd = ""; + $cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$env->{SOCKET_WRAPPER_DEFAULT_IFACE}\""; + $cmd .= " KRB5_CONFIG=\"$env->{KRB5_CONFIG}\""; + $cmd .= " $samba_tool drs kcc -k no $env->{SERVER}"; + $cmd .= " $env->{CONFIGURATION}"; + $cmd .= " -U$dc_vars->{DC_USERNAME}\%$dc_vars->{DC_PASSWORD}"; + unless (system($cmd) == 0) { + warn("Failed to exec kcc\n$cmd"); + return undef; + } + + 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 .= " $samba_tool drs replicate $env->{SERVER} $env->{DC_SERVER}"; + $cmd .= " $dc_vars->{CONFIGURATION}"; + $cmd .= " -U$dc_vars->{DC_USERNAME}\%$dc_vars->{DC_PASSWORD}"; + # replicate Configuration NC + my $cmd_repl = "$cmd \"CN=Configuration,$base_dn\""; + unless(system($cmd_repl) == 0) { + warn("Failed to replicate\n$cmd_repl"); + return undef; + } + # replicate Default NC + $cmd_repl = "$cmd \"$base_dn\""; + unless(system($cmd_repl) == 0) { + warn("Failed to replicate\n$cmd_repl"); + return undef; + } + $self->{vars}->{rodc} = $env; return $env; |