summaryrefslogtreecommitdiff
path: root/source4/script/tests
diff options
context:
space:
mode:
Diffstat (limited to 'source4/script/tests')
-rw-r--r--source4/script/tests/Samba4.pm4
-rwxr-xr-xsource4/script/tests/selftest.pl26
2 files changed, 19 insertions, 11 deletions
diff --git a/source4/script/tests/Samba4.pm b/source4/script/tests/Samba4.pm
index 28d8b91aa5..cc8f619c79 100644
--- a/source4/script/tests/Samba4.pm
+++ b/source4/script/tests/Samba4.pm
@@ -6,6 +6,7 @@
package Samba4;
use strict;
+use Cwd qw(abs_path);
use FindBin qw($RealBin);
use POSIX;
@@ -403,8 +404,7 @@ sub provision($$$$$)
my $server = "localhost";
my $srcdir="$RealBin/../..";
-d $prefix or mkdir($prefix) or die("Unable to create $prefix");
- my $prefix_abs = getcwd()."/".$prefix;
-
+ my $prefix_abs = abs_path($prefix);
my $tmpdir = "$prefix_abs/tmp";
my $etcdir = "$prefix_abs/etc";
my $piddir = "$prefix_abs/pid";
diff --git a/source4/script/tests/selftest.pl b/source4/script/tests/selftest.pl
index 0f7b29c258..f834918b8e 100755
--- a/source4/script/tests/selftest.pl
+++ b/source4/script/tests/selftest.pl
@@ -113,7 +113,7 @@ use FindBin qw($RealBin $Script);
use File::Spec;
use Getopt::Long;
use POSIX;
-use Cwd;
+use Cwd qw(abs_path);
use lib "$RealBin";
use Samba3;
use Samba4;
@@ -136,7 +136,7 @@ my $opt_resetup_env = undef;
my $srcdir = ".";
my $builddir = ".";
-my $prefix = "st";
+my $prefix = "./st";
my $suitesfailed = [];
my $start = time();
@@ -370,6 +370,16 @@ if ($ldap) {
}
$prefix =~ s+//+/+;
+$prefix =~ s+/./+/+;
+$prefix =~ s+/$++;
+
+my $prefix_abs = abs_path($prefix);
+my $srcdir_abs = abs_path($srcdir);
+
+die("using an empty prefix isn't allowed") unless $prefix ne "";
+die("using an empty absolute prefix isn't allowed") unless $prefix_abs ne "";
+die("using '/' as absolute prefix isn't allowed") unless $prefix_abs ne "/";
+
$ENV{PREFIX} = $prefix;
$ENV{SRCDIR} = $srcdir;
@@ -442,14 +452,12 @@ my $interfaces = join(',', ("127.0.0.6/8",
"127.0.0.10/8",
"127.0.0.11/8"));
-my $conffile = "$prefix/client.conf";
+my $conffile = "$prefix_abs/client/client.conf";
sub write_clientconf($$)
{
my ($conffile, $vars) = @_;
- my $abs_srcdir = cwd();
-
mkdir "$prefix/client" unless -d "$prefix/client";
if ( -d "$prefix/client/private" ) {
@@ -482,16 +490,16 @@ sub write_clientconf($$)
print CF "\twinbindd socket directory = $vars->{WINBINDD_SOCKET_DIR}\n";
}
print CF "
- private dir = $abs_srcdir/$prefix/client/private
- js include = $abs_srcdir/scripting/libjs
+ private dir = $srcdir_abs/$prefix/client/private
+ js include = $srcdir_abs/scripting/libjs
name resolve order = bcast
interfaces = $interfaces
- panic action = $abs_srcdir/script/gdb_backtrace \%PID\% \%PROG\%
+ panic action = $srcdir_abs/script/gdb_backtrace \%PID\% \%PROG\%
max xmit = 32K
notify:inotify = false
ldb:nosync = true
system:anonymous = true
- torture:basedir = ./st
+ torture:basedir = $prefix_abs
#We don't want to pass our self-tests if the PAC code is wrong
gensec:require_pac = true
";