From cc896bbcdeb0ecd244c8b8b8e6ea3e9d3ebf3298 Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Fri, 2 Aug 2013 15:09:00 -0400 Subject: [PATCH] [test suite] added checks to look for segfaults/crashes --- test/test-fwknop.pl | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/test-fwknop.pl b/test/test-fwknop.pl index 1e81a6ce..69e9638a 100755 --- a/test/test-fwknop.pl +++ b/test/test-fwknop.pl @@ -525,10 +525,25 @@ my @tests = ( @os_compatibility, @perl_FKO_module, @python_fko, + + { + 'category' => 'Look for crashes', + 'detail' => 'checking for segfaults (1)', + 'function' => \&look_for_crashes, + 'fatal' => $NO + }, + @gpg_no_pw, @gpg_no_pw_hmac, @gpg, @gpg_hmac, + + { + 'category' => 'Look for crashes', + 'detail' => 'checking for segfaults (2)', + 'function' => \&look_for_crashes, + 'fatal' => $NO + } ); &validate_test_hashes(); @@ -1031,6 +1046,23 @@ sub test_suite_conf_files() { return $rv; } +sub look_for_crashes() { + my $rv = 1; + + for my $f (glob("$output_dir/*")) { + + next if -d $f; + next unless $f =~ /\.test$/; + + if (&file_find_regex([qr/segmentation\sfault/i, qr/core\sdumped/i], + $MATCH_ANY, $APPEND_RESULTS, $f)) { + $rv = 0; + } + } + + return $rv; +} + sub make_distcheck() { ### 'make clean' as root