Mailing List Archive

svn commit: r1893437 - in /httpd/test/framework/trunk/t: conf/extra.conf.in modules/heartbeat.t
Author: jailletc36
Date: Sun Sep 19 11:49:33 2021
New Revision: 1893437

URL: http://svn.apache.org/viewvc?rev=1893437&view=rev
Log:
Add basic tests for mod_heartbeat and mod_heartmonitor

They need multicast to work, so maybe, some extra logic is needed to
avoid expected failures on some plateforms/configurations.

Added:
httpd/test/framework/trunk/t/modules/heartbeat.t
Modified:
httpd/test/framework/trunk/t/conf/extra.conf.in

Modified: httpd/test/framework/trunk/t/conf/extra.conf.in
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/conf/extra.conf.in?rev=1893437&r1=1893436&r2=1893437&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/conf/extra.conf.in (original)
+++ httpd/test/framework/trunk/t/conf/extra.conf.in Sun Sep 19 11:49:33 2021
@@ -1431,3 +1431,11 @@ LimitRequestFields 32
Script POST "/cgi_mod_actions/perl_post.pl"
</Directory>
</IfModule>
+
+<IfModule mod_heartbeat.c>
+ <IfModule mod_heartmonitor.c>
+ HeartbeatListen 239.0.0.1:27999
+ HeartbeatAddress 239.0.0.1:27999
+ </IfModule>
+</IfModule>
+

Added: httpd/test/framework/trunk/t/modules/heartbeat.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/heartbeat.t?rev=1893437&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/modules/heartbeat.t (added)
+++ httpd/test/framework/trunk/t/modules/heartbeat.t Sun Sep 19 11:49:33 2021
@@ -0,0 +1,29 @@
+use strict;
+use warnings FATAL => 'all';
+
+use Apache::Test;
+use Apache::TestRequest;
+use Apache::TestUtil qw/t_start_error_log_watch t_finish_error_log_watch/;
+
+my $r;
+my $line;
+my $count = 0;
+my $nb_seconds = 5;
+
+plan tests => 1, need_module('mod_heartbeat', 'mod_heartmonitor');
+
+# Give some time to the heart to beat a few times
+t_start_error_log_watch();
+sleep($nb_seconds);
+my @loglines = t_finish_error_log_watch();
+
+# Heartbeat sent by mod_heartbeat and received by mod_heartmonitor are logged with DEBUG AH02086 message
+foreach $line (@loglines) {
+ if ($line =~ "AH02086") {
+ $count++;
+ }
+}
+
+print "Expecting at least " . ($nb_seconds-1) . " heartbeat ; Seen: " . $count . "\n";
+ok($count >= $nb_seconds-1);
+