summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-04-11 03:45:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:49:55 -0500
commit7b88696bed9dac1a40e31f360a8781910636455a (patch)
treee33928f9bc2eb2f682ef6b65b6792793912b88cc
parentdbfb32ffe5925259994712c9b1f18c4b60b9cdee (diff)
downloadsamba-7b88696bed9dac1a40e31f360a8781910636455a.tar.gz
samba-7b88696bed9dac1a40e31f360a8781910636455a.tar.bz2
samba-7b88696bed9dac1a40e31f360a8781910636455a.zip
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 a230261e83fd9161e60554b74cf8556f36b1af45)
-rw-r--r--source4/script/tests/Samba3.pm12
-rw-r--r--source4/script/tests/Samba4.pm17
-rwxr-xr-xsource4/script/tests/selftest.pl5
3 files changed, 16 insertions, 18 deletions
diff --git a/source4/script/tests/Samba3.pm b/source4/script/tests/Samba3.pm
index 83604f29ab..950f7e3479 100644
--- a/source4/script/tests/Samba3.pm
+++ b/source4/script/tests/Samba3.pm
@@ -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;
diff --git a/source4/script/tests/Samba4.pm b/source4/script/tests/Samba4.pm
index ac3dc653b8..cbb128563b 100644
--- a/source4/script/tests/Samba4.pm
+++ b/source4/script/tests/Samba4.pm
@@ -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);
diff --git a/source4/script/tests/selftest.pl b/source4/script/tests/selftest.pl
index e6ca48bafb..6886f8231e 100755
--- a/source4/script/tests/selftest.pl
+++ b/source4/script/tests/selftest.pl
@@ -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",