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
548 winbind separator = /
555 sub should_run_test
($)
561 for (my $i=0; $i <= $#tests; $i++) {
562 if ($name =~ /$tests[$i]/i) {
574 open(IN
, $filename) or die("Unable to open $filename: $!");
577 if (/-- TEST(-LOADLIST|-IDLIST|) --\n/) {
578 my $supports_loadlist = (defined($1) and $1 eq "-LOADLIST");
579 my $supports_idlist = (defined($1) and $1 eq "-IDLIST");
586 if (should_run_test
($name) == 1) {
587 push (@ret, [$name, $env, $cmdline, $supports_loadlist, $supports_idlist]);
593 close(IN
) or die("Error creating recipe");
597 if ($#testlists == -1) {
598 die("No testlists specified");
601 $ENV{SELFTEST_PREFIX
} = "$prefix_abs";
602 $ENV{SELFTEST_TMPDIR
} = "$tmpdir_abs";
603 $ENV{TEST_DATA_PREFIX
} = "$tmpdir_abs";
604 if ($opt_socket_wrapper) {
605 $ENV{SELFTEST_INTERFACES
} = $interfaces;
607 $ENV{SELFTEST_INTERFACES
} = "";
610 $ENV{SELFTEST_QUICK
} = "1";
612 $ENV{SELFTEST_QUICK
} = "";
614 $ENV{SELFTEST_MAXTIME
} = $torture_maxtime;
617 foreach my $fn (@testlists) {
618 foreach (read_testlist
($fn)) {
620 next if (@includes and not defined(find_in_list
(\
@includes, $name)));
621 push (@available, $_);
625 my $restricted = undef;
626 my $restricted_used = {};
628 if ($opt_load_list) {
630 open(LOAD_LIST
, "<$opt_load_list") or die("Unable to open $opt_load_list");
631 while (<LOAD_LIST
>) {
633 push (@
$restricted, $_);
638 my $individual_tests = undef;
639 $individual_tests = {};
641 foreach my $testsuite (@available) {
642 my $name = $$testsuite[0];
643 my $skipreason = skip
($name);
644 if (defined($restricted)) {
645 # Find the testsuite for this test
647 foreach my $r (@
$restricted) {
649 $individual_tests->{$name} = [];
651 $restricted_used->{$r} = 1;
652 } elsif (substr($r, 0, length($name)+1) eq "$name.") {
653 push(@
{$individual_tests->{$name}}, $r);
655 $restricted_used->{$r} = 1;
659 if (defined($skipreason)) {
661 Subunit
::skip_testsuite
($name, $skipreason);
664 push(@todo, $testsuite);
667 } elsif (defined($skipreason)) {
669 Subunit
::skip_testsuite
($name, $skipreason);
672 push(@todo, $testsuite);
676 if (defined($restricted)) {
677 foreach (@
$restricted) {
678 unless (defined($restricted_used->{$_})) {
679 print "No test or testsuite found matching $_\n";
682 } elsif ($#todo == -1) {
683 print STDERR
"No tests to run\n";
687 my $suitestotal = $#todo + 1;
690 Subunit
::progress
($suitestotal);
691 Subunit
::report_time
(time());
697 my %running_envs = ();
699 sub get_running_env
($)
707 return $running_envs{$envname};
710 my @exported_envvars = (
715 # domain controller stuff
724 "MEMBER_NETBIOSNAME",
725 "MEMBER_NETBIOSALIAS",
727 # rpc proxy controller stuff
729 "RPC_PROXY_SERVER_IP",
730 "RPC_PROXY_NETBIOSNAME",
731 "RPC_PROXY_NETBIOSALIAS",
733 # domain controller stuff for Vampired DC
735 "VAMPIRE_DC_SERVER_IP",
736 "VAMPIRE_DC_NETBIOSNAME",
737 "VAMPIRE_DC_NETBIOSALIAS",
739 "PROMOTED_DC_SERVER",
740 "PROMOTED_DC_SERVER_IP",
741 "PROMOTED_DC_NETBIOSNAME",
742 "PROMOTED_DC_NETBIOSALIAS",
759 "SELFTEST_WINBINDD_SOCKET_DIR",
760 "WINBINDD_PRIV_PIPE_DIR",
765 "NSS_WRAPPER_PASSWD",
768 # UID/GID for rfc2307 mapping tests
773 $SIG{INT
} = $SIG{QUIT
} = $SIG{TERM
} = sub {
775 teardown_env
($_) foreach(keys %running_envs);
776 die("Received signal $signame");
781 my ($name, $prefix) = @_;
783 my $testenv_vars = undef;
789 $option =~ s/^[^:]*//;
792 $option = "client" if $option eq "";
794 if ($envname eq "none") {
796 } elsif (defined(get_running_env
($envname))) {
797 $testenv_vars = get_running_env
($envname);
798 if (not $testenv_vars->{target
}->check_env($testenv_vars)) {
799 print $testenv_vars->{target
}->getlog_env($testenv_vars);
800 $testenv_vars = undef;
803 $testenv_vars = $target->setup_env($envname, $prefix);
804 if (defined($testenv_vars) and $testenv_vars eq "UNKNOWN") {
805 return $testenv_vars;
806 } elsif (defined($testenv_vars) && not defined($testenv_vars->{target
})) {
807 $testenv_vars->{target
} = $target;
809 if (not defined($testenv_vars)) {
810 warn("$opt_target can't start up known environment '$envname'");
815 return undef unless defined($testenv_vars);
817 $running_envs{$envname} = $testenv_vars;
819 if ($option eq "local") {
820 SocketWrapper
::set_default_iface
($testenv_vars->{SOCKET_WRAPPER_DEFAULT_IFACE
});
821 $ENV{SMB_CONF_PATH
} = $testenv_vars->{SERVERCONFFILE
};
822 } elsif ($option eq "client") {
823 SocketWrapper
::set_default_iface
(11);
824 write_clientconf
($conffile, $clientdir, $testenv_vars);
825 $ENV{SMB_CONF_PATH
} = $conffile;
827 die("Unknown option[$option] for envname[$envname]");
830 foreach (@exported_envvars) {
831 if (defined($testenv_vars->{$_})) {
832 $ENV{$_} = $testenv_vars->{$_};
838 return $testenv_vars;
841 sub exported_envvars_str
($)
843 my ($testenv_vars) = @_;
846 foreach (@exported_envvars) {
847 next unless defined($testenv_vars->{$_});
848 $out .= $_."=".$testenv_vars->{$_}."\n";
857 return "" if ($envname eq "none");
858 my $env = get_running_env
($envname);
859 return $env->{target
}->getlog_env($env);
865 return 1 if ($envname eq "none");
866 my $env = get_running_env
($envname);
867 return $env->{target
}->check_env($env);
873 return if ($envname eq "none");
874 my $env = get_running_env
($envname);
875 $env->{target
}->teardown_env($env);
876 delete $running_envs{$envname};
879 # This 'global' file needs to be empty when we start
880 unlink("$prefix_abs/dns_host_file");
881 unlink("$prefix_abs/hosts");
883 if ($opt_random_order) {
885 my @newtodo = List
::Util
::shuffle
(@todo);
890 my $testenv_name = $ENV{SELFTEST_TESTENV
};
891 $testenv_name = $testenv_default unless defined($testenv_name);
893 my $testenv_vars = setup_env
($testenv_name, $prefix);
895 if (not $testenv_vars or $testenv_vars eq "UNKNOWN") {
896 die("Unable to setup environment $testenv_name");
899 $ENV{PIDDIR
} = $testenv_vars->{PIDDIR
};
900 $ENV{ENVNAME
} = $testenv_name;
902 my $envvarstr = exported_envvars_str
($testenv_vars);
904 my @term_args = ("echo -e \"
905 Welcome to the Samba4 Test environment '$testenv_name'
907 This matches the client environment used in make test
908 server is pid `cat \$PIDDIR/samba.pid`
910 Some useful environment variables:
911 TORTURE_OPTIONS=\$TORTURE_OPTIONS
912 SMB_CONF_PATH=\$SMB_CONF_PATH
915 \" && LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH} bash");
917 if ($ENV{TERMINAL
}) {
918 @term = ($ENV{TERMINAL
});
920 @term = ("xterm", "-e");
921 unshift(@term_args, ("bash", "-c"));
924 system(@term, @term_args);
926 teardown_env
($testenv_name);
927 } elsif ($opt_list) {
931 my $envname = $$_[1];
933 unless($cmd =~ /\$LISTOPT/) {
934 warn("Unable to list tests in $name");
938 $cmd =~ s/\$LISTOPT/--list/g;
943 die("Unable to run $cmd: $!");
945 die(sprintf("%s died with signal %d, %s coredump\n", $cmd, ($?
& 127), ($?
& 128) ?
'with' : 'without'));
948 my $exitcode = $?
>> 8;
949 if ($exitcode != 0) {
950 die("$cmd exited with exit code $exitcode");
958 my $envname = $$_[1];
960 my $envvars = setup_env
($envname, $prefix);
961 if (not defined($envvars)) {
962 Subunit
::start_testsuite
($name);
963 Subunit
::end_testsuite
($name, "error",
964 "unable to set up environment $envname - exiting");
966 } elsif ($envvars eq "UNKNOWN") {
967 Subunit
::start_testsuite
($name);
968 Subunit
::end_testsuite
($name, "skip",
969 "environment $envname is unknown in this test backend - skipping");
973 # Generate a file with the individual tests to run, if the
974 # test runner for this test suite supports it.
975 if ($individual_tests and $individual_tests->{$name}) {
977 my ($fh, $listid_file) = tempfile
(UNLINK
=> 0);
978 foreach my $test (@
{$individual_tests->{$name}}) {
979 print $fh substr($test, length($name)+1) . "\n";
981 $cmd =~ s/\$LOADLIST/--load-list=$listid_file/g;
983 $cmd =~ s/\s+[^\s]+\s*$//;
984 $cmd .= " " . join(' ', @
{$individual_tests->{$name}});
988 run_testsuite
($envname, $name, $cmd, $i, $suitestotal);
990 teardown_env
($envname) if ($opt_resetup_env);
996 teardown_env
($_) foreach (keys %running_envs);
1000 # if there were any valgrind failures, show them
1001 foreach (<$prefix/valgrind
.log*>) {
1002 next unless (-s
$_);
1003 print "VALGRIND FAILURE\n";