stas 2003/11/24 00:28:34
Modified: perl-framework/Apache-Test/lib/Apache TestConfig.pm
TestRun.pm TestServer.pm
Log:
the proper fix to -port problem is to reconfigure each time -port is
passed, since things may change between each invocation and some .conf.in
files are always regenerated, but not the others, so we get ports
collision - a complete regeneration of all conf files resolves this issue
Revision Changes Path
1.186 +5 -1
httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm
Index: TestConfig.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -u -r1.185 -r1.186
--- TestConfig.pm 24 Nov 2003 07:57:30 -0000 1.185
+++ TestConfig.pm 24 Nov 2003 08:28:34 -0000 1.186
@@ -1343,9 +1343,13 @@
}
sub need_reconfiguration {
- my $self = shift;
+ my($self, $conf_opts) = @_;
my @reasons = ();
my $vars = $self->{vars};
+
+ if ($conf_opts->{port}) {
+ push @reasons, "'-port $conf_opts->{port}' requires reconfiguration";
+ }
my $exe = $vars->{apxs} || $vars->{httpd};
# if httpd.conf is older than executable
1.123 +2 -1
httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm
Index: TestRun.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -u -r1.122 -r1.123
--- TestRun.pm 16 Nov 2003 19:16:19 -0000 1.122
+++ TestRun.pm 24 Nov 2003 08:28:34 -0000 1.123
@@ -352,7 +352,8 @@
$ENV{APACHE_TEST_HTTP11} = 1;
}
- if (my @reasons = $self->{test_config}->need_reconfiguration) {
+ if (my @reasons =
+ $self->{test_config}->need_reconfiguration($self->{conf_opts})) {
warning "forcing re-configuration:";
warning "\t- $_." for @reasons;
unless ($refreshed) {
1.73 +3 -4
httpd-test/perl-framework/Apache-Test/lib/Apache/TestServer.pm
Index: TestServer.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestServer.pm,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -u -r1.72 -r1.73
--- TestServer.pm 24 Nov 2003 07:59:54 -0000 1.72
+++ TestServer.pm 24 Nov 2003 08:28:34 -0000 1.73
@@ -36,7 +36,7 @@
$self->{name} = join ':',
map { $self->{config}->{vars}->{$_} } qw(servername port);
- $self->{port_counter} = $self->{config}->{vars}->{port} + 1;
+ $self->{port_counter} = $self->{config}->{vars}->{port};
$self->{version} = $self->{config}->httpd_version || '';
$self->{mpm} = $self->{config}->httpd_mpm || '';
@@ -270,9 +270,8 @@
my $max_tries = 100; #XXX
while ($max_tries-- > 0) {
- my $port = $self->{port_counter};
- $self->{port_counter}++;
- return $port if $self->port_available($port);
+ return $self->{port_counter}
+ if $self->port_available(++$self->{port_counter});
}
return 0;