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;
66 my ($list, $fullname) = @_;
69 if ($fullname =~ /$$_[0]/) {
70 return ($$_[1]) if ($$_[1]);
82 return find_in_list
(\
@excludes, $name);
91 return unless ($opt_socket_wrapper_pcap);
92 return unless defined($ENV{SOCKET_WRAPPER_PCAP_DIR
});
95 $fname =~ s
%[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\
-]%_%g;
97 my $pcap_file = "$ENV{SOCKET_WRAPPER_PCAP_DIR}/$fname.pcap";
99 SocketWrapper
::setup_pcap
($pcap_file);
106 my ($pcap_file, $exitcode) = @_;
108 return unless ($opt_socket_wrapper_pcap);
109 return if ($opt_socket_wrapper_keep_pcap);
110 return unless ($exitcode == 0);
111 return unless defined($pcap_file);
116 # expand strings from %ENV
117 sub expand_environment_strings
($)
120 # we use a reverse sort so we do the longer ones first
121 foreach my $k (sort { $b cmp $a } keys %ENV) {
122 $s =~ s/\$$k/$ENV{$k}/g;
127 sub run_testsuite
($$$$$)
129 my ($envname, $name, $cmd, $i, $totalsuites) = @_;
130 my $pcap_file = setup_pcap
($name);
132 Subunit
::start_testsuite
($name);
133 Subunit
::progress_push
();
134 Subunit
::report_time
(time());
136 Subunit
::report_time
(time());
137 Subunit
::progress_pop
();
140 Subunit
::progress_pop
();
141 Subunit
::end_testsuite
($name, "error", "Unable to run $cmd: $!");
144 Subunit
::end_testsuite
($name, "error",
145 sprintf("%s died with signal %d, %s coredump\n", $cmd, ($?
& 127), ($?
& 128) ?
'with' : 'without'));
149 my $exitcode = $?
>> 8;
151 my $envlog = getlog_env
($envname);
153 print "envlog: $envlog\n";
156 print "command: $cmd\n";
157 printf "expanded command: %s\n", expand_environment_strings
($cmd);
159 if ($exitcode == 0) {
160 Subunit
::end_testsuite
($name, "success");
162 Subunit
::end_testsuite
($name, "failure", "Exit code was $exitcode");
165 cleanup_pcap
($pcap_file, $exitcode);
167 if (not $opt_socket_wrapper_keep_pcap and defined($pcap_file)) {
168 print "PCAP FILE: $pcap_file\n";
171 if ($exitcode != 0) {
172 exit(1) if ($opt_one);
180 print "Samba test runner
181 Copyright (C) Jelmer Vernooij <jelmer\@samba.org>
182 Copyright (C) Stefan Metzmacher <metze\@samba.org>
184 Usage: $Script [OPTIONS] TESTNAME-REGEX
187 --help this help page
188 --target=samba[3]|win Samba version to target
189 --testlist=FILE file to read available tests from
192 --prefix=DIR prefix to run tests in [st]
193 --srcdir=DIR source directory [.]
194 --bindir=DIR binaries directory [./bin]
197 --socket-wrapper-pcap save traffic to pcap directories
198 --socket-wrapper-keep-pcap keep all pcap files, not just those for tests that
200 --socket-wrapper enable socket wrapper
203 --ldap=openldap|fedora-ds back samba onto specified ldap server
206 --quick run quick overall test
207 --one abort when the first test fails
208 --testenv run a shell in the requested test environment
209 --list list available tests
214 my $result = GetOptions
(
215 'help|h|?' => \
$opt_help,
216 'target=s' => \
$opt_target,
217 'prefix=s' => \
$prefix,
218 'socket-wrapper' => \
$opt_socket_wrapper,
219 'socket-wrapper-pcap' => \
$opt_socket_wrapper_pcap,
220 'socket-wrapper-keep-pcap' => \
$opt_socket_wrapper_keep_pcap,
221 'quick' => \
$opt_quick,
223 'exclude=s' => \
@opt_exclude,
224 'include=s' => \
@opt_include,
225 'srcdir=s' => \
$srcdir,
226 'bindir=s' => \
$bindir,
227 'testenv' => \
$opt_testenv,
228 'list' => \
$opt_list,
230 'resetup-environment' => \
$opt_resetup_env,
231 'testlist=s' => \
@testlists,
232 'random-order' => \
$opt_random_order,
233 'load-list=s' => \
$opt_load_list,
234 'binary-mapping=s' => \
$opt_binary_mapping
237 exit(1) if (not $result);
239 ShowHelp
() if ($opt_help);
241 die("--list and --testenv are mutually exclusive") if ($opt_list and $opt_testenv);
243 # we want unbuffered output
248 # quick hack to disable rpc validation when using valgrind - its way too slow
249 unless (defined($ENV{VALGRIND
})) {
250 $ENV{VALIDATE
} = "validate";
251 $ENV{MALLOC_CHECK_
} = 2;
254 # make all our python scripts unbuffered
255 $ENV{PYTHONUNBUFFERED
} = 1;
257 my $bindir_abs = abs_path
($bindir);
259 # Backwards compatibility:
260 if (defined($ENV{TEST_LDAP
}) and $ENV{TEST_LDAP
} eq "yes") {
261 if (defined($ENV{FEDORA_DS_ROOT
})) {
268 my $torture_maxtime = ($ENV{TORTURE_MAXTIME
} or 1200);
271 $torture_maxtime *= 2;
278 die("using an empty prefix isn't allowed") unless $prefix ne "";
280 # Ensure we have the test prefix around.
282 # We need restrictive
283 # permissions on this as some subdirectories in this tree will have
284 # wider permissions (ie 0777) and this would allow other users on the
285 # host to subvert the test process.
286 mkdir($prefix, 0700) unless -d
$prefix;
289 my $prefix_abs = abs_path
($prefix);
290 my $tmpdir_abs = abs_path
("$prefix/tmp");
291 mkdir($tmpdir_abs, 0777) unless -d
$tmpdir_abs;
293 my $srcdir_abs = abs_path
($srcdir);
295 die("using an empty absolute prefix isn't allowed") unless $prefix_abs ne "";
296 die("using '/' as absolute prefix isn't allowed") unless $prefix_abs ne "/";
298 $ENV{PREFIX
} = $prefix;
299 $ENV{KRB5CCNAME
} = "$prefix/krb5ticket";
300 $ENV{PREFIX_ABS
} = $prefix_abs;
301 $ENV{SRCDIR
} = $srcdir;
302 $ENV{SRCDIR_ABS
} = $srcdir_abs;
303 $ENV{BINDIR
} = $bindir_abs;
305 my $tls_enabled = not $opt_quick;
306 $ENV{TLS_ENABLED
} = ($tls_enabled?
"yes":"no");
308 sub prefix_pathvar
($$)
310 my ($name, $newpath) = @_;
311 if (defined($ENV{$name})) {
312 $ENV{$name} = "$newpath:$ENV{$name}";
314 $ENV{$name} = $newpath;
317 prefix_pathvar
("PKG_CONFIG_PATH", "$bindir_abs/pkgconfig");
318 prefix_pathvar
("PYTHONPATH", "$bindir_abs/python");
320 if ($opt_socket_wrapper_keep_pcap) {
321 # Socket wrapper keep pcap implies socket wrapper pcap
322 $opt_socket_wrapper_pcap = 1;
325 if ($opt_socket_wrapper_pcap) {
326 # Socket wrapper pcap implies socket wrapper
327 $opt_socket_wrapper = 1;
330 my $socket_wrapper_dir;
331 if ($opt_socket_wrapper) {
332 $socket_wrapper_dir = SocketWrapper
::setup_dir
("$prefix_abs/w", $opt_socket_wrapper_pcap);
333 print "SOCKET_WRAPPER_DIR=$socket_wrapper_dir\n";
334 } elsif (not $opt_list) {
336 warn("not using socket wrapper, but also not running as root. Will not be able to listen on proper ports");
341 my $testenv_default = "none";
343 my %binary_mapping = ();
344 if ($opt_binary_mapping) {
345 my @binmapping_list = split(/,/, $opt_binary_mapping);
346 foreach my $mapping (@binmapping_list) {
347 my ($bin, $map) = split(/\:/, $mapping);
348 $binary_mapping{$bin} = $map;
352 $ENV{BINARY_MAPPING
} = $opt_binary_mapping;
354 # After this many seconds, the server will self-terminate. All tests
355 # must terminate in this time, and testenv will only stay alive this
358 my $server_maxtime = 7500;
359 if (defined($ENV{SMBD_MAXTIME
}) and $ENV{SMBD_MAXTIME
} ne "") {
360 $server_maxtime = $ENV{SMBD_MAXTIME
};
364 if ($opt_target eq "samba") {
365 if ($opt_socket_wrapper and `$bindir/smbd -b | grep SOCKET_WRAPPER` eq "") {
366 die("You must include --enable-socket-wrapper when compiling Samba in order to execute 'make test'. Exiting....");
368 $testenv_default = "dc";
369 require target
::Samba
;
370 $target = new Samba
($bindir, \
%binary_mapping, $ldap, $srcdir, $server_maxtime);
371 } elsif ($opt_target eq "samba3") {
372 if ($opt_socket_wrapper and `$bindir/smbd -b | grep SOCKET_WRAPPER` eq "") {
373 die("You must include --enable-socket-wrapper when compiling Samba in order to execute 'make test'. Exiting....");
375 $testenv_default = "member";
376 require target
::Samba3
;
377 $target = new Samba3
($bindir, \
%binary_mapping, $srcdir_abs, $server_maxtime);
381 sub read_test_regexes
($)
385 open(LF
, "<$name") or die("unable to read $name: $!");
389 if (/^(.*?)([ \t]+)\#([\t ]*)(.*?)$/) {
390 push (@ret, [$1, $4]);
392 s/^(.*?)([ \t]+)\#([\t ]*)(.*?)$//;
393 push (@ret, [$_, undef]);
400 foreach (@opt_exclude) {
401 push (@excludes, read_test_regexes
($_));
404 foreach (@opt_include) {
405 push (@includes, read_test_regexes
($_));
408 my $interfaces = join(',', ("127.0.0.11/8",
415 my $clientdir = "$prefix_abs/client";
417 my $conffile = "$clientdir/client.conf";
418 $ENV{SMB_CONF_PATH
} = $conffile;
420 sub write_clientconf
($$$)
422 my ($conffile, $clientdir, $vars) = @_;
424 mkdir("$clientdir", 0777) unless -d
"$clientdir";
426 if ( -d
"$clientdir/private" ) {
427 unlink <$clientdir/private/*>;
429 mkdir("$clientdir/private", 0777);
432 if ( -d
"$clientdir/lockdir" ) {
433 unlink <$clientdir/lockdir/*>;
435 mkdir("$clientdir/lockdir", 0777);
438 if ( -d
"$clientdir/statedir" ) {
439 unlink <$clientdir/statedir/*>;
441 mkdir("$clientdir/statedir", 0777);
444 if ( -d
"$clientdir/cachedir" ) {
445 unlink <$clientdir/cachedir/*>;
447 mkdir("$clientdir/cachedir", 0777);
450 # this is ugly, but the ncalrpcdir needs exactly 0755
451 # otherwise tests fail.
454 if ( -d
"$clientdir/ncalrpcdir/np" ) {
455 unlink <$clientdir/ncalrpcdir/np
/*>;
456 rmdir "$clientdir/ncalrpcdir/np";
458 if ( -d
"$clientdir/ncalrpcdir" ) {
459 unlink <$clientdir/ncalrpcdir/*>;
460 rmdir "$clientdir/ncalrpcdir";
462 mkdir("$clientdir/ncalrpcdir", 0755);
465 open(CF
, ">$conffile");
466 print CF
"[global]\n";
467 print CF
"\tnetbios name = client\n";
468 if (defined($vars->{DOMAIN
})) {
469 print CF
"\tworkgroup = $vars->{DOMAIN}\n";
471 if (defined($vars->{REALM
})) {
472 print CF
"\trealm = $vars->{REALM}\n";
474 if ($opt_socket_wrapper) {
475 print CF
"\tinterfaces = $interfaces\n";
478 private dir = $clientdir/private
479 lock dir = $clientdir/lockdir
480 state directory = $clientdir/statedir
481 cache directory = $clientdir/cachedir
482 ncalrpc dir = $clientdir/ncalrpcdir
483 name resolve order = file bcast
484 panic action = $RealBin/gdb_backtrace \%d
486 notify:inotify = false
488 system:anonymous = true
489 client lanman auth = Yes
491 torture:basedir = $clientdir
492 #We don't want to pass our self-tests if the PAC code is wrong
493 gensec:require_pac = true
494 resolv:host file = $prefix_abs/dns_host_file
495 #We don't want to run 'speed' tests for very long
496 torture:timelimit = 1
503 sub should_run_test
($)
509 for (my $i=0; $i <= $#tests; $i++) {
510 if ($name =~ /$tests[$i]/i) {
522 open(IN
, $filename) or die("Unable to open $filename: $!");
525 if (/-- TEST(-LOADLIST|-IDLIST|) --\n/) {
526 my $supports_loadlist = (defined($1) and $1 eq "-LOADLIST");
527 my $supports_idlist = (defined($1) and $1 eq "-IDLIST");
534 if (should_run_test
($name) == 1) {
535 push (@ret, [$name, $env, $cmdline, $supports_loadlist, $supports_idlist]);
541 close(IN
) or die("Error creating recipe");
545 if ($#testlists == -1) {
546 die("No testlists specified");
549 $ENV{SELFTEST_PREFIX
} = "$prefix_abs";
550 $ENV{SELFTEST_TMPDIR
} = "$tmpdir_abs";
551 $ENV{TEST_DATA_PREFIX
} = "$tmpdir_abs";
552 if ($opt_socket_wrapper) {
553 $ENV{SELFTEST_INTERFACES
} = $interfaces;
555 $ENV{SELFTEST_INTERFACES
} = "";
558 $ENV{SELFTEST_QUICK
} = "1";
560 $ENV{SELFTEST_QUICK
} = "";
562 $ENV{SELFTEST_MAXTIME
} = $torture_maxtime;
565 foreach my $fn (@testlists) {
566 foreach (read_testlist
($fn)) {
568 next if (@includes and not defined(find_in_list
(\
@includes, $name)));
569 push (@available, $_);
573 my $restricted = undef;
574 my $restricted_used = {};
576 if ($opt_load_list) {
578 open(LOAD_LIST
, "<$opt_load_list") or die("Unable to open $opt_load_list");
579 while (<LOAD_LIST
>) {
581 push (@
$restricted, $_);
586 my $individual_tests = undef;
587 $individual_tests = {};
589 foreach my $testsuite (@available) {
590 my $name = $$testsuite[0];
591 my $skipreason = skip
($name);
592 if (defined($restricted)) {
593 # Find the testsuite for this test
595 foreach my $r (@
$restricted) {
597 $individual_tests->{$name} = [];
599 $restricted_used->{$r} = 1;
600 } elsif (substr($r, 0, length($name)+1) eq "$name.") {
601 push(@
{$individual_tests->{$name}}, $r);
603 $restricted_used->{$r} = 1;
607 if (defined($skipreason)) {
609 Subunit
::skip_testsuite
($name, $skipreason);
612 push(@todo, $testsuite);
615 } elsif (defined($skipreason)) {
617 Subunit
::skip_testsuite
($name, $skipreason);
620 push(@todo, $testsuite);
624 if (defined($restricted)) {
625 foreach (@
$restricted) {
626 unless (defined($restricted_used->{$_})) {
627 print "No test or testsuite found matching $_\n";
630 } elsif ($#todo == -1) {
631 print STDERR
"No tests to run\n";
635 my $suitestotal = $#todo + 1;
638 Subunit
::progress
($suitestotal);
639 Subunit
::report_time
(time());
645 my %running_envs = ();
647 sub get_running_env
($)
655 return $running_envs{$envname};
658 my @exported_envvars = (
663 # domain controller stuff
673 "MEMBER_SERVER_IPV6",
674 "MEMBER_NETBIOSNAME",
675 "MEMBER_NETBIOSALIAS",
677 # rpc proxy controller stuff
679 "RPC_PROXY_SERVER_IP",
680 "RPC_PROXY_SERVER_IPV6",
681 "RPC_PROXY_NETBIOSNAME",
682 "RPC_PROXY_NETBIOSALIAS",
684 # domain controller stuff for Vampired DC
686 "VAMPIRE_DC_SERVER_IP",
687 "VAMPIRE_DC_SERVER_IPV6",
688 "VAMPIRE_DC_NETBIOSNAME",
689 "VAMPIRE_DC_NETBIOSALIAS",
691 "PROMOTED_DC_SERVER",
692 "PROMOTED_DC_SERVER_IP",
693 "PROMOTED_DC_SERVER_IPV6",
694 "PROMOTED_DC_NETBIOSNAME",
695 "PROMOTED_DC_NETBIOSALIAS",
713 "WINBINDD_SOCKET_DIR",
714 "WINBINDD_PRIV_PIPE_DIR",
719 "NSS_WRAPPER_PASSWD",
722 # UID/GID for rfc2307 mapping tests
731 $SIG{INT
} = $SIG{QUIT
} = $SIG{TERM
} = 'DEFAULT';
732 $SIG{PIPE
} = 'IGNORE';
734 open(STDOUT
, ">&STDERR") or die "can't dup STDOUT to STDERR: $!";
736 print "$0: PID[$$]: Got SIG${signame} teardown environments.\n";
737 teardown_env
($_) foreach(keys %running_envs);
738 system("pstree -p $$");
739 print "$0: PID[$$]: Exiting...\n";
743 $SIG{INT
} = $SIG{QUIT
} = $SIG{TERM
} = $SIG{PIPE
} = \
&sighandler
;
747 my ($name, $prefix) = @_;
749 my $testenv_vars = undef;
755 $option =~ s/^[^:]*//;
758 $option = "client" if $option eq "";
760 if ($envname eq "none") {
762 } elsif (defined(get_running_env
($envname))) {
763 $testenv_vars = get_running_env
($envname);
764 if (not $testenv_vars->{target
}->check_env($testenv_vars)) {
765 print $testenv_vars->{target
}->getlog_env($testenv_vars);
766 $testenv_vars = undef;
769 $testenv_vars = $target->setup_env($envname, $prefix);
770 if (defined($testenv_vars) and $testenv_vars eq "UNKNOWN") {
771 return $testenv_vars;
772 } elsif (defined($testenv_vars) && not defined($testenv_vars->{target
})) {
773 $testenv_vars->{target
} = $target;
775 if (not defined($testenv_vars)) {
776 warn("$opt_target can't start up known environment '$envname'");
781 return undef unless defined($testenv_vars);
783 $running_envs{$envname} = $testenv_vars;
785 if ($option eq "local") {
786 SocketWrapper
::set_default_iface
($testenv_vars->{SOCKET_WRAPPER_DEFAULT_IFACE
});
787 $ENV{SMB_CONF_PATH
} = $testenv_vars->{SERVERCONFFILE
};
788 } elsif ($option eq "client") {
789 SocketWrapper
::set_default_iface
(11);
790 write_clientconf
($conffile, $clientdir, $testenv_vars);
791 $ENV{SMB_CONF_PATH
} = $conffile;
793 die("Unknown option[$option] for envname[$envname]");
796 foreach (@exported_envvars) {
797 if (defined($testenv_vars->{$_})) {
798 $ENV{$_} = $testenv_vars->{$_};
804 return $testenv_vars;
807 sub exported_envvars_str
($)
809 my ($testenv_vars) = @_;
812 foreach (@exported_envvars) {
813 next unless defined($testenv_vars->{$_});
814 $out .= $_."=".$testenv_vars->{$_}."\n";
823 return "" if ($envname eq "none");
824 my $env = get_running_env
($envname);
825 return $env->{target
}->getlog_env($env);
831 return 1 if ($envname eq "none");
832 my $env = get_running_env
($envname);
833 return $env->{target
}->check_env($env);
839 return if ($envname eq "none");
840 print STDERR
"teardown_env($envname)\n";
841 my $env = get_running_env
($envname);
842 $env->{target
}->teardown_env($env);
843 delete $running_envs{$envname};
846 # This 'global' file needs to be empty when we start
847 unlink("$prefix_abs/dns_host_file");
849 if ($opt_random_order) {
851 my @newtodo = List
::Util
::shuffle
(@todo);
856 my $testenv_name = $ENV{SELFTEST_TESTENV
};
857 $testenv_name = $testenv_default unless defined($testenv_name);
859 my $testenv_vars = setup_env
($testenv_name, $prefix);
861 die("Unable to setup environment $testenv_name") unless ($testenv_vars);
863 $ENV{PIDDIR
} = $testenv_vars->{PIDDIR
};
864 $ENV{ENVNAME
} = $testenv_name;
866 my $envvarstr = exported_envvars_str
($testenv_vars);
868 my @term_args = ("echo -e \"
869 Welcome to the Samba4 Test environment '$testenv_name'
871 This matches the client environment used in make test
872 server is pid `cat \$PIDDIR/samba.pid`
874 Some useful environment variables:
875 TORTURE_OPTIONS=\$TORTURE_OPTIONS
876 SMB_CONF_PATH=\$SMB_CONF_PATH
879 \" && LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH} bash");
881 if ($ENV{TERMINAL
}) {
882 @term = ($ENV{TERMINAL
});
884 @term = ("xterm", "-e");
885 unshift(@term_args, ("bash", "-c"));
888 system(@term, @term_args);
890 teardown_env
($testenv_name);
891 } elsif ($opt_list) {
895 my $envname = $$_[1];
897 unless($cmd =~ /\$LISTOPT/) {
898 warn("Unable to list tests in $name");
902 $cmd =~ s/\$LISTOPT/--list/g;
907 die("Unable to run $cmd: $!");
909 die(sprintf("%s died with signal %d, %s coredump\n", $cmd, ($?
& 127), ($?
& 128) ?
'with' : 'without'));
912 my $exitcode = $?
>> 8;
913 if ($exitcode != 0) {
914 die("$cmd exited with exit code $exitcode");
922 my $envname = $$_[1];
924 my $envvars = setup_env
($envname, $prefix);
925 if (not defined($envvars)) {
926 Subunit
::start_testsuite
($name);
927 Subunit
::end_testsuite
($name, "error",
928 "unable to set up environment $envname - exiting");
930 } elsif ($envvars eq "UNKNOWN") {
931 Subunit
::start_testsuite
($name);
932 Subunit
::end_testsuite
($name, "skip",
933 "environment $envname is unknown in this test backend - skipping");
937 # Generate a file with the individual tests to run, if the
938 # test runner for this test suite supports it.
939 if ($individual_tests and $individual_tests->{$name}) {
941 my ($fh, $listid_file) = tempfile
(UNLINK
=> 0);
942 foreach my $test (@
{$individual_tests->{$name}}) {
943 print $fh substr($test, length($name)+1) . "\n";
945 $cmd =~ s/\$LOADLIST/--load-list=$listid_file/g;
947 $cmd =~ s/\s+[^\s]+\s*$//;
948 $cmd .= " " . join(' ', @
{$individual_tests->{$name}});
952 run_testsuite
($envname, $name, $cmd, $i, $suitestotal);
954 teardown_env
($envname) if ($opt_resetup_env);
960 teardown_env
($_) foreach (keys %running_envs);
964 # if there were any valgrind failures, show them
965 foreach (<$prefix/valgrind
.log*>) {
967 print "VALGRIND FAILURE\n";