1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

selftest: abstract Samba3 provision a bit

metze
This commit is contained in:
Stefan Metzmacher 2009-01-28 20:30:16 +01:00
parent 8b7c66512d
commit 6a41a2de8d
2 changed files with 21 additions and 15 deletions

View File

@ -104,7 +104,18 @@ sub setup_dc($$)
{
my ($self, $path) = @_;
my $vars = $self->provision($path, "dc");
print "PROVISIONING DC...";
my $dc_options = "
domain master = yes
domain logons = yes
";
my $vars = $self->provision($path,
"LOCALDC2",
2,
"localdc2pass",
$dc_options);
$self->check_or_start($vars,
($ENV{NMBD_MAXTIME} or 2700),
@ -280,17 +291,16 @@ sub create_clientconf($$$)
close(CONF);
}
sub provision($$$)
sub provision($$$$$$)
{
my ($self, $prefix, $role) = @_;
my ($self, $prefix, $server, $swiface, $password, $extra_options) = @_;
##
## setup the various environment variables we need
##
my %ret = ();
my $server = "LOCALHOST2";
my $server_ip = "127.0.0.2";
my $server_ip = "127.0.0.$swiface";
my $domain = "SAMBA-TEST";
my $unix_name = ($ENV{USER} or $ENV{LOGNAME} or `PATH=/usr/ucb:$ENV{PATH} whoami`);
@ -366,14 +376,6 @@ sub provision($$$)
passdb backend = tdbsam
";
if ($role eq "dc") {
print CONF "\tdomain master = yes\n";
print CONF "\tdomain logons = yes\n";
}
print CONF "
time server = yes
add user script = $nss_wrapper_pl --path $nss_wrapper_passwd --type passwd --action add --name %u
@ -401,6 +403,10 @@ print CONF "
create mask = 755
vfs objects = $bindir_abs/xattr_tdb.so $bindir_abs/streams_depot.so
# Begin extra options
$extra_options
# End extra options
#Include user defined custom parameters if set
$ENV{INCLUDE_CUSTOM_CONF}
@ -470,7 +476,7 @@ $unix_name-group:x:$unix_gids[0]:
$ret{PIDDIR} = $piddir;
$ret{WINBINDD_SOCKET_DIR} = $wbsockdir;
$ret{WINBINDD_PRIV_PIPE_DIR} = $wbsockprivdir;
$ret{SOCKET_WRAPPER_DEFAULT_IFACE} => 2,
$ret{SOCKET_WRAPPER_DEFAULT_IFACE} => $swiface,
$ret{NSS_WRAPPER_PASSWD} = $nss_wrapper_passwd;
$ret{NSS_WRAPPER_GROUP} = $nss_wrapper_group;

View File

@ -16,7 +16,7 @@ test_time()
{
PARAM="$1"
${NETTIME} ${PARAM} -S localhost2
${NETTIME} -S ${SERVER} ${PARAM}
}
test_lookup()