]> git.ipfire.org Git - thirdparty/git.git/commit - t/t5541-http-push-smart.sh
test smart http fetch and push
authorShawn O. Pearce <spearce@spearce.org>
Sat, 31 Oct 2009 00:47:47 +0000 (17:47 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 5 Nov 2009 01:58:16 +0000 (17:58 -0800)
commit7da4e2280ccaf5ecb357f7cb2b81d62f78f00f9e
tree413a35aa4c959f21bb3c2357e365990eb14866c8
parent024bb1256627219671a0924b195582b6e049ca87
test smart http fetch and push

The top level directory "/smart/" of the test Apache server is mapped
through our git-http-backend CGI, but uses the same underlying
repository space as the server's document root.  This is the most
simple installation possible.

Server logs are checked to verify the client has accessed only the
smart URLs during the test.  During fetch testing the headers are
also logged from libcurl to ensure we are making a reasonably sane
HTTP request, and getting back reasonably sane response headers
from the CGI.

When validating the request headers used during smart fetch we munge
away the actual Content-Length and replace it with the placeholder
"xxx".  This avoids unnecessary varability in the test caused by
an unrelated change in the requested capabilities in the first want
line of the request.  However, we still want to look for and verify
that Content-Length was used, because smaller payloads should be
using Content-Length and not "Transfer-Encoding: chunked".

When validating the server response headers we must discard both
Content-Length and Transfer-Encoding, as Apache2 can use either
format to return our response.

During development of this test I observed Apache returning both
forms, depending on when the processes got CPU time.  If our CGI
returned the pack data quickly, Apache just buffered the whole
thing and returned a Content-Length.  If our CGI took just a bit
too long to complete, Apache flushed its buffer and instead used
"Transfer-Encoding: chunked".

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-httpd/apache.conf
t/t5540-http-push.sh
t/t5541-http-push.sh [new file with mode: 0755]
t/t5550-http-fetch.sh
t/t5551-http-fetch.sh [new file with mode: 0755]