SOURCES: lighttpd-mod_compress-disable-bzip2.patch - add test to check disa...

glen glen at pld-linux.org
Mon Sep 22 16:58:11 CEST 2008


Author: glen                         Date: Mon Sep 22 14:58:11 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- add test to check disabling methods

---- Files affected:
SOURCES:
   lighttpd-mod_compress-disable-bzip2.patch (1.13 -> 1.14) 

---- Diffs:

================================================================
Index: SOURCES/lighttpd-mod_compress-disable-bzip2.patch
diff -u SOURCES/lighttpd-mod_compress-disable-bzip2.patch:1.13 SOURCES/lighttpd-mod_compress-disable-bzip2.patch:1.14
--- SOURCES/lighttpd-mod_compress-disable-bzip2.patch:1.13	Mon Sep 22 16:10:53 2008
+++ SOURCES/lighttpd-mod_compress-disable-bzip2.patch	Mon Sep 22 16:58:05 2008
@@ -140,3 +140,74 @@
  compress.cache-dir
    name of the directory where compressed content will be cached
  
+Index: mod-compress.conf
+--- ./tests/mod-compress.conf	(revision 0)
++++ ./tests/mod-compress.conf	(revision 0)
+@@ -0,0 +1,32 @@
++debug.log-request-handling   = "enable"
++debug.log-response-header   = "disable"
++debug.log-request-header   = "disable"
++
++server.document-root         = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
++server.pid-file              = env.SRCDIR + "/tmp/lighttpd/lighttpd.pid"
++
++## bind to port (default: 80)
++server.port                 = 2048
++
++## bind to localhost (default: all interfaces)
++server.bind                = "localhost"
++server.errorlog            = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
++server.name                = "www.example.org"
++
++server.modules = (
++	"mod_compress"
++)
++
++######################## MODULE CONFIG ############################
++
++mimetype.assign = (
++	".html" => "text/html",
++	".txt"  => "text/plain",
++)
++
++$HTTP["host"] == "cache.example.org" {
++	compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
++}
++compress.filetype = ("text/plain", "text/html")
++
++compress.allowed-encodings = ( "gzip", "deflate" )
+Index: mod-compress.t
+===================================================================
+--- ./tests/mod-compress.t	(revision 2191)
++++ ./tests/mod-compress.t	(working copy)
+@@ -8,12 +8,14 @@
+ 
+ use strict;
+ use IO::Socket;
+-use Test::More tests => 10;
++use Test::More tests => 11;
+ use LightyTest;
+ 
+ my $tf = LightyTest->new();
+ my $t;
+ 
++$tf->{CONFIGFILE} = 'mod-compress.conf';
++
+ ok($tf->start_proc == 0, "Starting lighttpd") or die();
+ 
+ $t->{REQUEST}  = ( <<EOF
+@@ -88,5 +90,14 @@
+ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Type' => "text/plain" } ];
+ ok($tf->handle_http($t) == 0, 'Empty Accept-Encoding');
+ 
++$t->{REQUEST}  = ( <<EOF
++GET /index.txt HTTP/1.0
++Accept-Encoding: bzip2, gzip, deflate
++Host: cache.example.org
++EOF
++ );
++$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Encoding' => 'gzip', 'Content-Type' => "text/plain" } ];
++ok($tf->handle_http($t) == 0, 'bzip2 requested but disabled');
+ 
++
+ ok($tf->stop_proc == 0, "Stopping lighttpd");
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/lighttpd-mod_compress-disable-bzip2.patch?r1=1.13&r2=1.14&f=u



More information about the pld-cvs-commit mailing list