[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Sat Apr 16 04:30:01 MDT 2011


The branch, master has been updated
       via  2c55a99 util: Build samba-util without unresolved symbols.
       via  d1cbb9f s4-heimdal: Allow any kvno to match when searching the keytab.
       via  1f53442 s3-gse Allow GSSAPI wrapper to compile against Heimdal
       via  93f8f7b selftest: Allow the top level build to run the samba4 or samba3 tests
       via  ee4a7b3 s4-heimdal_build: Add extra HAVE defines needed for the source3 krb5 code
       via  d9e29c0 selftest Remove selftest of the test subsystem
       via  47b7c6f selftest: Move Samba4 selftest wscript to the top level
       via  1870d25 selftest Add binary mappings for samba3 selftest
       via  48bb69e selftest: Start using the binary mapping at the python layer as well
       via  4fd6ebf selftest: Remove duplication between BUILDIR and BINDIR
       via  cfb44f6 selftest: Remove unused BUILDDIR_ABS environment variable
       via  831955d selftest: Provide a single bindir_path function across all targets
      from  82fdad8 Trying to track down the SMB2 error. Add an invariant test.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 2c55a995fef133c1854058ed5de83185b9325895
Author: Brad Hards <bradh at frogmouth.net>
Date:   Thu Apr 14 16:12:19 2011 +1000

    util: Build samba-util without unresolved symbols.
    
    This is useful for the Samba4 case where external users otherwise need to link to
    (private) libsamba-util-common.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User: Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date: Sat Apr 16 12:29:33 CEST 2011 on sn-devel-104

commit d1cbb9f5ceb40d0634891086ef1939b3b76daa4f
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sat Apr 16 15:44:23 2011 +1000

    s4-heimdal: Allow any kvno to match when searching the keytab.
    
    Windows does not use a KVNO when it checks it's passwords, and MIT
    doesn't check the KVNO when no acceptor identity is specified (looping
    over all keys in the keytab).
    
    Andrew Bartlett

commit 1f534422cc09ca72f924643c7518c7f90241a732
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sat Apr 16 09:22:08 2011 +1000

    s3-gse Allow GSSAPI wrapper to compile against Heimdal

commit 93f8f7b579d92c943dfd89011c35f843a566968b
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sat Apr 16 08:47:50 2011 +1000

    selftest: Allow the top level build to run the samba4 or samba3 tests
    
    This is selected with for example
    
    ./buildtools/bin/waf test --target=samba3
    
    Andrew Bartlett

commit ee4a7b3530d00ce514f43dc5e7e2a3b886a86de6
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sat Apr 16 08:46:25 2011 +1000

    s4-heimdal_build: Add extra HAVE defines needed for the source3 krb5 code

commit d9e29c0250a052474936540e3768de2dcdaaeac9
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Apr 15 16:58:50 2011 +1000

    selftest Remove selftest of the test subsystem
    
    The intereactions between selftest.pl and the target are now too
    complex to unit test like this any more.
    
    Andrew Bartlett

commit 47b7c6fccf944ae2ae4bdbfa983adfa1d12204df
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Apr 15 16:42:35 2011 +1000

    selftest: Move Samba4 selftest wscript to the top level

commit 1870d254956ec56b8116a923adc38f8aae675963
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Apr 15 16:39:53 2011 +1000

    selftest Add binary mappings for samba3 selftest
    
    This will help us have a top level 'make test', working around the
    fact that the --eanble-s3build has different names for some of these
    binaries, without fixing the names forever (we can just change the
    mapping later).
    
    Andrew Bartlett

commit 48bb69ef001be8270ddf145fa4884a2c5ddc2645
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Apr 15 15:17:58 2011 +1000

    selftest: Start using the binary mapping at the python layer as well

commit 4fd6ebf544f90a6d18e6828eb3edc7b75f3b90a2
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Apr 15 12:41:22 2011 +1000

    selftest: Remove duplication between BUILDIR and BINDIR
    
    Just have BINDIR, and have it default to ./bin
    
    Andrew Bartlett

commit cfb44f63a4eadfd34c0cf7b003b677e43284376f
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Apr 15 12:28:21 2011 +1000

    selftest: Remove unused BUILDDIR_ABS environment variable

commit 831955ddf2d2d11b27318d8960d44c6ae9da624f
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Apr 15 12:27:30 2011 +1000

    selftest: Provide a single bindir_path function across all targets
    
    This will allow a mapping to be made between things like smbtorture4
    -> smbtorture that is correct for the different build environments.
    
    Andrew Bartlett

-----------------------------------------------------------------------

Summary of changes:
 lib/util/wscript_build                      |   91 +++++++++++++++++---------
 nsswitch/tests/test_wbinfo.sh               |    2 +-
 selftest/selftest.pl                        |   49 ++++++++++-----
 selftest/selftesthelpers.py                 |   16 ++++-
 selftest/target/Samba3.pm                   |   60 ++++++++----------
 selftest/target/Samba4.pm                   |   32 ++++------
 selftest/test_samba4.pl                     |   21 ------
 {source4/selftest => selftest}/wscript      |   50 ++++++++++-----
 source3/librpc/crypto/gse.c                 |    4 +-
 source3/script/tests/test_ntlm_auth_s3.sh   |    9 ++-
 source3/script/tests/test_smbclient_auth.sh |    7 +-
 source3/script/tests/test_smbclient_s3.sh   |    7 +-
 source3/script/tests/test_smbtorture_s3.sh  |    7 +-
 source3/selftest/s3-selftest.sh             |    6 +-
 source3/selftest/tests.py                   |   24 ++++----
 source3/selftest/wscript                    |    9 ++-
 source4/client/tests/test_cifsdd.sh         |    2 +-
 source4/client/tests/test_smbclient.sh      |    2 +-
 source4/heimdal/lib/krb5/rd_req.c           |    3 +-
 source4/heimdal_build/wscript_configure     |    3 +
 source4/scripting/devel/selftest-vars.sh    |    2 +-
 source4/selftest/tests.py                   |    3 +-
 source4/torture/tests/test_gentest.sh       |    2 +-
 source4/torture/tests/test_locktest.sh      |    2 +-
 source4/torture/tests/test_masktest.sh      |    2 +-
 source4/utils/tests/test_nmblookup.sh       |    2 +-
 source4/utils/tests/test_samba_tool.sh      |    2 +-
 testprogs/blackbox/test_chgdcpass.sh        |    2 +-
 testprogs/blackbox/test_export_keytab.sh    |    2 +-
 testprogs/blackbox/test_kinit.sh            |    2 +-
 testprogs/blackbox/test_ktpass.sh           |    6 +-
 testprogs/blackbox/test_ldb.sh              |    2 +-
 testprogs/blackbox/test_passwords.sh        |    2 +-
 testprogs/blackbox/test_pkinit.sh           |    2 +-
 wscript                                     |    4 +-
 35 files changed, 246 insertions(+), 195 deletions(-)
 delete mode 100755 selftest/test_samba4.pl
 rename {source4/selftest => selftest}/wscript (79%)


Changeset truncated at 500 lines:

diff --git a/lib/util/wscript_build b/lib/util/wscript_build
index 1186cd7..93827bc 100755
--- a/lib/util/wscript_build
+++ b/lib/util/wscript_build
@@ -1,38 +1,65 @@
 #!/usr/bin/env python
 
-# as we move files into common between samba-util and samba-util3, move them here.
-# Both samba-util and samba-util3 depend on this private library
-bld.SAMBA_LIBRARY('samba-util-common',
-                  source='''talloc_stack.c smb_threads.c xfile.c data_blob.c
-                  util_file.c time.c rbtree.c rfc1738.c select.c
-                  genrand.c fsusage.c blocking.c become_daemon.c
-                  signal.c system.c params.c util.c util_id.c util_net.c
-                  util_strlist.c idtree.c debug.c fault.c base64.c
-                  util_str_common.c''',
-                  public_deps='talloc pthread LIBCRYPTO',
-                  # until we get all the dependencies in this library in common
-                  # we need to allow this library to be built with unresolved symbols
-                  allow_undefined_symbols=True,
-                  local_include=False,
-                  public_headers='debug.h',
-                  header_path= [('*', 'util') ],
-                  private_library=True
-                  )
-
-if bld.env._SAMBA_BUILD_ == 4:
-    bld.SAMBA_LIBRARY('samba-util',
-                      source='''dprintf.c
-                      ms_fnmatch.c parmlist.c substitute.c util_str.c
-                      ''',
-                      deps='samba-util-common DYNCONFIG',
-                      public_deps='talloc CHARSET execinfo uid_wrapper',
-                      public_headers='attr.h byteorder.h data_blob.h memory.h safe_string.h time.h talloc_stack.h xfile.h dlinklist.h util.h',
-                      header_path= [ ('dlinklist.h util.h', '.'), ('*', 'util') ],
-                      local_include=False,
-                      vnum='0.0.1',
-                      pc_files='samba-util.pc'
-                      )
-
+common_util_sources = '''talloc_stack.c smb_threads.c xfile.c data_blob.c
+                    util_file.c time.c rbtree.c rfc1738.c select.c
+                    genrand.c fsusage.c blocking.c become_daemon.c
+                    signal.c system.c params.c util.c util_id.c util_net.c
+                    util_strlist.c idtree.c debug.c fault.c base64.c
+                    util_str_common.c'''
+
+common_util_headers = 'debug.h'
+common_util_public_deps = 'talloc pthread LIBCRYPTO'
+s4_util_sources = '''dprintf.c ms_fnmatch.c parmlist.c substitute.c util_str.c'''
+s4_util_deps = 'DYNCONFIG'
+s4_util_public_deps = 'talloc CHARSET execinfo uid_wrapper'
+s4_util_public_headers = 'attr.h byteorder.h data_blob.h memory.h safe_string.h time.h talloc_stack.h xfile.h dlinklist.h util.h'
+s4_util_header_path = [ ('dlinklist.h util.h', '.'), ('*', 'util') ]
+
+if bld.env.enable_s3build or bld.env._SAMBA_BUILD_ == 3:
+    # as we move files into common between samba-util and samba-util3, move them here.
+    # Both samba-util and samba-util3 depend on this private library
+    bld.SAMBA_LIBRARY('samba-util-common',
+                    source=common_util_sources,
+                    public_deps=common_util_public_deps,
+                    # until we get all the dependencies in this library in common
+                    # we need to allow this library to be built with unresolved symbols
+                    allow_undefined_symbols=True,
+                    local_include=False,
+                    public_headers=common_util_headers,
+                    header_path= [('*', 'util') ],
+                    private_library=True
+                    )
+
+    if bld.env._SAMBA_BUILD_ == 4:
+        bld.SAMBA_LIBRARY('samba-util',
+                        source=s4_util_sources,
+                        deps=s4_util_deps + ' samba-util-common',
+                        public_deps=s4_util_public_deps,
+                        public_headers=s4_util_public_headers,
+                        header_path= s4_util_header_path,
+                        local_include=False,
+                        vnum='0.0.1',
+                        pc_files='samba-util.pc'
+                        )
+
+else:
+    if bld.env._SAMBA_BUILD_ == 4:
+        bld.SAMBA_LIBRARY('samba-util',
+                        source=s4_util_sources + " " + common_util_sources,
+                        deps=s4_util_deps,
+                        public_deps=s4_util_public_deps + ' ' + common_util_public_deps,
+                        public_headers=s4_util_public_headers + ' ' + common_util_headers,
+                        header_path= s4_util_header_path,
+                        local_include=False,
+                        vnum='0.0.1',
+                        pc_files='samba-util.pc'
+                        )
+
+    # dummy subsystem for avoid wider deps changes.
+    bld.SAMBA_SUBSYSTEM('samba-util-common',
+                        source=[],
+                        deps='samba-util',
+                        local_include=False,)
 
 bld.SAMBA_LIBRARY('asn1util',
                   source='asn1.c',
diff --git a/nsswitch/tests/test_wbinfo.sh b/nsswitch/tests/test_wbinfo.sh
index b344f71..50f1274 100755
--- a/nsswitch/tests/test_wbinfo.sh
+++ b/nsswitch/tests/test_wbinfo.sh
@@ -14,7 +14,7 @@ TARGET=$4
 shift 4
 
 failed=0
-samba4bindir="$BUILDDIR/bin"
+samba4bindir="$BINDIR"
 wbinfo="$VALGRIND $samba4bindir/wbinfo$EXEEXT"
 
 . `dirname $0`/../../testprogs/blackbox/subunit.sh
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index fbb36a2..69c95e9 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -26,7 +26,7 @@ selftest - Samba test runner
 
 selftest --help
 
-selftest [--srcdir=DIR] [--builddir=DIR] [--exeext=EXT][--target=samba4|samba3|win|kvm] [--socket-wrapper] [--quick] [--exclude=FILE] [--include=FILE] [--one] [--prefix=prefix] [--testlist=FILE] [TESTS]
+selftest [--srcdir=DIR] [--bindir=DIR] [--exeext=EXT][--target=samba4|samba3|win|kvm] [--socket-wrapper] [--quick] [--exclude=FILE] [--include=FILE] [--one] [--prefix=prefix] [--testlist=FILE] [TESTS]
 
 =head1 DESCRIPTION
 
@@ -44,9 +44,9 @@ Show list of available options.
 
 Source directory.
 
-=item I<--builddir=DIR>
+=item I<--bindir=DIR>
 
-Build directory.
+Built binaries directory.
 
 =item I<--exeext=EXT>
 
@@ -156,12 +156,12 @@ my $opt_testenv = 0;
 my $opt_list = 0;
 my $ldap = undef;
 my $opt_resetup_env = undef;
-my $opt_bindir = undef;
+my $opt_binary_mapping = "";
 my $opt_load_list = undef;
 my @testlists = ();
 
 my $srcdir = ".";
-my $builddir = ".";
+my $bindir = "./bin";
 my $exeext = "";
 my $prefix = "./st";
 
@@ -306,7 +306,7 @@ Generic options:
 Paths:
  --prefix=DIR               prefix to run tests in [st]
  --srcdir=DIR               source directory [.]
- --builddir=DIR             output directory [.]
+ --bindir=DIR               binaries directory [./bin]
  --exeext=EXT               executable extention []
 
 Target Specific:
@@ -314,7 +314,6 @@ Target Specific:
  --socket-wrapper-keep-pcap keep all pcap files, not just those for tests that 
                             failed
  --socket-wrapper           enable socket wrapper
- --bindir=PATH              path to target binaries
 
 Samba4 Specific:
  --ldap=openldap|fedora-ds  back samba onto specified ldap server
@@ -344,17 +343,17 @@ my $result = GetOptions (
 		'exclude=s' => \@opt_exclude,
 		'include=s' => \@opt_include,
 		'srcdir=s' => \$srcdir,
-		'builddir=s' => \$builddir,
+		'bindir=s' => \$bindir,
 		'exeext=s' => \$exeext,
 		'verbose' => \$opt_verbose,
 		'testenv' => \$opt_testenv,
 		'list' => \$opt_list,
 		'ldap:s' => \$ldap,
 		'resetup-environment' => \$opt_resetup_env,
-		'bindir:s' => \$opt_bindir,
 		'image=s' => \$opt_image,
 		'testlist=s' => \@testlists,
 		'load-list=s' => \$opt_load_list,
+                'binary-mapping=s' => \$opt_binary_mapping
 	    );
 
 exit(1) if (not $result);
@@ -377,7 +376,6 @@ unless (defined($ENV{VALGRIND})) {
 # make all our python scripts unbuffered
 $ENV{PYTHONUNBUFFERED} = 1;
 
-my $bindir = ($opt_bindir or "$builddir/bin");
 my $bindir_abs = abs_path($bindir);
 
 # Backwards compatibility:
@@ -409,7 +407,6 @@ my $tmpdir_abs = abs_path("$prefix/tmp");
 mkdir($tmpdir_abs, 0777) unless -d $tmpdir_abs;
 
 my $srcdir_abs = abs_path($srcdir);
-my $builddir_abs = abs_path($builddir);
 
 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 "/";
@@ -419,8 +416,6 @@ $ENV{KRB5CCNAME} = "$prefix/krb5ticket";
 $ENV{PREFIX_ABS} = $prefix_abs;
 $ENV{SRCDIR} = $srcdir;
 $ENV{SRCDIR_ABS} = $srcdir_abs;
-$ENV{BUILDDIR} = $builddir;
-$ENV{BUILDDIR_ABS} = $builddir_abs;
 $ENV{BINDIR} = $bindir_abs;
 $ENV{EXEEXT} = $exeext;
 
@@ -462,17 +457,41 @@ if ($opt_socket_wrapper) {
 my $target;
 my $testenv_default = "none";
 
+my %binary_mapping = {};
+if ($opt_binary_mapping) {
+    my @binmapping_list = split(/,/, $opt_binary_mapping);
+    foreach my $mapping (@binmapping_list) {
+	my ($bin, $map) = split(/\:/, $mapping);
+	$binary_mapping{$bin} = $map;
+    }
+}
+
+$ENV{BINARY_MAPPING} = $opt_binary_mapping;
+
+sub bindir_path($$) {
+	my ($self, $path) = @_;
+
+	if (defined($self->{binary_mapping}->{$path})) {
+	    $path = $self->{binary_mapping}->{$path};
+	}
+
+	my $valpath = "$self->{bindir}/$path$self->{exeext}";
+
+	return $valpath if (-f $valpath);
+	return $path;
+}
+
 if ($opt_target eq "samba4") {
 	$testenv_default = "all";
 	require target::Samba4;
-	$target = new Samba4($bindir, $ldap, $srcdir, $exeext);
+	$target = new Samba4($bindir, \%binary_mapping, \&bindir_path, $ldap, $srcdir, $exeext);
 } elsif ($opt_target eq "samba3") {
 	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 = "member";
 	require target::Samba3;
-	$target = new Samba3($bindir, $srcdir_abs);
+	$target = new Samba3($bindir, \%binary_mapping, \&bindir_path, $srcdir_abs, $exeext);
 } elsif ($opt_target eq "win") {
 	die("Windows tests will not run with socket wrapper enabled.") 
 		if ($opt_socket_wrapper);
diff --git a/selftest/selftesthelpers.py b/selftest/selftesthelpers.py
index 781c8cc..085c62c 100644
--- a/selftest/selftesthelpers.py
+++ b/selftest/selftesthelpers.py
@@ -22,17 +22,27 @@ import os
 import subprocess
 
 def srcdir():
-    return os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
+    return os.path.normpath(os.getenv("SRCDIR", os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")))
 
 def source4dir():
-    return os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../source4"))
+    return os.path.normpath(os.path.join(srcdir(), "source4"))
 
 def bindir():
-    return os.path.normpath(os.path.join(os.getenv("BUILDDIR", "."), "bin"))
+    return os.path.normpath(os.getenv("BINDIR", "./bin"))
+
+binary_mapping = {}
 
 def binpath(name):
+    if name in binary_mapping:
+        name = binary_mapping[name]
     return os.path.join(bindir(), "%s%s" % (name, os.getenv("EXEEXT", "")))
 
+binary_mapping_string = os.getenv("BINARY_MAPPING", None)
+if binary_mapping_string is not None:
+    for binmapping_entry in binary_mapping_string.split(','):
+        binmapping = binmapping_entry.split(':')
+        binary_mapping[binmapping[0]] = binmapping[1]
+
 perl = os.getenv("PERL", "perl")
 perl = perl.split()
 
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index d2082f5..088acfd 100644
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -10,23 +10,15 @@ use Cwd qw(abs_path);
 use FindBin qw($RealBin);
 use POSIX;
 
-sub binpath($$)
-{
-	my ($self, $binary) = @_;
-
-	if (defined($self->{bindir})) {
-		my $path = "$self->{bindir}/$binary";
-		-f $path or die("File $path doesn't exist");
-		return $path;
-	}
-
-	return $binary;
-}
-
 sub new($$) {
-	my ($classname, $bindir, $srcdir) = @_;
-	my $self = { bindir => $bindir,
-		     srcdir => $srcdir
+	my ($classname, $bindir, $binary_mapping, $bindir_path, $srcdir, $exeext) = @_;
+	$exeext = "" unless defined($exeext);
+	my $self = { vars => {},
+		     bindir => $bindir,
+		     binary_mapping => $binary_mapping,
+		     bindir_path => $bindir_path,
+		     srcdir => $srcdir,
+		     exeext => $exeext
 	};
 	bless $self;
 	return $self;
@@ -180,7 +172,7 @@ sub setup_member($$$)
 
 	$ret or return undef;
 
-	my $net = $self->binpath("net");
+	my $net = $self->{bindir_path}->($self, "net");
 	my $cmd = "";
 	$cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$ret->{SOCKET_WRAPPER_DEFAULT_IFACE}\" ";
 	$cmd .= "$net join $ret->{CONFIGURATION} $dcvars->{DOMAIN} member";
@@ -411,14 +403,14 @@ sub check_or_start($$$$$) {
 			@optargs = split(/ /, $ENV{NMBD_OPTIONS});
 		}
 
-		$ENV{MAKE_TEST_BINARY} = $self->binpath("nmbd");
+		$ENV{MAKE_TEST_BINARY} = $self->{bindir_path}->($self, "nmbd");
 
-		my @preargs = ($self->binpath("timelimit"), $maxtime);
+		my @preargs = ($self->{bindir_path}->($self, "timelimit"), $maxtime);
 		if(defined($ENV{NMBD_VALGRIND})) { 
 			@preargs = split(/ /, $ENV{NMBD_VALGRIND});
 		}
 
-		exec(@preargs, $self->binpath("nmbd"), "-F", "--no-process-group", "-S", "-s", $env_vars->{SERVERCONFFILE}, @optargs) or die("Unable to start nmbd: $!");
+		exec(@preargs, $self->{bindir_path}->($self, "nmbd"), "-F", "--no-process-group", "-S", "-s", $env_vars->{SERVERCONFFILE}, @optargs) or die("Unable to start nmbd: $!");
 	}
 	write_pid($env_vars, "nmbd", $pid);
 	print "DONE\n";
@@ -454,14 +446,14 @@ sub check_or_start($$$$$) {
 			@optargs = split(/ /, $ENV{WINBINDD_OPTIONS});
 		}
 
-		$ENV{MAKE_TEST_BINARY} = $self->binpath("winbindd");
+		$ENV{MAKE_TEST_BINARY} = $self->{bindir_path}->($self, "winbindd");
 
-		my @preargs = ($self->binpath("timelimit"), $maxtime);
+		my @preargs = ($self->{bindir_path}->($self, "timelimit"), $maxtime);
 		if(defined($ENV{WINBINDD_VALGRIND})) {
 			@preargs = split(/ /, $ENV{WINBINDD_VALGRIND});
 		}
 
-		exec(@preargs, $self->binpath("winbindd"), "-F", "--no-process-group", "-s", $env_vars->{SERVERCONFFILE}, @optargs) or die("Unable to start winbindd: $!");
+		exec(@preargs, $self->{bindir_path}->($self, "winbindd"), "-F", "--no-process-group", "-s", $env_vars->{SERVERCONFFILE}, @optargs) or die("Unable to start winbindd: $!");
 	}
 	write_pid($env_vars, "winbindd", $pid);
 	print "DONE\n";
@@ -492,16 +484,16 @@ sub check_or_start($$$$$) {
 			exit 0;
 		}
 
-		$ENV{MAKE_TEST_BINARY} = $self->binpath("smbd");
+		$ENV{MAKE_TEST_BINARY} = $self->{bindir_path}->($self, "smbd");
 		my @optargs = ("-d0");
 		if (defined($ENV{SMBD_OPTIONS})) {
 			@optargs = split(/ /, $ENV{SMBD_OPTIONS});
 		}
-		my @preargs = ($self->binpath("timelimit"), $maxtime);
+		my @preargs = ($self->{bindir_path}->($self, "timelimit"), $maxtime);
 		if(defined($ENV{SMBD_VALGRIND})) {
 			@preargs = split(/ /,$ENV{SMBD_VALGRIND});
 		}
-		exec(@preargs, $self->binpath("smbd"), "-F", "--no-process-group", "-s", $env_vars->{SERVERCONFFILE}, @optargs) or die("Unable to start smbd: $!");
+		exec(@preargs, $self->{bindir_path}->($self, "smbd"), "-F", "--no-process-group", "-s", $env_vars->{SERVERCONFFILE}, @optargs) or die("Unable to start smbd: $!");
 	}
 	write_pid($env_vars, "smbd", $pid);
 	print "DONE\n";
@@ -824,7 +816,7 @@ domusers:X:$gid_domusers:
 	$ENV{NSS_WRAPPER_PASSWD} = $nss_wrapper_passwd;
 	$ENV{NSS_WRAPPER_GROUP} = $nss_wrapper_group;
 
-	open(PWD, "|".$self->binpath("smbpasswd")." -c $conffile -L -s -a $unix_name >/dev/null");
+	open(PWD, "|".$self->{bindir_path}->($self, "smbpasswd")." -c $conffile -L -s -a $unix_name >/dev/null");
 	print PWD "$password\n$password\n";
 	close(PWD) or die("Unable to set password for test account");
 
@@ -871,11 +863,11 @@ sub wait_for_start($$)
 	print "delaying for nbt name registration\n";
 	sleep(10);
 	# This will return quickly when things are up, but be slow if we need to wait for (eg) SSL init 
-	system($self->binpath("nmblookup") ." $envvars->{CONFIGURATION} -U $envvars->{SERVER_IP} __SAMBA__");
-	system($self->binpath("nmblookup") ." $envvars->{CONFIGURATION} __SAMBA__");
-	system($self->binpath("nmblookup") ." $envvars->{CONFIGURATION} -U 127.255.255.255 __SAMBA__");
-	system($self->binpath("nmblookup") ." $envvars->{CONFIGURATION} -U $envvars->{SERVER_IP} $envvars->{SERVER}");
-	system($self->binpath("nmblookup") ." $envvars->{CONFIGURATION} $envvars->{SERVER}");
+	system($self->{bindir_path}->($self, "nmblookup3") ." $envvars->{CONFIGURATION} -U $envvars->{SERVER_IP} __SAMBA__");
+	system($self->{bindir_path}->($self, "nmblookup3") ." $envvars->{CONFIGURATION} __SAMBA__");
+	system($self->{bindir_path}->($self, "nmblookup3") ." $envvars->{CONFIGURATION} -U 127.255.255.255 __SAMBA__");
+	system($self->{bindir_path}->($self, "nmblookup3") ." $envvars->{CONFIGURATION} -U $envvars->{SERVER_IP} $envvars->{SERVER}");
+	system($self->{bindir_path}->($self, "nmblookup3") ." $envvars->{CONFIGURATION} $envvars->{SERVER}");
 
 	# make sure smbd is also up set
 	print "wait for smbd\n";
@@ -883,7 +875,7 @@ sub wait_for_start($$)
 	my $count = 0;
 	my $ret;
 	do {
-	    $ret = system($self->binpath("smbclient") ." $envvars->{CONFIGURATION} -L $envvars->{SERVER} -U% -p 139");
+	    $ret = system($self->{bindir_path}->($self, "smbclient3") ." $envvars->{CONFIGURATION} -L $envvars->{SERVER} -U% -p 139");
 	    if ($ret != 0) {
 		sleep(2);
 	    }
@@ -895,7 +887,7 @@ sub wait_for_start($$)
 	    return 0;
 	}
 	# Ensure we have domain users mapped.
-	$ret = system($self->binpath("net") ." $envvars->{CONFIGURATION} groupmap add rid=513 unixgroup=domusers type=domain");
+	$ret = system($self->{bindir_path}->($self, "net") ." $envvars->{CONFIGURATION} groupmap add rid=513 unixgroup=domusers type=domain");
 	if ($ret != 0) {
 	    return 1;
 	}
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 07dcf36..6f78074 100644
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -12,12 +12,15 @@ use POSIX;
 use SocketWrapper;
 
 sub new($$$$$) {
-	my ($classname, $bindir, $ldap, $srcdir, $exeext) = @_;
+	my ($classname, $bindir, $binary_mapping, $bindir_path, $ldap, $srcdir, $exeext) = @_;
 	$exeext = "" unless defined($exeext);
+
 	my $self = {
 		vars => {},
 		ldap => $ldap,
 		bindir => $bindir,
+		binary_mapping => $binary_mapping,
+		bindir_path => $bindir_path,
 		srcdir => $srcdir,
 		exeext => $exeext
 	};
@@ -25,15 +28,6 @@ sub new($$$$$) {
 	return $self;
 }
 
-sub bindir_path($$) {
-	my ($self, $path) = @_;
-
-	my $valpath = "$self->{bindir}/$path$self->{exeext}";
-
-	return $valpath if (-f $valpath);
-	return $path;
-}
-
 sub scriptdir_path($$) {
 	my ($self, $path) = @_;
 	return "$self->{srcdir}/source4/scripting/$path";
@@ -46,7 +40,7 @@ sub slapd_start($$)
 {
 	my $count = 0;
 	my ($self, $env_vars) = @_;
-	my $ldbsearch = $self->bindir_path("ldbsearch");
+	my $ldbsearch = $self->bindir_path($self, "ldbsearch");
 
 	my $uri = $env_vars->{LDAP_URI};
 
@@ -138,7 +132,7 @@ sub check_or_start($$$)
 		if (defined($ENV{SAMBA_OPTIONS})) {
 			$optarg.= " $ENV{SAMBA_OPTIONS}";
 		}
-		my $samba = $self->bindir_path("samba");
+		my $samba = $self->{bindir_path}->($self, "samba");
 
 		# allow selection of the process model using
 		# the environment varibale SAMBA_PROCESS_MODEL
@@ -186,7 +180,7 @@ sub wait_for_start($$)
 
 	# This will return quickly when things are up, but be slow if we


-- 
Samba Shared Repository


More information about the samba-cvs mailing list