summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-09-01 23:11:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:03:25 -0500
commitc09c89a8a7ca5769fb8c0995779b9134f1618cf0 (patch)
treeb8072c25d65b5101ad8854c25252c2219cbb73ac
parentc125a7c5a7aee1b0506ab4eddbb4868ca8411fba (diff)
downloadsamba-c09c89a8a7ca5769fb8c0995779b9134f1618cf0.tar.gz
samba-c09c89a8a7ca5769fb8c0995779b9134f1618cf0.tar.bz2
samba-c09c89a8a7ca5769fb8c0995779b9134f1618cf0.zip
r24873: Print smbd/nmbd log files for Samba 3.
(This used to be commit 8dad4c5503b2987bdf44324301a067063d48495f)
-rw-r--r--source4/selftest/env/Samba3.pm27
1 files 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 (<LOG>) {
+ $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;
}
}