summaryrefslogtreecommitdiff
path: root/selftest
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-10-02 12:42:00 -0700
committerAndrew Tridgell <tridge@samba.org>2010-10-02 21:11:52 -0700
commit507c413e488dfe374870bae3af0d89c3b015add2 (patch)
tree459d102e9d08a3d73ee02a2a34dafb47691c6cf1 /selftest
parent60e25ab06bfe4aefcb06c1376074d717460d67af (diff)
downloadsamba-507c413e488dfe374870bae3af0d89c3b015add2.tar.gz
samba-507c413e488dfe374870bae3af0d89c3b015add2.tar.bz2
samba-507c413e488dfe374870bae3af0d89c3b015add2.zip
s4-selftest: fixed up exit codes on signals for make test
also set $ENVNAME in launched servers
Diffstat (limited to 'selftest')
-rw-r--r--selftest/target/Samba4.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 53237e0500..1e65c66384 100644
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -88,7 +88,7 @@ sub check_or_start($$$)
POSIX::mkfifo($env_vars->{SAMBA_TEST_FIFO}, 0700);
unlink($env_vars->{SAMBA_TEST_LOG});
- print "STARTING SAMBA... ";
+ print "STARTING SAMBA for $ENV{ENVNAME}\n";
my $pid = fork();
if ($pid == 0) {
open STDIN, $env_vars->{SAMBA_TEST_FIFO};
@@ -139,20 +139,23 @@ sub check_or_start($$$)
$model = $ENV{SAMBA_PROCESS_MODEL};
}
my $ret = system("$valgrind $samba $optarg $env_vars->{CONFIGURATION} -M $model -i");
- if ($? == -1) {
+ if ($ret == -1) {
print "Unable to start $samba: $ret: $!\n";
exit 1;
}
+ my $exit = ($ret >> 8);
unlink($env_vars->{SAMBA_TEST_FIFO});
- my $exit = $? >> 8;
if ($ret == 0) {
- print "$samba exits with status $exit\n";
+ print "$samba exited with no error\n";
+ exit 0;
} elsif ( $ret & 127 ) {
print "$samba got signal ".($ret & 127)." and exits with $exit!\n";
} else {
- $ret = $? >> 8;
print "$samba failed with status $exit!\n";
}
+ if ($exit == 0) {
+ $exit = -1;
+ }
exit $exit;
}
print "DONE\n";
@@ -1251,6 +1254,8 @@ sub setup_env($$$)
{
my ($self, $envname, $path) = @_;
+ $ENV{ENVNAME} = $envname;
+
if ($envname eq "dc") {
return $self->setup_dc("$path/dc");
} elsif ($envname eq "fl2000dc") {