mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
r22161: Clarify exactly where the socket_wrapper should be handled (early),
and ensure that $prefix exists before it tries to create $prefix/w.
This should fix the build farm. Perhaps we should have a rm -rf
$prefix at the start of this script, as that would have found the
problem, but I want to be careful about that...
Andrew Bartlett
(This used to be commit a230261e83
)
This commit is contained in:
parent
dbfb32ffe5
commit
7b88696bed
@ -16,14 +16,11 @@ sub new($$$) {
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub check_or_start($$$$)
|
||||
sub check_or_start($$$)
|
||||
{
|
||||
my ($self, $env_vars, $socket_wrapper_dir, $max_time) = @_;
|
||||
my ($self, $env_vars, $max_time) = @_;
|
||||
return 0 if ( -p $env_vars->{SMBD_TEST_FIFO});
|
||||
|
||||
warn("Not using socket wrapper, but also not running as root. Will not be able to listen on proper ports") unless
|
||||
defined($socket_wrapper_dir) or $< == 0;
|
||||
|
||||
unlink($env_vars->{SMBD_TEST_FIFO});
|
||||
POSIX::mkfifo($env_vars->{SMBD_TEST_FIFO}, 0700);
|
||||
unlink($env_vars->{SMBD_TEST_LOG});
|
||||
@ -49,7 +46,6 @@ sub check_or_start($$$$)
|
||||
exit 1;
|
||||
}
|
||||
unlink($env_vars->{SMBD_TEST_FIFO});
|
||||
unlink(<$socket_wrapper_dir/*>) if (defined($socket_wrapper_dir) and -d $socket_wrapper_dir);
|
||||
my $exit = $? >> 8;
|
||||
if ( $ret == 0 ) {
|
||||
print "smbd exits with status $exit\n";
|
||||
@ -121,9 +117,9 @@ sub stop($)
|
||||
return $failed;
|
||||
}
|
||||
|
||||
sub setup_env($$$)
|
||||
sub setup_env($$)
|
||||
{
|
||||
my ($self, $name, $socket_wrapper_dir) = @_;
|
||||
my ($self, $name) = @_;
|
||||
}
|
||||
|
||||
1;
|
||||
|
@ -58,9 +58,9 @@ sub slapd_stop($$)
|
||||
}
|
||||
}
|
||||
|
||||
sub check_or_start($$$$)
|
||||
sub check_or_start($$$)
|
||||
{
|
||||
my ($self, $env_vars, $socket_wrapper_dir, $max_time) = @_;
|
||||
my ($self, $env_vars, $max_time) = @_;
|
||||
return 0 if ( -p $env_vars->{SMBD_TEST_FIFO});
|
||||
|
||||
# Start slapd before smbd
|
||||
@ -99,7 +99,6 @@ sub check_or_start($$$$)
|
||||
exit 1;
|
||||
}
|
||||
unlink($env_vars->{SMBD_TEST_FIFO});
|
||||
unlink(<$socket_wrapper_dir/*>) if (defined($socket_wrapper_dir) and -d $socket_wrapper_dir);
|
||||
my $exit = $? >> 8;
|
||||
if ( $ret == 0 ) {
|
||||
print "smbd exits with status $exit\n";
|
||||
@ -181,24 +180,24 @@ sub teardown_env($$)
|
||||
return $failed;
|
||||
}
|
||||
|
||||
sub setup_env($$$$)
|
||||
sub setup_env($$$)
|
||||
{
|
||||
my ($self, $envname, $path, $socket_wrapper_dir) = @_;
|
||||
my ($self, $envname, $path) = @_;
|
||||
|
||||
if ($envname eq "dc") {
|
||||
return $self->setup_dc("$path/dc", $socket_wrapper_dir);
|
||||
return $self->setup_dc("$path/dc");
|
||||
} else {
|
||||
die("Samba4 can't provide environment $envname");
|
||||
}
|
||||
}
|
||||
|
||||
sub setup_dc($$$)
|
||||
sub setup_dc($$)
|
||||
{
|
||||
my ($self, $path, $socket_wrapper_dir) = @_;
|
||||
my ($self, $path) = @_;
|
||||
|
||||
my $env = $self->provision($path);
|
||||
|
||||
$self->check_or_start($env, $socket_wrapper_dir,
|
||||
$self->check_or_start($env,
|
||||
($ENV{SMBD_MAX_TIME} or 5400));
|
||||
|
||||
$self->wait_for_start($env);
|
||||
|
@ -371,6 +371,9 @@ $prefix =~ s+//+/+;
|
||||
$ENV{PREFIX} = $prefix;
|
||||
$ENV{SRCDIR} = $srcdir;
|
||||
|
||||
#Ensure we have the test prefix around
|
||||
mkdir $prefix unless -d $prefix;
|
||||
|
||||
my $tls_enabled = not $opt_quick;
|
||||
my $from_build_farm = (defined($ENV{RUN_FROM_BUILD_FARM}) and
|
||||
($ENV{RUN_FROM_BUILD_FARM} eq "yes"));
|
||||
@ -543,7 +546,7 @@ sub setup_env($)
|
||||
} elsif ($envname eq "none") {
|
||||
$testenv_vars = {};
|
||||
} else {
|
||||
$testenv_vars = $target->setup_env($envname, $prefix, $socket_wrapper_dir);
|
||||
$testenv_vars = $target->setup_env($envname, $prefix);
|
||||
}
|
||||
write_clientconf($conffile, $testenv_vars);
|
||||
foreach ("PASSWORD", "DOMAIN", "SERVER", "USERNAME", "NETBIOSNAME",
|
||||
|
Loading…
Reference in New Issue
Block a user