From c09c89a8a7ca5769fb8c0995779b9134f1618cf0 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 1 Sep 2007 23:11:48 +0000 Subject: r24873: Print smbd/nmbd log files for Samba 3. (This used to be commit 8dad4c5503b2987bdf44324301a067063d48495f) --- source4/selftest/env/Samba3.pm | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/source4/selftest/env/Samba3.pm b/source4/selftest/env/Samba3.pm index b699fbb2b5..22c6f59987 100644 --- a/source4/selftest/env/Samba3.pm +++ b/source4/selftest/env/Samba3.pm @@ -8,6 +8,7 @@ package Samba3; use strict; use Cwd qw(abs_path); use FindBin qw($RealBin); +use POSIX; sub binpath($$) { @@ -39,12 +40,32 @@ sub teardown_env($$) return 0; } +sub getlog_env_app($$$) +{ + my ($self, $envvars, $name) = @_; + + my $title = "$name LOG of: $envvars->{NETBIOSNAME}\n"; + my $out = $title; + + open(LOG, "<".$envvars->{$name."_TEST_LOG"}); + + seek(LOG, $envvars->{$name."_TEST_LOG_POS"}, SEEK_SET); + while () { + $out .= $_; + } + $envvars->{$name."_TEST_LOG_POS"} = tell(LOG); + close(LOG); + + return "" if $out eq $title; + + return $out; +} + sub getlog_env($$) { my ($self, $envvars) = @_; - # TODO... - return ""; + return $self->getlog_env_app($envvars, "SMBD") . $self->getlog_env_app($envvars, "NMBD"); } sub check_env($$) @@ -62,7 +83,7 @@ sub setup_env($$$) if ($envname eq "dc") { return $self->setup_dc("$path/dc"); } else { - die("Samba3 can't provide environment '$envname'"); + return undef; } } -- cgit