summaryrefslogtreecommitdiff
path: root/selftest
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
parent77bb2d6d0b6ba994aa5f9295ed42b1dbf98898b6 (diff)
downloadsamba-439172dc067a8295a6f5d50f6a604e2307d9944a.tar.gz
samba-439172dc067a8295a6f5d50f6a604e2307d9944a.tar.bz2
samba-439172dc067a8295a6f5d50f6a604e2307d9944a.zip
selftest: add "member" environment for Samba3
metze
Diffstat (limited to 'selftest')
-rwxr-xr-xselftest/selftest.pl2
-rw-r--r--selftest/target/Samba3.pm48
2 files changed, 49 insertions, 1 deletions
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index dc754efa17..97cf697179 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -457,7 +457,7 @@ if ($opt_target eq "samba4") {
if ($opt_socket_wrapper and `$bindir/smbd -b | grep SOCKET_WRAPPER` eq "") {
die("You must include --enable-socket-wrapper when compiling Samba in order to execute 'make test'. Exiting....");
}
- $testenv_default = "dc";
+ $testenv_default = "member";
require target::Samba3;
$target = new Samba3($bindir);
} elsif ($opt_target eq "win") {
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) = @_;