diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2009-10-30 17:47:47 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-11-04 17:58:16 -0800 |
commit | 7da4e2280ccaf5ecb357f7cb2b81d62f78f00f9e (patch) | |
tree | 413a35aa4c959f21bb3c2357e365990eb14866c8 /t/lib-httpd/apache.conf | |
parent | http tests: use /dumb/ URL prefix (diff) | |
download | tgif-7da4e2280ccaf5ecb357f7cb2b81d62f78f00f9e.tar.xz |
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>
Diffstat (limited to 't/lib-httpd/apache.conf')
-rw-r--r-- | t/lib-httpd/apache.conf | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf index 47a438f4c6..0fe3fd0d01 100644 --- a/t/lib-httpd/apache.conf +++ b/t/lib-httpd/apache.conf @@ -11,9 +11,26 @@ ErrorLog error.log <IfModule !mod_alias.c> LoadModule alias_module modules/mod_alias.so </IfModule> +<IfModule !mod_cgi.c> + LoadModule cgi_module modules/mod_cgi.so +</IfModule> +<IfModule !mod_env.c> + LoadModule env_module modules/mod_env.so +</IfModule> Alias /dumb/ www/ +<Location /smart/> + SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} +</Location> +ScriptAlias /smart/ ${GIT_EXEC_PATH}/git-http-backend/ +<Directory ${GIT_EXEC_PATH}> + Options None +</Directory> +<Files ${GIT_EXEC_PATH}/git-http-backend> + Options ExecCGI +</Files> + <IfDefine SSL> LoadModule ssl_module modules/mod_ssl.so |