Author: pgollucci Date: Mon Aug 7 20:49:23 2006 New Revision: 429556 URL: http://svn.apache.org/viewvc?rev=429556&view=rev Log: o Round out the set_check_interval() testing. o Add tests to see that we *actually* kill the httpd child.
Thanks to Torsten Foertsch <[EMAIL PROTECTED]> for the Apache-Test code to check the error_log file. Requires Apache::Test 1.29+ Modified: perl/Apache-SizeLimit/trunk/t/apache/check_n_requests.t perl/Apache-SizeLimit/trunk/t/apache/check_n_requests2.t perl/Apache-SizeLimit/trunk/t/response/TestApache/check_n_requests.pm perl/Apache-SizeLimit/trunk/t/response/TestApache/check_n_requests2.pm Modified: perl/Apache-SizeLimit/trunk/t/apache/check_n_requests.t URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/t/apache/check_n_requests.t?rev=429556&r1=429555&r2=429556&view=diff ============================================================================== --- perl/Apache-SizeLimit/trunk/t/apache/check_n_requests.t (original) +++ perl/Apache-SizeLimit/trunk/t/apache/check_n_requests.t Mon Aug 7 20:49:23 2006 @@ -2,10 +2,15 @@ use warnings FATAL => 'all'; use Apache::Test; -use Apache::TestUtil; +use Apache::TestUtil qw(t_start_error_log_watch t_finish_error_log_watch); use Apache::TestRequest; my $module = 'TestApache::check_n_requests'; my $url = Apache::TestRequest::module2url($module); -print GET_BODY_ASSERT $url; +plan tests => 1, need_min_module_version('Apache::Test' => 1.29); + +t_start_error_log_watch(); +my $res = GET $url; +my $c = grep { / Apache::SizeLimit httpd process too big/ } t_finish_error_log_watch(); +ok $c == 1; Modified: perl/Apache-SizeLimit/trunk/t/apache/check_n_requests2.t URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/t/apache/check_n_requests2.t?rev=429556&r1=429555&r2=429556&view=diff ============================================================================== --- perl/Apache-SizeLimit/trunk/t/apache/check_n_requests2.t (original) +++ perl/Apache-SizeLimit/trunk/t/apache/check_n_requests2.t Mon Aug 7 20:49:23 2006 @@ -2,10 +2,15 @@ use warnings FATAL => 'all'; use Apache::Test; -use Apache::TestUtil; +use Apache::TestUtil qw(t_start_error_log_watch t_finish_error_log_watch); use Apache::TestRequest; my $module = 'TestApache::check_n_requests2'; my $url = Apache::TestRequest::module2url($module); -print GET_BODY_ASSERT $url; +plan tests => 1, need_min_module_version('Apache::Test' => 1.29); + +t_start_error_log_watch(); +my $res = GET $url; +my $c = grep { /Apache::SizeLimit httpd process too big/ } t_finish_error_log_watch(); +ok $c == 0; Modified: perl/Apache-SizeLimit/trunk/t/response/TestApache/check_n_requests.pm URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/t/response/TestApache/check_n_requests.pm?rev=429556&r1=429555&r2=429556&view=diff ============================================================================== --- perl/Apache-SizeLimit/trunk/t/response/TestApache/check_n_requests.pm (original) +++ perl/Apache-SizeLimit/trunk/t/response/TestApache/check_n_requests.pm Mon Aug 7 20:49:23 2006 @@ -20,7 +20,7 @@ sub handler { my $r = shift; - plan $r, tests => 10; + plan $r, tests => 11; Apache::SizeLimit->add_cleanup_handler($r); Apache::SizeLimit->set_max_process_size(TEN_MB); @@ -39,6 +39,12 @@ "now using $i MB of memory (at least)" ); } + + is( + 1, + Apache::SizeLimit->_limits_are_exceeded(), + "we passed the limits and _WILL_ kill the child" + ); return Apache::Constants::OK; } Modified: perl/Apache-SizeLimit/trunk/t/response/TestApache/check_n_requests2.pm URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/t/response/TestApache/check_n_requests2.pm?rev=429556&r1=429555&r2=429556&view=diff ============================================================================== --- perl/Apache-SizeLimit/trunk/t/response/TestApache/check_n_requests2.pm (original) +++ perl/Apache-SizeLimit/trunk/t/response/TestApache/check_n_requests2.pm Mon Aug 7 20:49:23 2006 @@ -20,7 +20,7 @@ sub handler { my $r = shift; - plan $r, tests => 10; + plan $r, tests => 11; Apache::SizeLimit->add_cleanup_handler($r); Apache::SizeLimit->set_max_process_size(TEN_MB); @@ -36,6 +36,12 @@ is($i, $i, "now using $i MB of memory (at least)"); } + + is( + 1, + Apache::SizeLimit->_limits_are_exceeded(), + "we passed the limits and will _NOT_ kill the child" + ); return Apache::Constants::OK; }