diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-09-30 09:08:10 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:07:33 -0500 |
commit | 289f09e14b2d1622d77f16c819b51366808130c1 (patch) | |
tree | 3fdbe384efc320ece7ac70797e6d9efebd355480 /source4 | |
parent | f2e99e352f70556fce74b70bccdbd9f7f2084155 (diff) | |
download | samba-289f09e14b2d1622d77f16c819b51366808130c1.tar.gz samba-289f09e14b2d1622d77f16c819b51366808130c1.tar.bz2 samba-289f09e14b2d1622d77f16c819b51366808130c1.zip |
r25438: start samba3's winbindd in the selftest "dc" env
metze
(This used to be commit 161c55be37bf15b873eae103463ac732e318a74a)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/selftest/env/Samba3.pm | 76 |
1 files changed, 63 insertions, 13 deletions
diff --git a/source4/selftest/env/Samba3.pm b/source4/selftest/env/Samba3.pm index 1e3b155a58..546556eff1 100644 --- a/source4/selftest/env/Samba3.pm +++ b/source4/selftest/env/Samba3.pm @@ -36,11 +36,14 @@ sub teardown_env($$) my $smbdpid = read_pid($envvars, "smbd"); my $nmbdpid = read_pid($envvars, "nmbd"); + my $winbinddpid = read_pid($envvars, "winbindd"); $self->stop_sig_term($smbdpid); $self->stop_sig_term($nmbdpid); + $self->stop_sig_term($winbinddpid); $self->stop_sig_kill($smbdpid); $self->stop_sig_kill($nmbdpid); + $self->stop_sig_kill($winbinddpid); return 0; } @@ -69,8 +72,13 @@ sub getlog_env_app($$$) sub getlog_env($$) { my ($self, $envvars) = @_; + my $ret = ""; - return $self->getlog_env_app($envvars, "SMBD") . $self->getlog_env_app($envvars, "NMBD"); + $ret .= $self->getlog_env_app($envvars, "SMBD"); + $ret .= $self->getlog_env_app($envvars, "NMBD"); + $ret .= $self->getlog_env_app($envvars, "WINBINDD"); + + return $ret; } sub check_env($$) @@ -98,7 +106,10 @@ sub setup_dc($$) my $vars = $self->provision($path, "dc"); - $self->check_or_start($vars, ($ENV{NMBD_MAXTIME} or 2700), ($ENV{SMBD_MAXTIME} or 2700)); + $self->check_or_start($vars, + ($ENV{NMBD_MAXTIME} or 2700), + ($ENV{WINBINDD_MAXTIME} or 2700), + ($ENV{SMBD_MAXTIME} or 2700)); $self->wait_for_start($vars); @@ -140,7 +151,7 @@ sub read_pid($$) } sub check_or_start($$$$) { - my ($self, $env_vars, $nmbd_maxtime, $smbd_maxtime) = @_; + my ($self, $env_vars, $nmbd_maxtime, $winbindd_maxtime, $smbd_maxtime) = @_; unlink($env_vars->{NMBD_TEST_LOG}); print "STARTING NMBD..."; @@ -148,20 +159,39 @@ sub check_or_start($$$$) { if ($pid == 0) { open STDOUT, ">$env_vars->{NMBD_TEST_LOG}"; open STDERR, '>&STDOUT'; - + + $ENV{WINBINDD_SOCKET_DIR} = $env_vars->{WINBINDD_SOCKET_DIR}; + $ENV{MAKE_TEST_BINARY} = $self->binpath("nmbd"); exec($self->binpath("timelimit"), $nmbd_maxtime, $self->binpath("nmbd"), "-F", "-S", "-d0", "--no-process-group", "-s", $env_vars->{SERVERCONFFILE}) or die("Unable to start nmbd: $!"); } write_pid($env_vars, "nmbd", $pid); print "DONE\n"; + unlink($env_vars->{WINBINDD_TEST_LOG}); + print "STARTING WINBINDD..."; + my $pid = fork(); + if ($pid == 0) { + open STDOUT, ">$env_vars->{WINBINDD_TEST_LOG}"; + open STDERR, '>&STDOUT'; + + $ENV{WINBINDD_SOCKET_DIR} = $env_vars->{WINBINDD_SOCKET_DIR}; + + $ENV{MAKE_TEST_BINARY} = $self->binpath("winbindd"); + exec($self->binpath("timelimit"), $winbindd_maxtime, $self->binpath("winbindd"), "-F", "-S", "-d0", "--no-process-group", "-s", $env_vars->{SERVERCONFFILE}) or die("Unable to start winbindd: $!"); + } + write_pid($env_vars, "winbindd", $pid); + print "DONE\n"; + unlink($env_vars->{SMBD_TEST_LOG}); print "STARTING SMBD..."; $pid = fork(); if ($pid == 0) { open STDOUT, ">$env_vars->{SMBD_TEST_LOG}"; open STDERR, '>&STDOUT'; - + + $ENV{WINBINDD_SOCKET_DIR} = $env_vars->{WINBINDD_SOCKET_DIR}; + $ENV{MAKE_TEST_BINARY} = $self->binpath("smbd"); exec($self->binpath("timelimit"), $smbd_maxtime, $self->binpath("smbd"), "-F", "-S", "-d0" , "--no-process-group", "-s", $env_vars->{SERVERCONFFILE}) or die("Unable to start smbd: $!"); } @@ -216,6 +246,8 @@ sub provision($$$) my %ret = (); my $server = "localhost2"; my $server_ip = "127.0.0.2"; + my $domain = "SAMBA-TEST"; + my $username = `PATH=/usr/ucb:$ENV{PATH} whoami`; chomp $username; my $password = "test"; @@ -223,14 +255,29 @@ sub provision($$$) my $srcdir="$RealBin/.."; my $scriptdir="$srcdir/selftest"; my $prefix_abs = abs_path($prefix); - my $shrdir="$prefix_abs/tmp"; + + my @dirs = (); + + my $shrdir="$prefix_abs/share"; + push(@dirs,$shrdir); + my $libdir="$prefix_abs/lib"; + push(@dirs,$libdir); + my $piddir="$prefix_abs/pid"; - my $conffile="$libdir/server.conf"; + push(@dirs,$piddir); + my $privatedir="$prefix_abs/private"; + push(@dirs,$privatedir); + my $lockdir="$prefix_abs/lockdir"; + push(@dirs,$lockdir); + my $logdir="$prefix_abs/logs"; - my $domain = "SAMBA-TEST"; + push(@dirs,$logdir); + + # this gets autocreated by winbindd + my $wbsockdir="$prefix_abs/winbindd"; ## ## create the test directory layout @@ -238,10 +285,9 @@ sub provision($$$) mkdir($prefix_abs, 0777); print "CREATE TEST ENVIRONMENT IN '$prefix'..."; system("rm -rf $prefix_abs/*"); - mkdir($_, 0777) foreach($privatedir,$libdir,$piddir,$lockdir,$logdir); - my $tmpdir = "$prefix_abs/tmp"; - mkdir($tmpdir, 0777); - chmod 0777, $tmpdir; + mkdir($_, 0777) foreach(@dirs); + + my $conffile="$libdir/server.conf"; open(CONF, ">$conffile") or die("Unable to open $conffile"); print CONF " @@ -283,8 +329,10 @@ sub provision($$$) print CONF " + winbindd:socket dir = $wbsockdir + [tmp] - path = $tmpdir + path = $shrdir read only = no smbd:sharedelay = 100000 map hidden = yes @@ -321,6 +369,7 @@ print CONF " $ret{SERVER_IP} = $server_ip; $ret{NMBD_TEST_LOG} = "$prefix/nmbd_test.log"; + $ret{WINBINDD_TEST_LOG} = "$prefix/winbindd_test.log"; $ret{SMBD_TEST_LOG} = "$prefix/smbd_test.log"; $ret{SERVERCONFFILE} = $conffile; $ret{CONFIGURATION} ="-s $conffile"; @@ -330,6 +379,7 @@ print CONF " $ret{NETBIOSNAME} = $server; $ret{PASSWORD} = $password; $ret{PIDDIR} = $piddir; + $ret{WINBINDD_SOCKET_DIR} = $wbsockdir; return \%ret; } |