diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-04-18 17:38:35 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-04-19 14:26:59 +1000 |
commit | 9000188fb4226b4c70ae6b50292a0fe2a55e653c (patch) | |
tree | 666fada1d1712c226d8f6c5ccf9ac894bc9b42d4 /selftest/target | |
parent | aed450df0b38d6648cbfd3229722db82a85ad746 (diff) | |
download | samba-9000188fb4226b4c70ae6b50292a0fe2a55e653c.tar.gz samba-9000188fb4226b4c70ae6b50292a0fe2a55e653c.tar.bz2 samba-9000188fb4226b4c70ae6b50292a0fe2a55e653c.zip |
selftest Add combined 'Samba' target module
To work around environment variable handling, the initialisation of
NSS_WRAPPER_WINBIND_SO_PATH is pushed in to Samba3.pm (the s3 autoconf
build still overrides this)
Andrew Bartlett
Diffstat (limited to 'selftest/target')
-rw-r--r-- | selftest/target/Samba.pm | 45 | ||||
-rw-r--r-- | selftest/target/Samba3.pm | 3 |
2 files changed, 48 insertions, 0 deletions
diff --git a/selftest/target/Samba.pm b/selftest/target/Samba.pm new file mode 100644 index 0000000000..703d0b5e62 --- /dev/null +++ b/selftest/target/Samba.pm @@ -0,0 +1,45 @@ +#!/usr/bin/perl +# Bootstrap Samba and run a number of tests against it. +# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer@samba.org> +# Published under the GNU GPL, v3 or later. + +package Samba; + +use strict; +use target::Samba3; +use target::Samba4; + +sub new($$$$$) { + my ($classname, $bindir, $binary_mapping, $bindir_path, $ldap, $srcdir, $exeext) = @_; + + my $self = { + samba3 => new Samba3($bindir,$binary_mapping, $bindir_path, $srcdir, $exeext), + samba4 => new Samba4($bindir,$binary_mapping, $bindir_path, $ldap, $srcdir, $exeext), + }; + bless $self; + return $self; +} + +sub setup_env($$$) +{ + my ($self, $envname, $path) = @_; + + $ENV{ENVNAME} = $envname; + + my $env = $self->{samba4}->setup_env($envname, $path); + if (defined($env)) { + $env->{target} = $self->{samba4}; + } else { + $env = $self->{samba3}->setup_env($envname, $path); + if (defined($env)) { + $env->{target} = $self->{samba3}; + } + } + if (not defined $env) { + warn("Samba can't provide environment '$envname'"); + return undef; + } + return $env; +} + +1; diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 06a0dc3199..13023791da 100644 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -850,6 +850,9 @@ domusers:X:$gid_domusers: $ret{NSS_WRAPPER_PASSWD} = $nss_wrapper_passwd; $ret{NSS_WRAPPER_GROUP} = $nss_wrapper_group; $ret{NSS_WRAPPER_WINBIND_SO_PATH} = $ENV{NSS_WRAPPER_WINBIND_SO_PATH}; + if (not defined($ret{NSS_WRAPPER_WINBIND_SO_PATH})) { + $ret{NSS_WRAPPER_WINBIND_SO_PATH} = $self->{bindir_path}->($self, "default/nsswitch/libnss-winbind.so"); + } $ret{LOCAL_PATH} = "$shrdir"; return \%ret; |