diff options
-rwxr-xr-x | selftest/selftest.pl | 2 | ||||
-rw-r--r-- | selftest/target/Samba3.pm | 48 | ||||
-rwxr-xr-x | source3/selftest/tests.sh | 4 |
3 files changed, 53 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) = @_; diff --git a/source3/selftest/tests.sh b/source3/selftest/tests.sh index 3a53fa1df2..28a02d659e 100755 --- a/source3/selftest/tests.sh +++ b/source3/selftest/tests.sh @@ -66,5 +66,9 @@ for t in $tests; do done plantest "blackbox.smbclient" dc BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$USERNAME \$PASSWORD +plantest "blackbox.smbclient member creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$SERVER\\\\\$USERNAME \$PASSWORD +plantest "blackbox.smbclient domain creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$DOMAIN\\\\\$DC_USERNAME \$DC_PASSWORD + plantest "blackbox.wbinfo" dc BINDIR="$BINDIR" script/tests/test_wbinfo_s3.sh \$DOMAIN \$SERVER \$USERNAME \$PASSWORD plantest "blackbox.net" dc BINDIR="$BINDIR" SCRIPTDIR="$SCRIPTDIR" script/tests/test_net_s3.sh + |