diff options
Diffstat (limited to 'selftest')
-rw-r--r-- | selftest/SocketWrapper.pm | 16 | ||||
-rw-r--r-- | selftest/Subunit.pm | 16 | ||||
-rw-r--r-- | selftest/output/buildfarm.pm | 15 | ||||
-rw-r--r-- | selftest/output/html.pm | 16 | ||||
-rw-r--r-- | selftest/output/plain.pm | 16 | ||||
-rwxr-xr-x | selftest/selftest.pl | 14 | ||||
-rw-r--r-- | selftest/target/Samba3.pm | 38 | ||||
-rw-r--r-- | selftest/target/Samba4.pm | 8 |
8 files changed, 113 insertions, 26 deletions
diff --git a/selftest/SocketWrapper.pm b/selftest/SocketWrapper.pm index e63605b8df..ef8058da79 100644 --- a/selftest/SocketWrapper.pm +++ b/selftest/SocketWrapper.pm @@ -1,7 +1,21 @@ #!/usr/bin/perl # Bootstrap Samba and run a number of tests against it. # Copyright (C) 2005-2007 Jelmer Vernooij <jelmer@samba.org> -# Published under the GNU GPL, v3 or later. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + package SocketWrapper; diff --git a/selftest/Subunit.pm b/selftest/Subunit.pm index 05e51da541..19af636d0b 100644 --- a/selftest/Subunit.pm +++ b/selftest/Subunit.pm @@ -1,3 +1,19 @@ +# Simple Perl module for parsing the Subunit protocol +# Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + package Subunit; require Exporter; diff --git a/selftest/output/buildfarm.pm b/selftest/output/buildfarm.pm index cee6c1e63a..77ea26621b 100644 --- a/selftest/output/buildfarm.pm +++ b/selftest/output/buildfarm.pm @@ -1,4 +1,19 @@ #!/usr/bin/perl +# Buildfarm output for selftest +# Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. package output::buildfarm; diff --git a/selftest/output/html.pm b/selftest/output/html.pm index 1049527129..e490765d06 100644 --- a/selftest/output/html.pm +++ b/selftest/output/html.pm @@ -1,5 +1,19 @@ #!/usr/bin/perl - +# HTML output for selftest +# Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. package output::html; use Exporter; @ISA = qw(Exporter); diff --git a/selftest/output/plain.pm b/selftest/output/plain.pm index 82a73ab932..5312a9e27b 100644 --- a/selftest/output/plain.pm +++ b/selftest/output/plain.pm @@ -1,5 +1,19 @@ #!/usr/bin/perl - +# Plain text output for selftest +# Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. package output::plain; use Exporter; @ISA = qw(Exporter); diff --git a/selftest/selftest.pl b/selftest/selftest.pl index ef4c385d33..3653523541 100755 --- a/selftest/selftest.pl +++ b/selftest/selftest.pl @@ -2,7 +2,19 @@ # Bootstrap Samba and run a number of tests against it. # Copyright (C) 2005-2008 Jelmer Vernooij <jelmer@samba.org> # Copyright (C) 2007-2009 Stefan Metzmacher <metze@samba.org> -# Published under the GNU GPL, v3 or later. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. =pod diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index e1bea16523..0b176d601c 100644 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -41,6 +41,9 @@ sub teardown_env($$) $self->stop_sig_term($smbdpid); $self->stop_sig_term($nmbdpid); $self->stop_sig_term($winbinddpid); + + sleep(2); + $self->stop_sig_kill($smbdpid); $self->stop_sig_kill($nmbdpid); $self->stop_sig_kill($winbinddpid); @@ -123,9 +126,8 @@ sub setup_dc($$) $dc_options); $self->check_or_start($vars, - ($ENV{NMBD_MAXTIME} or 2700), - ($ENV{WINBINDD_MAXTIME} or 2700), - ($ENV{SMBD_MAXTIME} or 2700)); + ($ENV{SMBD_MAXTIME} or 2700), + "yes", "yes", "yes"); $self->wait_for_start($vars); @@ -142,6 +144,7 @@ sub setup_member($$$) my $member_options = " security = domain + server signing = on "; my $ret = $self->provision($prefix, "LOCALMEMBER3", @@ -160,9 +163,8 @@ sub setup_member($$$) system($cmd) == 0 or die("Join failed\n$cmd"); $self->check_or_start($ret, - ($ENV{NMBD_MAXTIME} or 2700), - ($ENV{WINBINDD_MAXTIME} or 2700), - ($ENV{SMBD_MAXTIME} or 2700)); + ($ENV{SMBD_MAXTIME} or 2700), + "yes", "yes", "yes"); $self->wait_for_start($ret); @@ -187,7 +189,7 @@ sub stop_sig_term($$) { sub stop_sig_kill($$) { my ($self, $pid) = @_; - kill("KILL", $pid) or warn("Unable to kill $pid: $!"); + kill("ALRM", $pid) or warn("Unable to kill $pid: $!"); } sub write_pid($$$) @@ -209,8 +211,8 @@ sub read_pid($$) return $pid; } -sub check_or_start($$$$) { - my ($self, $env_vars, $nmbd_maxtime, $winbindd_maxtime, $smbd_maxtime) = @_; +sub check_or_start($$$$$) { + my ($self, $env_vars, $maxtime, $nmbd, $winbindd, $smbd) = @_; unlink($env_vars->{NMBD_TEST_LOG}); print "STARTING NMBD..."; @@ -226,13 +228,13 @@ sub check_or_start($$$$) { $ENV{NSS_WRAPPER_PASSWD} = $env_vars->{NSS_WRAPPER_PASSWD}; $ENV{NSS_WRAPPER_GROUP} = $env_vars->{NSS_WRAPPER_GROUP}; - if ($nmbd_maxtime eq "skip") { + if ($nmbd ne "yes") { $SIG{USR1} = $SIG{ALRM} = $SIG{INT} = $SIG{QUIT} = $SIG{TERM} = sub { my $signame = shift; print("Skip nmbd received signal $signame"); exit 0; }; - sleep(999999); + sleep($maxtime); exit 0; } @@ -243,7 +245,7 @@ sub check_or_start($$$$) { $ENV{MAKE_TEST_BINARY} = $self->binpath("nmbd"); - my @preargs = ($self->binpath("timelimit"), $nmbd_maxtime); + my @preargs = ($self->binpath("timelimit"), $maxtime); if(defined($ENV{NMBD_VALGRIND})) { @preargs = split(/ /, $ENV{NMBD_VALGRIND}); } @@ -267,13 +269,13 @@ sub check_or_start($$$$) { $ENV{NSS_WRAPPER_PASSWD} = $env_vars->{NSS_WRAPPER_PASSWD}; $ENV{NSS_WRAPPER_GROUP} = $env_vars->{NSS_WRAPPER_GROUP}; - if ($winbindd_maxtime eq "skip") { + if ($winbindd ne "yes") { $SIG{USR1} = $SIG{ALRM} = $SIG{INT} = $SIG{QUIT} = $SIG{TERM} = sub { my $signame = shift; print("Skip winbindd received signal $signame"); exit 0; }; - sleep(999999); + sleep($maxtime); exit 0; } @@ -284,7 +286,7 @@ sub check_or_start($$$$) { $ENV{MAKE_TEST_BINARY} = $self->binpath("winbindd"); - my @preargs = ($self->binpath("timelimit"), $winbindd_maxtime); + my @preargs = ($self->binpath("timelimit"), $maxtime); if(defined($ENV{WINBINDD_VALGRIND})) { @preargs = split(/ /, $ENV{WINBINDD_VALGRIND}); } @@ -308,13 +310,13 @@ sub check_or_start($$$$) { $ENV{NSS_WRAPPER_PASSWD} = $env_vars->{NSS_WRAPPER_PASSWD}; $ENV{NSS_WRAPPER_GROUP} = $env_vars->{NSS_WRAPPER_GROUP}; - if ($smbd_maxtime eq "skip") { + if ($smbd ne "yes") { $SIG{USR1} = $SIG{ALRM} = $SIG{INT} = $SIG{QUIT} = $SIG{TERM} = sub { my $signame = shift; print("Skip smbd received signal $signame"); exit 0; }; - sleep(999999); + sleep($maxtime); exit 0; } @@ -323,7 +325,7 @@ sub check_or_start($$$$) { if (defined($ENV{SMBD_OPTIONS})) { @optargs = split(/ /, $ENV{SMBD_OPTIONS}); } - my @preargs = ($self->binpath("timelimit"), $smbd_maxtime); + my @preargs = ($self->binpath("timelimit"), $maxtime); if(defined($ENV{SMBD_VALGRIND})) { @preargs = split(/ /,$ENV{SMBD_VALGRIND}); } diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index 71dddf6939..1058ac66e0 100644 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -103,8 +103,8 @@ sub check_or_start($$$) SocketWrapper::set_default_iface($env_vars->{SOCKET_WRAPPER_DEFAULT_IFACE}); my $valgrind = ""; - if (defined($ENV{SMBD_VALGRIND})) { - $valgrind = $ENV{SMBD_VALGRIND}; + if (defined($ENV{SAMBA_VALGRIND})) { + $valgrind = $ENV{SAMBA_VALGRIND}; } $ENV{KRB5_CONFIG} = $env_vars->{KRB5_CONFIG}; @@ -122,8 +122,8 @@ sub check_or_start($$$) if (defined($max_time)) { $optarg = "--maximum-runtime=$max_time "; } - if (defined($ENV{SMBD_OPTIONS})) { - $optarg.= " $ENV{SMBD_OPTIONS}"; + if (defined($ENV{SAMBA_OPTIONS})) { + $optarg.= " $ENV{SAMBA_OPTIONS}"; } my $samba = $self->bindir_path("samba"); my $ret = system("$valgrind $samba $optarg $env_vars->{CONFIGURATION} -M single -i --leak-report-full"); |