From 0b5f3e123c6f32cbff89da5b6b7df23a1963317a Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Mon, 28 Apr 2014 11:54:23 -0700 Subject: [PATCH] nginx: looking for segfaults on the regression test. If nginx segfaults it will return, warning that the test failed. --- tests/run-regression-tests-nginx.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/run-regression-tests-nginx.pl b/tests/run-regression-tests-nginx.pl index 6e4af858..6d1ee436 100755 --- a/tests/run-regression-tests-nginx.pl +++ b/tests/run-regression-tests-nginx.pl @@ -204,6 +204,16 @@ sub runfile { my $rc = 0; my $conf_fn; + # watch for segfaults + if ($t and !$t->{match_log}) { + $t->{match_log} = {}; + } + if ($t and $t->{match_log} and !$t->{match_log}{-error}) { + $t->{match_log}{-error} = []; + } + push $t->{match_log}{-error}, qr/(core dump)/; + push $t->{match_log}{-error}, 1; + # Startup nginx with optionally included conf. if (exists $t{conf} and defined $t{conf}) { $conf_fn = sprintf "%s/%s_%s_%06d.conf", @@ -498,7 +508,6 @@ READ: { #dbg("Match \"$re\" in $name \"$$rbuf\" ($n)"); if ($$rbuf =~ m/$re/m) { $rc = $&; -# print "bonga\n"; last; } # TODO: Use select()/poll() @@ -695,6 +704,7 @@ sub nginx_reset_fd { return undef; } + # Any extras listed in "match_log" if ($t and exists $t->{match_log}) { for my $k (keys %{ $t->{match_log} || {} }) {