summaryrefslogtreecommitdiff
path: root/selftest/target
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-01-28 21:01:04 +0100
committerStefan Metzmacher <metze@samba.org>2009-01-29 10:39:06 +0100
commit439172dc067a8295a6f5d50f6a604e2307d9944a (patch)
treece14eb4a73217bf58a33abffa3b7d339183db3ed /selftest/target
parent77bb2d6d0b6ba994aa5f9295ed42b1dbf98898b6 (diff)
downloadsamba-439172dc067a8295a6f5d50f6a604e2307d9944a.tar.gz
samba-439172dc067a8295a6f5d50f6a604e2307d9944a.tar.bz2
samba-439172dc067a8295a6f5d50f6a604e2307d9944a.zip
selftest: add "member" environment for Samba3
metze
Diffstat (limited to 'selftest/target')
-rw-r--r--selftest/target/Samba3.pm48
1 files changed, 48 insertions, 0 deletions
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 2b2f6a51b5..bb074b7b6e 100644
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -95,6 +95,11 @@ sub setup_env($$$)
if ($envname eq "dc") {
return $self->setup_dc("$path/dc");
+ } elsif ($envname eq "member") {
+ if (not defined($self->{vars}->{dc})) {
+ $self->setup_dc("$path/dc");
+ }
+ return $self->setup_member("$path/member", $self->{vars}->{dc});
} else {
return undef;
}
@@ -124,9 +129,52 @@ sub setup_dc($$)
$self->wait_for_start($vars);
+ $self->{vars}->{dc} = $vars;
+
return $vars;
}
+sub setup_member($$$)
+{
+ my ($self, $prefix, $dcvars) = @_;
+
+ print "PROVISIONING MEMBER...";
+
+ my $member_options = "
+ security = domain
+";
+ my $ret = $self->provision($prefix,
+ "LOCALMEMBER3",
+ 3,
+ "localmember3pass",
+ $member_options);
+
+ $ret or die("Unable to provision");
+
+ my $net = $self->binpath("net");
+ my $cmd = "";
+ $cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$ret->{SOCKET_WRAPPER_DEFAULT_IFACE}\" ";
+ $cmd .= "$net join $ret->{CONFIGURATION} $dcvars->{DOMAIN} member";
+ $cmd .= " -U$dcvars->{USERNAME}\%$dcvars->{PASSWORD}";
+
+ system($cmd) == 0 or die("Join failed\n$cmd");
+
+ $self->check_or_start($ret,
+ ($ENV{NMBD_MAXTIME} or 2700),
+ ($ENV{WINBINDD_MAXTIME} or 2700),
+ ($ENV{SMBD_MAXTIME} or 2700));
+
+ $self->wait_for_start($ret);
+
+ $ret->{DC_SERVER} = $dcvars->{SERVER};
+ $ret->{DC_SERVER_IP} = $dcvars->{SERVER_IP};
+ $ret->{DC_NETBIOSNAME} = $dcvars->{NETBIOSNAME};
+ $ret->{DC_USERNAME} = $dcvars->{USERNAME};
+ $ret->{DC_PASSWORD} = $dcvars->{PASSWORD};
+
+ return $ret;
+}
+
sub stop($)
{
my ($self) = @_;