diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-05-08 06:55:33 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-05-08 19:00:28 +0200 |
commit | eae061293bad97e6e70526b4e755ca69c02d0ae9 (patch) | |
tree | 18ea9d52eae39c9df4fcd46b1d700d345ef03401 /selftest | |
parent | f52c6eeacc1131fca6656d07eca035668423b008 (diff) | |
download | samba-eae061293bad97e6e70526b4e755ca69c02d0ae9.tar.gz samba-eae061293bad97e6e70526b4e755ca69c02d0ae9.tar.xz samba-eae061293bad97e6e70526b4e755ca69c02d0ae9.zip |
selftest: Add plugin_s4_dc environment
This environment uses pdb_samba4 and auth_samba4 to plug these
critical subsystems into a mixed Samba3/Samba4 DC, in a similar way to
the 'Franky' proposal.
Andrew Barltett
Diffstat (limited to 'selftest')
-rw-r--r-- | selftest/target/Samba3.pm | 50 | ||||
-rw-r--r-- | selftest/target/Samba4.pm | 57 |
2 files changed, 107 insertions, 0 deletions
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index a563653fb4..66ae8b5ec7 100644 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -269,6 +269,56 @@ sub setup_admember($$$$) return $ret; } +sub setup_plugin_s4_dc($$$$) +{ + my ($self, $prefix, $dcvars, $iface) = @_; + + print "PROVISIONING S4 PLUGIN AD DC$iface..."; + + my $plugin_s4_dc_options = " + workgroup = $dcvars->{DOMAIN} + realm = $dcvars->{REALM} + security=ads + passdb backend = samba4 + auth methods = guest samba4 + domain logons = yes + rpc_server:lsarpc = external + rpc_server:netlogon = external + rpc_server:samr = external + server signing = on +"; + + my $ret = $self->provision($prefix, + "plugindc", + $iface, + "pluGin${iface}Pass", + $plugin_s4_dc_options); + + $ret or return undef; + + close(USERMAP); + $ret->{DOMAIN} = $dcvars->{DOMAIN}; + $ret->{REALM} = $dcvars->{REALM}; + $ret->{KRB5_CONFIG} = $dcvars->{KRB5_CONFIG}; + $ret->{DC_USERNAME} = $dcvars->{USERNAME}; + $ret->{DC_PASSWORD} = $dcvars->{PASSWORD}; + + # We need world access to this share, as otherwise the domain + # administrator from the AD domain provided by Samba4 can't + # access the share for tests. + chmod 0777, "$prefix/share"; + + $self->check_or_start($ret, + "no", "yes", "yes"); + + $self->wait_for_start($ret); + + # Special case, this is called from Samba4.pm but needs to use the Samba3 check_env and get_log_env + $ret->{target} = $self; + + return $ret; +} + sub setup_secshare($$) { my ($self, $path) = @_; diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index 84ef576b38..e5ee391be2 100644 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -611,6 +611,7 @@ sub provision_raw_step1($$) spn update command = $ENV{SRCDIR_ABS}/source4/scripting/bin/samba_spnupdate resolv:host file = $ctx->{dns_host_file} dreplsrv:periodic_startup_interval = 0 + ncalrpc dir = $ctx->{lockdir}/ncalrpc "; if (defined($ctx->{sid_generator}) && $ctx->{sid_generator} ne "internal") { @@ -1157,6 +1158,40 @@ sub provision_rodc($$$) return $ret; } +sub provision_plugin_s4_dc($$) +{ + my ($self, $prefix) = @_; + + my $extra_smbconf_options = " +server services = -winbind, -smb +"; + + print "PROVISIONING PLUGIN S4 DC..."; + my $ret = $self->provision($prefix, + "domain controller", + "plugindc", + "PLUGINDOMAIN", + "plugin.samba.example.com", + "2008", + 30, + "locDCpass1", + undef, $extra_smbconf_options); + + return undef unless(defined $ret); + unless($self->add_wins_config("$prefix/private")) { + warn("Unable to add wins configuration"); + return undef; + } + + $ret->{DC_SERVER} = $ret->{SERVER}; + $ret->{DC_SERVER_IP} = $ret->{SERVER_IP}; + $ret->{DC_NETBIOSNAME} = $ret->{NETBIOSNAME}; + $ret->{DC_USERNAME} = $ret->{USERNAME}; + $ret->{DC_PASSWORD} = $ret->{PASSWORD}; + + return $ret; +} + sub teardown_env($$) { my ($self, $envvars) = @_; @@ -1261,6 +1296,8 @@ sub setup_env($$$) $self->setup_dc("$path/dc"); } return $target3->setup_admember("$path/s3member", $self->{vars}->{dc}, 29); + } elsif ($envname eq "plugin_s4_dc") { + return $self->setup_plugin_s4_dc("$path/plugin_s4_dc"); } elsif ($envname eq "all") { if (not defined($self->{vars}->{dc})) { $ENV{ENVNAME} = "dc"; @@ -1491,4 +1528,24 @@ sub setup_rodc($$$) return $env; } +sub setup_plugin_s4_dc($$) +{ + my ($self, $path) = @_; + + my $env = $self->provision_plugin_s4_dc($path); + if (defined $env) { + $self->check_or_start($env); + + $self->wait_for_start($env); + + my $s3_part_env = $self->{target3}->setup_plugin_s4_dc($path, $env, 30); + if (not defined($s3_part_env)) { + return undef; + } + + $self->{vars}->{plugin_s4_dc} = $s3_part_env; + } + return $env; +} + 1; |