You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2019/03/25 15:44:22 UTC
svn commit: r1856208 - /httpd/test/framework/trunk/t/apache/mergeslashes.t
Author: jorton
Date: Mon Mar 25 15:44:22 2019
New Revision: 1856208
URL: http://svn.apache.org/viewvc?rev=1856208&view=rev
Log:
Send Connection: close rather than use cheeky TCP half-close
which gives intermittent failures.
Modified:
httpd/test/framework/trunk/t/apache/mergeslashes.t
Modified: httpd/test/framework/trunk/t/apache/mergeslashes.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/apache/mergeslashes.t?rev=1856208&r1=1856207&r2=1856208&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/apache/mergeslashes.t (original)
+++ httpd/test/framework/trunk/t/apache/mergeslashes.t Mon Mar 25 15:44:22 2019
@@ -13,13 +13,13 @@ use Socket;
my @test_cases = (
# request, status code global, status code 'mergeslashes off' VH, msg
- [ "GET /authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\n\r\n" => 403, "exact match"],
- [ "GET //authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\n\r\n" => 403, "merged even at front"],
- [ "GET ///authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\n\r\n" => 403, "merged even at front"],
- [ "GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost: merge-default\r\n\r\n" => 403, "c// should be merged"],
- [ "GET /authz_core/a//b/c/index.html HTTP/1.1\r\nHost: merge-default\r\n\r\n" => 403, "a// should be merged"],
- [ "GET /authz_core/a//b/c/index.html HTTP/1.1\r\nHost: merge-disabled\r\n\r\n" => 403, "a// matches locationmatch"],
- [ "GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost: merge-disabled\r\n\r\n" => 200, "c// doesn't match locationmatch"],
+ [ "GET /authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n" => 403, "exact match"],
+ [ "GET //authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n" => 403, "merged even at front"],
+ [ "GET ///authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n" => 403, "merged even at front"],
+ [ "GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n" => 403, "c// should be merged"],
+ [ "GET /authz_core/a//b/c/index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n" => 403, "a// should be merged"],
+ [ "GET /authz_core/a//b/c/index.html HTTP/1.1\r\nHost: merge-disabled\r\nConnection: close\r\n\r\n" => 403, "a// matches locationmatch"],
+ [ "GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost: merge-disabled\r\nConnection: close\r\n\r\n" => 200, "c// doesn't match locationmatch"],
);
plan tests => scalar(@test_cases), need_min_apache_version('2.4.39');
@@ -38,7 +38,6 @@ plan tests => scalar(@test_cases), need_
}
$sock->print($req);
- $sock->shutdown(1);
sleep(0.1);
$req = escape($req);
print "# SENDING to " . peer($sock) . "\n# $req\n";
@@ -102,6 +101,7 @@ sub peer
{
my $sock = shift;
my $hersockaddr = getpeername($sock);
+ return "<disconnected>" if !$hersockaddr;
my ($port, $iaddr) = sockaddr_in($hersockaddr);
my $herhostname = gethostbyaddr($iaddr, AF_INET);
my $herstraddr = inet_ntoa($iaddr);
Re: svn commit: r1856208 -
/httpd/test/framework/trunk/t/apache/mergeslashes.t
Posted by Christophe JAILLET <ch...@wanadoo.fr>.
Le 26/03/2019 à 09:16, Joe Orton a écrit :
> On Tue, Mar 26, 2019 at 07:13:03AM +0100, Christophe JAILLET wrote:
>> Hi,
>>
>> not related to this patch (I have the same output before it was applied),
>> but on my system, I get:
>>
>> # SENDING to 127.0.0.1:8546
>> # GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost:
>> merge-disabled\r\nConnection: close\r\n\r\n
>> # expected 200, got 403 for c// doesn't match locationmatch
>> not ok 7
>> # Test 7 got: "403" (t/apache/mergeslashes.t at line 73 fail #7)
>> # Expected: "200" (c// doesn't match locationmatch)
>> Failed 1/7 subtests
>>
>> I don't have time to dig into it these days.
>> Does anyone has the same issue?
>> Any pointer where to look at?
> It's working for me now, the only unreliable test I see with 2.4.x and
> test/framework/trunk is buffer.t as discussed elsewhere.
>
> What's the full output, is it using the same host:port for all the
> tests, and what is in *.conf for that port? The port number being
> picked is quite high, maybe something screwy in vhost generation or
> selection in the test. I get:
>
> t/apache/mergeslashes.t ..
> 1..7
> # Running under perl version 5.028001 for linux
> # Current time local: Tue Mar 26 08:12:03 2019
> # Current time GMT: Tue Mar 26 08:12:03 2019
> # Using Test.pm version 1.31
> # Using Apache/Test.pm version 1.41
> # SENDING to 127.0.0.1:8539
> # GET /authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n
> # expected 403, got 403 for exact match
> ok 1
> # SENDING to 127.0.0.1:8539
> # GET //authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n
> # expected 403, got 403 for merged even at front
> ok 2
> # SENDING to 127.0.0.1:8539
> # GET ///authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n
> # expected 403, got 403 for merged even at front
> ok 3
> # SENDING to 127.0.0.1:8539
> # GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n
> # expected 403, got 403 for c// should be merged
> ok 4
> # SENDING to 127.0.0.1:8539
> # GET /authz_core/a//b/c/index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n
> # expected 403, got 403 for a// should be merged
> ok 5
> # SENDING to 127.0.0.1:8539
> # GET /authz_core/a//b/c/index.html HTTP/1.1\r\nHost: merge-disabled\r\nConnection: close\r\n\r\n
> # expected 403, got 403 for a// matches locationmatch
> ok 6
> # SENDING to 127.0.0.1:8539
> # GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost: merge-disabled\r\nConnection: close\r\n\r\n
> # expected 200, got 200 for c// doesn't match locationmatch
> ok 7
> ok
> All tests successful.
> Files=1, Tests=7, 2 wallclock secs ( 0.02 usr 0.00 sys + 1.90 cusr
> 0.46 csys = 2.38 CPU)
> Result: PASS
>
>
> .... and ...
>
> $ grep 8539 t/conf/*.conf
> t/conf/core.conf:Listen 0.0.0.0:8539
> t/conf/core.conf:NameVirtualHost *:8539
> t/conf/core.conf:<VirtualHost *:8539>
> t/conf/core.conf: ServerName strict-default:8539
> t/conf/core.conf:<VirtualHost *:8539>
> t/conf/core.conf: ServerName strict-nvh:8539
> t/conf/core.conf: <VirtualHost *:8539>
> t/conf/core.conf: ServerName merge-default:8539
> t/conf/core.conf: <VirtualHost *:8539>
> t/conf/core.conf: ServerName merge-disabled:8539
>
>
>
t/apache/mergeslashes.t ..
1..7
# Running under perl version 5.026002 for linux
# Current time local: Tue Mar 26 22:33:18 2019
# Current time GMT: Tue Mar 26 21:33:18 2019
# Using Test.pm version 1.30
# Using Apache/Test.pm version 1.41
# SENDING to 127.0.0.1:8546
# GET /authz_core/a/b/c/index.html HTTP/1.1\r\nHost:
merge-default\r\nConnection: close\r\n\r\n
# expected 403, got 403 for exact match
ok 1
# SENDING to 127.0.0.1:8546
# GET //authz_core/a/b/c/index.html HTTP/1.1\r\nHost:
merge-default\r\nConnection: close\r\n\r\n
# expected 403, got 403 for merged even at front
ok 2
# SENDING to 127.0.0.1:8546
# GET ///authz_core/a/b/c/index.html HTTP/1.1\r\nHost:
merge-default\r\nConnection: close\r\n\r\n
# expected 403, got 403 for merged even at front
ok 3
# SENDING to 127.0.0.1:8546
# GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost:
merge-default\r\nConnection: close\r\n\r\n
# expected 403, got 403 for c// should be merged
ok 4
# SENDING to 127.0.0.1:8546
# GET /authz_core/a//b/c/index.html HTTP/1.1\r\nHost:
merge-default\r\nConnection: close\r\n\r\n
# expected 403, got 403 for a// should be merged
ok 5
# SENDING to 127.0.0.1:8546
# GET /authz_core/a//b/c/index.html HTTP/1.1\r\nHost:
merge-disabled\r\nConnection: close\r\n\r\n
# expected 403, got 403 for a// matches locationmatch
ok 6
# SENDING to 127.0.0.1:8546
# GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost:
merge-disabled\r\nConnection: close\r\n\r\n
# expected 200, got 403 for c// doesn't match locationmatch
not ok 7
# Test 7 got: "403" (t/apache/mergeslashes.t at line 73 fail #7)
# Expected: "200" (c// doesn't match locationmatch)
Failed 1/7 subtests
Test Summary Report
-------------------
t/apache/mergeslashes.t (Wstat: 0 Tests: 7 Failed: 1)
Failed test: 7
Files=1, Tests=7, 1 wallclock secs ( 0.04 usr 0.00 sys + 0.64 cusr
0.15 csys = 0.83 CPU)
Result: FAIL
Failed 1/1 test programs. 1/7 subtests failed.
[warning] server localhost:8529 shutdown
[ error] error running tests (please examine t/logs/error_log)
.... and ...
$ grep 8546 t/conf/*.conf
t/conf/core.conf:Listen 0.0.0.0:8546
t/conf/core.conf:NameVirtualHost *:8546
t/conf/core.conf:<VirtualHost *:8546>
t/conf/core.conf: ServerName strict-default:8546
t/conf/core.conf:<VirtualHost *:8546>
t/conf/core.conf: ServerName strict-nvh:8546
t/conf/core.conf: <VirtualHost *:8546>
t/conf/core.conf: ServerName merge-default:8546
t/conf/core.conf: <VirtualHost *:8546>
t/conf/core.conf: ServerName merge-disabled:8546
CJ
Re: svn commit: r1856208 -
/httpd/test/framework/trunk/t/apache/mergeslashes.t
Posted by Marion & Christophe JAILLET <ch...@wanadoo.fr>.
Le 26/03/2019 à 22:52, Eric Covener a écrit :
>>> # GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost:
>>> merge-disabled\r\nConnection: close\r\n\r\n
>>> # expected 200, got 403 for c// doesn't match locationmatch
>>> not ok 7
>>> # Test 7 got: "403" (t/apache/mergeslashes.t at line 73 fail #7)
>>> # Expected: "200" (c// doesn't match locationmatch)
>>> Failed 1/7 subtests
> Backported version is working OK for me too. Thanks for the
> reliability fix Joe.
>
> Can you verify the 403 in t/logs/error_log is a 'client denied by
> server configuration' and that it goes away (but other tests break) if
> you comment the 2nd-to last locationmatch in t/conf/core.conf?
Ok, I found my mistakes. (my 2.4.x SHOULD always be UN-modified, well,
hmm, it wasn't...)
Everything is fine for me. Sorry for the noise.
CJ
Re: svn commit: r1856208 - /httpd/test/framework/trunk/t/apache/mergeslashes.t
Posted by Eric Covener <co...@gmail.com>.
> > # GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost:
> > merge-disabled\r\nConnection: close\r\n\r\n
> > # expected 200, got 403 for c// doesn't match locationmatch
> > not ok 7
> > # Test 7 got: "403" (t/apache/mergeslashes.t at line 73 fail #7)
> > # Expected: "200" (c// doesn't match locationmatch)
> > Failed 1/7 subtests
Backported version is working OK for me too. Thanks for the
reliability fix Joe.
Can you verify the 403 in t/logs/error_log is a 'client denied by
server configuration' and that it goes away (but other tests break) if
you comment the 2nd-to last locationmatch in t/conf/core.conf?
--
Eric Covener
covener@gmail.com
Re: svn commit: r1856208 -
/httpd/test/framework/trunk/t/apache/mergeslashes.t
Posted by Joe Orton <jo...@redhat.com>.
On Tue, Mar 26, 2019 at 07:13:03AM +0100, Christophe JAILLET wrote:
> Hi,
>
> not related to this patch (I have the same output before it was applied),
> but on my system, I get:
>
> # SENDING to 127.0.0.1:8546
> # GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost:
> merge-disabled\r\nConnection: close\r\n\r\n
> # expected 200, got 403 for c// doesn't match locationmatch
> not ok 7
> # Test 7 got: "403" (t/apache/mergeslashes.t at line 73 fail #7)
> # Expected: "200" (c// doesn't match locationmatch)
> Failed 1/7 subtests
>
> I don't have time to dig into it these days.
> Does anyone has the same issue?
> Any pointer where to look at?
It's working for me now, the only unreliable test I see with 2.4.x and
test/framework/trunk is buffer.t as discussed elsewhere.
What's the full output, is it using the same host:port for all the
tests, and what is in *.conf for that port? The port number being
picked is quite high, maybe something screwy in vhost generation or
selection in the test. I get:
t/apache/mergeslashes.t ..
1..7
# Running under perl version 5.028001 for linux
# Current time local: Tue Mar 26 08:12:03 2019
# Current time GMT: Tue Mar 26 08:12:03 2019
# Using Test.pm version 1.31
# Using Apache/Test.pm version 1.41
# SENDING to 127.0.0.1:8539
# GET /authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n
# expected 403, got 403 for exact match
ok 1
# SENDING to 127.0.0.1:8539
# GET //authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n
# expected 403, got 403 for merged even at front
ok 2
# SENDING to 127.0.0.1:8539
# GET ///authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n
# expected 403, got 403 for merged even at front
ok 3
# SENDING to 127.0.0.1:8539
# GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n
# expected 403, got 403 for c// should be merged
ok 4
# SENDING to 127.0.0.1:8539
# GET /authz_core/a//b/c/index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n
# expected 403, got 403 for a// should be merged
ok 5
# SENDING to 127.0.0.1:8539
# GET /authz_core/a//b/c/index.html HTTP/1.1\r\nHost: merge-disabled\r\nConnection: close\r\n\r\n
# expected 403, got 403 for a// matches locationmatch
ok 6
# SENDING to 127.0.0.1:8539
# GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost: merge-disabled\r\nConnection: close\r\n\r\n
# expected 200, got 200 for c// doesn't match locationmatch
ok 7
ok
All tests successful.
Files=1, Tests=7, 2 wallclock secs ( 0.02 usr 0.00 sys + 1.90 cusr
0.46 csys = 2.38 CPU)
Result: PASS
.... and ...
$ grep 8539 t/conf/*.conf
t/conf/core.conf:Listen 0.0.0.0:8539
t/conf/core.conf:NameVirtualHost *:8539
t/conf/core.conf:<VirtualHost *:8539>
t/conf/core.conf: ServerName strict-default:8539
t/conf/core.conf:<VirtualHost *:8539>
t/conf/core.conf: ServerName strict-nvh:8539
t/conf/core.conf: <VirtualHost *:8539>
t/conf/core.conf: ServerName merge-default:8539
t/conf/core.conf: <VirtualHost *:8539>
t/conf/core.conf: ServerName merge-disabled:8539
Re: svn commit: r1856208 -
/httpd/test/framework/trunk/t/apache/mergeslashes.t
Posted by Christophe JAILLET <ch...@wanadoo.fr>.
Hi,
not related to this patch (I have the same output before it was
applied), but on my system, I get:
# SENDING to 127.0.0.1:8546
# GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost:
merge-disabled\r\nConnection: close\r\n\r\n
# expected 200, got 403 for c// doesn't match locationmatch
not ok 7
# Test 7 got: "403" (t/apache/mergeslashes.t at line 73 fail #7)
# Expected: "200" (c// doesn't match locationmatch)
Failed 1/7 subtests
I don't have time to dig into it these days.
Does anyone has the same issue?
Any pointer where to look at?
CJ
Le 25/03/2019 à 16:44, jorton@apache.org a écrit :
> Author: jorton
> Date: Mon Mar 25 15:44:22 2019
> New Revision: 1856208
>
> URL: http://svn.apache.org/viewvc?rev=1856208&view=rev
> Log:
> Send Connection: close rather than use cheeky TCP half-close
> which gives intermittent failures.
>
> Modified:
> httpd/test/framework/trunk/t/apache/mergeslashes.t
>
> Modified: httpd/test/framework/trunk/t/apache/mergeslashes.t
> URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/apache/mergeslashes.t?rev=1856208&r1=1856207&r2=1856208&view=diff
> ==============================================================================
> --- httpd/test/framework/trunk/t/apache/mergeslashes.t (original)
> +++ httpd/test/framework/trunk/t/apache/mergeslashes.t Mon Mar 25 15:44:22 2019
> @@ -13,13 +13,13 @@ use Socket;
>
> my @test_cases = (
> # request, status code global, status code 'mergeslashes off' VH, msg
> - [ "GET /authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\n\r\n" => 403, "exact match"],
> - [ "GET //authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\n\r\n" => 403, "merged even at front"],
> - [ "GET ///authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\n\r\n" => 403, "merged even at front"],
> - [ "GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost: merge-default\r\n\r\n" => 403, "c// should be merged"],
> - [ "GET /authz_core/a//b/c/index.html HTTP/1.1\r\nHost: merge-default\r\n\r\n" => 403, "a// should be merged"],
> - [ "GET /authz_core/a//b/c/index.html HTTP/1.1\r\nHost: merge-disabled\r\n\r\n" => 403, "a// matches locationmatch"],
> - [ "GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost: merge-disabled\r\n\r\n" => 200, "c// doesn't match locationmatch"],
> + [ "GET /authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n" => 403, "exact match"],
> + [ "GET //authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n" => 403, "merged even at front"],
> + [ "GET ///authz_core/a/b/c/index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n" => 403, "merged even at front"],
> + [ "GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n" => 403, "c// should be merged"],
> + [ "GET /authz_core/a//b/c/index.html HTTP/1.1\r\nHost: merge-default\r\nConnection: close\r\n\r\n" => 403, "a// should be merged"],
> + [ "GET /authz_core/a//b/c/index.html HTTP/1.1\r\nHost: merge-disabled\r\nConnection: close\r\n\r\n" => 403, "a// matches locationmatch"],
> + [ "GET /authz_core/a/b/c//index.html HTTP/1.1\r\nHost: merge-disabled\r\nConnection: close\r\n\r\n" => 200, "c// doesn't match locationmatch"],
> );
> plan tests => scalar(@test_cases), need_min_apache_version('2.4.39');
>
> @@ -38,7 +38,6 @@ plan tests => scalar(@test_cases), need_
> }
>
> $sock->print($req);
> - $sock->shutdown(1);
> sleep(0.1);
> $req = escape($req);
> print "# SENDING to " . peer($sock) . "\n# $req\n";
> @@ -102,6 +101,7 @@ sub peer
> {
> my $sock = shift;
> my $hersockaddr = getpeername($sock);
> + return "<disconnected>" if !$hersockaddr;
> my ($port, $iaddr) = sockaddr_in($hersockaddr);
> my $herhostname = gethostbyaddr($iaddr, AF_INET);
> my $herstraddr = inet_ntoa($iaddr);
>
>
>