2 # Bootstrap Samba and run a number of tests against it.
3 # Copyright (C) 2005-2010 Jelmer Vernooij <jelmer@samba.org>
4 # Copyright (C) 2007-2009 Stefan Metzmacher <metze@samba.org>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 use FindBin
qw($RealBin $Script);
23 use File::Temp qw(tempfile);
33 Time
::HiRes
->import("time");
36 print "You don't have Time::Hires installed !\n";
40 my $opt_target = "samba";
42 my $opt_socket_wrapper = 0;
43 my $opt_socket_wrapper_pcap = undef;
44 my $opt_socket_wrapper_keep_pcap = undef;
45 my $opt_random_order = 0;
52 my $opt_resetup_env = undef;
53 my $opt_binary_mapping = "";
54 my $opt_load_list = undef;
55 my $opt_libnss_wrapper_so_path = "";
56 my $opt_libsocket_wrapper_so_path = "";
57 my $opt_libuid_wrapper_so_path = "";
69 print STDERR
"Exiting early because of SIGPIPE.\n";
73 $SIG{PIPE
} = \
&pipe_handler
;
77 my ($list, $fullname) = @_;
80 if ($fullname =~ /$$_[0]/) {
81 return ($$_[1]) if ($$_[1]);
93 return find_in_list
(\
@excludes, $name);
102 return unless ($opt_socket_wrapper_pcap);
103 return unless defined($ENV{SOCKET_WRAPPER_PCAP_DIR
});
106 $fname =~ s
%[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\
-]%_%g;
108 my $pcap_file = "$ENV{SOCKET_WRAPPER_PCAP_DIR}/$fname.pcap";
110 SocketWrapper
::setup_pcap
($pcap_file);
117 my ($pcap_file, $exitcode) = @_;
119 return unless ($opt_socket_wrapper_pcap);
120 return if ($opt_socket_wrapper_keep_pcap);
121 return unless ($exitcode == 0);
122 return unless defined($pcap_file);
127 # expand strings from %ENV
128 sub expand_environment_strings
($)
131 # we use a reverse sort so we do the longer ones first
132 foreach my $k (sort { $b cmp $a } keys %ENV) {
133 $s =~ s/\$$k/$ENV{$k}/g;
138 sub run_testsuite
($$$$$)
140 my ($envname, $name, $cmd, $i, $totalsuites) = @_;
141 my $pcap_file = setup_pcap
($name);
143 Subunit
::start_testsuite
($name);
144 Subunit
::progress_push
();
145 Subunit
::report_time
(time());
147 Subunit
::report_time
(time());
148 Subunit
::progress_pop
();
151 Subunit
::progress_pop
();
152 Subunit
::end_testsuite
($name, "error", "Unable to run $cmd: $!");
155 Subunit
::end_testsuite
($name, "error",
156 sprintf("%s died with signal %d, %s coredump\n", $cmd, ($?
& 127), ($?
& 128) ?
'with' : 'without'));
160 my $exitcode = $?
>> 8;
162 my $envlog = getlog_env
($envname);
164 print "envlog: $envlog\n";
167 print "command: $cmd\n";
168 printf "expanded command: %s\n", expand_environment_strings
($cmd);
170 if ($exitcode == 0) {
171 Subunit
::end_testsuite
($name, "success");
173 Subunit
::end_testsuite
($name, "failure", "Exit code was $exitcode");
176 cleanup_pcap
($pcap_file, $exitcode);
178 if (not $opt_socket_wrapper_keep_pcap and defined($pcap_file)) {
179 print "PCAP FILE: $pcap_file\n";
182 if ($exitcode != 0) {
183 exit(1) if ($opt_one);
191 print "Samba test runner
192 Copyright (C) Jelmer Vernooij <jelmer\@samba.org>
193 Copyright (C) Stefan Metzmacher <metze\@samba.org>
195 Usage: $Script [OPTIONS] TESTNAME-REGEX
198 --help this help page
199 --target=samba[3]|win Samba version to target
200 --testlist=FILE file to read available tests from
203 --prefix=DIR prefix to run tests in [st]
204 --srcdir=DIR source directory [.]
205 --bindir=DIR binaries directory [./bin]
208 --nss_wrapper_so_path=FILE the nss_wrapper library to preload
209 --socket_wrapper_so_path=FILE the socket_wrapper library to preload
210 --uid_wrapper_so_path=FILE the uid_wrapper library to preload
213 --socket-wrapper-pcap save traffic to pcap directories
214 --socket-wrapper-keep-pcap keep all pcap files, not just those for tests that
216 --socket-wrapper enable socket wrapper
219 --ldap=openldap|fedora-ds back samba onto specified ldap server
222 --quick run quick overall test
223 --one abort when the first test fails
224 --testenv run a shell in the requested test environment
225 --list list available tests
230 my $result = GetOptions
(
231 'help|h|?' => \
$opt_help,
232 'target=s' => \
$opt_target,
233 'prefix=s' => \
$prefix,
234 'socket-wrapper' => \
$opt_socket_wrapper,
235 'socket-wrapper-pcap' => \
$opt_socket_wrapper_pcap,
236 'socket-wrapper-keep-pcap' => \
$opt_socket_wrapper_keep_pcap,
237 'quick' => \
$opt_quick,
239 'exclude=s' => \
@opt_exclude,
240 'include=s' => \
@opt_include,
241 'srcdir=s' => \
$srcdir,
242 'bindir=s' => \
$bindir,
243 'testenv' => \
$opt_testenv,
244 'list' => \
$opt_list,
246 'resetup-environment' => \
$opt_resetup_env,
247 'testlist=s' => \
@testlists,
248 'random-order' => \
$opt_random_order,
249 'load-list=s' => \
$opt_load_list,
250 'binary-mapping=s' => \
$opt_binary_mapping,
251 'nss_wrapper_so_path=s' => \
$opt_libnss_wrapper_so_path,
252 'socket_wrapper_so_path=s' => \
$opt_libsocket_wrapper_so_path,
253 'uid_wrapper_so_path=s' => \
$opt_libuid_wrapper_so_path
256 exit(1) if (not $result);
258 ShowHelp
() if ($opt_help);
260 die("--list and --testenv are mutually exclusive") if ($opt_list and $opt_testenv);
262 # we want unbuffered output
267 # quick hack to disable rpc validation when using valgrind - its way too slow
268 unless (defined($ENV{VALGRIND
})) {
269 $ENV{VALIDATE
} = "validate";
270 $ENV{MALLOC_CHECK_
} = 3;
273 # make all our python scripts unbuffered
274 $ENV{PYTHONUNBUFFERED
} = 1;
276 my $bindir_abs = abs_path
($bindir);
278 # Backwards compatibility:
279 if (defined($ENV{TEST_LDAP
}) and $ENV{TEST_LDAP
} eq "yes") {
280 if (defined($ENV{FEDORA_DS_ROOT
})) {
287 my $torture_maxtime = ($ENV{TORTURE_MAXTIME
} or 1200);
290 $torture_maxtime *= 2;
297 die("using an empty prefix isn't allowed") unless $prefix ne "";
299 # Ensure we have the test prefix around.
301 # We need restrictive
302 # permissions on this as some subdirectories in this tree will have
303 # wider permissions (ie 0777) and this would allow other users on the
304 # host to subvert the test process.
305 mkdir($prefix, 0700) unless -d
$prefix;
308 my $prefix_abs = abs_path
($prefix);
309 my $tmpdir_abs = abs_path
("$prefix/tmp");
310 mkdir($tmpdir_abs, 0777) unless -d
$tmpdir_abs;
312 my $srcdir_abs = abs_path
($srcdir);
314 die("using an empty absolute prefix isn't allowed") unless $prefix_abs ne "";
315 die("using '/' as absolute prefix isn't allowed") unless $prefix_abs ne "/";
317 $ENV{PREFIX
} = $prefix;
318 $ENV{KRB5CCNAME
} = "$prefix/krb5ticket";
319 $ENV{PREFIX_ABS
} = $prefix_abs;
320 $ENV{SRCDIR
} = $srcdir;
321 $ENV{SRCDIR_ABS
} = $srcdir_abs;
322 $ENV{BINDIR
} = $bindir_abs;
324 my $tls_enabled = not $opt_quick;
325 $ENV{TLS_ENABLED
} = ($tls_enabled?
"yes":"no");
327 sub prefix_pathvar
($$)
329 my ($name, $newpath) = @_;
330 if (defined($ENV{$name})) {
331 $ENV{$name} = "$newpath:$ENV{$name}";
333 $ENV{$name} = $newpath;
336 prefix_pathvar
("PKG_CONFIG_PATH", "$bindir_abs/pkgconfig");
337 prefix_pathvar
("PYTHONPATH", "$bindir_abs/python");
339 if ($opt_socket_wrapper_keep_pcap) {
340 # Socket wrapper keep pcap implies socket wrapper pcap
341 $opt_socket_wrapper_pcap = 1;
344 if ($opt_socket_wrapper_pcap) {
345 # Socket wrapper pcap implies socket wrapper
346 $opt_socket_wrapper = 1;
349 my $ld_preload = $ENV{LD_PRELOAD
};
351 if ($opt_libnss_wrapper_so_path) {
353 $ld_preload = "$ld_preload:$opt_libnss_wrapper_so_path";
355 $ld_preload = "$opt_libnss_wrapper_so_path";
359 if ($opt_libsocket_wrapper_so_path) {
361 $ld_preload = "$ld_preload:$opt_libsocket_wrapper_so_path";
363 $ld_preload = "$opt_libsocket_wrapper_so_path";
367 if ($opt_libuid_wrapper_so_path) {
369 $ld_preload = "$ld_preload:$opt_libuid_wrapper_so_path";
371 $ld_preload = "$opt_libuid_wrapper_so_path";
375 $ENV{LD_PRELOAD
} = $ld_preload;
376 print "LD_PRELOAD=$ENV{LD_PRELOAD}\n";
378 # Enable uid_wrapper globally
379 $ENV{UID_WRAPPER
} = 1;
381 # Disable RTLD_DEEPBIND hack for Samba bind dlz module
383 # This is needed in order to allow the ldb_*ldap module
384 # to work with a preloaded socket wrapper.
385 $ENV{LDB_MODULES_DISABLE_DEEPBIND
} = 1;
387 my $socket_wrapper_dir;
388 if ($opt_socket_wrapper) {
389 $socket_wrapper_dir = SocketWrapper
::setup_dir
("$prefix_abs/w", $opt_socket_wrapper_pcap);
390 print "SOCKET_WRAPPER_DIR=$socket_wrapper_dir\n";
391 } elsif (not $opt_list) {
393 warn("not using socket wrapper, but also not running as root. Will not be able to listen on proper ports");
398 my $testenv_default = "none";
400 my %binary_mapping = ();
401 if ($opt_binary_mapping) {
402 my @binmapping_list = split(/,/, $opt_binary_mapping);
403 foreach my $mapping (@binmapping_list) {
404 my ($bin, $map) = split(/\:/, $mapping);
405 $binary_mapping{$bin} = $map;
409 $ENV{BINARY_MAPPING
} = $opt_binary_mapping;
411 # After this many seconds, the server will self-terminate. All tests
412 # must terminate in this time, and testenv will only stay alive this
415 my $server_maxtime = 7500;
416 if (defined($ENV{SMBD_MAXTIME
}) and $ENV{SMBD_MAXTIME
} ne "") {
417 $server_maxtime = $ENV{SMBD_MAXTIME
};
421 if ($opt_target eq "samba") {
422 $testenv_default = "dc";
423 require target
::Samba
;
424 $target = new Samba
($bindir, \
%binary_mapping, $ldap, $srcdir, $server_maxtime);
425 } elsif ($opt_target eq "samba3") {
426 $testenv_default = "member";
427 require target
::Samba3
;
428 $target = new Samba3
($bindir, \
%binary_mapping, $srcdir_abs, $server_maxtime);
432 sub read_test_regexes
($)
436 open(LF
, "<$name") or die("unable to read $name: $!");
440 if (/^(.*?)([ \t]+)\#([\t ]*)(.*?)$/) {
441 push (@ret, [$1, $4]);
443 s/^(.*?)([ \t]+)\#([\t ]*)(.*?)$//;
444 push (@ret, [$_, undef]);
451 foreach (@opt_exclude) {
452 push (@excludes, read_test_regexes
($_));
455 foreach (@opt_include) {
456 push (@includes, read_test_regexes
($_));
459 my $interfaces = join(',', ("127.0.0.11/8",
466 my $clientdir = "$prefix_abs/client";
468 my $conffile = "$clientdir/client.conf";
469 $ENV{SMB_CONF_PATH
} = $conffile;
471 sub write_clientconf
($$$)
473 my ($conffile, $clientdir, $vars) = @_;
475 mkdir("$clientdir", 0777) unless -d
"$clientdir";
477 if ( -d
"$clientdir/private" ) {
478 unlink <$clientdir/private/*>;
480 mkdir("$clientdir/private", 0777);
483 if ( -d
"$clientdir/lockdir" ) {
484 unlink <$clientdir/lockdir/*>;
486 mkdir("$clientdir/lockdir", 0777);
489 if ( -d
"$clientdir/statedir" ) {
490 unlink <$clientdir/statedir/*>;
492 mkdir("$clientdir/statedir", 0777);
495 if ( -d
"$clientdir/cachedir" ) {
496 unlink <$clientdir/cachedir/*>;
498 mkdir("$clientdir/cachedir", 0777);
501 # this is ugly, but the ncalrpcdir needs exactly 0755
502 # otherwise tests fail.
505 if ( -d
"$clientdir/ncalrpcdir/np" ) {
506 unlink <$clientdir/ncalrpcdir/np
/*>;
507 rmdir "$clientdir/ncalrpcdir/np";
509 if ( -d
"$clientdir/ncalrpcdir" ) {
510 unlink <$clientdir/ncalrpcdir/*>;
511 rmdir "$clientdir/ncalrpcdir";
513 mkdir("$clientdir/ncalrpcdir", 0755);
516 open(CF
, ">$conffile");
517 print CF
"[global]\n";
518 print CF
"\tnetbios name = client\n";
519 if (defined($vars->{DOMAIN
})) {
520 print CF
"\tworkgroup = $vars->{DOMAIN}\n";
522 if (defined($vars->{REALM
})) {
523 print CF
"\trealm = $vars->{REALM}\n";
525 if ($opt_socket_wrapper) {
526 print CF
"\tinterfaces = $interfaces\n";
529 private dir = $clientdir/private
530 lock dir = $clientdir/lockdir
531 state directory = $clientdir/statedir
532 cache directory = $clientdir/cachedir
533 ncalrpc dir = $clientdir/ncalrpcdir
534 name resolve order = file bcast
535 panic action = $RealBin/gdb_backtrace \%d
537 notify:inotify = false
539 system:anonymous = true
540 client lanman auth = Yes
542 torture:basedir = $clientdir
543 #We don't want to pass our self-tests if the PAC code is wrong
544 gensec:require_pac = true
545 resolv:host file = $prefix_abs/dns_host_file
546 #We don't want to run 'speed' tests for very long
547 torture:timelimit = 1
554 sub should_run_test
($)
560 for (my $i=0; $i <= $#tests; $i++) {
561 if ($name =~ /$tests[$i]/i) {
573 open(IN
, $filename) or die("Unable to open $filename: $!");
576 if (/-- TEST(-LOADLIST|-IDLIST|) --\n/) {
577 my $supports_loadlist = (defined($1) and $1 eq "-LOADLIST");
578 my $supports_idlist = (defined($1) and $1 eq "-IDLIST");
585 if (should_run_test
($name) == 1) {
586 push (@ret, [$name, $env, $cmdline, $supports_loadlist, $supports_idlist]);
592 close(IN
) or die("Error creating recipe");
596 if ($#testlists == -1) {
597 die("No testlists specified");
600 $ENV{SELFTEST_PREFIX
} = "$prefix_abs";
601 $ENV{SELFTEST_TMPDIR
} = "$tmpdir_abs";
602 $ENV{TEST_DATA_PREFIX
} = "$tmpdir_abs";
603 if ($opt_socket_wrapper) {
604 $ENV{SELFTEST_INTERFACES
} = $interfaces;
606 $ENV{SELFTEST_INTERFACES
} = "";
609 $ENV{SELFTEST_QUICK
} = "1";
611 $ENV{SELFTEST_QUICK
} = "";
613 $ENV{SELFTEST_MAXTIME
} = $torture_maxtime;
616 foreach my $fn (@testlists) {
617 foreach (read_testlist
($fn)) {
619 next if (@includes and not defined(find_in_list
(\
@includes, $name)));
620 push (@available, $_);
624 my $restricted = undef;
625 my $restricted_used = {};
627 if ($opt_load_list) {
629 open(LOAD_LIST
, "<$opt_load_list") or die("Unable to open $opt_load_list");
630 while (<LOAD_LIST
>) {
632 push (@
$restricted, $_);
637 my $individual_tests = undef;
638 $individual_tests = {};
640 foreach my $testsuite (@available) {
641 my $name = $$testsuite[0];
642 my $skipreason = skip
($name);
643 if (defined($restricted)) {
644 # Find the testsuite for this test
646 foreach my $r (@
$restricted) {
648 $individual_tests->{$name} = [];
650 $restricted_used->{$r} = 1;
651 } elsif (substr($r, 0, length($name)+1) eq "$name.") {
652 push(@
{$individual_tests->{$name}}, $r);
654 $restricted_used->{$r} = 1;
658 if (defined($skipreason)) {
660 Subunit
::skip_testsuite
($name, $skipreason);
663 push(@todo, $testsuite);
666 } elsif (defined($skipreason)) {
668 Subunit
::skip_testsuite
($name, $skipreason);
671 push(@todo, $testsuite);
675 if (defined($restricted)) {
676 foreach (@
$restricted) {
677 unless (defined($restricted_used->{$_})) {
678 print "No test or testsuite found matching $_\n";
681 } elsif ($#todo == -1) {
682 print STDERR
"No tests to run\n";
686 my $suitestotal = $#todo + 1;
689 Subunit
::progress
($suitestotal);
690 Subunit
::report_time
(time());
696 my %running_envs = ();
698 sub get_running_env
($)
706 return $running_envs{$envname};
709 my @exported_envvars = (
714 # domain controller stuff
723 "MEMBER_NETBIOSNAME",
724 "MEMBER_NETBIOSALIAS",
726 # rpc proxy controller stuff
728 "RPC_PROXY_SERVER_IP",
729 "RPC_PROXY_NETBIOSNAME",
730 "RPC_PROXY_NETBIOSALIAS",
732 # domain controller stuff for Vampired DC
734 "VAMPIRE_DC_SERVER_IP",
735 "VAMPIRE_DC_NETBIOSNAME",
736 "VAMPIRE_DC_NETBIOSALIAS",
738 "PROMOTED_DC_SERVER",
739 "PROMOTED_DC_SERVER_IP",
740 "PROMOTED_DC_NETBIOSNAME",
741 "PROMOTED_DC_NETBIOSALIAS",
758 "SELFTEST_WINBINDD_SOCKET_DIR",
759 "WINBINDD_PRIV_PIPE_DIR",
764 "NSS_WRAPPER_PASSWD",
767 # UID/GID for rfc2307 mapping tests
772 $SIG{INT
} = $SIG{QUIT
} = $SIG{TERM
} = sub {
774 teardown_env
($_) foreach(keys %running_envs);
775 die("Received signal $signame");
780 my ($name, $prefix) = @_;
782 my $testenv_vars = undef;
788 $option =~ s/^[^:]*//;
791 $option = "client" if $option eq "";
793 if ($envname eq "none") {
795 } elsif (defined(get_running_env
($envname))) {
796 $testenv_vars = get_running_env
($envname);
797 if (not $testenv_vars->{target
}->check_env($testenv_vars)) {
798 print $testenv_vars->{target
}->getlog_env($testenv_vars);
799 $testenv_vars = undef;
802 $testenv_vars = $target->setup_env($envname, $prefix);
803 if (defined($testenv_vars) and $testenv_vars eq "UNKNOWN") {
804 return $testenv_vars;
805 } elsif (defined($testenv_vars) && not defined($testenv_vars->{target
})) {
806 $testenv_vars->{target
} = $target;
808 if (not defined($testenv_vars)) {
809 warn("$opt_target can't start up known environment '$envname'");
814 return undef unless defined($testenv_vars);
816 $running_envs{$envname} = $testenv_vars;
818 if ($option eq "local") {
819 SocketWrapper
::set_default_iface
($testenv_vars->{SOCKET_WRAPPER_DEFAULT_IFACE
});
820 $ENV{SMB_CONF_PATH
} = $testenv_vars->{SERVERCONFFILE
};
821 } elsif ($option eq "client") {
822 SocketWrapper
::set_default_iface
(11);
823 write_clientconf
($conffile, $clientdir, $testenv_vars);
824 $ENV{SMB_CONF_PATH
} = $conffile;
826 die("Unknown option[$option] for envname[$envname]");
829 foreach (@exported_envvars) {
830 if (defined($testenv_vars->{$_})) {
831 $ENV{$_} = $testenv_vars->{$_};
837 return $testenv_vars;
840 sub exported_envvars_str
($)
842 my ($testenv_vars) = @_;
845 foreach (@exported_envvars) {
846 next unless defined($testenv_vars->{$_});
847 $out .= $_."=".$testenv_vars->{$_}."\n";
856 return "" if ($envname eq "none");
857 my $env = get_running_env
($envname);
858 return $env->{target
}->getlog_env($env);
864 return 1 if ($envname eq "none");
865 my $env = get_running_env
($envname);
866 return $env->{target
}->check_env($env);
872 return if ($envname eq "none");
873 my $env = get_running_env
($envname);
874 $env->{target
}->teardown_env($env);
875 delete $running_envs{$envname};
878 # This 'global' file needs to be empty when we start
879 unlink("$prefix_abs/dns_host_file");
880 unlink("$prefix_abs/hosts");
882 if ($opt_random_order) {
884 my @newtodo = List
::Util
::shuffle
(@todo);
889 my $testenv_name = $ENV{SELFTEST_TESTENV
};
890 $testenv_name = $testenv_default unless defined($testenv_name);
892 my $testenv_vars = setup_env
($testenv_name, $prefix);
894 if (not $testenv_vars or $testenv_vars eq "UNKNOWN") {
895 die("Unable to setup environment $testenv_name");
898 $ENV{PIDDIR
} = $testenv_vars->{PIDDIR
};
899 $ENV{ENVNAME
} = $testenv_name;
901 my $envvarstr = exported_envvars_str
($testenv_vars);
903 my @term_args = ("echo -e \"
904 Welcome to the Samba4 Test environment '$testenv_name'
906 This matches the client environment used in make test
907 server is pid `cat \$PIDDIR/samba.pid`
909 Some useful environment variables:
910 TORTURE_OPTIONS=\$TORTURE_OPTIONS
911 SMB_CONF_PATH=\$SMB_CONF_PATH
914 \" && LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH} bash");
916 if ($ENV{TERMINAL
}) {
917 @term = ($ENV{TERMINAL
});
919 @term = ("xterm", "-e");
920 unshift(@term_args, ("bash", "-c"));
923 system(@term, @term_args);
925 teardown_env
($testenv_name);
926 } elsif ($opt_list) {
930 my $envname = $$_[1];
932 unless($cmd =~ /\$LISTOPT/) {
933 warn("Unable to list tests in $name");
937 $cmd =~ s/\$LISTOPT/--list/g;
942 die("Unable to run $cmd: $!");
944 die(sprintf("%s died with signal %d, %s coredump\n", $cmd, ($?
& 127), ($?
& 128) ?
'with' : 'without'));
947 my $exitcode = $?
>> 8;
948 if ($exitcode != 0) {
949 die("$cmd exited with exit code $exitcode");
957 my $envname = $$_[1];
959 my $envvars = setup_env
($envname, $prefix);
960 if (not defined($envvars)) {
961 Subunit
::start_testsuite
($name);
962 Subunit
::end_testsuite
($name, "error",
963 "unable to set up environment $envname - exiting");
965 } elsif ($envvars eq "UNKNOWN") {
966 Subunit
::start_testsuite
($name);
967 Subunit
::end_testsuite
($name, "skip",
968 "environment $envname is unknown in this test backend - skipping");
972 # Generate a file with the individual tests to run, if the
973 # test runner for this test suite supports it.
974 if ($individual_tests and $individual_tests->{$name}) {
976 my ($fh, $listid_file) = tempfile
(UNLINK
=> 0);
977 foreach my $test (@
{$individual_tests->{$name}}) {
978 print $fh substr($test, length($name)+1) . "\n";
980 $cmd =~ s/\$LOADLIST/--load-list=$listid_file/g;
982 $cmd =~ s/\s+[^\s]+\s*$//;
983 $cmd .= " " . join(' ', @
{$individual_tests->{$name}});
987 run_testsuite
($envname, $name, $cmd, $i, $suitestotal);
989 teardown_env
($envname) if ($opt_resetup_env);
995 teardown_env
($_) foreach (keys %running_envs);
999 # if there were any valgrind failures, show them
1000 foreach (<$prefix/valgrind
.log*>) {
1001 next unless (-s
$_);
1002 print "VALGRIND FAILURE\n";